Esempio n. 1
0
 /**
  * <code>getToolTipText</code>
  *
  * @return - <code>String</code> -
  */
 public String getToolTipText() {
   if (variable == null) {
     return null;
   }
   String operation = null;
   if (areNeighborsShown()) {
     operation = "close";
   } else {
     operation = "open";
   }
   StringBuffer tip = new StringBuffer("<html> ");
   boolean isVariableWithConstraints =
       (!hasZeroConstraints) && (partialPlanView instanceof ConstraintNetworkView);
   NodeGenerics.getVariableNodeToolTipText(variable, partialPlanView, tip);
   if (isDebug) {
     tip.append(" linkCnt ").append(String.valueOf(constraintLinkCount));
   }
   if (partialPlanView.getZoomFactor() > 1) {
     tip.append("<br>key=");
     tip.append(variable.getId().toString());
   }
   if (isVariableWithConstraints) {
     tip.append("<br> Mouse-L: ").append(operation);
   }
   return tip.append("</html>").toString();
 } // end getToolTipText
Esempio n. 2
0
 /**
  * <code>getToolTipText</code> - when over 1/8 scale overview variable node implements
  * OverviewToolTip
  *
  * @param isOverview - <code>boolean</code> -
  * @return - <code>String</code> -
  */
 public String getToolTipText(boolean isOverview) {
   StringBuffer tip = new StringBuffer("<html> ");
   NodeGenerics.getVariableNodeToolTipText(variable, partialPlanView, tip);
   tip.append("<br>key=");
   tip.append(variable.getId().toString());
   tip.append("</html>");
   return tip.toString();
 } // end getToolTipText
Esempio n. 3
0
  private void redrawView() {
    System.err.println("Redrawing Navigator View ...");
    if (startTimeMSecs == 0L) {
      startTimeMSecs = System.currentTimeMillis();
    }
    this.setVisible(false);

    redrawPMThread =
        createProgressMonitorThread(
            "Redrawing Navigator View ...", 0, 6, Thread.currentThread(), this);
    if (!progressMonitorWait(redrawPMThread, this)) {
      System.err.println("progressMonitorWait failed");
      closeView(this);
      return;
    }
    redrawPMThread.getProgressMonitor().setProgress(3 * ViewConstants.MONITOR_MIN_MAX_SCALING);
    // content spec apply/reset do not change layout, only TokenNode/
    // variableNode/constraintNode opening/closing
    setNodesLinksVisible();

    if (isLayoutNeeded) {
      NavigatorViewLayout layout = new NavigatorViewLayout(jGoDocument, startTimeMSecs);
      layout.performLayout();

      isLayoutNeeded = false;
    }

    if ((focusNode == null) && (highlightPathNodesList != null)) {
      NodeGenerics.highlightPathNodes(highlightPathNodesList, jGoView);
    } else if (focusNode != null) {
      // do not highlight node, if it has been removed
      NodeGenerics.focusViewOnNode(focusNode, ((IncrementalNode) focusNode).inLayout(), jGoView);
    }

    long stopTimeMSecs = System.currentTimeMillis();
    System.err.println(
        "   ... "
            + ViewConstants.NAVIGATOR_VIEW
            + " elapsed time: "
            + (stopTimeMSecs - startTimeMSecs)
            + " msecs.");
    startTimeMSecs = 0L;
    this.setVisible(true);
    redrawPMThread.setProgressMonitorCancel();
  } // end redrawView
Esempio n. 4
0
  private void renderStepContent(String query) {
    getDocument().deleteContents();
    Color bgColor = ViewConstants.VIEW_BACKGROUND_COLOR;
    int x = 0, y = 5;
    Iterator transItr = transactionList.iterator();
    int i = 1;
    // System.err.println( "renderStepContent: transactionList " + transactionList);
    while (transItr.hasNext()) {
      x = 0;
      PwTransaction transaction = (PwTransaction) transItr.next();
      StepField stepNumField =
          new StepField(
              transaction.getStepNumber().toString(),
              new Point(x, y),
              JGoText.ALIGN_RIGHT,
              bgColor,
              viewableObject,
              vizView);
      jGoDocument.addObjectAtTail(stepNumField);
      stepNumField.setSize(
          (int) headerJGoView.getStepNumNode().getSize().getWidth(),
          (int) stepNumField.getSize().getHeight());
      x += headerJGoView.getStepNumNode().getSize().getWidth();

      keyField =
          new StepField(
              transaction.getId().toString(),
              new Point(x, y),
              JGoText.ALIGN_CENTER,
              bgColor,
              viewableObject);
      jGoDocument.addObjectAtTail(keyField);
      keyField.setSize(
          (int) headerJGoView.getKeyNode().getSize().getWidth(),
          (int) keyField.getSize().getHeight());
      x += headerJGoView.getKeyNode().getSize().getWidth();

      StepField typeField =
          new StepField(
              transaction.getType(),
              new Point(x, y),
              JGoText.ALIGN_CENTER,
              bgColor,
              viewableObject);
      jGoDocument.addObjectAtTail(typeField);
      typeField.setSize(
          (int) headerJGoView.getTypeNode().getSize().getWidth(),
          (int) typeField.getSize().getHeight());
      x += headerJGoView.getTypeNode().getSize().getWidth();

      if ((query.indexOf(" With ") >= 0) || ((query.indexOf(" With ") == -1) && key.equals(""))) {
        StepField objectKeyField =
            new StepField(
                transaction.getObjectId().toString(),
                new Point(x, y),
                JGoText.ALIGN_CENTER,
                bgColor,
                viewableObject);
        jGoDocument.addObjectAtTail(objectKeyField);
        objectKeyField.setSize(
            (int) headerJGoView.getObjectKeyNode().getSize().getWidth(),
            (int) objectKeyField.getSize().getHeight());
        x += headerJGoView.getObjectKeyNode().getSize().getWidth();
      }

      String objectName =
          NodeGenerics.trimName(
              transaction.getInfo()[0], headerJGoView.getObjectNameNode(), vizView);
      StepField objectNameField =
          new StepField(objectName, new Point(x, y), JGoText.ALIGN_CENTER, bgColor, viewableObject);
      jGoDocument.addObjectAtTail(objectNameField);
      objectNameField.setSize(
          (int) headerJGoView.getObjectNameNode().getSize().getWidth(),
          (int) objectNameField.getSize().getHeight());
      x += headerJGoView.getObjectNameNode().getSize().getWidth();

      String predicateName =
          NodeGenerics.trimName(
              transaction.getInfo()[1], headerJGoView.getPredicateNode(), vizView);
      StepField predicateField =
          new StepField(
              predicateName, new Point(x, y), JGoText.ALIGN_CENTER, bgColor, viewableObject);
      jGoDocument.addObjectAtTail(predicateField);
      predicateField.setSize(
          (int) headerJGoView.getPredicateNode().getSize().getWidth(),
          (int) predicateField.getSize().getHeight());
      x += headerJGoView.getPredicateNode().getSize().getWidth();

      String parameterName =
          NodeGenerics.trimName(
              transaction.getInfo()[2], headerJGoView.getParameterNode(), vizView);
      StepField parameterField =
          new StepField(
              parameterName, new Point(x, y), JGoText.ALIGN_CENTER, bgColor, viewableObject);
      jGoDocument.addObjectAtTail(parameterField);
      parameterField.setSize(
          (int) headerJGoView.getParameterNode().getSize().getWidth(),
          (int) parameterField.getSize().getHeight());
      x += headerJGoView.getParameterNode().getSize().getWidth();

      y += stepNumField.getSize().getHeight();
      i++;
    }
  } // end renderSteps