EchoPoint
1.0

echopoint
Class GridPanel

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Panel
          extended byechopoint.Panel
              extended byechopoint.ScrollablePanel
                  extended byechopoint.GridPanel
All Implemented Interfaces:
Borderable, Clippable, LayoutManageable, MouseCursorable, Positionable, ReflectionSetter, Scrollable, ScrollableContainer, java.io.Serializable

public class GridPanel
extends ScrollablePanel

The GridPanel is a ScrollablePanel that uses an GridLayoutManager as its layout manager.

Why, when Echo already has a Grid component, would you use GridPanel?

Grid requires you to always specify {column,row} coordinates when adding components. GridPanel alleviates this by maintaining a "cell cursor" to which newly added Components can be added. The GridPanel will grow in height to accomodate new Components.

Nearly all of the functionality of GridPanel is provided by its underlying GridLayoutManager. And of course GridLayoutManager can be used on any LayoutManageable container like ScrollablePanel, HidingSlidingPanel or DialogPanel.

See Also:
GridLayoutManager, 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 EVEN_CENTER
           
static int EVEN_LEFT
           
static int EVEN_RIGHT
           
static int ODD_CENTER
           
static int ODD_LEFT
           
static int ODD_RIGHT
           
 
Fields inherited from class echopoint.ScrollablePanel
DEFAULT_POSITONABLE_POLICY, DEFAULT_SCROLLBAR_POLICY
 
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
GridPanel()
          Constructs a GridPanel with an internal GridLayoutManager sized as 1000 x 1 cells.
GridPanel(int width, int height)
          Constructs a GridPanel with the specified cell width and cell height.
GridPanel(int left, int top, int right, int bottom)
          Constructs a GridPanel with a cell width of 1 and cell height of 1.
GridPanel(int left, int top, int right, int bottom, int zIndex)
          Constructs a GridPanel with a cell width of 1 and cell height of 1 and a zIndex.
GridPanel(int left, int top, int right, int bottom, int zIndex, int positioning)
          Constructs a GridPanel with a cell width of 1 and cell height of 1 and a zIndex and a positioning value.
GridPanel(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy)
          Constructs a GridPanel with a cell width of 1 and cell height of 1.
GridPanel(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy, int[] clipRect)
          Constructs a GridPanel with a cell width of 1 and cell height of 1.
 
Method Summary
 int getCellSpacing()
          Gets the cell spacing of the underlying GridLayoutManager.
 int getCursorColumn()
          Returns the current Column position of the Grid cursor.
 int getCursorRow()
          Returns the current Row position of the Grid cursor
 int getGridHeight()
          Gets the height of the underlying GridLayoutManager
 int getGridWidth()
          Gets the width of the underlying GridLayoutManager
 int getHorizontalAlignment()
          Gets the horizontal alignment of the underlying GridLayoutManager.
 int getVerticalAlignment()
          Gets the vertical alignment of the underlying GridLayoutManager.
 boolean isFullHeight()
          Returns TRUE if the underlying GridLayoutManager will fill its parents full height
 boolean isFullWidth()
          Returns TRUE if the underlying GridLayoutManager will fill its parents full width
 void newLine()
          Invokes newLine() on the underlying GridLayoutManager.
 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 setCellSpacing(int newCellSpacing)
          Sets the cell spacing of the underlying GridLayoutManager.
 void setCursorColumn(int newColumn)
          Sets the current Column position of the Grid cursor.
 void setCursorRow(int newRow)
          Sets the current Row position of the Grid cursor
 void setFullHeight(boolean newFullHeight)
          If this is TRUE then the underlying GridLayoutManager will fill its parents full height.
 void setFullWidth(boolean newFullWidth)
          If this is TRUE then the underlying GridLayoutManager will fill its parents full width.
 void setGridHeight(int newHeight)
          Sets the height of the underlying GridLayoutManager
 void setGridWidth(int newWidth)
          Sets the width of the underlying GridLayoutManager
 void setHorizontalAlignment(int newHorizontalAlignment)
          Sets the horizontal alignment of the underlying GridLayoutManager.
 void setLayoutManager(LayoutManager newLayoutManager)
          Sets a new LayoutManager into the LayoutManageable container.
 void setVerticalAlignment(int newVerticalAlignment)
          Sets the vertical alignment of the underlying GridLayoutManager.
 void space()
          Invokes space() on the underlying GridLayoutManager.
 
