예제 #1
0
 /**
  * <code>doMouseClick</code> - For Constraint Network View, Mouse-left opens/closes variableNode
  * to show constraintNodes
  *
  * @param modifiers - <code>int</code> -
  * @param dc - <code>Point</code> -
  * @param vc - <code>Point</code> -
  * @param view - <code>JGoView</code> -
  * @return - <code>boolean</code> -
  */
 public boolean doMouseClick(int modifiers, Point docCoords, Point viewCoords, JGoView view) {
   if (variable == null) {
     return false;
   }
   JGoObject obj = view.pickDocObject(docCoords, false);
   //         System.err.println( "doMouseClick obj class " +
   //                             obj.getTopLevelObject().getClass().getName());
   VariableNode variableNode = (VariableNode) obj.getTopLevelObject();
   if (MouseEventOSX.isMouseLeftClick(modifiers, PlanWorks.isMacOSX())) {
     if ((!hasZeroConstraints) && (partialPlanView instanceof ConstraintNetworkView)) {
       if (!areNeighborsShown()) {
         // System.err.println
         //  ( "doMouseClick: Mouse-L show constraint/token nodes of variable id " +
         //    variableNode.getVariable().getId());
         addVariableNodeContainersAndConstraints(this, (ConstraintNetworkView) partialPlanView);
         setAreNeighborsShown(true);
       } else {
         // System.err.println
         //  ( "doMouseClick: Mouse-L hide constraint/token nodes of variable id " +
         //    variableNode.getVariable().getId());
         removeVariableNodeContainersAndConstraints(this, (ConstraintNetworkView) partialPlanView);
         setAreNeighborsShown(false);
       }
       return true;
     }
   } else if (MouseEventOSX.isMouseRightClick(modifiers, PlanWorks.isMacOSX())) {
     mouseRightPopupMenu(viewCoords);
     return true;
   }
   return false;
 } // end doMouseClick
예제 #2
0
  /**
   * <code>doMouseClick</code>
   *
   * @param modifiers - <code>int</code> -
   * @param dc - <code>Point</code> -
   * @param vc - <code>Point</code> -
   * @param view - <code>JGoView</code> -
   * @return - <code>boolean</code> -
   */
  public boolean doMouseClick(int modifiers, Point dc, Point vc, JGoView view) {
    JGoObject obj = view.pickDocObject(dc, false);
    if (MouseEventOSX.isMouseLeftClick(modifiers, PlanWorks.isMacOSX())) {
      //       System.err.println( "doMouseClick obj class " +
      //                           obj.getTopLevelObject().getClass().getName());
      //       SlotNode slotNode = (SlotNode) obj.getTopLevelObject();
      //       System.err.println( "doMouseClick: slot predicate " + slotNode.getText());

      //       JGoSelection jGoSelection = view.getSelection();
      //       jGoSelection.clearSelection();
      //       System.err.println( "doMouseClick num: " + jGoSelection.getNumObjects());
      //       JGoListPosition position = jGoSelection.getFirstObjectPos();
      //       while (position != null) {
      //         JGoObject object = jGoSelection.getObjectAtPos( position);
      //         System.err.println( "doMouseClick selection obj class " +
      //                           object.getClass().getName());
      //         jGoSelection.toggleSelection( object);
      //         // position = jGoSelection.getNextObjectPosAtTop( position);
      //         // position = jGoSelection.getNextObjectPos( position);
      //         position = jGoSelection.getFirstObjectPos();
      //       }
      return true;

    } else if (MouseEventOSX.isMouseRightClick(modifiers, PlanWorks.isMacOSX())) {
      //
    }
    return false;
  } // end doMouseClick
예제 #3
0
 /**
  * <code>doBackgroundClick</code> - Mouse-Right pops up menu:
  *
  * @param modifiers - <code>int</code> -
  * @param docCoords - <code>Point</code> -
  * @param viewCoords - <code>Point</code> -
  */
 public final void doBackgroundClick(
     final int modifiers, final Point docCoords, final Point viewCoords) {
   if (MouseEventOSX.isMouseLeftClick(modifiers, PlanWorks.isMacOSX())) {
     // do nothing
   } else if (MouseEventOSX.isMouseRightClick(modifiers, PlanWorks.isMacOSX())) {
     mouseRightPopupMenu(viewCoords);
   }
 } // end doBackgroundClick
예제 #4
0
  /**
   * <code>doMouseClick</code> -
   *
   * @param modifiers - <code>int</code> -
   * @param docCoords - <code>Point</code> -
   * @param viewCoords - <code>Point</code> -
   * @param view - <code>JGoView</code> -
   * @return - <code>boolean</code> -
   */
  public boolean doMouseClick(int modifiers, Point docCoords, Point viewCoords, JGoView view) {
    JGoObject obj = view.pickDocObject(docCoords, false);
    //         System.err.println( "doMouseClick obj class " +
    //                             obj.getTopLevelObject().getClass().getName());
    StepField stepField = (StepField) obj.getTopLevelObject();
    if (MouseEventOSX.isMouseLeftClick(modifiers, PlanWorks.isMacOSX())) {

    } else if (MouseEventOSX.isMouseRightClick(modifiers, PlanWorks.isMacOSX())) {
      // mouseRightPopupMenu( viewCoords);
      // return true;
    }
    return false;
  } // end doMouseClick
예제 #5
0
 /**
  * <code>doMouseClick</code> - For Constraint Network View, Mouse-left opens/closes constarintNode
  * to show variableNodes
  *
  * @param modifiers - <code>int</code> -
  * @param dc - <code>Point</code> -
  * @param vc - <code>Point</code> -
  * @param view - <code>JGoView</code> -
  * @return - <code>boolean</code> -
  */
 public boolean doMouseClick(int modifiers, Point dc, Point vc, JGoView view) {
   JGoObject obj = view.pickDocObject(dc, false);
   //         System.err.println( "doMouseClick obj class " +
   //                             obj.getTopLevelObject().getClass().getName());
   ConstraintNode constraintNode = (ConstraintNode) obj.getTopLevelObject();
   if (MouseEventOSX.isMouseLeftClick(modifiers, PlanWorks.isMacOSX())) {
     if ((!isUnaryConstraint) && (partialPlanView instanceof ConstraintNetworkView)) {
       if (!areNeighborsShown) {
         // System.err.println( "doMouseClick: Mouse-L show variable nodes of constraint id " +
         //                    constraintNode.getConstraint().getId());
         addConstraintNodeVariables(this, (ConstraintNetworkView) partialPlanView);
         areNeighborsShown = true;
       } else {
         // System.err.println( "doMouseClick: Mouse-L hide variable nodes of constraint id " +
         //                    constraintNode.getConstraint().getId());
         removeConstraintNodeVariables(this, (ConstraintNetworkView) partialPlanView);
         areNeighborsShown = false;
       }
       return true;
     }
   } else if (MouseEventOSX.isMouseRightClick(modifiers, PlanWorks.isMacOSX())) {
   }
   return false;
 } // end doMouseClick