Package org.jitterbit.ui.graph2d.node

Examples of org.jitterbit.ui.graph2d.node.GraphNodeUi2D


        // operation icon, name, and collapse button. We need to adjust for this title pane.
        // For the moment we hardcode the offset (30 pixels seems to work fine), but we should
        // really ask the node UI for this information.
        box.y -= 30;
        box.height += 30;
        GraphNodeUi2D nodeUi = graphLayout.getGraph().getNodeUi(opNode);
        Dimension minSize = nodeUi.getMinimumSize();
        box.width = Math.max(box.width, minSize.width);
        box.height = Math.max(box.height, minSize.height);
    }
View Full Code Here


            updateOpNodeSize();
            graphLayout.fireLayoutChanged();
        }
       
        private Rectangle applyNewBounds() {
            GraphNodeUi2D nodeUi = graphLayout.getGraph().getNodeUi(insertedNode);
            Dimension size = DimensionUtils.max(nodeUi.getSize(), nodeUi.getMinimumSize());
            int x = getX(startBounds);
            int y = getY(endBounds, endBounds, size);
            Rectangle newBounds = new Rectangle(x, y, size.width, size.height);
            shift += size.width;
            activityBounds.put(insertedNode, newBounds);
            nodeUi.setSize(newBounds.getSize());
            return newBounds;
        }
View Full Code Here

        throw new NotImplementedYetException();
    }

    @Override
    public void resize(Object node, Dimension newSize) {
        GraphNodeUi2D nodeUi = getGraph().getNodeUi(node);
        if (!nodeUi.isResizable()) {
            // alternatively just return quietly
            throw new IllegalArgumentException("node is not resizable");
        }
        Dimension currentSize = nodeUi.getSize();
        Dimension minSize = nodeUi.getMinimumSize();
        newSize.width = Math.max(newSize.width, minSize.width);
        newSize.height = Math.max(newSize.height, minSize.height);
        if (!currentSize.equals(newSize)) {
            if (node instanceof EmailWrapperNode) {
                resizeEmailNode((EmailWrapperNode) node, newSize);
View Full Code Here

        fireLayoutChanged();
        expand(node);
    }

    private void insertNewEmailNode(EmailWrapperNode node, Object previous) {
        GraphNodeUi2D nodeUi = getGraph().getNodeUi(node);
        Dimension size = nodeUi.getPreferredSize();
        Rectangle bounds = emailLayoutCache.getBounds(node.getEmailId());
        if (bounds == null) {
            // TODO: Refactor out the positioning logic here to a strategy interface,
            // making it easy to try out different approaches.
            int x = MIN_X;
View Full Code Here

    @Override
    public void resize(Object node, int dw, int dh) {
        if (dw == 0 || dh == 0) {
            return;
        }
        GraphNodeUi2D nodeUi = getGraph().getNodeUi(node);
        if (!nodeUi.isResizable()) {
            // alternatively just return quietly
            throw new IllegalArgumentException("node is not resizable");
        }
        Dimension currentSize = nodeUi.getSize();
        Dimension newSize = new Dimension(currentSize.width + dw, currentSize.height + dh);
        resizeImpl(node, nodeUi, currentSize, newSize);
    }
View Full Code Here

        resizeImpl(node, nodeUi, currentSize, newSize);
    }

    @Override
    public void resize(Object node, Dimension newSize) {
        GraphNodeUi2D nodeUi = getGraph().getNodeUi(node);
        if (!nodeUi.isResizable()) {
            // alternatively just return quietly
            throw new IllegalArgumentException("node is not resizable");
        }
        Dimension currentSize = nodeUi.getSize();
        resizeImpl(node, nodeUi, currentSize, newSize);
    }
View Full Code Here

            shiftNodes();
            fireLayoutChanged();
        }
       
        private Rectangle applyNewBounds(Object n, Rectangle previousBounds, int remaining) {
            GraphNodeUi2D nodeUi = getGraph().getNodeUi(n);
            Dimension size = nodeUi.getSize();
            int x = getX(previousBounds);
            int y = getY(previousBounds, endBounds, size, remaining);
            Rectangle newBounds = new Rectangle(x, y, size.width, size.height);
            shift += size.width;
            nodeBounds.put(n, newBounds);
View Full Code Here

        if (nodeEditor != null) {
            if (!nodeEditor.stopCellEditing()) {
                return;
            }
        }
        GraphNodeUi2D nodeUi = getNodeUi(node);
        if (nodeUi != null) {
            GraphNodeEditor editor = nodeUi.getEditor();
            if (editor != null) {
                showNodeEditor(editor);
            }
        }
    }
View Full Code Here

    public GraphNodeUi2D getNodeUi(Object node) {
        return nodeUis.get(node);
    }
   
    private GraphNodeUi2D createAndAddNodeUi(Object node) {
        GraphNodeUi2D ui = nodeUiFactory.createNodeUi(this, node);
        ui.addSizeListener(modelListener);
        nodeUis.put(node, ui);
        return ui;
    }
View Full Code Here

                }
            });
        }

        private void recreateExpandedOrCollapsedNode(Object node) {
            GraphNodeUi2D nodeUi = nodeUis.remove(node);
            if (nodeUi != null) {
                nodeUi.dispose();
            }
            createAndAddNodeUi(node);
            repaint();
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.ui.graph2d.node.GraphNodeUi2D

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.