Methods inherited from class echopoint.ScrollablePanel
applyStyle, clearPositioning, getBottom, getClipRect, getHeight, getLeft, getPositioning, getRight, getScreenHeight, getScreenWidth, getScrollBarPolicy, getScrollBarX, getScrollBarY, getTop, getWidth, getzIndex, isPositioned, setBottom, setClipRect, setClipRect, setClipRect, setHeight, setLeft, setPositioning, setRight, setScrollBarPolicy, setScrollBarX, setScrollBarY, setTop, setWidth, setzIndex
 
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, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setMouseCursor, setMouseCursorURI, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setTopBorderColor, setTopBorderSize, setTopBorderStyle
 
Methods inherited from class nextapp.echo.Panel
getInsets, setInsets
 
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
getInsets, setInsets
 
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
 

Field Detail

ODD_LEFT

public static final int ODD_LEFT
See Also:
GridLayoutManager, Constant Field Values

ODD_RIGHT

public static final int ODD_RIGHT
See Also:
GridLayoutManager, Constant Field Values

ODD_CENTER

public static final int ODD_CENTER
See Also:
GridLayoutManager, Constant Field Values

EVEN_LEFT

public static final int EVEN_LEFT
See Also:
GridLayoutManager, Constant Field Values

EVEN_RIGHT

public static final int EVEN_RIGHT
See Also:
GridLayoutManager, Constant Field Values

EVEN_CENTER

public static final int EVEN_CENTER
See Also:
GridLayoutManager, Constant Field Values
Constructor Detail

GridPanel

public GridPanel()
Constructs a GridPanel with an internal GridLayoutManager sized as 1000 x 1 cells.

Therefore if you add Components to this GridPanel without specifying the co-ordinates, then the Components will line up left to right until you call newLine();

See Also:
GridLayoutManager

GridPanel

public GridPanel(int width,
                 int height)
Constructs a GridPanel with the specified cell width and cell height.

Note that this contructor differs from the usual ScrollablePanel constructor which usually takes left and top values.

See Also:
GridLayoutManager

GridPanel

public GridPanel(int left,
                 int top,
                 int right,
                 int bottom)
Constructs a GridPanel with a cell width of 1 and cell height of 1. It will be placed at {left,top}{right,bottom} co-ordinates.

See Also:
ScrollablePanel

GridPanel

public GridPanel(int left,
                 int top,
                 int right,
                 int bottom,
                 int zIndex)
Constructs a GridPanel with a cell width of 1 and cell height of 1 and a zIndex. It will be placed at {left,top}{right,bottom} co-ordinates.

See Also:
ScrollablePanel

GridPanel

public GridPanel(int left,
                 int top,
                 int right,
                 int bottom,
                 int zIndex,
                 int positioning)
Constructs a GridPanel with a cell width of 1 and cell height of 1 and a zIndex and a positioning value. It will be placed at {left,top}{right,bottom} co-ordinates.

See Also:
ScrollablePanel

GridPanel

public GridPanel(int left,
                 int top,
                 int right,
                 int bottom,
                 int zIndex,
                 int positioning,
                 int scrollBarPolicy)
Constructs a GridPanel with a cell width of 1 and cell height of 1.

See Also:
ScrollablePanel

GridPanel

public GridPanel(int left,
                 int top,
                 int right,
                 int bottom,
                 int zIndex,
                 int positioning,
                 int scrollBarPolicy,
                 int[] clipRect)
Constructs a GridPanel with a cell width of 1 and cell height of 1.

See Also:
ScrollablePanel
Method Detail

getCellSpacing

public int getCellSpacing()
Gets the cell spacing of the underlying GridLayoutManager.

See Also:
GridLayoutManager

getCursorColumn

public int getCursorColumn()
Returns the current Column position of the Grid cursor.

See Also:
GridLayoutManager

getCursorRow

public int getCursorRow()
Returns the current Row position of the Grid cursor

See Also:
GridLayoutManager

getGridHeight

public int getGridHeight()
Gets the height of the underlying GridLayoutManager

See Also:
GridLayoutManager

getGridWidth

public int getGridWidth()
Gets the width of the underlying GridLayoutManager

See Also:
GridLayoutManager

getHorizontalAlignment

public int getHorizontalAlignment()
Gets the horizontal alignment of the underlying GridLayoutManager.

This can be one of the EchoConstant values :

You can also "OR" on the following values to overrride the above

The above will only be applied to their respective "odd" or "even" columns.

Returns:
int
See Also:
GridLayoutManager

getVerticalAlignment

public int getVerticalAlignment()
Gets the vertical alignment of the underlying GridLayoutManager.

This can be one of the EchoConstant values :

Returns:
int
See Also:
GridLayoutManager

isFullHeight

public boolean isFullHeight()
Returns TRUE if the underlying GridLayoutManager will fill its parents full height

Returns:
boolean
See Also:
GridLayoutManager

isFullWidth

public boolean isFullWidth()
Returns TRUE if the underlying GridLayoutManager will fill its parents full width

Returns:
boolean
See Also:
GridLayoutManager

newLine

public void newLine()
Invokes newLine() on the underlying GridLayoutManager.

See Also:
GridLayoutManager

setCellSpacing

public void setCellSpacing(int newCellSpacing)
Sets the cell spacing of the underlying GridLayoutManager.

See Also:
GridLayoutManager

setCursorColumn

public void setCursorColumn(int newColumn)
Sets the current Column position of the Grid cursor.

See Also:
GridLayoutManager

setCursorRow

public void setCursorRow(int newRow)
Sets the current Row position of the Grid cursor

See Also:
GridLayoutManager

setFullHeight

public void setFullHeight(boolean newFullHeight)
If this is TRUE then the underlying GridLayoutManager will fill its parents full height.

Parameters:
newFullHeight - boolean
See Also:
GridLayoutManager

setFullWidth

public void setFullWidth(boolean newFullWidth)
If this is TRUE then the underlying GridLayoutManager will fill its parents full width.

Parameters:
newFullWidth - boolean
See Also:
GridLayoutManager

setGridHeight

public void setGridHeight(int newHeight)
Sets the height of the underlying GridLayoutManager

See Also:
GridLayoutManager

setGridWidth

public void setGridWidth(int newWidth)
Sets the width of the underlying GridLayoutManager

See Also:
GridLayoutManager

setHorizontalAlignment

public void setHorizontalAlignment(int newHorizontalAlignment)
Sets the horizontal alignment of the underlying GridLayoutManager.

This can be one of the EchoConstant values :

You can also "OR" on the following values to overrride the above

The above will only be applied to their respective "odd" or "even" columns.

Parameters:
newHorizontalAlignment - int
See Also:
GridLayoutManager

setLayoutManager

public void setLayoutManager(LayoutManager newLayoutManager)
Sets a new LayoutManager into the LayoutManageable container. This must be non-null and an instanceof of GridLayoutManager otherwise an IllegalArgumentException is thrown.

Specified by:
setLayoutManager in interface LayoutManageable
Overrides:
setLayoutManager in class Panel
See Also:
LayoutManageable.setLayoutManager(echopoint.layout.LayoutManager)

setVerticalAlignment

public void setVerticalAlignment(int newVerticalAlignment)
Sets the vertical alignment of the underlying GridLayoutManager.

This can be one of the EchoConstant values :

Parameters:
newVerticalAlignment - int
See Also:
GridLayoutManager

space

public void space()
Invokes space() on the underlying GridLayoutManager.

See Also:
GridLayoutManager

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 ScrollablePanel
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0