« Learn Some JavaFX Script, and Neville's Algorithm, from Luis! | Main | Rolling Your Own JavaFX "Custom Nodes": A Graphical Menu Example »

July 17, 2008

Comments

generic cialis

You may want to set MouseThreshold1 and 2 a little higher than 0 if
your pointer becomes a little too jumpy on the screen, but make sure
that MouseThreshold2 is greater or equal to MouseThreshold1, and all
three of these are integer values.

James Weaver

Bill,

Regarding the layout issues, please take a look at the Grid layout in the JFXtras project:
http://javafxpert.com/weblog/2008/12/jfxtras-01-release-utilities-and-addons-for-the-javafx-language.html

Thanks,
Jim Weaver

Bill Thayer

So - So example, (Sorry)

My how JavaFX moves fast. His program is only 5 months old. I had to update it and notice now how the combination of HBox, and VBox to lay out the Nodes actually maligns text. Looks like there is some more work to do as far as mouse event handling goes. Look at the last example. The Node.id is not returned.

I found this while trying to find out why I cannot get any response from my app between the time that I press down the middle mouse button until the time I release it.

Oh well, Here is the update code from Svens web page:

/**
* Display mouse events.
*
* @author Sven Drieling
* @version 0.4 (02-Aug-2008)
* @copyright (C) 2008 by Sven Drieling
* @license GPL 2.0
*/

package mouseevents;

import javafx.ext.swing.SwingLabel;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.*;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

var type = '';
var m: MouseEvent;
Stage {
title: "Mouse: Display MouseEvents"
scene: Scene {
width: 390
height: 700
content: [
VBox{
spacing: 20
content:[
Rectangle{
x: 20
y: 20
width: 350
height: 200
fill: Color.BLUE

onMouseClicked: function (e: MouseEvent) {
type = 'onMouseClicked';
m = e;
}// onMouseClicked

onMouseDragged: function (e: MouseEvent) {
type = 'onMouseDragged';
m = e;
}// onMouseDragged

onMouseEntered: function (e: MouseEvent) {
type = 'onMouseEntered';
m = e;
}// onMouseEntered

onMouseExited: function (e: MouseEvent) {
type = 'onMouseExited';
m = e;
}// onMouseExited

onMouseMoved: function (e: MouseEvent) {
type = 'onMouseMoved';
m = e;
}// onMouseMoved

onMousePressed: function (e: MouseEvent) {
type = 'onMousePressed';
m = e;
}// onMousePressed

onMouseReleased: function (e: MouseEvent) {
type = 'onMouseReleased';
m = e;
}// onMouseReleased

onMouseWheelMoved: function (e: MouseEvent) {
type = 'onMouseWheelMoved';
m = e;
}// onMouseWheelMoved

},// Rectangle

HBox{
spacing:6
content: [VBox{
spacing: 6

content:[
SwingLabel {
text: 'Type'},
SwingLabel {
text: 'Button'},
SwingLabel {
text: 'ClickCount'},
SwingLabel {
text: 'WheelRotation'},
SwingLabel {
text: 'ScreenX/Y'},
SwingLabel {
text: 'X/Y'},
SwingLabel {
text: 'SceneX/Y'},
SwingLabel {
text: 'DragX/Y'},
SwingLabel {
text: 'AltDown'},
SwingLabel {
text: 'ControlDown'},
SwingLabel {
text: 'MetaDown'},
SwingLabel {
text: 'ShiftDown'},
SwingLabel {
text: 'PopupTrigger'},
SwingLabel {
text: 'PrimaryButtonDown'},
SwingLabel {
text: 'MiddleButtonDown'},
SwingLabel {
text: 'SecondaryButtonDown'},
SwingLabel {
text: 'Node.id'}
]//content
},// VBox
VBox{
spacing: 7
content: [
SwingLabel {
text: bind "{type}"},
SwingLabel {
text: bind "{m.button}"},
SwingLabel {
text: bind "{m.clickCount}"},
SwingLabel {
text: bind "{m.wheelRotation}"},
SwingLabel {
text: bind "{m.screenX}/{m.screenY}"},
SwingLabel {
text: bind "{m.x}/{m.y}"},
SwingLabel {
text: bind "{m.sceneX}/{m.sceneY}"},
SwingLabel {
text: bind "{m.dragX}/{m.dragY}"},
SwingLabel {
text: bind "{m.altDown}"},
SwingLabel {
text: bind "{m.controlDown}"},
SwingLabel {
text: bind "{m.metaDown}"},
SwingLabel {
text: bind "{m.shiftDown}"},
SwingLabel {
text: bind "{m.popupTrigger}"},
SwingLabel {
text: bind "{m.primaryButtonDown}"
},
SwingLabel {
text: bind "{m.middleButtonDown}"
},
SwingLabel {
text: bind "{m.secondaryButtonDown}"
},
SwingLabel {
text: bind "{m.node.id}"
}
]//content

}// VBox
]//content
}// Hbox
]// content


}, //VBox

]// content

}// Scene
}// Stage

Online Gambling

The mighty mouse examples are cool. :)

The comments to this entry are closed.

Categories