org.nakedobjects.plugins.dnd.viewer.border
Class ScrollBorder

java.lang.Object
  extended by org.nakedobjects.plugins.dnd.viewer.border.AbstractViewDecorator
      extended by org.nakedobjects.plugins.dnd.viewer.border.ScrollBorder
All Implemented Interfaces:
java.lang.Cloneable, View

public class ScrollBorder
extends AbstractViewDecorator

A scroll border provides a window on a larger view, providing scrollbars as a way of moving the visible part of that view around the actual visible viewing area. To achieve this the view is divided up into five main areas, not all of which are used. In the centre is the viewing area of the underlying view. At the bottom and to the right... At the top and to the left are headers that


Field Summary
protected  int bottom
           
protected  int left
           
protected  int right
           
protected  int top
           
 
Fields inherited from class org.nakedobjects.plugins.dnd.viewer.border.AbstractViewDecorator
wrappedView
 
Fields inherited from interface org.nakedobjects.plugins.dnd.View
HPADDING, VPADDING
 
Constructor Summary
ScrollBorder(View view)
           
ScrollBorder(View content, View leftHeader, View topHeader)
          Note - the leftHeader, if it is specified, view must be the same height as the content view and the rightHeader, if it is specified, must be the same width.
 
Method Summary
protected  void debugDetails(DebugString debug)
           
 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 firstClick(Click click)
          Called when the user clicks the mouse buttone within this view.
 Location getAbsoluteLocation()
           
 Bounds getBounds()
          Returns the bounding rectangle that describes where (within it parent), and how big, this view is.
 int getHorizontalPosition()
           
 Size getRequiredSize(Size maximumSize)
           
 Size getSize()
          Determines the size of this view.
 int getVerticalPosition()
           
 View identify(Location location)
           
 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(Bounds bounds)
           
 void mouseMoved(Location location)
          Called as the mouse is moved around within this view.
protected  boolean overContent(Location location)
           
 void reset()
           
 void secondClick(Click click)
          Moves the scrollbar to beginning or the end when a double click occurs on that side.
 void setBounds(Bounds bounds)
           
 void setLeftHeader(View leftHeader)
           
 void setMaximumSize(Size size)
           
 void setSize(Size size)
           
 void setTopHeader(View topHeader)
           
 void thirdClick(Click click)
          Called when the user triple-clicks the mouse buttone within this view.
 ViewAreaType viewAreaType(Location location)
          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.
protected  Bounds viewportArea()
           
 
Methods inherited from class org.nakedobjects.plugins.dnd.viewer.border.AbstractViewDecorator
addView, canChangeValue, canFocus, contains, containsFocus, contentMenuOptions, debug, debugStructure, dispose, drag, drop, drop, editComplete, entered, exited, focusLost, focusReceived, getBaseline, getContent, getFeedbackManager, getFocusManager, getId, getLocation, getMaximumSize, getPadding, getParent, getSpecification, getState, getSubviews, getView, getViewAxis, getViewManager, getWorkspace, hasFocus, invalidateContent, invalidateLayout, keyPressed, keyReleased, keyTyped, layout, markDamaged, mouseDown, mouseUp, objectActionResult, pickupContent, pickupView, print, refresh, removeView, replaceView, setFocusManager, setLocation, setParent, setView, subviewFor, toString, update, updateView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bottom

protected int bottom

left

protected int left

right

protected int right

top

protected int top
Constructor Detail

ScrollBorder

public ScrollBorder(View view)

ScrollBorder

public ScrollBorder(View content,
                    View leftHeader,
                    View topHeader)
Note - the leftHeader, if it is specified, view must be the same height as the content view and the rightHeader, if it is specified, must be the same width.

Method Detail

setTopHeader

public void setTopHeader(View topHeader)

setLeftHeader

public void setLeftHeader(View leftHeader)

viewportArea

protected Bounds viewportArea()

debugDetails

protected void debugDetails(DebugString debug)
Overrides:
debugDetails in class AbstractViewDecorator

drag

public void drag(InternalDrag drag)
Description copied from interface: View
Called as mouse is dragged within and without this view. This only occurs when no content or view is being dragged.

Specified by:
drag in interface View
Overrides:
drag in class AbstractViewDecorator

dragStart

public Drag dragStart(DragStart drag)
Specified by:
dragStart in interface View
Overrides:
dragStart in class AbstractViewDecorator

dragCancel

public void dragCancel(InternalDrag drag)
Specified by:
dragCancel in interface View
Overrides:
dragCancel in class AbstractViewDecorator

dragTo

public void dragTo(InternalDrag drag)
Description copied from interface: View
Called as the drag ends within and without this view. This only occurs when no content or view is being dragged.

Specified by:
dragTo in interface View
Overrides:
dragTo in class AbstractViewDecorator

dragFrom

public View dragFrom(Location location)
Specified by:
dragFrom in interface View
Overrides:
dragFrom in class AbstractViewDecorator

dragIn

public void dragIn(ContentDrag drag)
Description copied from interface: View
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.

Specified by:
dragIn in interface View
Overrides:
dragIn in class AbstractViewDecorator

dragOut

public void dragOut(ContentDrag drag)
Description copied from interface: View
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.

Specified by:
dragOut in interface View
Overrides:
dragOut in class AbstractViewDecorator

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 AbstractViewDecorator

firstClick

public void firstClick(Click click)
Description copied from interface: View
Called when the user clicks the mouse buttone within this view.

Specified by:
firstClick in interface View
Overrides:
firstClick in class AbstractViewDecorator
Parameters:
click - the location within the current view where the mouse click took place

getAbsoluteLocation

public Location getAbsoluteLocation()
Specified by:
getAbsoluteLocation in interface View
Overrides:
getAbsoluteLocation in class AbstractViewDecorator

getBounds

public Bounds getBounds()
Description copied from interface: View
Returns the bounding rectangle that describes where (within it parent), and how big, this view is.

Specified by:
getBounds in interface View
Overrides:
getBounds in class AbstractViewDecorator
Returns:
Bounds
See Also:
View.getSize(), View.getLocation()

getRequiredSize

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

getSize

public Size getSize()
Description copied from interface: View
Determines the size of this view.

Specified by:
getSize in interface View
Overrides:
getSize in class AbstractViewDecorator
See Also:
View.getBounds()

identify

public View identify(Location location)
Specified by:
identify in interface View
Overrides:
identify in class AbstractViewDecorator

limitBoundsWithin

public void limitBoundsWithin(Size size)
Description copied from interface: View
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.

Specified by:
limitBoundsWithin in interface View
Overrides:
limitBoundsWithin in class AbstractViewDecorator

markDamaged

public void markDamaged(Bounds bounds)
Specified by:
markDamaged in interface View
Overrides:
markDamaged in class AbstractViewDecorator

mouseMoved

public void mouseMoved(Location location)
Description copied from interface: View
Called as the mouse is moved around within this view. Does nothing; should be overriden when needed.

Specified by:
mouseMoved in interface View
Overrides:
mouseMoved in class AbstractViewDecorator
Parameters:
location - the position relative to the top-left of this view

overContent

protected boolean overContent(Location location)

reset

public void reset()

secondClick

public void secondClick(Click click)
Moves the scrollbar to beginning or the end when a double click occurs on that side.

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

thirdClick

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

Specified by:
thirdClick in interface View
Overrides:
thirdClick in class AbstractViewDecorator

setBounds

public void setBounds(Bounds bounds)
Specified by:
setBounds in interface View
Overrides:
setBounds in class AbstractViewDecorator

setMaximumSize

public void setMaximumSize(Size size)
Specified by:
setMaximumSize in interface View
Overrides:
setMaximumSize in class AbstractViewDecorator

setSize

public void setSize(Size size)
Specified by:
setSize in interface View
Overrides:
setSize in class AbstractViewDecorator

getVerticalPosition

public int getVerticalPosition()

getHorizontalPosition

public int getHorizontalPosition()

viewAreaType

public ViewAreaType viewAreaType(Location location)
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:
viewAreaType in interface View
Overrides:
viewAreaType in class AbstractViewDecorator
Returns:
true if the user is targeting the view itself, false if the user is targeting what is being represented

viewMenuOptions

public void viewMenuOptions(UserActionSet menuOptions)
Description copied from interface: View
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.

Specified by:
viewMenuOptions in interface View
Overrides:
viewMenuOptions in class AbstractViewDecorator


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