|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.fopps.model.AbstractItem
|
+--org.fopps.model.Relation
|
+--org.fopps.model.Constraint
Constraint is the base class for all constraints. A constraint is a special relation with an additional attibute 'type'. Currently a constraint may be an 'exclude' or an 'include' constraint. 'A exclude B' means, that A must not be selected, if B is selected. 'A include B' means, that A requires also the selection of B.
Please note, that these rules are not reflexive: 'A includes B' does not imply 'B includes A' (same for exclude). In this case you have to define a seperate constraint.
Convention: The first part of the constrained will also called the
| Field Summary |
| Fields inherited from class org.fopps.model.Relation |
from, to |
| Fields inherited from class org.fopps.model.AbstractItem |
ADDED_EVENT, CHANGE_EVENT, name, REMOVED_EVENT |
| Constructor Summary | |
Constraint(AbstractItem pFrom,
AbstractItem pTo,
ConstraintType pConstraintType)
Creates a new constraint |
|
| Method Summary | |
abstract boolean |
check()
Checks, if constraint is met by current configuration |
ConstraintType |
getConstraintType()
|
boolean |
isValid()
Checks if relation is valid. |
protected void |
saveUndoOnDisconnect()
Called while disconnecting. |
void |
setConstraintType(ConstraintType pConstraintType)
|
void |
toggleConstraintType()
Toggle constraint type |
java.lang.String |
toString()
|
| Methods inherited from class org.fopps.model.Relation |
accept, disconnect, getFrom, getTo, isGhost, loopAllowed, setAllowLoop, setFrom, setGhost, setTo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Constraint(AbstractItem pFrom,
AbstractItem pTo,
ConstraintType pConstraintType)
throws InvalidRelationException
pFrom - Constraint source| Method Detail |
public ConstraintType getConstraintType()
public void toggleConstraintType()
public void setConstraintType(ConstraintType pConstraintType)
public boolean isValid()
Relation
isValid in class RelationRelation.accept(AbstractItem)protected void saveUndoOnDisconnect()
saveUndoOnDisconnect in class Relationpublic abstract boolean check()
public java.lang.String toString()
toString in class Relation
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||