Package unbbayes.draw

Examples of unbbayes.draw.UShapeDecisionNode


      }
        break;
      case CREATE_DECISION_NODE: {
        newNode = controller.insertDecisionNode(e.getX(), e.getY());
        UShapeDecisionNode shape = new UShapeDecisionNode(this,
            newNode, (int) newNode.getPosition().x
                - newNode.getWidth() / 2, (int) newNode
                .getPosition().y
                - newNode.getHeight() / 2, newNode.getWidth(),
            newNode.getHeight());
        addShape(shape);
        shape.setState(UShape.STATE_SELECTED, null);
        showCPT(newNode);
      }
        break;
      case CREATE_UTILITY_NODE: {
        newNode = controller.insertUtilityNode(e.getX(), e.getY());
        UShapeUtilityNode shape = new UShapeUtilityNode(
            this,
            newNode,
            (int) newNode.getPosition().x - newNode.getWidth() / 2,
            (int) newNode.getPosition().y - newNode.getHeight() / 2,
            newNode.getWidth(), newNode.getHeight());
        addShape(shape);
        shape.setState(UShape.STATE_SELECTED, null);
        showCPT(newNode);
      }
        break;
      case ADD_PLUGIN_NODE: {
        // build new node
        newNode = this.getNodeDataTransferObject().getNodeBuilder()
            .buildNode();
        newNode.setPosition(e.getX(), e.getY());

        // add new node into network
        this.controller.getNetwork().addNode(newNode);

        // build a new shape for new node
        UShape shape = null;
        try {
          shape = this.getNodeDataTransferObject().getShapeBuilder()
              .build().getUShape(newNode, this);
        } catch (IllegalAccessException e1) {
          throw new RuntimeException(e1);
        } catch (InstantiationException e1) {
          throw new RuntimeException(e1);
        }

        // add shape into this pane (canvas)
        addShape(shape);

        // set this node/shape as selected
        shape.setState(UShape.STATE_SELECTED, null);

        shape.update();

        // notify the probability function panel's builder that a new
        // node is currently "selected" as owner
        this.getNodeDataTransferObject()
            .getProbabilityFunctionPanelBuilder()
View Full Code Here


        shape = new UShapeProbabilisticNode(this, newNode,
            (int) newNode.getPosition().x, (int) newNode
                .getPosition().y, newNode.getWidth(), newNode
                .getHeight());
      } else if (newNode instanceof DecisionNode) {
        shape = new UShapeDecisionNode(this, newNode, (int) newNode
            .getPosition().x, (int) newNode.getPosition().y,
            newNode.getWidth(), newNode.getHeight());
      } else if (newNode instanceof UtilityNode) {
        shape = new UShapeUtilityNode(this, newNode, (int) newNode
            .getPosition().x, (int) newNode.getPosition().y,
View Full Code Here

TOP

Related Classes of unbbayes.draw.UShapeDecisionNode

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.