Package org.openquark.gems.client.DisplayedGem

Examples of org.openquark.gems.client.DisplayedGem.DisplayedPartConnectable


         * {@inheritDoc}
         */
        public void typeChanged(TypeChangeEvent e) {
            // When a part's type changes, repaint for the new type.
            PartConnectable partChanged = (PartConnectable)e.getSource();
            DisplayedPartConnectable displayedPartConnectable = getDisplayedPartConnectable(partChanged);
            if (displayedPartConnectable != null) {
                getTableTopPanel().repaint(displayedPartConnectable.getBounds());
            }
        }
View Full Code Here


                    treeNode = (DefaultMutableTreeNode) explorerTree.getModel().getRoot();
                    explorerTree.setSelectionPath(new TreePath(treeNode.getPath()));
                }

                Rectangle location = getIntellicutLocation(treeNode);
                DisplayedPartConnectable displayedPart = null;

                if (userObject instanceof Gem.PartInput) {
                    displayedPart = gemCutter.getTableTop().getDisplayedPartConnectable((Gem.PartInput) userObject);
                }
View Full Code Here

            private static final long serialVersionUID = 4980938816525148088L;

            public void actionPerformed(ActionEvent e) {
                DefaultMutableTreeNode treeNode = tableTopExplorer.getInputNode(inputPart);
                DisplayedPartConnectable displayedPart = gemCutter.getTableTop().getDisplayedPartConnectable(inputPart);
                Rectangle location = getIntellicutLocation(treeNode);
                gemCutter.getIntellicutManager().startIntellicutMode(displayedPart, location, false, null, tableTopExplorer.getExplorerTree());
            }
        };
View Full Code Here

                if (input.isBurnt() || input.isConnected()) {
                    return false;
                }

                DisplayedPartConnectable displayedPart = gemCutter.getTableTop().getDisplayedPartConnectable(input);
                gemCutter.getIntellicutManager().startIntellicutMode(displayedPart, location, false, null, explorerTree);
                return true;

            } else {
View Full Code Here

        PartInput inPart = null;
        PartOutput outPart = null;
       
        // Copy the reference to avoid threading issues.
        DisplayedPartConnectable intellicutPartConnectable = intellicutPart;

        // Assign the correct parts to inPart and outPart.
        if (intellicutPartConnectable instanceof DisplayedPartInput) {
            inPart = (PartInput) intellicutPartConnectable.getPartConnectable();
        } else if (intellicutPartConnectable instanceof DisplayedPartOutput) {
            outPart = (PartOutput) intellicutPartConnectable.getPartConnectable();
        }
        if (part instanceof DisplayedPartInput) {
            inPart = (PartInput) part.getPartConnectable();
        } else if (part instanceof DisplayedPartOutput) {
            outPart = (PartOutput) part.getPartConnectable();
View Full Code Here

            DisplayedPart partOver = gemCutter.getTableTop().getGemPartUnder(evt.getPoint());
                   
            if (partOver instanceof DisplayedPartOutput ||
                (partOver instanceof DisplayedPartInput && !((DisplayedPartInput)partOver).getPartInput().isBurnt())) {
   
                DisplayedPartConnectable dPartConnectable = (DisplayedPartConnectable)partOver;
                PartConnectable partConnectable = dPartConnectable.getPartConnectable();
   
                if (!partConnectable.isConnected()) {
       
                    if (lastPartConnectable == null || lastPartConnectable == partConnectable) {
View Full Code Here

                // Increment the update level to aggregate any unburns with connection change edits.
                undoableEditSupport.beginUpdate();
               
                // Get the part which the user pressed.  Should be connectable!
                DisplayedPartConnectable partPressed =
                    (DisplayedPartConnectable)tableTop.getGemPartUnder(pressedAt);

                // Keep track of the disconnected part.
                disconnectedDisplayedPart = partPressed;

                // Get the gem connection to disconnect.
                DisplayedConnection disconnectConn = partPressed.getDisplayedConnection();
               
                // Adjust the apparent click point to be the point of the arrow of the part that is
                // not being disconnected.
                if (partPressed instanceof DisplayedPartOutput) {
                    connectionDragAnchorPart = disconnectConn.getDestination();
                } else {
                    connectionDragAnchorPart = disconnectConn.getSource();
                }
               
                pressedAt = connectionDragAnchorPart.getConnectionPoint();                     
               
                // Indicate to the user that a drag disconnect is possible.
                setCursor(connectCursor);            

                // Disconnect the connection.
                tableTop.handleDisconnectGesture(disconnectConn.getConnection());

                // Undo any autoburns if we disconnected an output
                if (partPressed instanceof DisplayedPartOutput) {
                    DisplayedGem burnGem = partPressed.getDisplayedGem();
                    tableTop.getBurnManager().doUnburnAutomaticallyBurnedInputsUserAction(burnGem.getGem());
                }

            } else if (nextMode == TableTopDragMode.SELECTING && SwingUtilities.isLeftMouseButton(e)) {
               
View Full Code Here

        displayedPartOutput.bindDisplayedConnection(tempConnection);
       
        // tidy the temporary connection..
        DisplayedGem[] displayedGems = {displayedPartInput.getDisplayedGem(), displayedPartOutput.getDisplayedGem()};
        Graph.LayoutArranger layoutArranger = new Graph.LayoutArranger(displayedGems);
        DisplayedPartConnectable anchorPart = anchorOutput ? (DisplayedPartConnectable)displayedPartOutput : displayedPartInput;
        tableTop.doTidyUserAction(layoutArranger, anchorPart.getDisplayedGem());
       
        // Restore the old connection info.
        displayedPartOutput.bindDisplayedConnection(oldOutputConnection);
        displayedPartInput.bindDisplayedConnection(oldInputConnection);
    }
View Full Code Here

TOP

Related Classes of org.openquark.gems.client.DisplayedGem.DisplayedPartConnectable

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.