org.nakedobjects.viewer.lightweight
Class ObjectIconView

java.lang.Object
  extended byorg.nakedobjects.viewer.lightweight.AbstractView
      extended byorg.nakedobjects.viewer.lightweight.AbstractObjectView
          extended byorg.nakedobjects.viewer.lightweight.ObjectIconView
All Implemented Interfaces:
java.lang.Cloneable, ObjectView, View
Direct Known Subclasses:
AbstractCompositeView, FallbackView, ObjectIcon

public abstract class ObjectIconView
extends AbstractObjectView


Field Summary
 
Fields inherited from class org.nakedobjects.viewer.lightweight.AbstractObjectView
LOG
 
Fields inherited from class org.nakedobjects.viewer.lightweight.AbstractView
DEBUG, DRAG_HANDLE_WIDTH, HPADDING, ICON_SIZE, VPADDING
 
Constructor Summary
ObjectIconView()
           
 
Method Summary
protected static java.lang.String defaultName(NakedObject object)
          returns a default name for an object.
 void draw(Canvas canvas)
          Called by the frame, or the parent view, when this view must redraw itself.
 int getBaseline()
          Returns the postion of the baseline for adjacent label.
protected  Style.Text getStyle()
          Deprecated. replaced by getTitleTextStyle()
protected  Style.Text getTitleTextStyle()
          Defines the text style that should be used when rendering the title.
protected  boolean includeIcon()
          Flags that an icon should be included in this view.
protected  boolean includeTitle()
          Flags that an icon title should be included in this view.
 boolean indicatesForView(Location mouseLocation)
          Determines if the user is invoking an action relating to this view, rather than to whatever this view represents.
 boolean objectLocatedAt(Location mouseLocation)
           
 Size size()
          Deprecated.  
protected  Bounds titleIconBounds()
           
protected  Size titleSize()
           
 Bounds titleTextBounds()
          Distance to the start of the title text
 
Methods inherited from class org.nakedobjects.viewer.lightweight.AbstractObjectView
backgroundColor, clearRootViewIdentified, clone, collectionAddUpdate, collectionRemoveUpdate, createIconImage, debugDetails, dispose, dragCancel, dragging, dragObjectIn, dragObjectOut, dropObject, dropView, entered, enteredSubview, exited, exitedSubview, firstClick, getFieldOf, getObject, getRequiredSize, getRoot, getState, init, isIdentified, isRoot, makeView, menuOptions, mouseMoved, objectInfo, objectMenuOptions, objectUpdate, parentObjectView, pickupObject, pickupView, removeViewsFor, secondClick, setRootViewIdentified, topView, toString, transparentBackground, viewMenuOptions
 
Methods inherited from class org.nakedobjects.viewer.lightweight.AbstractView
addControl, assignId, calculateRepaintArea, contains, createCanvas, defaultFieldHeight, getAbsoluteLocation, getBorder, getBounds, getId, getLocation, getName, getPadding, getParent, getSize, getWorkspace, identifyView, invalidateLayout, isLayoutInvalid, isOpen, isReplaceable, layout, limitBounds, print, redraw, removeControl, repaintAll, setBorder, setBounds, setLayoutValid, setLocation, setParent, setSize, setWorkspace, thirdClick, validateLayout
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.viewer.lightweight.View
calculateRepaintArea, contains, getAbsoluteLocation, getBorder, getBounds, getId, getLocation, getName, getPadding, getParent, getSize, getWorkspace, identifyView, invalidateLayout, isLayoutInvalid, isOpen, isReplaceable, layout, print, redraw, setBorder, setBounds, setLocation, setSize, thirdClick, validateLayout
 

Constructor Detail

ObjectIconView

public ObjectIconView()
Method Detail

getBaseline

public int getBaseline()
Description copied from class: AbstractView
Returns the postion of the baseline for adjacent label. If the label is drawn on this baseline when top of the label rectangle and this view's rectangle are aligned then the label should share the baseline with whatever text is shown within the view.

Specified by:
getBaseline in interface View
Overrides:
getBaseline in class AbstractView
Returns:
int the baseline to draw the label at.

draw

public void draw(Canvas canvas)
Description copied from interface: View
Called by the frame, or the parent view, when this view must redraw itself.

Specified by:
draw in interface View
Overrides:
draw in class AbstractObjectView

indicatesForView

public boolean indicatesForView(Location mouseLocation)
Description copied from interface: View
Determines if the user is invoking an action relating to this view, rather than to whatever this view represents.

Specified by:
indicatesForView in interface View
Overrides:
indicatesForView in class AbstractView

objectLocatedAt

public boolean objectLocatedAt(Location mouseLocation)
Specified by:
objectLocatedAt in interface ObjectView
Overrides:
objectLocatedAt in class AbstractObjectView

size

public Size size()
Deprecated.  


titleTextBounds

public final Bounds titleTextBounds()
Distance to the start of the title text


titleSize

protected final Size titleSize()

getStyle

protected Style.Text getStyle()
Deprecated. replaced by getTitleTextStyle()


getTitleTextStyle

protected Style.Text getTitleTextStyle()
Defines the text style that should be used when rendering the title. By default returns the 'normal' text style.


defaultName

protected static java.lang.String defaultName(NakedObject object)
returns a default name for an object. Useful when no title exists. Create a name using the name of the object's class, e.g. 'A Customer'.


includeIcon

protected boolean includeIcon()
Flags that an icon should be included in this view. By default returns true.


includeTitle

protected boolean includeTitle()
Flags that an icon title should be included in this view. By default returns true.


titleIconBounds

protected final Bounds titleIconBounds()