|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.nakedobjects.viewer.lightweight.AbstractView
A View is the visual representation of the object the user is working with.
A View knows who its parent is (another view), and which frame it belongs
to. If the view is a part of the frame (it is a top-level view) then its
parent wil be null
.
A View also knows it position within the frame.
Field Summary | |
static boolean |
DEBUG
|
static int |
DRAG_HANDLE_WIDTH
|
static int |
HPADDING
Horizontal padding (||) between two components |
protected static int |
ICON_SIZE
|
static int |
VPADDING
Vertical padding (=) between two components |
Constructor Summary | |
AbstractView()
|
Method Summary | |
void |
addControl(Control control)
Adds a control to this view. |
protected void |
assignId()
Assigns a unique ID to this component |
protected Color |
backgroundColor()
|
void |
calculateRepaintArea()
Called to mark this view's on-screen state as invalid, i.e. it needs to be redrawn. |
boolean |
contains(Location mousePosition)
Returns true if the pointer is within this objects bounds. |
Canvas |
createCanvas(java.awt.Graphics g)
|
java.lang.String |
debugDetails()
Returns debug details about this view. |
protected int |
defaultFieldHeight()
|
void |
dispose()
Default implementation, which does nothing, override when needed. |
void |
draw(Canvas canvas)
Called by the frame, or the parent view, when this view must redraw itself. |
void |
entered()
Default implementation, which does nothing, override when needed. |
void |
enteredSubview()
Default implementation, which does nothing, override when needed. |
void |
exited()
Default implementation, which does nothing, override when needed. |
void |
exitedSubview()
Default implementation, which does nothing, override when needed. |
void |
firstClick(Click click)
Called when the user clicks the mouse buttone within this view. |
Location |
getAbsoluteLocation()
the location of this view relative to the containing java.awt.Window object. |
int |
getBaseline()
Returns the postion of the baseline for adjacent label. |
Border |
getBorder()
|
Bounds |
getBounds()
Returns the bounding rectangle that describes where (within it parent), and how big, this view is. |
int |
getId()
|
Location |
getLocation()
Determines the location relative to this object's containing view |
java.lang.String |
getName()
|
Padding |
getPadding()
|
CompositeView |
getParent()
Returns the View that this view belongs to. |
Size |
getSize()
Determines the size of this view. |
Workspace |
getWorkspace()
Returns the enclosing ApplicationFrame that this view is part of. |
View |
identifyView(Location mouseLocationer,
View current)
Returns the view that mouse pointer is over. |
boolean |
indicatesForView(Location mouseLocation)
Default behaviour, returning true to indicate that the view itself is the target of the user's action - rather than what this view represents. |
void |
invalidateLayout()
sets this view layout flag to show that the layout is no longer valid |
boolean |
isLayoutInvalid()
Returns true when this views layout is not current, i.e. it needs to be laid out again. |
boolean |
isOpen()
By default a vew is deemed to open, showing its content. |
boolean |
isReplaceable()
By default a view can be replaced by another view representing the same object |
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.. |
void |
limitBounds()
|
void |
menuOptions(MenuOptionSet options)
Called when the popup menu is being populated for this view. |
void |
mouseMoved(Location at)
Called as the mouse is moved around within this view. |
void |
print(Canvas canvas)
|
void |
redraw()
Requests that the frame repaints this view, and only this view. |
void |
removeControl(Control control)
Removes a control from this view. |
void |
repaintAll()
Calls repaint() on the the top-level owner of this view. |
void |
secondClick(Click click)
Called when the user double-clicked this view. |
void |
setBorder(Border border)
|
void |
setBounds(Location point,
Size size)
|
void |
setLayoutValid()
|
void |
setLocation(Location point)
Sets the location of this view. |
void |
setParent(CompositeView parent)
Sets the parent of the view. |
void |
setSize(Size size)
|
protected static void |
setWorkspace(Workspace workspace)
|
void |
thirdClick(Click click)
Called when the user triple-clicks the mouse buttone within this view. |
protected boolean |
transparentBackground()
|
void |
validateLayout()
Reqests that this view tree needs to be laid out. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.nakedobjects.viewer.lightweight.View |
getRequiredSize, makeView |
Field Detail |
public static final int VPADDING
public static final int HPADDING
public static final int DRAG_HANDLE_WIDTH
protected static final int ICON_SIZE
public static boolean DEBUG
Constructor Detail |
public AbstractView()
Method Detail |
public final Location getAbsoluteLocation()
View
getAbsoluteLocation
in interface View
public void setBorder(Border border)
setBorder
in interface View
public Border getBorder()
getBorder
in interface View
public final void setBounds(Location point, Size size)
setBounds
in interface View
public final Bounds getBounds()
View
getBounds
in interface View
View.getSize()
,
View.getLocation()
public int getId()
getId
in interface View
public boolean isLayoutInvalid()
View
isLayoutInvalid
in interface View
public void setLayoutValid()
public final void setLocation(Location point)
layout
should be called subsequently.
setLocation
in interface View
point
- public final Location getLocation()
View
getLocation
in interface View
View.getBounds()
public int getBaseline()
getBaseline
in interface View
public java.lang.String getName()
getName
in interface View
public Padding getPadding()
getPadding
in interface View
public void setParent(CompositeView parent)
public CompositeView getParent()
null
is
returned then this view is a top-level view and is shown directly on the
frame.
getParent
in interface View
public final void setSize(Size size)
setSize
in interface View
public final Size getSize()
View
getSize
in interface View
View.getBounds()
public boolean isOpen()
isOpen
in interface View
public boolean isReplaceable()
isReplaceable
in interface View
public Workspace getWorkspace()
getWorkspace
in interface View
public void addControl(Control control)
control
- public final boolean contains(Location mousePosition)
contains
in interface View
public void calculateRepaintArea()
View
calculateRepaintArea
in interface View
public Canvas createCanvas(java.awt.Graphics g)
public java.lang.String debugDetails()
debugDetails
in interface View
public void dispose()
dispose
in interface View
public void entered()
entered
in interface View
public void enteredSubview()
enteredSubview
in interface View
public void exited()
exited
in interface View
public void exitedSubview()
exitedSubview
in interface View
public void firstClick(Click click)
Passes on to the control at the mouse location.
firstClick
in interface View
click
- the location within the current view where the mouse click
took placepublic View identifyView(Location mouseLocationer, View current)
identifyView
in interface View
mouseLocationer
- current
-
public boolean indicatesForView(Location mouseLocation)
indicatesForView
in interface View
mouseLocation
-
public void invalidateLayout()
View
invalidateLayout
in interface View
public final void validateLayout()
View
validateLayout
in interface View
public void draw(Canvas canvas)
View
draw
in interface View
public void layout()
layout
in interface View
public void limitBounds()
public void menuOptions(MenuOptionSet options)
View
menuOptions
object.
menuOptions
in interface View
options
- public void mouseMoved(Location at)
mouseMoved
in interface View
at
- the position relative to the top-left of this viewpublic void print(Canvas canvas)
print
in interface View
public void removeControl(Control control)
control
- public void repaintAll()
public void redraw()
redraw
in interface View
public void secondClick(Click click)
click
.
Does nothing; should be overriden when needed.
secondClick
in interface View
public void thirdClick(Click click)
doubleClick
.
Does nothing; should be overriden when needed.
thirdClick
in interface View
protected static void setWorkspace(Workspace workspace)
protected void assignId()
protected Color backgroundColor()
protected int defaultFieldHeight()
protected boolean transparentBackground()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |