EchoPoint
1.0

echopoint
Class ScrollablePanel

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Panel
          extended byechopoint.Panel
              extended byechopoint.ScrollablePanel
All Implemented Interfaces:
Borderable, Clippable, LayoutManageable, MouseCursorable, Positionable, ReflectionSetter, Scrollable, ScrollableContainer, java.io.Serializable
Direct Known Subclasses:
DialogPanel, GridPanel, HorizontalPanel, HtmlTemplatePanel, JspTemplatePanel, NewsTicker

public class ScrollablePanel
extends Panel
implements ScrollableContainer

The ScrollablePanel, which extends Panel is a generic lightweight container that implements Scrollable, Positionable and Clippable.

It is derived from echopoint.Panel and hence is LayoutManageable, and can therefore use a LayoutManager.

See Also:
Positionable, Scrollable, Clippable, AbstractScrollableComponent, Serialized Form

Nested Class Summary
 
Nested classes inherited from class echopoint.positionable.ScrollableContainer
ScrollableContainer.NestedStyleInfo
 
Nested classes inherited from class echopoint.positionable.MouseCursorable
MouseCursorable.NestedStyleInfo
 
Field Summary
static int DEFAULT_POSITONABLE_POLICY
          the default positioning is POSITIONING_FLOW
static int DEFAULT_SCROLLBAR_POLICY
          the default scrollbar policy is SCROLLBARS_AUTO
 
Fields inherited from class nextapp.echo.Panel
DEFAULT_INSETS, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, INSETS_CHANGED_PROPERTY, STYLE_HORIZONTAL_ALIGNMENT, STYLE_INSETS, STYLE_VERTICAL_ALIGNMENT, VERTICAL_ALIGNMENT_CHANGED_PROPERTY
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.ScrollableContainer
HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, INSETS_CHANGED_PROPERTY, STYLE_HORIZONTAL_ALIGNMENT, STYLE_INSETS, STYLE_VERTICAL_ALIGNMENT, VERTICAL_ALIGNMENT_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Scrollable
HEIGHT_CHANGED_PROPERTY, SCROLL_BAR_X_CHANGED_PROPERTY, SCROLL_BAR_Y_CHANGED_PROPERTY, SCROLLBAR_POLICY_CHANGED_PROPERTY, SCROLLBARS_ALWAYS, SCROLLBARS_AUTO, SCROLLBARS_CLIPHIDE, SCROLLBARS_NEVER, STYLE_HEIGHT, STYLE_SCROLL_BAR_POLICY, STYLE_WIDTH, UNDEFINED, undefinedSymbolic, WIDTH_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Positionable
POSITION_CHANGED_PROPERTY, POSITIONING_ABSOLUTE, POSITIONING_FLOW, POSITIONING_RELATIVE, positioningSymbolics, STYLE_BOTTOM, STYLE_LEFT, STYLE_POSITIONING, STYLE_RIGHT, STYLE_TOP, STYLE_ZINDEX, UNDEFINED, undefinedSymbolic
 
Fields inherited from interface echopoint.positionable.Clippable
CLIP_RECT_CHANGED_PROPERTY, STYLE_CLIP_RECT
 
Fields inherited from interface echopoint.positionable.Borderable
BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_GROOVE, BORDER_INSET, BORDER_NONE, BORDER_OUTSET, BORDER_RIDGE, BORDER_SOLID, borderStyleSymbolics, STYLE_BORDER_COLOR, STYLE_BORDER_SIZE, STYLE_BORDER_STYLE, STYLE_BOTTOM_BORDER_COLOR, STYLE_BOTTOM_BORDER_SIZE, STYLE_BOTTOM_BORDER_STYLE, STYLE_LEFT_BORDER_COLOR, STYLE_LEFT_BORDER_SIZE, STYLE_LEFT_BORDER_STYLE, STYLE_RIGHT_BORDER_COLOR, STYLE_RIGHT_BORDER_SIZE, STYLE_RIGHT_BORDER_STYLE, STYLE_TOP_BORDER_COLOR, STYLE_TOP_BORDER_SIZE, STYLE_TOP_BORDER_STYLE
 
Fields inherited from interface echopoint.layout.LayoutManageable
LAYOUT_MANAGED_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.MouseCursorable
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI
 
Constructor Summary
ScrollablePanel()
          Construct a ScrollablePanel with no direct positioning in affect at all.
ScrollablePanel(int left, int top)
          Constructs a ScrollablePanel with to right and bottom properties set to Positionable.UNDEFINED, a zIndex of 0 and with POSITIONING_ABSOLUTE, SCROLLBARS_NEVER and no clipping rectangle.
ScrollablePanel(int left, int top, int right, int bottom)
          Constructs a ScrollablePanel with a zIndex of 0 and with POSITIONING_ABSOLUTE, SCROLLBARS_NEVER and no clipping rectangle.
ScrollablePanel(int left, int top, int right, int bottom, int zIndex)
          Constructs a ScrollablePanel with POSITIONING_ABSOLUTE, SCROLLBARS_NEVER and no clipping rectangle.
ScrollablePanel(int left, int top, int right, int bottom, int zIndex, int positioning)
          Constructs a ScrollablePanel with SCROLLBARS_NEVER and no clipping rectangle.
ScrollablePanel(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy)
          Constructs a ScrollablePanel
ScrollablePanel(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy, int[] clipRect)
          Constructs a ScrollablePanel with all the properties
ScrollablePanel(LayoutManager layoutManager)
          Constructs a ScrollablePanel with a LayoutManager with no direct positioning in affect at all.
 
Method Summary
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 void clearPositioning()
          This sets all the positioning attributes (left,top,right,bottom,z-index) to Integer.MAX, the positioning POSITIONING_FLOW and the scroll bar policy to SCROLLBAR_NONE.
 int getBottom()
          Returns the bottom Y position of the component
 ClipRect getClipRect()
          Returns the clipping rectangle on the component.
 int getHeight()
          Returns the height of the component
 int getLeft()
          Returns the left X position of the component
 int getPositioning()
          This can be one of : POSITIONING_NONE POSITIONING_ABSOLUTE POSITIONING_RELATIVE
 int getRight()
          Returns the right X position of the component
static int getScreenHeight(nextapp.echo.EchoInstance instance)
          This convenience method returns the current client screen height.
static int getScreenWidth(nextapp.echo.EchoInstance instance)
          This convenience method returns the current client screen width.
 int getScrollBarPolicy()
          Returns the ScrollBarPolicy in place This can be one of : SCOLLBARS_NONE SCOLLBARS_ALWAYS SCOLLBARS_AUTO
 int getScrollBarX()
          Returns the position of the horizontal scroll bar, in pixels offset from the left of the panel.
 int getScrollBarY()
          Returns the position of the vertical scroll bar, in pixels offset from the top the panel.
 int getTop()
          Returns the top Y position of the component
 int getWidth()
          Returns the width of the component
 int getzIndex()
          Returns the z-index of the component
 boolean isPositioned()
          This returns true if any positioning is in place
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setBottom(int newValue)
          Sets the bottom Y position of the component
 void setClipRect(ClipRect clipRect)
          Sets the clipping rectangle of the component.
 void setClipRect(int[] clipRectArr)
          Sets the clipping rectangle of the component.
 void setClipRect(int x, int y, int width, int height)
          Sets the clipping rectangle of the component.
 void setHeight(int newValue)
          Sets the height of the component
 void setLeft(int newValue)
          Set the left X position of the component
 void setPositioning(int newPositioning)
          Sets the positioning of the component This can be one of : POSITIONING_NONE POSITIONING_ABSOLUTE POSITIONING_RELATIVE
 void setRight(int newValue)
          Sets the right X position of the component
 void setScrollBarPolicy(int newScrollBarPolicy)
          This sets the scroll bar policy to use.
 void setScrollBarX(int newValue)
          Sets the position of the horizontal scroll bar, in pixels offset from the left of the panel.
 void setScrollBarY(int newValue)
          Sets the position of the vertical scroll bar, in pixels offset from the top of the panel.
 void setTop(int newValue)
          Sets the top Y position of the component
 void setWidth(int newValue)
          Sets the width of the component
 void setzIndex(int newValue)
          Sets the z-index of the component
 
Methods inherited from class echopoint.Panel
add, add, add, add, addImpl, getBorderColor, getBorderSize, getBorderStyle, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getLayoutManager, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getMouseCursor, getMouseCursorURI, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getTopBorderColor, getTopBorderSize, getTopBorderStyle, remove, remove, setBorderColor, setBorderSize, setBorderStyle, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setLayoutManager, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setMouseCursor, setMouseCursorURI, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setTopBorderColor, setTopBorderSize, setTopBorderStyle
 
Methods inherited from class nextapp.echo.Panel
getHorizontalAlignment, getInsets, getVerticalAlignment, setHorizontalAlignment, setInsets, setVerticalAlignment
 
Methods inherited from class nextapp.echo.Component
addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface echopoint.positionable.ScrollableContainer
getHorizontalAlignment, getInsets, getVerticalAlignment, setHorizontalAlignment, setInsets, setVerticalAlignment
 
Methods inherited from interface echopoint.positionable.Borderable
getBorderColor, getBorderSize, getBorderStyle, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getTopBorderColor, getTopBorderSize, getTopBorderStyle, setBorderColor, setBorderSize, setBorderStyle, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setTopBorderColor, setTopBorderSize, setTopBorderStyle
 
Methods inherited from interface echopoint.layout.LayoutManageable
add, add, add, add, getLayoutManager, remove, remove, setLayoutManager
 

Field Detail

DEFAULT_POSITONABLE_POLICY

public static final int DEFAULT_POSITONABLE_POLICY
the default positioning is POSITIONING_FLOW

See Also:
Constant Field Values

DEFAULT_SCROLLBAR_POLICY

public static final int DEFAULT_SCROLLBAR_POLICY
the default scrollbar policy is SCROLLBARS_AUTO

See Also:
Constant Field Values
Constructor Detail

ScrollablePanel

public ScrollablePanel()
Construct a ScrollablePanel with no direct positioning in affect at all.


ScrollablePanel

public ScrollablePanel(int left,
                       int top)
Constructs a ScrollablePanel with to right and bottom properties set to Positionable.UNDEFINED, a zIndex of 0 and with POSITIONING_ABSOLUTE, SCROLLBARS_NEVER and no clipping rectangle.


ScrollablePanel

public ScrollablePanel(int left,
                       int top,
                       int right,
                       int bottom)
Constructs a ScrollablePanel with a zIndex of 0 and with POSITIONING_ABSOLUTE, SCROLLBARS_NEVER and no clipping rectangle.


ScrollablePanel

public ScrollablePanel(int left,
                       int top,
                       int right,
                       int bottom,
                       int zIndex)
Constructs a ScrollablePanel with POSITIONING_ABSOLUTE, SCROLLBARS_NEVER and no clipping rectangle.


ScrollablePanel

public ScrollablePanel(int left,
                       int top,
                       int right,
                       int bottom,
                       int zIndex,
                       int positioning)
Constructs a ScrollablePanel with SCROLLBARS_NEVER and no clipping rectangle.


ScrollablePanel

public ScrollablePanel(int left,
                       int top,
                       int right,
                       int bottom,
                       int zIndex,
                       int positioning,
                       int scrollBarPolicy)
Constructs a ScrollablePanel


ScrollablePanel

public ScrollablePanel(int left,
                       int top,
                       int right,
                       int bottom,
                       int zIndex,
                       int positioning,
                       int scrollBarPolicy,
                       int[] clipRect)
Constructs a ScrollablePanel with all the properties


ScrollablePanel

public ScrollablePanel(LayoutManager layoutManager)
Constructs a ScrollablePanel with a LayoutManager with no direct positioning in affect at all.

Method Detail

applyStyle

public void applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. The base nextapp.echo.Component style names can be used as well.

Specified by:
applyStyle in interface Scrollable
Overrides:
applyStyle in class Panel
See Also:
Borderable.applyStyle(nextapp.echo.Style)

clearPositioning

public void clearPositioning()
This sets all the positioning attributes (left,top,right,bottom,z-index) to Integer.MAX, the positioning POSITIONING_FLOW and the scroll bar policy to SCROLLBAR_NONE.

Specified by:
clearPositioning in interface Positionable

getBottom

public int getBottom()
Returns the bottom Y position of the component

Specified by:
getBottom in interface Positionable

getClipRect

public ClipRect getClipRect()
Returns the clipping rectangle on the component. This can be null or a ClipRect object.

Specified by:
getClipRect in interface Clippable

getHeight

public int getHeight()
Returns the height of the component

Specified by:
getHeight in interface Scrollable

getLeft

public int getLeft()
Returns the left X position of the component

Specified by:
getLeft in interface Positionable

getPositioning

public int getPositioning()
This can be one of :

Specified by:
getPositioning in interface Positionable

getRight

public int getRight()
Returns the right X position of the component

Specified by:
getRight in interface Positionable

getScrollBarPolicy

public int getScrollBarPolicy()
Returns the ScrollBarPolicy in place This can be one of :

Specified by:
getScrollBarPolicy in interface Scrollable

getScrollBarX

public int getScrollBarX()
Returns the position of the horizontal scroll bar, in pixels offset from the left of the panel.

Specified by:
getScrollBarX in interface Scrollable
Returns:
The position of the horizontal scroll bar.

getScrollBarY

public int getScrollBarY()
Returns the position of the vertical scroll bar, in pixels offset from the top the panel.

Specified by:
getScrollBarY in interface Scrollable
Returns:
The position of the vertical scroll bar.

getTop

public int getTop()
Returns the top Y position of the component

Specified by:
getTop in interface Positionable

getWidth

public int getWidth()
Returns the width of the component

Specified by:
getWidth in interface Scrollable

getzIndex

public int getzIndex()
Returns the z-index of the component

Specified by:
getzIndex in interface Positionable

isPositioned

public boolean isPositioned()
This returns true if any positioning is in place

Specified by:
isPositioned in interface Positionable

setBottom

public void setBottom(int newValue)
Sets the bottom Y position of the component

Specified by:
setBottom in interface Positionable

setClipRect

public void setClipRect(ClipRect clipRect)
Sets the clipping rectangle of the component. This should be a ClipRect object.

eg. new ClipRect{ 2,3,10,15}

If no clipping is required, this should be set to null.

Specified by:
setClipRect in interface Clippable

setClipRect

public void setClipRect(int x,
                        int y,
                        int width,
                        int height)
Sets the clipping rectangle of the component.

Specified by:
setClipRect in interface Clippable

setClipRect

public void setClipRect(int[] clipRectArr)
Sets the clipping rectangle of the component. This should be a 4 in array containing the clipping poath.

eg. new int { 2,3,10,15}

If no clipping is required, this should be set to null.

Specified by:
setClipRect in interface Clippable

setHeight

public void setHeight(int newValue)
Sets the height of the component

Specified by:
setHeight in interface Scrollable

setLeft

public void setLeft(int newValue)
Set the left X position of the component

Specified by:
setLeft in interface Positionable

setPositioning

public void setPositioning(int newPositioning)
Sets the positioning of the component This can be one of :

Specified by:
setPositioning in interface Positionable

setRight

public void setRight(int newValue)
Sets the right X position of the component

Specified by:
setRight in interface Positionable

setScrollBarPolicy

public void setScrollBarPolicy(int newScrollBarPolicy)
This sets the scroll bar policy to use. This can be one of :

Specified by:
setScrollBarPolicy in interface Scrollable

setScrollBarX

public void setScrollBarX(int newValue)
Sets the position of the horizontal scroll bar, in pixels offset from the left of the panel.

Specified by:
setScrollBarX in interface Scrollable
Parameters:
newValue - The new position of the horizontal scroll bar, in pixels.

setScrollBarY

public void setScrollBarY(int newValue)
Sets the position of the vertical scroll bar, in pixels offset from the top of the panel.

Specified by:
setScrollBarY in interface Scrollable
Parameters:
newValue - The new position of the vertical scroll bar, in pixels.

setTop

public void setTop(int newValue)
Sets the top Y position of the component

Specified by:
setTop in interface Positionable

setWidth

public void setWidth(int newValue)
Sets the width of the component

Specified by:
setWidth in interface Scrollable

setzIndex

public void setzIndex(int newValue)
Sets the z-index of the component

Specified by:
setzIndex in interface Positionable

getScreenHeight

public static int getScreenHeight(nextapp.echo.EchoInstance instance)
This convenience method returns the current client screen height.


getScreenWidth

public static int getScreenWidth(nextapp.echo.EchoInstance instance)
This convenience method returns the current client screen width.


set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Overrides:
set in class Panel
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0