|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AttrViewSetting
Mediator interface, facilitating view-dependent access to attribute objects.
The "Mediator" design pattern was chosen for a loose and lightweight coupling
of attribute objects and their visual representation. It also allows
view-dependent (editor) and view-independent (graph transformation unit)
users of the attribute component to identify their attribute objects by the
same handles.
Please pay attention that the integer selectors for attribute tuple members
are not absolute indexes as in the AttrTuple interface. Rather, they are
"slots", member positions in respect to this view.
There can be an arbitrary number of views, each holding exactly one
(changeable) representation of an attribute tuple (order of members, hiding
of members).
Each view has two 'subviews', an 'open view' and a 'masked view'. They
basically share the same tuple layout information, with one exception. Tuple
access using the subview obtained by calling getOpenView() does not hide the
'hidden' members, although they can be hidden by invoking setVisibleAt(
aTuple, false, aSlot ). The hiding effect only occurs when using the subview
obtained by calling getMaskedView(). The order of members is consistent, i.e.
if memberA == aTuple.getMember( slotA1, aViewSetting.getOpenView()) &&
mamberB == aTuple.getMember( slotB1, aViewSetting.getOpenView()) && memberA ==
aTuple.getMember( slotA2, aViewSetting.getMaskedView()) && memberB ==
aTuple.getMember( slotB2, aViewSetting.getMaskedView()) && slotA1 < slotB1
then slotA2 < slotB2
The event indices (slots) are delivered according to the view for which the
observer registered. When accessing a tuple using these slots always remember
to supply the appropriate view. It can be obtained by invoking getView() on
the delivered event.
Field Summary | |
---|---|
static long |
serialVersionUID
|
Method Summary | |
---|---|
void |
addObserver(AttrViewObserver o,
AttrTuple attr)
Adding an observer for an attribute tuple's representation. |
int |
convertIndexToSlot(AttrTuple attr,
int index)
Returns the slot position in the view layout for 'attr' at 'index'. |
int |
convertSlotToIndex(AttrTuple attr,
int slot)
Returns the index for 'attr' at 'slot', as set in this view layout. |
AttrViewSetting |
getMaskedView()
Returns the 'masked subview', manipulating of visibility of members (setVisibleAt(...)) affects this subview. |
AttrViewSetting |
getOpenView()
Returns the 'open subview', manipulating of visibility of members (setVisibleAt(...)) only affects the other subview. |
int |
getSize(AttrTuple attr)
Returns the number of members that are visible in this view. |
boolean |
hasObserver(AttrTuple attr)
|
boolean |
isVisible(AttrTuple attr,
int slot)
Testing if the attribute member at the specified slot is visible in this view. |
void |
moveSlotAppending(AttrTuple attr,
int srcSlot,
int destSlot)
Moves the member at "srcSlot" to "destSlot", appending-wise. |
void |
moveSlotInserting(AttrTuple attr,
int srcSlot,
int destSlot)
Moves the member at "srcSlot" to "destSlot", inserting-wise. |
void |
removeObserver(AttrViewObserver o,
AttrTuple attr)
Removing an observer for an attribute tuple's representation. |
void |
resetTuple(AttrTuple attr)
Reset the tuple layout, so each slot number is the same as the index it contains, with all slots visible. |
void |
setAllVisible(AttrTuple attr,
boolean b)
Setting, if all attribute members of 'attr' should either be at once made visible or hidden. |
void |
setVisible(AttrTuple attr)
Set visibility to true, if declaration type member of AttrTuple attr is visible, else - to false. |
void |
setVisibleAt(AttrTuple attr,
boolean b,
int slot)
Setting, if the attribute member at the specified slot of this view should be visible or not. |
Methods inherited from interface agg.util.Disposable |
---|
dispose |
Field Detail |
---|
static final long serialVersionUID
Method Detail |
---|
AttrViewSetting getOpenView()
getMaskedView().
AttrViewSetting getMaskedView()
void addObserver(AttrViewObserver o, AttrTuple attr)
void removeObserver(AttrViewObserver o, AttrTuple attr)
boolean hasObserver(AttrTuple attr)
int convertIndexToSlot(AttrTuple attr, int index)
int convertSlotToIndex(AttrTuple attr, int slot)
int getSize(AttrTuple attr)
boolean isVisible(AttrTuple attr, int slot)
void setVisibleAt(AttrTuple attr, boolean b, int slot)
void setAllVisible(AttrTuple attr, boolean b)
void setVisible(AttrTuple attr)
void moveSlotInserting(AttrTuple attr, int srcSlot, int destSlot)
void moveSlotAppending(AttrTuple attr, int srcSlot, int destSlot)
void resetTuple(AttrTuple attr)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |