Package javafx.geometry

Examples of javafx.geometry.Point2D


        return new GetAction<Point>() {
            @Override
            public void run(Object... parameters) {
                Bounds layout = node.getControl().getLayoutBounds();
                Bounds toScene = node.getControl().localToScene(layout);
                Point2D loc = node.getControl().localToScene(layout.getMinX() + p.x, layout.getMinY() + p.y);
                setResult(new Point(loc.getX() - toScene.getMinX(), loc.getY() - toScene.getMinY()));
            }
        }.dispatch(node.getEnvironment());
    }
View Full Code Here


        return new GetAction<Point>() {
            @Override
            public void run(Object... parameters) {
                Bounds layout = node.getControl().getLayoutBounds();
                Bounds toScene = node.getControl().localToScene(layout);
                Point2D loc = node.getControl().sceneToLocal(toScene.getMinX() + p.x, toScene.getMinY() + p.y);
                setResult(new Point(loc.getX() - layout.getMinX(), loc.getY() - layout.getMinY()));
            }
        }.dispatch(node.getEnvironment());
    }
View Full Code Here

            final EventType TYPE = mouseEvent.getEventType();
            final Object    SRC  = mouseEvent.getSource();
            if (MouseEvent.MOUSE_ENTERED == TYPE) {
                if(popupMap.containsKey(SRC)) {
                    if (!validatorMap.get(SRC).getInfoText().isEmpty()) {
                        Point2D pos = ((Node) SRC).localToScreen(((Node) SRC).getLayoutBounds().getMinX(), ((Node) SRC).getLayoutBounds().getMinY());
                        popupMap.get(SRC).setX(pos.getX());
                        //popupMap.get(SRC).setY(pos.getY() - popupMap.get(SRC).getHeight());
                        popupMap.get(SRC).setY(pos.getY() + ((Node) SRC).getLayoutBounds().getHeight() + 5);
                        popupMap.get(SRC).show(((Node) SRC).getScene().getWindow());
                    }
                }
            } else if (MouseEvent.MOUSE_EXITED == TYPE) {
                if(popupMap.containsKey(SRC)) {
View Full Code Here

        for (Node node : validatorMap.keySet()) {
            Validator validator = validatorMap.get(node);

            ctx.save();
            ctx.setGlobalAlpha(validator.getAlpha());
            Point2D nodeMinPos = node.localToScene(node.getLayoutBounds().getMinX(), node.getLayoutBounds().getMinY());
            Point2D nodeMaxPos = node.localToScene(node.getLayoutBounds().getMaxX(), node.getLayoutBounds().getMaxY());

            if (nodeMinPos.getX() > 0 && nodeMinPos.getY() > 0) {
                if (Pos.CENTER_LEFT == validator.getValidatorPosition()) {
                    indicatorPos[0] = nodeMinPos.getX() - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMinPos.getY() + (node.getLayoutBounds().getHeight() - Validator.IMG_SIZE) * 0.5;
                } else if (Pos.BOTTOM_LEFT == validator.getValidatorPosition()) {
                    indicatorPos[0] = nodeMinPos.getX() - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMaxPos.getY() - Validator.IMG_OFFSET;
                } else if (Pos.TOP_RIGHT == validator.getValidatorPosition()) {
                    indicatorPos[0] = nodeMaxPos.getX() - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMinPos.getY() - Validator.IMG_OFFSET;
                } else if (Pos.CENTER_RIGHT == validator.getValidatorPosition()) {
                    indicatorPos[0] = nodeMaxPos.getX() - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMinPos.getY() + (node.getLayoutBounds().getHeight() - Validator.IMG_SIZE) * 0.5;
                } else if (Pos.BOTTOM_RIGHT == validator.getValidatorPosition()) {
                    indicatorPos[0] = nodeMaxPos.getX() - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMaxPos.getY() - Validator.IMG_OFFSET;
                } else if (Pos.TOP_CENTER == validator.getValidatorPosition()) {
                    indicatorPos[0] = nodeMinPos.getX() + (node.getLayoutBounds().getWidth()) * 0.5 - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMinPos.getY() - Validator.IMG_OFFSET;
                } else if (Pos.BOTTOM_CENTER == validator.getValidatorPosition()) {
                    indicatorPos[0] = nodeMinPos.getX() + (node.getLayoutBounds().getWidth()) * 0.5 - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMaxPos.getY() - Validator.IMG_OFFSET;
                } else {
                    indicatorPos[0] = nodeMinPos.getX() - Validator.IMG_OFFSET;
                    indicatorPos[1] = nodeMinPos.getY() - Validator.IMG_OFFSET;
                }
                validator.setIconLocation(indicatorPos[0], indicatorPos[1]);
View Full Code Here

                    EventType type = event.getEventType();

                    if (type == MouseEvent.MOUSE_PRESSED) {
                        width = getWidth();
                        height = getHeight();
                        dragAnchor = new Point2D(event.getSceneX(), event.getSceneY());
                    } else if (type == MouseEvent.MOUSE_DRAGGED) {
                        setWidth(Math.max(decoratedRoot.minWidth(-1),   width  + (event.getSceneX() - dragAnchor.getX())));
                        setHeight(Math.max(decoratedRoot.minHeight(-1), height + (event.getSceneY() - dragAnchor.getY())));
                    }
                }
View Full Code Here

                    EventType type = event.getEventType();

                    if (type == MouseEvent.MOUSE_PRESSED) {
                        width = getWidth();
                        height = getHeight();
                        dragAnchor = new Point2D(event.getSceneX(), event.getSceneY());
                    } else if (type == MouseEvent.MOUSE_DRAGGED) {
                        setWidth(Math.max(decoratedRoot.minWidth(-1),   width  + (event.getSceneX() - dragAnchor.getX())));
                        setHeight(Math.max(decoratedRoot.minHeight(-1), height + (event.getSceneY() - dragAnchor.getY())));
                    }
                }
View Full Code Here

                    EventType type = event.getEventType();

                    if (type == MouseEvent.MOUSE_PRESSED) {
                        width = getWidth();
                        height = getHeight();
                        dragAnchor = new Point2D(event.getSceneX(), event.getSceneY());
                    } else if (type == MouseEvent.MOUSE_DRAGGED) {
                        setWidth(Math.max(decoratedRoot.minWidth(-1),   width  + (event.getSceneX() - dragAnchor.getX())));
                        setHeight(Math.max(decoratedRoot.minHeight(-1), height + (event.getSceneY() - dragAnchor.getY())));
                    }
                }
View Full Code Here

                    EventType type = event.getEventType();

                    if (type == MouseEvent.MOUSE_PRESSED) {
                        width = getWidth();
                        height = getHeight();
                        dragAnchor = new Point2D(event.getSceneX(), event.getSceneY());
                    } else if (type == MouseEvent.MOUSE_DRAGGED) {
                        setWidth(Math.max(decoratedRoot.minWidth(-1),   width  + (event.getSceneX() - dragAnchor.getX())));
                        setHeight(Math.max(decoratedRoot.minHeight(-1), height + (event.getSceneY() - dragAnchor.getY())));
                    }
                }
View Full Code Here

                dataCtx.setFill(getSkinnable().getSectionTextColor());                                                                               
                dataCtx.save();
                                               
                dataCtx.translate(size * 0.5, size * 0.5);                                         
                dataCtx.rotate(-startAngle - (ANGLE_EXTEND * 0.5));               
                Point2D textPoint = new Point2D(size * 0.35, 0);
                switch (getSkinnable().getDataFormat()) {
                    case TEXT:
                        dataCtx.fillText(DATA_POINT.getName(), textPoint.getX(), textPoint.getY());
                        break;
                    case VALUE:
                        dataCtx.fillText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", DATA_POINT.getPieValue()), textPoint.getX(), textPoint.getY());
                        break;
                    case PERCENTAGE:
                        dataCtx.fillText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", percentage) + "%", textPoint.getX(), textPoint.getY());
                        break;
                    case TEXT_AND_PERCENTAGE:                   
                        dataCtx.fillText(DATA_POINT.getName() + "\n" + String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", percentage) + "%", textPoint.getX(), textPoint.getY());
                        break;
                    case TEXT_AND_VALUE:
                    default:
                        dataCtx.fillText(DATA_POINT.getName() + "\n" + String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", DATA_POINT.getPieValue()), textPoint.getX(), textPoint.getY());
                        break;
                }  
                dataCtx.restore();
            }           
            dataCtx.restore();
View Full Code Here

            ITEM_CONTAINER.setPickOnBounds(false);
            ITEM_CONTAINER.setOpacity(0.0);

            // Add animations for each menu item
            double  degree    = (((degrees / positions) * i) + options.getOffset()) % 360;
            Point2D position  = new Point2D(Math.cos(Math.toRadians(degree)), Math.sin(Math.toRadians(degree)));
            double x          = Math.round(position.getX() * options.getRadius());
            double y          = Math.round(position.getY() * options.getRadius());
            double delay      = (200 / ITEMS.size()) * i;

            openTimeLines[i= options.isSimpleMode() ? createSimpleItemOpenTimeLine(ITEM_CONTAINER, x, y, delay) : createItemOpenTimeLine(ITEM_CONTAINER, x, y, delay);
            closeTimeLines[i] = options.isSimpleMode() ? createSimpleItemCloseTimeLine(ITEM_CONTAINER, x, y, delay) : createItemCloseTimeLine(ITEM_CONTAINER, x, y, delay);

View Full Code Here

TOP

Related Classes of javafx.geometry.Point2D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.