/** * <code>ConstraintNode</code> - constructor * * @param constraint - <code>PwConstraint</code> - * @param variableNode - <code>VariableNode</code> - * @param constraintLocation - <code>Point</code> - * @param backgroundColor - <code>Color</code> - * @param isFreeToken - <code>boolean</code> - * @param isDraggable - <code>boolean</code> - * @param partialPlanView - <code>PartialPlanView</code> - */ public ConstraintNode( PwConstraint constraint, VariableNode variableNode, Point constraintLocation, Color backgroundColor, boolean isFreeToken, boolean isDraggable, PartialPlanView partialPlanView) { super(); this.constraint = constraint; this.variableNode = variableNode; this.isFreeToken = isFreeToken; this.partialPlanView = partialPlanView; variableNodeList = new ArrayList(); variableNodeList.add(variableNode); constraintVariableLinkList = new ArrayList(); constraintVariableLinkMap = new HashMap(); inLayout = false; isUnaryConstraint = true; if (constraint.getVariablesList().size() > 1) { isUnaryConstraint = false; } isDebug = false; // isDebug = true; StringBuffer labelBuf = new StringBuffer(constraint.getName()); labelBuf.append("\nkey=").append(constraint.getId().toString()); nodeLabel = labelBuf.toString(); // System.err.println( "ConstraintNode: " + nodeLabel); hasBeenVisited = false; resetNode(false); configure(constraintLocation, backgroundColor, isDraggable); } // end constructor
/** * <code>getToolTipText</code> - when over 1/8 scale overview constraint node * * @param isOverview - <code>boolean</code> - * @return - <code>String</code> - */ public String getToolTipText(boolean isOverview) { StringBuffer tip = new StringBuffer("<html> "); tip.append(constraint.getName()); tip.append("<br>key="); tip.append(constraint.getId().toString()); tip.append("</html>"); return tip.toString(); } // end getToolTipText