18 Jul 22:58
[groovy-user] Usage of Factory to extend SwingBuilder
From: Raphaël Piéroni <raphaelpieroni@...>
Subject: [groovy-user] Usage of Factory to extend SwingBuilder
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-18 21:02:35 GMT
Subject: [groovy-user] Usage of Factory to extend SwingBuilder
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-18 21:02:35 GMT
Hi folks,
I'd like to enhance the SwingBuilder with s custom made factory.
I successfully had
animatedPane = panel {
imageLabel = label(id: 'imageLabel', text: 'Image goes here')
}
imageTransition = animate(duration: 1000, acceleration:
0.3f, deceleration: 0.15f, component: animatedPane, closure: {
animatedPane.removeAll()
animatedPane.add label(icon: model.image)
animatedPane.revalidate()
})
in my swing builder script.
I registered a factory to animate which override newInstance only
Object newInstance(FactoryBuilderSupport builder, def name, def
value, Map attributes) {
def animator = new Animator(attributes.duration)
animator.acceleration = attributes.acceleration
animator.deceleration = attributes.deceleration
new ScreenTransition(attributes.component, attributes.closure
as TransitionTarget, animator)
}
I would like to enable
animate(...) {...}
and give retreive the closure
(Continue reading)
RSS Feed