|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.state.StateFlag | +--gumbo.util.state.ObjectFlag | +--gumbo.interact.SelectFlag
Base class for "selection" interactor flags. Selection inherently involves logical grouping, with a given interactor being a member of none or more selection groups. Selection flags have a concrete flag type (used for identity and sorting), a selection order (typically representing an overlap or Z-order), and a selection role (such as a command type, or the parent aspect model).
The default Gumbo selection model uses InteractorFlags.SELECT_COMAND for command target selection (general interactive selection), and InteractorFlags.SELECT_ASPECT for aspect member selection. Also, the selection flag order parallels the picking order (see PickMapper). As such, a single selection order is used for all select flags. More sophisticated selection models may wish to maintain separate selection orders for separate concrete subtypes (such as for command targets and aspect models).
A select flag is an ObjectFlag, with the object identifying the selection role. The identity (equals(), hashCode()) of a select flag incorporates the selection role, the selection order, and an instanceof test for the concrete flag type (as implemented by checkConcreteType()). Breaking with the contract for Comparable, a select flag will have an equal sorting order if select order is equal, not if equals() is true. As such, sorting multiple select flags of the same concrete type and order but different roles will result in a single select flag, which is arbitrarily chosen.
Since an interactor cannot easily provide feedback for membership in an unlimited number of groups, a select flag includes a selection order. Typically, this number is used for overlap precedence or "Z order", with only the select flag with the highest order being presented. Logical grouping is often closely associated with data modelling, especially aspect models (soft models). To maintain correspondence between a selection group and its data model the selection role can be a reference to a parent data model. Since "hard" model interactors already contain a relation to their associated part models the data model reference is typically only used to associate "soft" model interactors with their parent aspect model. Typically, a data model's client data is used by an interactor as a rendering hint, such as border, background, and/or text colors. Such use requires cooperation between the interactors and the data models they represent.
Constructor Summary | |
SelectFlag(int order,
java.lang.Object role,
java.lang.String name)
Creates an instance. |
Method Summary | |
protected boolean |
checkConcreteType(SelectFlag obj)
Called by the system for identity and comparability testing for the concrete type. |
int |
compareTo(java.lang.Object obj)
Warning: Inconsistent with equals. |
boolean |
equals(java.lang.Object obj)
True if object is an instance of this select flag subtype and has equal select order and data model. |
int |
getOrder()
Returns the selection order of this selection flag. |
int |
hashCode()
Returns the superclass hash code plus the select order. |
java.lang.String |
toString()
Returns the order of this flag followed by its name and role. |
Methods inherited from class gumbo.util.state.ObjectFlag |
getObject, isObjectAssignableTo |
Methods inherited from class gumbo.util.state.StateFlag |
getName |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SelectFlag(int order, java.lang.Object role, java.lang.String name)
order
- The selection order index of this flag's selection
group. Typically the overlap precedence or Z-order (highest is
presented).role
- The role of this flag's selection group as defined
by the identify of this object. Null if none. Typically a Class,
String, or DataModel. If a DataModel, the client data typically
provides rendering hints.name
- Name of this state flag. If null, defaults to
"SelectFlag".Method Detail |
public int getOrder()
protected boolean checkConcreteType(SelectFlag obj)
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class ObjectFlag
public boolean equals(java.lang.Object obj)
equals
in class ObjectFlag
public int hashCode()
hashCode
in class ObjectFlag
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |