Package org.openquark.gems.client.AutoburnLogic

Examples of org.openquark.gems.client.AutoburnLogic.AutoburnUnifyStatus


                AutoburnInfo autoburnInfo =
                    GemGraph.isAncestorOfBrokenGemForest(thisGem) ?
                            null :
                                AutoburnLogic.getAutoburnInfo(typeToUnify, thisGem, tableTop.getTypeCheckInfo());

                AutoburnUnifyStatus autoburnUnifyStatus =
                    autoburnInfo != null ?
                            autoburnInfo.getAutoburnUnifyStatus() :
                                AutoburnLogic.AutoburnUnifyStatus.NOT_POSSIBLE;          

                if (autoburnUnifyStatus == AutoburnUnifyStatus.UNAMBIGUOUS_NOT_NECESSARY) {
View Full Code Here


     * @return the burning icon to use or a blank image for no burning icon
     */
    private Icon getBurnImageForEntry(IntellicutListEntry listEntry) {

        IntellicutInfo intellicutInfo = listEntry.getIntellicutInfo();
        AutoburnUnifyStatus burnStatus = intellicutInfo.getAutoburnUnifyStatus();

        if (burnStatus == AutoburnUnifyStatus.UNAMBIGUOUS) {
            return burnImageIcon;

        } else if (burnStatus == AutoburnUnifyStatus.NOT_NECESSARY) {
View Full Code Here

               
            // Figure out if we should connect the gem by burning it or by just connecting it.
            // We want to perform whatever action results in the highest type closeness.

            AutoburnInfo autoburnInfo = AutoburnLogic.getAutoburnInfo(part.getType(), dGem.getGem(), gemCutter.getTypeCheckInfo());
            AutoburnUnifyStatus burnStatus = autoburnInfo.getAutoburnUnifyStatus();
           
            boolean attemptToConnect = burnStatus.isAutoConnectable();
       
            if (burnStatus == AutoburnUnifyStatus.UNAMBIGUOUS) {

                // Perform the burn if it is unambiguous.
                attemptToConnect = autoburnGem(dGem, autoburnInfo);
View Full Code Here

        if (GemGraph.arePartsConnectable(sourcePart, sinkPart) && GemGraph.isConnectionValid(sourcePart, sinkPart)) {

            // Get the burn status for the two gems
            Gem sourceGem = sourcePart.getGem();
            TypeExpr destTypeExpr = sinkPart.getType();
            AutoburnUnifyStatus autoburnUnifyStatus = GemGraph.isAncestorOfBrokenGemForest(sourceGem) ?
                                        AutoburnUnifyStatus.NOT_POSSIBLE
                                    :   AutoburnLogic.getAutoburnInfo(destTypeExpr, sourceGem, gemCutter.getTypeCheckInfo()).getAutoburnUnifyStatus();
   
            if (autoburnUnifyStatus.isConnectableWithoutBurning()) {

                // we can link directly without burning
                lineDashSize = 10;
                lineSpaceSize = 10;
                lineDashPhase = 0;
               
            } else if (autoburnUnifyStatus.isUnambiguous()) {
               
                // we can link via unambiguous burning
                lineDashSize = 1;
                lineSpaceSize = 9;
                lineDashPhase = 0;
View Full Code Here

                GemEntity gemEntity = (GemEntity) ((GemTreeNode) value).getUserObject();
           
                if (browserTreeModel.isVisibleGem(gemEntity)) {
               
                    IntellicutInfo intellicutInfo = intellicutManager.getIntellicutInfo(gemEntity);
                    AutoburnUnifyStatus autoburnStatus = intellicutInfo.getAutoburnUnifyStatus();

                    if (autoburnStatus == AutoburnUnifyStatus.UNAMBIGUOUS) {
                        setIcon(BURN_ICON);
                        setForeground(BURN_COLOR);
                   
                    } else if (autoburnStatus == AutoburnUnifyStatus.AMBIGUOUS) {
                        setIcon(AMBIGUOUS_ICON);
                        setForeground(AMBIGUOUS_COLOR);
                   
                    } else if (autoburnStatus == AutoburnUnifyStatus.NOT_POSSIBLE) {
                        setIcon(CANNOT_CONNECT_ICON);
                        setForeground(CANNOT_CONNECT_COLOR);

                    } else if (autoburnStatus == AutoburnUnifyStatus.UNAMBIGUOUS_NOT_NECESSARY &&                   
                               intellicutInfo.getBurnTypeCloseness() > intellicutInfo.getNoBurnTypeCloseness()) {
                              
                        setIcon(BURN_ICON);
                        setForeground(BURN_COLOR);
               
                    } else if (autoburnStatus == AutoburnUnifyStatus.AMBIGUOUS_NOT_NECESSARY &&
                               intellicutInfo.getBurnTypeCloseness() > intellicutInfo.getNoBurnTypeCloseness()) {

                        setIcon(AMBIGUOUS_ICON);
                        setForeground(AMBIGUOUS_COLOR);
                    }
               
                } else {
                    setIcon(CANNOT_CONNECT_ICON);
                    setForeground(CANNOT_CONNECT_COLOR);               
                }
   
            } else {

                // This is a folder. Determine if and how it should pulse.

                // Assume we can't connect at all to start with.
                Color folderColor = CANNOT_CONNECT_COLOR;

                Enumeration<TreeNode> subTreeEnum = UnsafeCast.<Enumeration<TreeNode>>unsafeCast(((DefaultMutableTreeNode)value).breadthFirstEnumeration());
           
                while (subTreeEnum.hasMoreElements()) {

                    DefaultMutableTreeNode childTreeNode = (DefaultMutableTreeNode) subTreeEnum.nextElement();
               
                    if (childTreeNode instanceof GemTreeNode) {

                        GemEntity gemEntity = (GemEntity) childTreeNode.getUserObject();

                        if (browserTreeModel.isVisibleGem(gemEntity)) {

                            IntellicutInfo intellicutInfo = intellicutManager.getIntellicutInfo(gemEntity);
                            AutoburnUnifyStatus autoburnStatus = intellicutInfo.getAutoburnUnifyStatus();

                            if (autoburnStatus == AutoburnUnifyStatus.NOT_NECESSARY) {
                                // Connections take precedence. If we find a connection then stop.
                                folderColor = null;
                                break;
View Full Code Here

                    if (obj instanceof GemEntity) {

                        GemEntity gemEntity = (GemEntity) obj;
                        IntellicutInfo intellicutInfo = intellicutManager.getIntellicutInfo(gemEntity);
                        AutoburnUnifyStatus autoburnStatus = intellicutInfo.getAutoburnUnifyStatus();

                        if (autoburnStatus != AutoburnUnifyStatus.NOT_POSSIBLE) {

                            tableTop.getUndoableEditSupport().beginUpdate();
View Full Code Here

                    statusMessageDisplayer.clearMessage(this);

                } else if (((BrowserTreeModel) gemCutter.getBrowserTree().getModel()).isVisibleGem(gemEntity)) {

                    IntellicutInfo intellicutInfo = intellicutManager.getIntellicutInfo(gemEntity);
                    AutoburnUnifyStatus autoburnStatus = intellicutInfo.getAutoburnUnifyStatus();

                    if (autoburnStatus.isAutoConnectable()) {
                        statusMessageDisplayer.setMessageFromResource(this, "SM_IntellicutGemConnectable", StatusMessageDisplayer.MessageType.PERSISTENT);
                    } else {
                        statusMessageDisplayer.clearMessage(this);
                    }
View Full Code Here

                autoburnInfo = autoburnInfoForType;
            }
        }

        if (autoburnInfo != null) {
            AutoburnUnifyStatus autoburnUnifyStatus = autoburnInfo.getAutoburnUnifyStatus();
           
            if (autoburnUnifyStatus != AutoburnUnifyStatus.NOT_POSSIBLE &&
                    (allowFreeArguments || canBurnAllArguments(outputListEntry, autoburnInfo))) {
               
                return new IntellicutInfo(autoburnInfo.getAutoburnUnifyStatus(), autoburnInfo.getMaxTypeCloseness(), noBurnTypeCloseness, exactMatch, dependents);
View Full Code Here

TOP

Related Classes of org.openquark.gems.client.AutoburnLogic.AutoburnUnifyStatus

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.