|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfacets.util.Tracer
facets.core.superficial.TargetCore
facets.core.superficial.app.ViewerTarget
public abstract class ViewerTarget
Connects a facet to the viewer and retargeting architectures.
ViewerTarget connects a viewer facet
to the surface targeter tree in three distinct ways.
Firstly, it implements SViewer to supply a viewer facet with
view policy and content based on two final STarget
members passed to the constructor:
views is either a SFrameTarget whose SFrameTarget.framed
is a SView, or an SIndexing of several such.
viewable is the ViewableFrame
whose framed is to be exposed in whole or part by the
viewer facet attached to the ViewerTargetBoth views and (most commonly) viewable can
be shared with other ViewerTargets.
Secondly, ViewerTarget implements FacetedTarget to represent
its facet in turn to the retargeting architecture via the SAreaTarget content area tree.
Finally, the ViewableActions passed to the constructor are
coupled to STrigger targets that can be
The STargeter returned by newTargeter() ensures that
trigger live states are updated at each retargeting.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface facets.core.superficial.STarget |
|---|
STarget.Targeted |
| Nested classes/interfaces inherited from interface facets.core.superficial.Notifying |
|---|
Notifying.Impact |
| Field Summary | |
|---|---|
STrigger[] |
actionTriggers
Coupled to the ViewableActions passed to the constructor. |
static int |
ELEMENTS_FACET
|
static int |
ELEMENTS_VIEWABLE
|
ViewableFrame |
viewable
Frames content of which some portion is to be exposed by the viewer facet. |
STarget |
views
Either a SFrameTarget decorating a SView,
or an SIndexing of several such. |
| Fields inherited from class facets.core.superficial.TargetCore |
|---|
targets |
| Fields inherited from interface facets.core.superficial.STarget |
|---|
NONE |
| Fields inherited from interface facets.core.superficial.app.SViewer |
|---|
CURSOR_CROSSHAIR, CURSOR_DEFAULT, CURSOR_HAND, CURSOR_MOVE, CURSOR_NORTH, CURSOR_TEXT, CURSOR_WAIT, CURSOR_WEST |
| Constructor Summary | |
|---|---|
protected |
ViewerTarget(java.lang.String title,
ViewableFrame viewable,
STarget views)
Unique constructor. |
| Method Summary | |
|---|---|
protected void |
actionTriggerFired(ViewableAction action)
Responds to firing of a trigger coupled to the action. |
SAreaTarget |
areaParent()
The parent in the area target tree. |
SFacet |
attachedFacet()
The SFacet attached with FacetedTarget.attachFacet(SFacet). |
void |
attachFacet(SFacet facet)
Attach an immutable facet. |
protected boolean |
blockNotification()
Enables notification to be restricted to this member of the tree. |
void |
ensureActive(boolean notify)
Ensure that the targeter tree treats the faceted as having the GUI focus. |
protected abstract ViewableAction |
getTriggerAction(STrigger trigger)
Retrieve the action coupled to a trigger. |
java.lang.Object |
identity()
Return an object that is as far as possible unique for the implementation. |
Notifying.Impact |
impact()
Allows this Notifying to specify a default Notifying.Impact. |
boolean |
isActive()
Should the targeter tree treat the facet as having the GUI focus? |
protected STarget[] |
lazyElements()
Re-implementation. |
Notifiable |
monitor()
The current Notifiable in the notification tree,
as set with setMonitor. |
protected STarget[] |
newActionTriggerGroups(ViewableAction[] actions)
Compose groups of triggers for use in the targeter tree. |
protected abstract STrigger[] |
newActionTriggers(ViewableAction[] actions)
Create triggers coupled to the actions passed. |
protected TypedNode[] |
newDebugChildren()
Create a TypedNode[] representation of this Notifying
for debug purposes. |
protected static TypedNode |
newDebugContentNode(java.lang.String title,
java.lang.Object source)
|
protected static TypedNode |
newDebugContentNode(java.lang.String title,
java.lang.Object[] source)
|
protected static TypedNode |
newDebugMonitorNode(Notifiable monitor)
|
TypedNode |
newGraphNode()
Returns a descriptive node for use in debug object graph. |
STargeter |
newTargeter()
Final re-implementation. |
static SFrameTarget[] |
newViewFrames(SView[] views)
Convenenience method that wraps SViews in SFrameTargets. |
protected boolean |
notifiesTargeter()
Used to construct the notification tree. |
void |
notify(Notice notice)
Respond to the Notice passed. |
void |
notifyMonitor(Notifying.Impact impact)
Call notify on the parent monitor in the notification tree,
typically with itself as parameter to the Notice passed. |
void |
retargetFacets(Notifying.Impact impact)
Implements interface method. |
SSelection |
selection()
Implements abstract method. |
void |
selectionChanged(SSelection selection)
Implements interface method. |
void |
selectionEdited(SSelection selection,
java.lang.Object edit,
boolean interim)
Implements interface method. |
void |
setAreaParent(SAreaTarget parent)
|
void |
setLive(boolean live)
Re-implementation that ensures the viewable is also set live. |
void |
setMonitor(Notifiable monitor)
Attach the Notifying to a Notifiable parent
in the notification tree. |
java.lang.String |
toString()
|
SView |
view()
Implements abstract method. |
SFrameTarget |
viewFrame()
Represents the SView currently returned by view(). |
| Methods inherited from class facets.core.superficial.TargetCore |
|---|
elements, findMonitorOfType, isLive, join, setElements, title, wantsFocus |
| Methods inherited from class facets.util.Tracer |
|---|
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutput, traceOutputWithClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface facets.core.superficial.STarget |
|---|
elements, isLive, wantsFocus |
| Methods inherited from interface facets.util.Titled |
|---|
title |
| Methods inherited from interface facets.core.superficial.Notifying |
|---|
impact, monitor, notifyMonitor, setMonitor |
| Methods inherited from interface facets.core.superficial.Notifiable |
|---|
notify |
| Field Detail |
|---|
public static final int ELEMENTS_VIEWABLE
public static final int ELEMENTS_FACET
public final STrigger[] actionTriggers
ViewableActions passed to the constructor.
public final STarget views
SFrameTarget decorating a SView,
or an SIndexing of several such.
public final ViewableFrame viewable
| Constructor Detail |
|---|
protected ViewerTarget(java.lang.String title,
ViewableFrame viewable,
STarget views)
The views passed can be either:
SFrameTarget wrapping
a SViewSIndexing of several such
title - passed to superclassviewable - stored as immutable memberviews - stored as immutable member; if an SIndexing
the ViewerTarget is set as its notification monitor| Method Detail |
|---|
protected abstract STrigger[] newActionTriggers(ViewableAction[] actions)
Called from the constructor (so should not rely on instance variables in subclasses)
actions - were passed to the constructor
STrigger[] for storage as actionTriggersprotected STarget[] lazyElements()
STriggers created by newActionTriggerGroups(ViewableAction[]);
lazyElements in class TargetCoreprotected STarget[] newActionTriggerGroups(ViewableAction[] actions)
Groups must contain only members of actionTriggers.
actions -
STarget[] for return by lazyElements();
default returns a STarget[] with a single member grouping
all actionTriggersprotected abstract ViewableAction getTriggerAction(STrigger trigger)
Called during retargeting; the trigger live state is set to the value
returned by ViewableFrame.actionIsLive(SViewer, ViewableAction),
trigger - was coupled in newActionTriggers(ViewableAction[])
to the action to be checkedprotected final void actionTriggerFired(ViewableAction action)
Calls ViewableFrame.actionTriggered(SViewer, ViewableAction)
with action.
action - was coupled in newActionTriggers(ViewableAction[])
to the trigger firedpublic final STargeter newTargeter()
Returns a targeter that updates trigger live states during
STargeter.retarget(STarget, Notifying.Impact).
newTargeter in class TargetCorepublic final SView view()
view in interface SViewerSFrameTarget.framed returned by viewFrame()public final SSelection selection()
Returns a SSelection for display in its viewer facet,
calling ViewableFrame.newViewerSelection(SViewer)
to obtain a suitable (sub-)selection within its content.
The SSelection is memoed and returned at any subsequent invocation
until the next invocation of retargetFacets(Notifying.Impact), when it is destroyed
before SRetargetable.retarget(STarget,Notifying.Impact) is called on attachedFacet().
selection in interface SViewerpublic final void selectionChanged(SSelection selection)
Calls ViewableFrame.viewerSelectionChanged(SViewer,SSelection)
followed by Notifying.notifyMonitor(Impact).
selectionChanged in interface SViewerselection - defines the new selection.
public final void selectionEdited(SSelection selection,
java.lang.Object edit,
boolean interim)
Calls ViewableFrame.viewerSelectionEdited(SViewer, Object, boolean) followed by
Notifying.notifyMonitor(Impact).
selectionEdited in interface SViewerselection - if null implies edit should be applied to the
current selection; otherwise the selection should be changed to matchedit - defines the change proposed to the selectioninterim - if true the edit forms part of a sequencepublic final void attachFacet(SFacet facet)
FacetedTargetAs a STarget representing its FacetedTarget.attachedFacet(),
FacetedTarget can only attach a single viewer or area facet;
it should complain if any attempt is made to attach another.
attachFacet in interface FacetableattachFacet in interface FacetedTargetfacet - will be applied during each retargeting sequencepublic final SFacet attachedFacet()
FacetedTargetSFacet attached with FacetedTarget.attachFacet(SFacet).
Return the facet attached to this FacetedTarget,
complaining if none yet attached.
attachedFacet in interface FacetedTargetpublic final void retargetFacets(Notifying.Impact impact)
Retargets any attached facet on this ViewerTarget;
also destroys the currently memoed SSelection.
retargetFacets in interface Facetablepublic boolean isActive()
FacetedTarget
isActive in interface SViewerisActive in interface FacetedTargetpublic final void ensureActive(boolean notify)
FacetedTarget
ensureActive in interface FacetedTargetnotify - if true, also trigger a retargetingNotifyingpublic final SAreaTarget areaParent()
FacetedTarget
areaParent in interface FacetedTargetpublic final void setLive(boolean live)
setLive in interface STargetsetLive in class TargetCorepublic final SFrameTarget viewFrame()
SView currently returned by view().
(Encapsulates the logic for the implementation of view().)
SFrameTarget or the indexed
of the SIndexing set as views.protected final boolean notifiesTargeter()
TargetCoreNOTE This method must NOT be overridden in application code.
notifiesTargeter in class TargetCorepublic java.lang.String toString()
toString in class TargetCoreprotected TypedNode[] newDebugChildren()
TypedNode[] representation of this Notifying
for debug purposes.
newDebugChildren in class TargetCorepublic void setAreaParent(SAreaTarget parent)
public static final SFrameTarget[] newViewFrames(SView[] views)
SViews in SFrameTargets.
views - to be wrapped
protected static final TypedNode newDebugContentNode(java.lang.String title,
java.lang.Object source)
protected static final TypedNode newDebugContentNode(java.lang.String title,
java.lang.Object[] source)
protected static final TypedNode newDebugMonitorNode(Notifiable monitor)
public final TypedNode newGraphNode()
public Notifying.Impact impact()
NotifyingNotifying to specify a default Notifying.Impact.
impact in interface NotifyingNotifying.Impact.DEFAULTpublic java.lang.Object identity()
IdentifiedThis will usually be a class instance counter.
identity in interface Identifiedpublic final Notifiable monitor()
Notifiable in the notification tree,
as set with setMonitor.
Complains if no parent has been set.
monitor in interface Notifyingpublic void notify(Notice notice)
NotifiableNotice passed.
When this method is called, the Notifiable should
respond based on
Notice passed.
notify in interface Notifiablepublic final void notifyMonitor(Notifying.Impact impact)
Notifyingnotify on the parent monitor in the notification tree,
typically with itself as parameter to the Notice passed.
Has no effect if no monitor has been set.
This is the usual means to trigger a surface retargeting, being called
by an exposing SFacet on its target.
notifyMonitor in interface Notifyingimpact - suggests the level of retargeting requiredprotected boolean blockNotification()
Checked by notify(Notice); default returns false.
public final void setMonitor(Notifiable monitor)
NotifyingNotifying to a Notifiable parent
in the notification tree.
setMonitor in interface Notifying
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||