org.nakedobjects.viewer.lightweight
Class AbstractCompositeView

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

public abstract class AbstractCompositeView
extends ObjectIconView
implements LayoutTarget, CompositeView

A view that is made up of other views, e.g. a form or list.


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
AbstractCompositeView()
           
 
Method Summary
 void addView(InternalView view)
           
 void calculateRepaintArea()
          Called to mark this view's on-screen state as invalid, i.e. it needs to be redrawn.
 void clearRootViewIdentified()
           
protected  java.lang.Object clone()
           
 java.lang.String debugDetails()
          Returns debug details about this view.
protected  void debugFieldDetails(java.lang.StringBuffer b, int level)
           
 void dispose()
          Called when a view is no longer needed and its resources can be disposed of.
 void draw(Canvas canvas)
          Called by the frame, or the parent view, when this view must redraw itself.
 void dropView(ViewDrag drag)
          Deals with the dropping of a contained and open view such that the view is removed from the containing view and is placed in its own window.
 void focusNext(InternalView view)
           
 void focusPrevious(InternalView view)
           
 int getBaseline()
          returns the baseline for the first component
 InternalView[] getComponents()
           
 Layout getLayout()
           
 Padding getPadding()
           
 Size getRequiredSize()
           
 View identifyView(Location p, View current)
          Returns the view that mouse pointer is over.
 void layout()
          This method is called when the frame, or the parent view, needs this view to determine is spatial requirements and to lay out its compnents..
protected  void removeAllViews()
           
 void removeView(InternalView view)
           
 void replaceView(InternalView toReplace, InternalView replacement)
           
 void setLayout(Layout layout)
           
 void setRootViewIdentified()
           
 
Methods inherited from class org.nakedobjects.viewer.lightweight.ObjectIconView
defaultName, getStyle, getTitleTextStyle, includeIcon, includeTitle, indicatesForView, objectLocatedAt, size, titleIconBounds, titleSize, titleTextBounds
 
Methods inherited from class org.nakedobjects.viewer.lightweight.AbstractObjectView
backgroundColor, collectionAddUpdate, collectionRemoveUpdate, createIconImage, dragCancel, dragging, dragObjectIn, dragObjectOut, dropObject, entered, enteredSubview, exited, exitedSubview, firstClick, getFieldOf, getObject, getRoot, getState, init, isIdentified, isRoot, makeView, menuOptions, mouseMoved, objectInfo, objectMenuOptions, objectUpdate, parentObjectView, pickupObject, pickupView, removeViewsFor, secondClick, topView, toString, transparentBackground, viewMenuOptions
 
Methods inherited from class org.nakedobjects.viewer.lightweight.AbstractView
addControl, assignId, contains, createCanvas, defaultFieldHeight, getAbsoluteLocation, getBorder, getBounds, getId, getLocation, getName, getParent, getSize, getWorkspace, invalidateLayout, isLayoutInvalid, isOpen, isReplaceable, 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.LayoutTarget
setLayoutValid
 
Methods inherited from interface org.nakedobjects.viewer.lightweight.ObjectView
collectionAddUpdate, collectionRemoveUpdate, getObject, getState, isRoot, objectInfo, objectLocatedAt, objectMenuOptions, objectUpdate, pickupObject, pickupView, removeViewsFor, topView, viewMenuOptions
 
Methods inherited from interface org.nakedobjects.viewer.lightweight.View
contains, entered, enteredSubview, exited, exitedSubview, firstClick, getAbsoluteLocation, getBorder, getBounds, getId, getLocation, getName, getParent, getSize, getWorkspace, indicatesForView, invalidateLayout, isLayoutInvalid, isOpen, isReplaceable, makeView, menuOptions, mouseMoved, print, redraw, secondClick, setBorder, setBounds, setLocation, setSize, thirdClick, validateLayout
 

Constructor Detail

AbstractCompositeView

public AbstractCompositeView()
Method Detail

getBaseline

public int getBaseline()
returns the baseline for the first component

Specified by:
getBaseline in interface View
Overrides:
getBaseline in class ObjectIconView

getComponents

public InternalView[] getComponents()
Specified by:
getComponents in interface LayoutTarget

setLayout

public void setLayout(Layout layout)
Specified by:
setLayout in interface CompositeView

getLayout

public Layout getLayout()
Specified by:
getLayout in interface CompositeView

getPadding

public Padding getPadding()
Specified by:
getPadding in interface LayoutTarget
Overrides:
getPadding in class AbstractView

getRequiredSize

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

setRootViewIdentified

public void setRootViewIdentified()
Specified by:
setRootViewIdentified in interface ObjectView
Overrides:
setRootViewIdentified in class AbstractObjectView

addView

public void addView(InternalView view)
Specified by:
addView in interface CompositeView

calculateRepaintArea

public void calculateRepaintArea()
Description copied from interface: View
Called to mark this view's on-screen state as invalid, i.e. it needs to be redrawn.

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

clearRootViewIdentified

public void clearRootViewIdentified()
Specified by:
clearRootViewIdentified in interface ObjectView
Overrides:
clearRootViewIdentified in class AbstractObjectView

debugDetails

public java.lang.String debugDetails()
Description copied from class: AbstractView
Returns debug details about this view.

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

debugFieldDetails

protected void debugFieldDetails(java.lang.StringBuffer b,
                                 int level)

dispose

public void dispose()
Description copied from interface: View
Called when a view is no longer needed and its resources can be disposed of.

Specified by:
dispose in interface View
Overrides:
dispose 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 ObjectIconView

dropView

public void dropView(ViewDrag drag)
Deals with the dropping of a contained and open view such that the view is removed from the containing view and is placed in its own window.

Specified by:
dropView in interface ObjectView
Overrides:
dropView in class AbstractObjectView

focusNext

public void focusNext(InternalView view)
Specified by:
focusNext in interface CompositeView

focusPrevious

public void focusPrevious(InternalView view)
Specified by:
focusPrevious in interface CompositeView

identifyView

public View identifyView(Location p,
                         View current)
Description copied from interface: View
Returns the view that mouse pointer is over. If it is over this view and not over any of it's components then this views reference is returned. Returns this view; should be overriden for container views.

Specified by:
identifyView in interface View
Overrides:
identifyView in class AbstractView
Parameters:
p -
current -
Returns:
View this view

layout

public void layout()
Description copied from class: AbstractView
This method is called when the frame, or the parent view, needs this view to determine is spatial requirements and to lay out its compnents..

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

removeView

public void removeView(InternalView view)
Specified by:
removeView in interface CompositeView

replaceView

public void replaceView(InternalView toReplace,
                        InternalView replacement)
Specified by:
replaceView in interface CompositeView

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class AbstractObjectView
Throws:
java.lang.CloneNotSupportedException

removeAllViews

protected void removeAllViews()