public

a custom browser using GroovyFX.

  • Download Gist
groovyfx_custombrowser.groovy
Groovy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
import groovyx.javafx.ClosureEventHandler
import groovyx.javafx.GroovyFX
import groovyx.javafx.SceneGraphBuilder
import javafx.animation.Interpolator
import javafx.animation.TranslateTransition
import javafx.util.Duration
 
GroovyFX.start({
def loadAction = { view.engine.load(new URI(urlBox.getText()).toString()) }
def stage = new SceneGraphBuilder().stage(title: "GroovyFXのテスト") {
scene(width: 800, height: 600) {
vbox(spacing: 10, layoutY: 10) {
hbox(spacing: 10, alignment: "center") {
urlBox = textBox(columns: 40, action: loadAction);
button(text: "Load", onAction: loadAction)
}
view = webView(
engine: webEngine(location: "http://www.yahoo.co.jp/"),
prefWidth: 800, prefHeight: 400,
translateX: 800,
effect: reflection(),
)
}
}
}
view.engine.loadTask.onDone = new ClosureEventHandler(action: {
new TranslateTransition().with {
node = view
fromX = 800
toX = 0
interpolator = Interpolator.EASE_BOTH
duration = new Duration(500)
play()
}
})
view.engine.loadTask.onStarted = new ClosureEventHandler(action: {
new TranslateTransition().with {
node = view
fromX = 0
toX = -800
duration = new Duration(500)
play()
}
})
stage.visible = true
});

Very interesting! Thank you.

Hi, thank you for Interesting this. I updated this for JavaFX 2.0 build 36+ and newer GroovyFX.
https://gist.github.com/1101054

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.