fig.setAttribute(GroupConstraintFigure.GroupType, value);
fig.invalidate();
}
}
} else if (src instanceof VPConstraint) {
VPConstraint target = (VPConstraint) src;
String propertyName = evt.getPropertyName();
if (propertyName.equals(VPConstraintProperties.TYPE)) {
Set set = idToFigureMap.get(target.getID());
if (set == null) return;
//update the figure's display
VPConstraintType gType = target.getType();
String value = null;
if (VPConstraintType.SingleVP.equals(gType)) {
value = VPConstraintFigure.Single;
} else if (VPConstraintType.MultiVP.equals(gType)) {
value = VPConstraintFigure.Multi;
} else if (VPConstraintType.AllVP.equals(gType)) {
value = VPConstraintFigure.All;
}
Iterator iterator = set.iterator();
while (iterator.hasNext()) {
Figure fig = (Figure) iterator.next();
fig.setAttribute(VPConstraintFigure.VPType, value);
fig.invalidate();
}
}
} else if (src instanceof CompositeConstraint) {
CompositeConstraint target = (CompositeConstraint) src;
String propertyName = evt.getPropertyName();
if (propertyName.equals(CompositeConstraintProperties.PL_TYPE)) {
//find the figure
Set set = idToFigureMap.get(target.getID());
if (set == null) return;
//update the figure's display
CompositeConstraintType plType = target.getPLType();
Integer value = null;
if (CompositeConstraintType.L2R_Implication.equals(plType)) {
value = PLFigure.L2R_REQUIRE;
} else if (CompositeConstraintType.R2L_Implication.equals(plType)) {
value = PLFigure.R2L_REQUIRE;
} else if (CompositeConstraintType.Mutex.equals(plType)) {
value = PLFigure.MUTEX;
} else if (CompositeConstraintType.Equivalence.equals(plType)) {
value = PLFigure.EQUIVALENCE;
}
Iterator iterator = set.iterator();
while (iterator.hasNext()) {
Figure fig = (Figure) iterator.next();
fig.setAttribute(PLFigure.PLType, value);
fig.invalidate();
}
} else if (propertyName.equals(CompositeConstraintProperties.SOURCE_TYPE)) {
//find the figure
Set set = idToFigureMap.get(target.getID());
if (set == null) return;
//update the figure's display
CompositeConstraintPortType sourceType = target.getSourceType();
String value = null;
if (CompositeConstraintPortType.Single.equals(sourceType)) {
value = PLFigure.Single;
} else if (CompositeConstraintPortType.Multi.equals(sourceType)) {
value = PLFigure.Multi;
} else {
value = PLFigure.All;
}
Iterator iterator = set.iterator();
while (iterator.hasNext()) {
Figure fig = (Figure) iterator.next();
fig.setAttribute(PLFigure.SourceType, value);
fig.invalidate();
}
} else if (propertyName.equals(CompositeConstraintProperties.SINK_TYPE)) {
//find the figure
Set set = idToFigureMap.get(target.getID());
if (set == null) return;
//update the figure's display
CompositeConstraintPortType sinkType = target.getSinkType();
String value = null;
if (CompositeConstraintPortType.Single.equals(sinkType)) {
value = PLFigure.Single;