org.nakedobjects.plugins.dnd
Interface View

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
Workspace
All Known Implementing Classes:
AboutView, AbstractBorder, AbstractCompositeView, AbstractControlView, AbstractField, AbstractView, AbstractViewDecorator, AbstractWindowBorder, ApplicationWorkspace, BackgroundBorder, BlankView, Button, ButtonBorder, CalendarBorder, CalendarTemplate, CheckboxField, CloseWindowControl, ColorField, CompositeViewUsingBuilder, DebugBorder, DialogBorder, DisposedObjectBorder, DisposeOverlay, DragViewBorder, DragViewOutline, DroppableLabelBorder, EmptyBorder, EmptyField, ExpandableViewBorder, FallbackView, FieldErrorView, HelpView, Icon, IconBorder, IconizeWindowControl, Identifier, ImageField, InternalCollectionBorder, LabelBorder, LineBorder, MasterDetailPanel, MinimizedView, NullView, ObjectBorder, ObjectView, OpenDropDownBorder, OpenObjectDropDownBorder, OpenValueDropDownBorder, PasswordField, PopupMenu, PopupMenuContainer, ResizeBorder, ResizeWindowControl, ScrollBorder, SelectedBorder, ServiceBorder, ServiceIcon, SimpleIdentifier, SingleLineTextField, TableHeader, TableRowBorder, TextField, TextFieldBorder, TextFieldResizeBorder, TextParseableFieldAbstract, TextView, TreeNodeBorder, ViewResizeBorder, ViewResizeOutline, WindowBorder, WindowControl, WrappedTextField

public interface View
extends java.lang.Cloneable


Field Summary
static int HPADDING
          Horizontal padding (||) between two components
static int VPADDING
          Vertical padding (=) between two components
 
