Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
a custom browser using GroovyFX.
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
});
@bgoetzmann

Very interesting! Thank you.

@hideaki-t
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.