org.nakedobjects.viewer.lightweight.view
Class ClassIcon

java.lang.Object
  extended byorg.nakedobjects.viewer.lightweight.AbstractView
      extended byorg.nakedobjects.viewer.lightweight.AbstractObjectView
          extended byorg.nakedobjects.viewer.lightweight.view.ClassIcon
All Implemented Interfaces:
ClassView, java.lang.Cloneable, DesktopView, DragSource, DragTarget, DragView, ObjectView, View

public class ClassIcon
extends AbstractObjectView
implements DragSource, DragView, DragTarget, DesktopView, ClassView


Field Summary
protected  NakedClass cls
           
protected  Icon icon
           
protected static int ICON_SIZE
           
 
Fields inherited from class org.nakedobjects.viewer.lightweight.AbstractObjectView
LOG
 
Fields inherited from class org.nakedobjects.viewer.lightweight.AbstractView
DEBUG, DRAG_HANDLE_WIDTH, HPADDING, VPADDING
 
Constructor Summary
ClassIcon()
           
 
Method Summary
 void dragObjectIn(ObjectDrag drag)
          Called as an object drag moves into this view
 void draw(Canvas canvas)
          Called by the frame, or the parent view, when this view must redraw itself.
 void dropObject(ObjectDrag drag)
          Called when a dragged object is dropped onto this view.
 NakedClass forNakedClass()
           
 java.lang.String getName()
           
 NakedObject getObject()
           
 Size getRequiredSize()
           
 boolean indicatesForView(Location mouseLocation)
          Determines if the user is invoking an action relating to this view, rather than to whatever this view represents.
protected  void init(NakedObject object)
           
 boolean isOpen()
          Class icons are alway icons.
 boolean isReplaceable()
          Class icons cannot be replaced by windows
 boolean objectLocatedAt(Location mouseLocation)
           
 void objectMenuOptions(MenuOptionSet options)
           
 DragView pickupObject(ObjectDrag drag)
          Returns the view that logically contains this view, i.e., for the associated object.
 DragView pickupView(ViewDrag drag)
           
 void secondClick(Click click)
          Called when the user double-clicked this view.
protected  boolean transparentBackground()
          Root views should be opaque
 
Methods inherited from class org.nakedobjects.viewer.lightweight.AbstractObjectView
backgroundColor, clearRootViewIdentified, clone, collectionAddUpdate, collectionRemoveUpdate, createIconImage, debugDetails, dispose, dragCancel, dragging, dragObjectOut, dropView, entered, enteredSubview, exited, exitedSubview, firstClick, getFieldOf, getRoot, getState, isIdentified, isRoot, makeView, menuOptions, mouseMoved, objectInfo, objectUpdate, parentObjectView, removeViewsFor, setRootViewIdentified, topView, toString, viewMenuOptions
 
Methods inherited from class org.nakedobjects.viewer.lightweight.AbstractView
addControl, assignId, calculateRepaintArea, contains, createCanvas, defaultFieldHeight, getAbsoluteLocation, getBaseline, getBorder, getBounds, getId, getLocation, getPadding, getParent, getSize, getWorkspace, identifyView, invalidateLayout, isLayoutInvalid, 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.DragSource
dropView
 
Methods inherited from interface org.nakedobjects.viewer.lightweight.View
calculateRepaintArea, contains, debugDetails, dispose, entered, enteredSubview, exited, exitedSubview, firstClick, getAbsoluteLocation, getBaseline, getBorder, getBounds, getId, getLocation, getPadding, getParent, getSize, getWorkspace, identifyView, invalidateLayout, isLayoutInvalid, layout, makeView, menuOptions, mouseMoved, print, redraw, setBorder, setBounds, setLocation, setSize, thirdClick, validateLayout
 
Methods inherited from interface org.nakedobjects.viewer.lightweight.DragView
dragCancel, dragging
 
Methods inherited from interface org.nakedobjects.viewer.lightweight.DragTarget
dragObjectOut
 

Field Detail

ICON_SIZE

protected static final int ICON_SIZE

icon

protected Icon icon

cls

protected NakedClass cls
Constructor Detail

ClassIcon

public ClassIcon()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface View
Overrides:
getName in class AbstractView

getObject

public NakedObject getObject()
Specified by:
getObject in interface ObjectView
Overrides:
getObject in class AbstractObjectView

isOpen

public boolean isOpen()
Class icons are alway icons.

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

isReplaceable

public boolean isReplaceable()
Class icons cannot be replaced by windows

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

getRequiredSize

public Size getRequiredSize()
Specified by:
getRequiredSize in interface View
Overrides:
getRequiredSize in class AbstractObjectView

dragObjectIn

public void dragObjectIn(ObjectDrag drag)
Description copied from interface: DragTarget
Called as an object drag moves into this view

Specified by:
dragObjectIn in interface DragTarget
Overrides:
dragObjectIn in class AbstractObjectView

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

dropObject

public void dropObject(ObjectDrag drag)
Description copied from interface: DragTarget
Called when a dragged object is dropped onto this view.

Specified by:
dropObject in interface DragTarget
Overrides:
dropObject in class AbstractObjectView

forNakedClass

public NakedClass forNakedClass()
Specified by:
forNakedClass in interface ClassView

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

init

protected void init(NakedObject object)
Overrides:
init in class AbstractObjectView

objectLocatedAt

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

objectMenuOptions

public void objectMenuOptions(MenuOptionSet options)
Specified by:
objectMenuOptions in interface ObjectView
Overrides:
objectMenuOptions in class AbstractObjectView

pickupObject

public DragView pickupObject(ObjectDrag drag)
Description copied from interface: ObjectView
Returns the view that logically contains this view, i.e., for the associated object. If this view is for a one to one to one association, then the view will be the view up one level in the view tree. However, if this view is for a one to many association, then the view will be view, not of the internal collection, but of the parent of the collection, i.e. up two levels.

Specified by:
pickupObject in interface DragSource
Overrides:
pickupObject in class AbstractObjectView

pickupView

public DragView pickupView(ViewDrag drag)
Specified by:
pickupView in interface DragSource
Overrides:
pickupView in class AbstractObjectView

secondClick

public void secondClick(Click click)
Description copied from interface: View
Called when the user double-clicked this view. This method will have been preceded by a call to click.

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

transparentBackground

protected boolean transparentBackground()
Description copied from class: AbstractObjectView
Root views should be opaque

Overrides:
transparentBackground in class AbstractObjectView