Example #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
Example #2
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
Example #3
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