facets.core.app.avatar
Class AvatarPolicies

java.lang.Object
  extended by facets.util.Tracer
      extended by facets.core.app.avatar.AvatarPolicies
All Implemented Interfaces:
java.io.Serializable

public abstract class AvatarPolicies
extends Tracer
implements java.io.Serializable

Mix-in for avatar creation, painting and drag policies.

AvatarPolicies enables content policies for an AvatarView to be separated cleanly from the display policy.

See Also:
Serialized Form

Constructor Summary
AvatarPolicies()
           
 
Method Summary
 AvatarPolicy avatarPolicy(SViewer viewer, AvatarContent content, PainterSource p)
          /** Defines how an avatar should paint its content.
 DragPolicy dragPolicy(AvatarView view, AvatarContent[] content, java.lang.Object hit, PainterSource p)
          Defines how the viewer should drag an avatar selection.
 Painter getBackgroundPainter(SViewer viewer, PainterSource p)
          /** Return painters for non-avatar view elements.
 boolean isContentSelectable(AvatarContent content)
           
 SSelection newAvatarSelection(SViewer viewer, SSelection viewable)
          Return avatar content to be displayed by viewer.
 
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, toString, wait, wait, wait
 

Constructor Detail

AvatarPolicies

public AvatarPolicies()
Method Detail

isContentSelectable

public boolean isContentSelectable(AvatarContent content)

getBackgroundPainter

public Painter getBackgroundPainter(SViewer viewer,
                                    PainterSource p)
/** Return painters for non-avatar view elements.

Parameters:
viewer - for references to view, selection
p - must be supplied by a facet builder
Returns:
a non-null Painter[];by default an empty array

avatarPolicy

public AvatarPolicy avatarPolicy(SViewer viewer,
                                 AvatarContent content,
                                 PainterSource p)
/** Defines how an avatar should paint its content.

Parameters:
content - to be painted
p - must be supplied by a facet builder

dragPolicy

public DragPolicy dragPolicy(AvatarView view,
                             AvatarContent[] content,
                             java.lang.Object hit,
                             PainterSource p)
Defines how the viewer should drag an avatar selection.

Parameters:
content - content of the avatars selected
hit - specifies where the drag was initiated in selection
p - must be supplied by a facet builder
view - will use the policy

newAvatarSelection

public SSelection newAvatarSelection(SViewer viewer,
                                     SSelection viewable)
Return avatar content to be displayed by viewer.

Facilitates delegation by implementations of ViewableFrame.newViewerSelection(SViewer);

Parameters:
viewer - controlled by the AvatarView returning the receiver as AvatarView.avatars()
viewable - the current SelectingFrame.selection()