Package org.apache.airavata.xbaya.graph

Examples of org.apache.airavata.xbaya.graph.GraphPiece


    /**
     * @see org.apache.airavata.xbaya.graph.gui.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
     *      org.apache.airavata.xbaya.XBayaEngine)
     */
    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
        GraphPiece piece = getGraphPieceAt(event.getPoint());
        if (piece != null && graph.isEditable()) {
            piece.getGUI().mouseClicked(event, engine);
        }
    }
View Full Code Here


     *            The location
     * @return The visible object a the specified location
     */
    protected GraphPiece getGraphPieceAt(Point point) {

        GraphPiece piece = null;

        // Starts from edge because it is drawn first, which means it's at the
        // bottom.
        double minEdgeDist = Double.MAX_VALUE;
        Edge closestEdge = null;
View Full Code Here

        /*
         * If there is multi-selected and a click on a node, switch to that node or deselect node if it is already
         * selected
         */
        Point point = event.getPoint();
        GraphPiece clicked = this.graph.getGUI().getGraphPieceAt(point);
        if ((clicked instanceof Node) && this.multipleSelectedNodes != null) {
            Node node = (Node) clicked;
            if (!this.crtlPressed) {
                selectNode(node);
            }
View Full Code Here

        // Get focus to handle key board events
        this.panel.requestFocusInWindow();

        // Get select item
        GraphPiece selected = this.graph.getGUI().getGraphPieceAt(point);

        /*
         * Doing Nothing if pressed is on the selected node
         */
        if (this.multipleSelectedNodes != null) {
View Full Code Here

            this.draggedNode = null;

        }

        if (this.draggedPort != null) {
            GraphPiece graphPiece = this.graph.getGUI().getGraphPieceAt(point);
            if (graphPiece instanceof DynamicNode) {
                if (this.draggedPort.getKind() == Kind.DATA_OUT && draggedPort instanceof DataPort) {
                    this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
                    DynamicNode dynamicNode = (DynamicNode) graphPiece;
                    dynamicNode.getComponent();
View Full Code Here

        this.panel.repaint();
        event.consume();
      }
      if (this.draggedPort != null) {
        GraphPiece piece = this.graph.getGUI().getGraphPieceAt(point);
        if (piece instanceof Port) {
          Port port = (Port) piece;
          // Display the information of port that is close to the mouse
          // pointer.
          if (this.draggedPort.getKind() == Kind.DATA_IN
View Full Code Here

    }

    private void mouseMoved(MouseEvent event) {
        Point point = event.getPoint();
        GraphPiece graphPiece = this.graph.getGUI().getGraphPieceAt(point);
        if (graphPiece instanceof Node) {
            Node node = (Node) graphPiece;
            if (node.getGUI().isInConfig(point)) {
                this.panel.setCursor(SwingUtil.HAND_CURSOR);
            } else {
View Full Code Here

    }
    }

    private void maybeShowPopup(MouseEvent event) {
        if (event.isPopupTrigger()) {
            GraphPiece piece = this.graph.getGUI().getGraphPieceAt(event.getPoint());
            if (piece instanceof Node) {
                prepareNodePopupMenu((Node) piece);
                this.nodePopup.show(event.getComponent(), event.getX(), event.getY());
            } else if (piece instanceof Edge) {
                this.edgePopup.show(event.getComponent(), event.getX(), event.getY());
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.graph.GraphPiece

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.