Method Summary
 void addView(View view)
           
 Consent canChangeValue()
          Determines if the user is able to change the held value.
 boolean canFocus()
          Determines whether this view accepts keyboard focus.
 boolean contains(View view)
           
 boolean containsFocus()
           
 void contentMenuOptions(UserActionSet menuOptions)
          Called when the popup menu is being populated for this view.
 void debug(DebugString debug)
           
 void debugStructure(DebugString debug)
           
 void dispose()
          Called when a view is no longer needed and its resources can be disposed of.
 void drag(ContentDrag contentDrag)
           
 void drag(InternalDrag drag)
          Called as mouse is dragged within and without this view.
 void dragCancel(InternalDrag drag)
           
 View dragFrom(Location location)
           
 void dragIn(ContentDrag drag)
          Called as the content being dragged is dragged into this view.
 void dragOut(ContentDrag drag)
          Called as the content being dragged is dragged out of this view.
 Drag dragStart(DragStart drag)
           
 void dragTo(InternalDrag drag)
          Called as the drag ends within and without this view.
 void draw(Canvas canvas)
          Called by the frame, or the parent view, when this view must redraw itself.
 void drop(ContentDrag drag)
          Called as another view's contents (the source) is dropped on this view's contents (the target).
 void drop(ViewDrag drag)
          Called as another view (the source) is dropped on this view (the target).
 void editComplete(boolean moveFocus, boolean toNextField)
          Indicates that editing has been completed and the entry should be saved.
 void entered()
          Called as the mouse crosses the bounds, and ends up inside, of this view.
 void exited()
          Called as the mouse crosses the bounds, and ends up outside, of this view.
 void firstClick(Click click)
          Called when the user clicks the mouse buttone within this view.
 void focusLost()
           
 void focusReceived()
           
 Location getAbsoluteLocation()
           
 int getBaseline()
           
 Bounds getBounds()
          Returns the bounding rectangle that describes where (within it parent), and how big, this view is.
 Content getContent()
          get the object that this view represents
 Feedback getFeedbackManager()
           
 FocusManager getFocusManager()
           
 int getId()
           
 Location getLocation()
          Determines the location relative to this object's containing view
 Size getMaximumSize()
           
 Padding getPadding()
           
 View getParent()
           
 Size getRequiredSize(Size maximumSize)
           
 Size getSize()
          Determines the size of this view.
 ViewSpecification getSpecification()
           
 ViewState getState()
           
 View[] getSubviews()
           
 View getView()
          returns the topmost decorator in the chain, or the view itself if not decorated.
 ViewAxis getViewAxis()
           
 Viewer getViewManager()
           
 Workspace getWorkspace()
           
 boolean hasFocus()
           
 View identify(Location mouseLocation)
           
 void invalidateContent()
          Flags that the views do not properly represent the content, and hence it needs rebuilding.
 void invalidateLayout()
          Flags that the views are possibly not displaying the content fully - too small, wrong place etc - although views exists for all the content.
 void keyPressed(KeyboardAction key)
          Called when the user presses any key on the keyboard while this view has the focus.
 void keyReleased(int keyCode, int modifiers)
          Called when the user releases any key on the keyboard while this view has the focus.
 void keyTyped(char keyCode)
          Called when the user presses a non-control key (i.e.
 void layout(Size maximumSize)
           
 void limitBoundsWithin(Size size)
          Limits the bounds of this view (normally when being moved or dropped) so it never extends beyond the bounds of a view of the specified size.
 void markDamaged()
           
 void markDamaged(Bounds bounds)
           
 void mouseDown(Click click)
          Called as the mouse button is pressed down within this view.
 void mouseMoved(Location location)
          Called as the mouse is moved around within this view.
 void mouseUp(Click click)
          Called as the mouse button is released within this view (assuming that it was pressed in this view).
 void objectActionResult(NakedObject result, Location at)
          Called when an action generates a result, allowing this view to decide what to do with it.
 View pickupContent(Location location)
          Called as the drag of this view's content starts.
 View pickupView(Location location)
          Called as the drag of this view starts.
 void print(Canvas canvas)
           
 void refresh()
          Refreshes this view by reaccessing its content and redisplaying it.
 void removeView(View view)
          Removes the specifed view from the subviews contained by this view.
 void replaceView(View toReplace, View replacement)
           
 void secondClick(Click click)
          Called when the user double-clicked this view.
 void setBounds(Bounds bounds)
           
 void setFocusManager(FocusManager focusManager)
           
 void setLocation(Location point)
          Specifies the location of this view, relative to its enclosing view.
 void setMaximumSize(Size size)
           
 void setParent(View view)
           
 void setSize(Size size)
           
 void setView(View view)
           
 View subviewFor(Location location)
          Identifies the subview that contains the specified location within its bounds.
 void thirdClick(Click click)
          Called when the user triple-clicks the mouse buttone within this view.
 void update(NakedObject object)
          notification that the content of this view has changed
 void updateView()
           
 ViewAreaType viewAreaType(Location mouseLocation)
          Determines if the user is invoking an action relating to this view, rather than to whatever this view represents.
 void viewMenuOptions(UserActionSet menuOptions)
          Called when the popup menu is being populated for this view.
 

Field Detail

HPADDING

static final int HPADDING
Horizontal padding (||) between two components


VPADDING

static final int VPADDING
Vertical padding (=) between two components

Method Detail

addView

void addView(View view)

canChangeValue

Consent canChangeValue()
Determines if the user is able to change the held value.


canFocus

boolean canFocus()
Determines whether this view accepts keyboard focus. If so focusLost and focusReceived will be called.


contains

boolean contains(View view)

containsFocus

boolean containsFocus()

contentMenuOptions

void contentMenuOptions(UserActionSet menuOptions)
Called when the popup menu is being populated for this view. Any content options that need to appear on the menu should be added to the menuOptions object.


debug

void debug(DebugString debug)

debugStructure

void debugStructure(DebugString debug)

dispose

void dispose()
Called when a view is no longer needed and its resources can be disposed of. Dissociates this view from its parent, and removes itself from the list of views that need to be updated.

See Also:
removeView(View)

drag

void drag(InternalDrag drag)
Called as mouse is dragged within and without this view. This only occurs when no content or view is being dragged.


dragCancel

void dragCancel(InternalDrag drag)

dragFrom

View dragFrom(Location location)

dragIn

void dragIn(ContentDrag drag)
Called as the content being dragged is dragged into this view. This only occurs when view contents are being dragged, and not when views themselves are being dragged.


dragOut

void dragOut(ContentDrag drag)
Called as the content being dragged is dragged out of this view. This only occurs when view contents are being dragged, and not when views themselves are being dragged.


dragStart

Drag dragStart(DragStart drag)

dragTo

void dragTo(InternalDrag drag)
Called as the drag ends within and without this view. This only occurs when no content or view is being dragged.


draw

void draw(Canvas canvas)
Called by the frame, or the parent view, when this view must redraw itself.


drop

void drop(ContentDrag drag)
Called as another view's contents (the source) is dropped on this view's contents (the target). The source view can be obtained from the ViewDrag object.


drop

void drop(ViewDrag drag)
Called as another view (the source) is dropped on this view (the target). The source view can be obtained from the ViewDrag object.


editComplete

void editComplete(boolean moveFocus,
                  boolean toNextField)
Indicates that editing has been completed and the entry should be saved. Will be called by the view manager when other action place within the parent.

Parameters:
moveFocus - flags that focus should be moved from this field after the entry has been processed.
toNextField - flags that the focus should be moved to the next field (if true) or to the previous field (if false). This parameter is ignored if the moveFocus parameter is false.

entered

void entered()
Called as the mouse crosses the bounds, and ends up inside, of this view. Is also called as the mouse returns into this view from a contained view.


exited

void exited()
Called as the mouse crosses the bounds, and ends up outside, of this view.


firstClick

void firstClick(Click click)
Called when the user clicks the mouse buttone within this view.

Parameters:
click - the location within the current view where the mouse click took place

focusLost

void focusLost()

focusReceived

void focusReceived()

getAbsoluteLocation

Location getAbsoluteLocation()

getBaseline

int getBaseline()

getBounds

Bounds getBounds()
Returns the bounding rectangle that describes where (within it parent), and how big, this view is.

Returns:
Bounds
See Also:
getSize(), getLocation()

getContent

Content getContent()
get the object that this view represents


getFocusManager

FocusManager getFocusManager()

getId

int getId()

getLocation

Location getLocation()
Determines the location relative to this object's containing view

See Also:
getBounds()

getMaximumSize

Size getMaximumSize()

getPadding

Padding getPadding()

getParent

View getParent()

getRequiredSize

Size getRequiredSize(Size maximumSize)

getSize

Size getSize()
Determines the size of this view.

See Also:
getBounds()

getSpecification

ViewSpecification getSpecification()

getState

ViewState getState()

getSubviews

View[] getSubviews()

getView

View getView()
returns the topmost decorator in the chain, or the view itself if not decorated.


getViewAxis

ViewAxis getViewAxis()

getViewManager

Viewer getViewManager()

getFeedbackManager

Feedback getFeedbackManager()

getWorkspace

Workspace getWorkspace()

hasFocus

boolean hasFocus()

identify

View identify(Location mouseLocation)

invalidateContent

void invalidateContent()
Flags that the views do not properly represent the content, and hence it needs rebuilding. Contrast this with invalidateLayout(), which deals with an a complete view, but one that is not showing properly.

See Also:
invalidateLayout()

invalidateLayout

void invalidateLayout()
Flags that the views are possibly not displaying the content fully - too small, wrong place etc - although views exists for all the content. Contrast this with invalidateContent(), which deals with an incomplete view.

See Also:
invalidateContent()

keyPressed

void keyPressed(KeyboardAction key)
Called when the user presses any key on the keyboard while this view has the focus.

Parameters:
key - TODO

keyReleased

void keyReleased(int keyCode,
                 int modifiers)
Called when the user releases any key on the keyboard while this view has the focus.


keyTyped

void keyTyped(char keyCode)
Called when the user presses a non-control key (i.e. data entry keys and not shift, up-arrow etc). Such a key press will result in a prior call to keyPressed and a subsequent call to keyReleased.


layout

void layout(Size maximumSize)

limitBoundsWithin

void limitBoundsWithin(Size size)
Limits the bounds of this view (normally when being moved or dropped) so it never extends beyond the bounds of a view of the specified size.


markDamaged

void markDamaged()

markDamaged

void markDamaged(Bounds bounds)

mouseDown

void mouseDown(Click click)
Called as the mouse button is pressed down within this view. Does nothing; should be overriden when needed. the position relative to the top-left of this view


mouseMoved

void mouseMoved(Location location)
Called as the mouse is moved around within this view. Does nothing; should be overriden when needed.

Parameters:
location - the position relative to the top-left of this view

mouseUp

void mouseUp(Click click)
Called as the mouse button is released within this view (assuming that it was pressed in this view). Does nothing; should be overriden when needed.


objectActionResult

void objectActionResult(NakedObject result,
                        Location at)
Called when an action generates a result, allowing this view to decide what to do with it.

Parameters:
at - the location where the action took place

pickupContent

View pickupContent(Location location)
Called as the drag of this view's content starts.


pickupView

View pickupView(Location location)
Called as the drag of this view starts.


print

void print(Canvas canvas)

refresh

void refresh()
Refreshes this view by reaccessing its content and redisplaying it.


removeView

void removeView(View view)
Removes the specifed view from the subviews contained by this view.


replaceView

void replaceView(View toReplace,
                 View replacement)

secondClick

void secondClick(Click click)
Called when the user double-clicked this view. This method will have been preceded by a call to click.


setBounds

void setBounds(Bounds bounds)

setFocusManager

void setFocusManager(FocusManager focusManager)

setLocation

void setLocation(Location point)
Specifies the location of this view, relative to its enclosing view.


setParent

void setParent(View view)

setMaximumSize

void setMaximumSize(Size size)

setSize

void setSize(Size size)

setView

void setView(View view)

subviewFor

View subviewFor(Location location)
Identifies the subview that contains the specified location within its bounds. Returns null if no subview exists for that location.


thirdClick

void thirdClick(Click click)
Called when the user triple-clicks the mouse buttone within this view. This method will have been preceded by a call to doubleClick.


update

void update(NakedObject object)
notification that the content of this view has changed


updateView

void updateView()

viewAreaType

ViewAreaType viewAreaType(Location mouseLocation)
Determines if the user is invoking an action relating to this view, rather than to whatever this view represents.

Parameters:
mouseLocation -
Returns:
true if the user is targeting the view itself, false if the user is targeting what is being represented

viewMenuOptions

void viewMenuOptions(UserActionSet menuOptions)
Called when the popup menu is being populated for this view. Any view options that need to appear on the menu should be added to the menuOptions object.


drag

void drag(ContentDrag contentDrag)


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.