当前位置: 首页>>代码示例>>Java>>正文


Java MouseEvent.getSceneY方法代码示例

本文整理汇总了Java中javafx.scene.input.MouseEvent.getSceneY方法的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent.getSceneY方法的具体用法?Java MouseEvent.getSceneY怎么用?Java MouseEvent.getSceneY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.input.MouseEvent的用法示例。


在下文中一共展示了MouseEvent.getSceneY方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handle

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
@Override
public void handle(MouseEvent event) {

    // don't do anything if the user is in the process of adding to the selection model
    if( event.isControlDown() || event.isShiftDown()) {
        return;
    }

    Node node = (Node) event.getSource();

    dragContext.x = node.getTranslateX() - event.getSceneX();
    dragContext.y = node.getTranslateY() - event.getSceneY();

    // clear the model if the current node isn't in the selection => new selection
    if( !selectionModel.contains(node)) {
        selectionModel.clear();
        selectionModel.add( node);
    }

    // flag that the mouse released handler should consume the event, so it won't bubble up to the pane which has a rubberband selection mouse released handler
    enabled = true;

    // prevent rubberband selection handler
    event.consume();
}
 
开发者ID:lttng,项目名称:lttng-scope,代码行数:26,代码来源:ExampleMouseDrag2.java

示例2: moveNodes

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
public void moveNodes(MouseEvent event){
    double offsetX = (event.getSceneX() - initMoveX)*(1/diagramController.drawPane.getScaleX());
    double offsetY = (event.getSceneY() - initMoveY)*(1/diagramController.drawPane.getScaleY());

    //Drag all selected nodes and their children
    for(AbstractNode n : toBeMoved)
    {
        Double x = initTranslateMap.get(n).getX() + offsetX;
        Double y = initTranslateMap.get(n).getY() + offsetY;
        n.setTranslateX(x);
        n.setTranslateY(y);
        n.setX(x);
        n.setY(y);
        if(snapIndicators){
            setSnapIndicators(closestInteger(x.intValue(), Constants.GRID_DISTANCE), closestInteger(y.intValue(), Constants.GRID_DISTANCE), n, true);
        }
    }
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:19,代码来源:NodeController.java

示例3: handle

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
@Override
public void handle(MouseEvent t) {
    orgSceneX = t.getSceneX();
    orgSceneY = t.getSceneY();
    orgTranslateX = ((Circle)(t.getSource())).getTranslateX();
    orgTranslateY = ((Circle)(t.getSource())).getTranslateY();
}
 
开发者ID:lttng,项目名称:lttng-scope,代码行数:8,代码来源:ExampleMouseDrag.java

示例4: moveSketchFinished

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
public double[] moveSketchFinished(MouseEvent event) {
    toBeMoved.clear();
    initTranslateMap.clear();
    double[] deltaTranslateVector = new double[2];
    deltaTranslateVector[0] = event.getSceneX() - initMoveX;
    deltaTranslateVector[1] = event.getSceneY() - initMoveY;
    return deltaTranslateVector;
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:9,代码来源:SketchController.java

示例5: autoscrollIfNeeded

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
private void autoscrollIfNeeded(MouseEvent evt) {
    if (getBoundsInLocal().getWidth() < 1) {
        if (getBoundsInLocal().getWidth() < 1) {
            stopAutoScrollIfNeeded();
            return;
        }
    }

    double yOffset = 0;

    // y offset

    double delta = evt.getSceneY() - localToScene(0, 0).getY();
    if (delta < 0) {
        yOffset = Math.max(delta / 2, -10);
    }

    delta = localToScene(0, 0).getY() + getHeight() - evt.getSceneY();
    if (delta < 0) {
        yOffset = Math.min(-delta / 2, 10);
    }

    if (yOffset != 0) {
        autoscroll(yOffset);
    } else {
        stopAutoScrollIfNeeded();
    }
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:29,代码来源:AutoScrollPane.java

示例6: handle

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
/**
 * Sets the current position of the mouse and the current position on the canvas
 * @param event - event
 */
public void handle(MouseEvent event) {
    // right mouse button => panning
    if (!event.isSecondaryButtonDown()) {
        return;
    }

    sceneDragContext.mouseAnchorX = event.getSceneX();
    sceneDragContext.mouseAnchorY = event.getSceneY();

    sceneDragContext.translateAnchorX = canvas.getTranslateX();
    sceneDragContext.translateAnchorY = canvas.getTranslateY();
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:17,代码来源:SceneGestures.java

示例7: movePane

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
void movePane(MouseEvent event) {
    ScrollPane scrollPane = diagramController.getScrollPane();
    double xScroll =  (initMoveX - event.getSceneX()) / 8000; //8000 is the size of aDrawPane set in view.classDiagramView.fxml
    double yScroll = (initMoveY - event.getSceneY()) / 8000;

    scrollPane.setHvalue(scrollPane.getHvalue() + xScroll);
    scrollPane.setVvalue(scrollPane.getVvalue() + yScroll);

    initMoveX = event.getSceneX();
    initMoveY = event.getSceneY();
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:12,代码来源:GraphController.java

示例8: moveSketchStart

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
public void moveSketchStart(MouseEvent event) {
    initMoveX = event.getSceneX();
    initMoveY = event.getSceneY();
    Point2D.Double initTranslate;
    for (Sketch sketch : mController.getSelectedSketches()) {
        initTranslate = new Point2D.Double(sketch.getTranslateX(), sketch.getTranslateY());
        initTranslateMap.put(sketch, initTranslate);
        toBeMoved.add(sketch);
    }
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:11,代码来源:SketchController.java

示例9: moveNodesStart

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
public void moveNodesStart(MouseEvent event){
    initMoveX = event.getSceneX();
    initMoveY = event.getSceneY();

    Point2D.Double initTranslate;
    ArrayList<AbstractNode> selectedNodes = new ArrayList<>();
    for(AbstractNodeView nodeView : diagramController.getSelectedNodes()){
        selectedNodes.add(diagramController.getNodeMap().get(nodeView));
    }

    //Move all selected nodes and their children. (Only package nodes can have children)
    for(AbstractNode n : diagramController.getGraphModel().getAllNodes()){
        if(selectedNodes.contains(n)) {
            initTranslate = new Point2D.Double(n.getTranslateX(), n.getTranslateY());
            initTranslateMap.put(n, initTranslate);
            toBeMoved.add(n);
            if(snapIndicators){
                createSnapIndicators(n);
            }
            if (n instanceof PackageNode) {
                for (AbstractNode child : ((PackageNode) n).getChildNodes()) {
                    if (!selectedNodes.contains(child)) {
                        initTranslate = new Point2D.Double(child.getTranslateX(), child.getTranslateY());
                        initTranslateMap.put(child, initTranslate);
                        toBeMoved.add(child);
                    }
                }
            }
        }
    }
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:32,代码来源:NodeController.java

示例10: handleMousePressed

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
@FXML
private void handleMousePressed(MouseEvent event) {
	xOffset = event.getSceneX();
	yOffset = event.getSceneY();
}
 
开发者ID:nshusa,项目名称:rsam-gui,代码行数:6,代码来源:StoreController.java

示例11: moveMousePressed

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
@FXML
void moveMousePressed(MouseEvent event) {
    xOffset = event.getSceneX();
    yOffset = event.getSceneY();
}
 
开发者ID:dainesch,项目名称:HueSense,代码行数:6,代码来源:QuickPresenter.java

示例12: mousePressed

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
private void mousePressed(MouseEvent mouseEvent) {
    mouseOldX = mouseEvent.getSceneX();
    mouseOldY = mouseEvent.getSceneY();
}
 
开发者ID:adihubba,项目名称:javafx-3d-surface-chart,代码行数:5,代码来源:Mesh3DChartPanel.java

示例13: handle

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
public void handle(MouseEvent event) {

            // left mouse button => dragging
            if (!event.isPrimaryButtonDown())
                return;

            nodeDragContext.mouseAnchorX = event.getSceneX();
            nodeDragContext.mouseAnchorY = event.getSceneY();

            Node node = (Node) event.getSource();
            System.out.format("%10f,%10f%n", node.getTranslateX(), node.getTranslateY());

            nodeDragContext.translateAnchorX = node.getTranslateX();
            nodeDragContext.translateAnchorY = node.getTranslateY();

        }
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:17,代码来源:NodeGestures.java

示例14: movePaneStart

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
void movePaneStart(MouseEvent event) {
    initMoveX = event.getSceneX();
    initMoveY = event.getSceneY();
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:5,代码来源:GraphController.java


注:本文中的javafx.scene.input.MouseEvent.getSceneY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。