本文整理汇总了Java中javafx.scene.Node.sceneToLocal方法的典型用法代码示例。如果您正苦于以下问题:Java Node.sceneToLocal方法的具体用法?Java Node.sceneToLocal怎么用?Java Node.sceneToLocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.Node
的用法示例。
在下文中一共展示了Node.sceneToLocal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findRawRComponent
import javafx.scene.Node; //导入方法依赖的package包/类
public RFXComponent findRawRComponent(Node source, Point2D point, IJSONRecorder recorder) {
for (IRFXComponentFinder entry : entries) {
Class<? extends RFXComponent> k = entry.get(source);
if (k == null) {
continue;
}
try {
Constructor<? extends RFXComponent> cons = k.getConstructor(Node.class, JSONOMapConfig.class, Point2D.class,
IJSONRecorder.class);
if (point != null) {
point = source.sceneToLocal(point);
}
return cons.newInstance(source, omapConfig, point, recorder);
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
示例2: findRCellComponent
import javafx.scene.Node; //导入方法依赖的package包/类
public RFXComponent findRCellComponent(Node source, Point2D point, IJSONRecorder recorder) {
if (source == null)
return null;
for (IRFXComponentFinder entry : entries) {
Class<? extends RFXComponent> k = entry.get(source);
if (k == null) {
continue;
}
try {
Constructor<? extends RFXComponent> cons = k.getConstructor(Node.class, JSONOMapConfig.class, Point2D.class,
IJSONRecorder.class);
if (point != null) {
point = source.sceneToLocal(point);
}
RFXComponent newInstance = cons.newInstance(source, omapConfig, point, recorder);
if (newInstance instanceof RFXUnknownComponent || newInstance instanceof RFXIgnoreComponent)
return null;
return newInstance;
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
示例3: recordRawMouseEvent
import javafx.scene.Node; //导入方法依赖的package包/类
@Override public void recordRawMouseEvent(final RFXComponent r, MouseEvent e) {
final JSONObject event = new JSONObject();
event.put("type", "click_raw");
int button = e.getButton() == MouseButton.PRIMARY ? java.awt.event.MouseEvent.BUTTON1 : java.awt.event.MouseEvent.BUTTON3;
event.put("button", button);
event.put("clickCount", e.getClickCount());
event.put("modifiersEx", buildModifiersText(e));
Node source = (Node) e.getSource();
Node target = r.getComponent();
Point2D sts = source.localToScene(new Point2D(e.getX(), e.getY()));
Point2D tts = target.sceneToLocal(sts);
event.put("x", tts.getX());
event.put("y", tts.getY());
final JSONObject o = new JSONObject();
o.put("event", event);
fill(r, o);
if (e.getClickCount() == 1) {
clickTimer = new Timer();
clickTimer.schedule(new TimerTask() {
@Override public void run() {
sendRecordMessage(o);
}
}, timerinterval.intValue());
} else if (e.getClickCount() == 2) {
if (clickTimer != null) {
clickTimer.cancel();
clickTimer = null;
}
sendRecordMessage(o);
}
}