Package org.openquark.gems.client.Gem

Examples of org.openquark.gems.client.Gem.PartOutput


     * @return whether a connection was made
     */
    boolean attemptIntellicutAutoConnect(DisplayedPartConnectable part) {

        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();
        }
       
        // Check if parts are valid. They maye be burnt, connected or have a null type.
        // A null type occurs if parts belong to a broken gem graph.
        if (inPart == null || inPart.isBurnt() || inPart.isConnected() || inPart.getType() == null ||
            outPart == null || outPart.isConnected() || outPart.getType() == null) {
           
            return false;
        }

        Gem inGem = inPart.getGem();
        Gem outGem = outPart.getGem();
        boolean makeIntellicutConnection = false;
   
        // Connection not possible if both parts are from the same gem.
        if (outGem != inGem) {   
           
View Full Code Here

TOP

Related Classes of org.openquark.gems.client.Gem.PartOutput

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.