Package lupos.gui.operatorgraph.graphwrapper

Examples of lupos.gui.operatorgraph.graphwrapper.GraphWrapper


   * create the button to show the operator graph.
   */
  public JButton createASTCoreSPARQLButton() {
    // create operatorgraph-button, add actionListener and add it to
    // Applet...
    final GraphWrapper graphWrapper = getASTCoreGraphWrapper();
    final JButton bt_coreAST = new JButton("Show AST Core "
        + queryOrRule());
    bt_coreAST.setMargin(new Insets(0, 0, 0, 0));
    bt_coreAST.setEnabled(graphWrapper != null);

View Full Code Here


  protected void replaceOperator(final Operator newOP, final VisualGraph<Operator> parent, final GraphWrapper oldGW) {
    newOP.cloneFrom(this);
    this.replaceWith(newOP);

    final GraphWrapper gw = new GraphWrapperOperator(newOP);
    final GraphBox box = parent.getBoxes().get(oldGW);

    box.initBox(gw);
    box.arrange(Arrange.values()[0]);

    parent.getBoxes().remove(oldGW);
    parent.getBoxes().put(gw, box);

    parent.remove(this.panel);
    parent.add(box.getElement());

    for(final Operator preOp : this.precedingOperators) {
      final GraphWrapper preGW = new GraphWrapperOperator(preOp);
      final GraphBox preBox = parent.getBoxes().get(preGW);

      preBox.setLineAnnotations(preOp.drawAnnotations(parent));
    }
View Full Code Here

    try {
      final T newOp = this.createOperator(clazz, content);

      this.handleAddOperator(newOp);

      final GraphWrapper gw = this.createGraphWrapper(newOp);

      // create the GraphBox at the right position...
      final GraphBox box = this.graphBoxCreator.createGraphBox(this, gw);
      box.setY(y);
      box.updateX(x, y, new HashSet<GraphBox>());
View Full Code Here

    this.visualEditor.activateGraphMenus();

    this.handleAddOperator(newOp);

    //    final GraphWrapper gw = new GraphWrapperOperator(newOp, this.prefix);
    final GraphWrapper gw = this.createGraphWrapper(newOp);

    // find out whether the operator is a subclass of RetrieveData...
    if(newClassSuperName.startsWith("RetrieveData")) {
      this.rootList.add(gw);
    }
View Full Code Here

  public Hashtable<GraphWrapper, AbstractSuperGuiComponent> drawAnnotations(VisualGraph<Operator> parent) {
    Hashtable<GraphWrapper, AbstractSuperGuiComponent> lineLables = new Hashtable<GraphWrapper, AbstractSuperGuiComponent>();

    for(OperatorIDTuple<Operator> opIDt : this.succeedingOperators) {
      GraphWrapper gw = new GraphWrapperOperator(this);
      GraphWrapper childGW = new GraphWrapperOperator(opIDt.getOperator());

      AbstractGuiComponent<Operator> element = new AnnotationPanel<Operator>(parent, gw, this, opIDt.getOperator());

      this.annotationLabels.put(opIDt.getOperator(), element);
View Full Code Here

    final LinkedList<GraphWrapperIDTuple> succedingElements = new LinkedList<GraphWrapperIDTuple>();

    // walk through succeeding BasicOperators...
    for(final OperatorIDTuple<Operator> oit : succedingOperators) {
      // put BasicOperator in GraphWrapper class...
      final GraphWrapper element = new GraphWrapperOperator(oit.getOperator());

      // add GraphWrapperIDTuple with current BasicOperator to list of
      // succeeding elements...
      succedingElements.add(new GraphWrapperIDTuple(element, oit.getId()));
    }
View Full Code Here

      }
    }

    stopAnimation = false;

    final GraphWrapper fromGW = this
        .findGraphWrapper(this.fromBasicOperator);

    // --- define position for the commentPanel - begin --
    final Tuple<Point, Dimension> positionAndSizeOfFromOp = this.operatorGraph
        .getPositionAndDimension(fromGW);
    final Point positionOfFromOp = positionAndSizeOfFromOp.getFirst();
    final Dimension sizeOfFromOp = positionAndSizeOfFromOp.getSecond();
    // --- define position for the commentPanel - end --

    if (this.toBasicOperator == null) {
      this.setLocation(positionOfFromOp.x, positionOfFromOp.y
          + sizeOfFromOp.height + (int) this.operatorGraph.PADDING);
      return;
    }

    final GraphWrapper toGW = this.findGraphWrapper(this.toBasicOperator);

    // --- define end position for the commentPanel - begin ---
    final Tuple<Point, Dimension> positionAndSizeOfToOp = this.operatorGraph
        .getPositionAndDimension(toGW);
    final Point positionOfToOp = positionAndSizeOfToOp.getFirst();
View Full Code Here

    }

    // walk through succeeding elements of this root GraphWrapper...
    for (final GraphWrapperIDTuple gwIDT : graphWrapper
        .getSucceedingElements()) {
      final GraphWrapper gw = gwIDT.getOperator(); // get the GraphWrapper

      final GraphWrapper found = this.findChildGW(gw, basicOp, visited);

      if (found != null) {
        return found;
      }
    }
View Full Code Here

    final LinkedList<GraphWrapper> rootList = this.operatorGraph
        .getRootList(false);

    // finding the GraphWrapper to the "from"-operator...
    final HashSet<GraphWrapper> visited = new HashSet<GraphWrapper>();
    GraphWrapper graphWrapper = null;

    // walk through root GraphWrappers of the OperatorGraph...
    for (final GraphWrapper rootGW : rootList) {
      graphWrapper = this.findChildGW(rootGW, basicOperator, visited);
View Full Code Here

    }
    else{
   
      // iterate over all nodes in the level
      for (int currentIndex = 0; currentIndex < currentLevel.size(); currentIndex++) {
        GraphWrapper currentNode = currentLevel.get(currentIndex);
        int gridPositionsSum = 0; // Sum of positions of ancestors of current node
        int nodeAmount = 0;    // Amount of ancestors of current node     
        // List of all ancestors of the current node
        LinkedList <GraphWrapper> ancestors = currentNode.getPrecedingElements();
           
        // iterate over all ancestors
        for (int i = 0; i < ancestors.size();i++) {
          GraphWrapper ancestor = ancestors.get(i);

          gridPositionsSum += getGridPosition(levels, ancestor, level-1);

          // if current level is root-level
          if (gridPositionsSum < 0) return moves;
View Full Code Here

TOP

Related Classes of lupos.gui.operatorgraph.graphwrapper.GraphWrapper

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.