|
||||||||||
| 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 Viewpublic void setBorder(Border border)
setBorder in interface Viewpublic Border getBorder()
getBorder in interface View
public final void setBounds(Location point,
Size size)
setBounds in interface Viewpublic final Bounds getBounds()
View
getBounds in interface ViewView.getSize(),
View.getLocation()public int getId()
getId in interface Viewpublic boolean isLayoutInvalid()
View
isLayoutInvalid in interface Viewpublic void setLayoutValid()
public final void setLocation(Location point)
layout should be called subsequently.
setLocation in interface Viewpoint - public final Location getLocation()
View
getLocation in interface ViewView.getBounds()public int getBaseline()
getBaseline in interface Viewpublic java.lang.String getName()
getName in interface Viewpublic Padding getPadding()
getPadding in interface Viewpublic 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 Viewpublic final void setSize(Size size)
setSize in interface Viewpublic final Size getSize()
View
getSize in interface ViewView.getBounds()public boolean isOpen()
isOpen in interface Viewpublic boolean isReplaceable()
isReplaceable in interface Viewpublic Workspace getWorkspace()
getWorkspace in interface Viewpublic void addControl(Control control)
control - public final boolean contains(Location mousePosition)
contains in interface Viewpublic void calculateRepaintArea()
View
calculateRepaintArea in interface Viewpublic Canvas createCanvas(java.awt.Graphics g)
public java.lang.String debugDetails()
debugDetails in interface Viewpublic void dispose()
dispose in interface Viewpublic void entered()
entered in interface Viewpublic void enteredSubview()
enteredSubview in interface Viewpublic void exited()
exited in interface Viewpublic void exitedSubview()
exitedSubview in interface Viewpublic void firstClick(Click click)
Passes on to the control at the mouse location.
firstClick in interface Viewclick - the location within the current view where the mouse click
took place
public View identifyView(Location mouseLocationer,
View current)
identifyView in interface ViewmouseLocationer - current -
public boolean indicatesForView(Location mouseLocation)
indicatesForView in interface ViewmouseLocation -
public void invalidateLayout()
View
invalidateLayout in interface Viewpublic final void validateLayout()
View
validateLayout in interface Viewpublic void draw(Canvas canvas)
View
draw in interface Viewpublic void layout()
layout in interface Viewpublic void limitBounds()
public void menuOptions(MenuOptionSet options)
ViewmenuOptions object.
menuOptions in interface Viewoptions - public void mouseMoved(Location at)
mouseMoved in interface Viewat - the position relative to the top-left of this viewpublic void print(Canvas canvas)
print in interface Viewpublic void removeControl(Control control)
control - public void repaintAll()
public void redraw()
redraw in interface Viewpublic void secondClick(Click click)
click.
Does nothing; should be overriden when needed.
secondClick in interface Viewpublic void thirdClick(Click click)
doubleClick.
Does nothing; should be overriden when needed.
thirdClick in interface Viewprotected 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 | |||||||||