當前位置: 首頁>>代碼示例>>Java>>正文


Java Node.sceneToLocal方法代碼示例

本文整理匯總了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;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:20,代碼來源:RFXComponentFactory.java

示例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;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:25,代碼來源:RFXComponentFactory.java

示例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);
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:32,代碼來源:WSRecorder.java


注:本文中的javafx.scene.Node.sceneToLocal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。