|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object facets.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 ViewerTarget
Both views
and (most commonly) viewable
can
be shared with other ViewerTarget
s.
Secondly, ViewerTarget
implements FacetedTarget
to represent
its facet in turn to the retargeting architecture via the SAreaTarget
content area tree.
Finally, the ViewableAction
s 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 ViewableAction s 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 SView s in SFrameTarget s. |
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
ViewableAction
s 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 SView
SIndexing
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 monitorMethod 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 actionTriggers
protected STarget[] lazyElements()
STrigger
s created by newActionTriggerGroups(ViewableAction[])
;
lazyElements
in class TargetCore
protected 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 actionTriggers
protected 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 TargetCore
public final SView view()
view
in interface SViewer
SFrameTarget.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 SViewer
public final void selectionChanged(SSelection selection)
Calls ViewableFrame.viewerSelectionChanged(SViewer,SSelection)
followed by Notifying.notifyMonitor(Impact)
.
selectionChanged
in interface SViewer
selection
- 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 SViewer
selection
- 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)
FacetedTarget
As 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 Facetable
attachFacet
in interface FacetedTarget
facet
- will be applied during each retargeting sequencepublic final SFacet attachedFacet()
FacetedTarget
SFacet
attached with FacetedTarget.attachFacet(SFacet)
.
Return the facet attached to this FacetedTarget
,
complaining if none yet attached.
attachedFacet
in interface FacetedTarget
public final void retargetFacets(Notifying.Impact impact)
Retargets any attached facet on this ViewerTarget
;
also destroys the currently memoed SSelection
.
retargetFacets
in interface Facetable
public boolean isActive()
FacetedTarget
isActive
in interface SViewer
isActive
in interface FacetedTarget
public final void ensureActive(boolean notify)
FacetedTarget
ensureActive
in interface FacetedTarget
notify
- if true
, also trigger a retargetingNotifying
public final SAreaTarget areaParent()
FacetedTarget
areaParent
in interface FacetedTarget
public final void setLive(boolean live)
setLive
in interface STarget
setLive
in class TargetCore
public 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()
TargetCore
NOTE This method must NOT be overridden in application code.
notifiesTargeter
in class TargetCore
public java.lang.String toString()
toString
in class TargetCore
protected TypedNode[] newDebugChildren()
TypedNode[]
representation of this Notifying
for debug purposes.
newDebugChildren
in class TargetCore
public void setAreaParent(SAreaTarget parent)
public static final SFrameTarget[] newViewFrames(SView[] views)
SView
s in SFrameTarget
s.
views
- to be wrappedprotected 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()
Notifying
Notifying
to specify a default Notifying.Impact
.
impact
in interface Notifying
Notifying.Impact.DEFAULT
public java.lang.Object identity()
Identified
This will usually be a class instance counter.
identity
in interface Identified
public final Notifiable monitor()
Notifiable
in the notification tree,
as set with setMonitor
.
Complains if no parent has been set.
monitor
in interface Notifying
public void notify(Notice notice)
Notifiable
Notice
passed.
When this method is called, the Notifiable
should
respond based on
Notice
passed.
notify
in interface Notifiable
public final void notifyMonitor(Notifying.Impact impact)
Notifying
notify
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 Notifying
impact
- suggests the level of retargeting requiredprotected boolean blockNotification()
Checked by notify(Notice)
; default returns false
.
public final void setMonitor(Notifiable monitor)
Notifying
Notifying
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 |