EchoPoint
1.0

echopoint
Class HidingSlidingPanel

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
              extended byechopoint.positionable.AbstractScrollableComponent
                  extended byechopoint.ScrollableBox
                      extended byechopoint.HidingSlidingPanel
All Implemented Interfaces:
Borderable, Clippable, LayoutManageable, MouseCursorable, Positionable, ReflectionSetter, Scrollable, ScrollableContainer, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport

public class HidingSlidingPanel
extends ScrollableBox

The HidingSlidingPanel class provides a Scrollable component that can be hidden on the side of the client window ready to slide in and be used.

It is useful to provide quick access to a panel of other components, that the user can tuck away out of view. For example it could be used to hold a tool box of controls or a list of actions the user can perform.

The hidingAlignment property controls which side of the client window the HidingSlidingPanel will go to. This can be the following values :

The XY property is the position along the client window that the panel will be placed. It is always the opposite of the alignment.

The hidingOnIcon and hidingOffIcon are used to provide a visual clue as to the presence of the HidingPanel. Clicking on these icons will move/remove the HidingPanel from view. You must provde an icon other wise the user will not have a visual cue with which to move the HidingSlidingPanel.

Note : the normal Positionable parameters are not adhered to by the HidingSlidingPanel. While they are used to size the panel initially, the panel will be moved to a place controlled by the XY property.

Author:
Brad Baker
See Also:
Serialized Form

Nested Class Summary
static class HidingSlidingPanel.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String EXPANDED_CHANGED_PROPERTY
           
static java.lang.String HIDING_ALIGMENT_CHANGED_PROPERTY
          Property change name constants
static java.lang.String JUMP_CHANGED_PROPERTY
           
static java.lang.String OFF_ICON_CHANGED_PROPERTY
           
static java.lang.String ON_ICON_CHANGED_PROPERTY
           
static java.lang.String STYLE_EXPANDED
          A style constant for the Expanded property.
static java.lang.String STYLE_HIDING_ALIGNMENT
          A style constant for the HidingAlignment property.
static java.lang.String STYLE_OFF_ICON
          A style constant for the Off Icon property.
static java.lang.String STYLE_ON_ICON
          A style constant for the On Icon property.
static java.lang.String STYLE_XY
          A style constant for the XY property.
static java.lang.String XY_CHANGED_PROPERTY
           
 
Fields inherited from class echopoint.ScrollableBox
DEFAULT_INSETS, DEFAULT_POSITONABLE_POLICY, DEFAULT_SCROLLBAR_POLICY
 
Fields inherited from class echopoint.EchoPointComponent
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp
 
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
HidingSlidingPanel()
          Constructs a HidingPanel with the hiding alignment site to EchoConstants.LEFT and the XY property set to 10.
HidingSlidingPanel(int newHidingAlignment)
          Constructs a HidingPanel with the specified hiding alignment and the XY property set to 10.
HidingSlidingPanel(LayoutManager layoutManager)
          Constructs a HidingSlidingPanel with a LayoutManager and with the hiding alignment site to EchoConstants.LEFT and the XY property set to 10.
 
Method Summary
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 int getHidingAlignment()
          Returns the hiding alignment in place.
 nextapp.echo.ImageReference getOffIcon()
          Returns the icon to be used when the panel is hidden
 java.lang.String getOffTitle()
          Returns the Off Title used on the expansion icons.
 nextapp.echo.Font getOffTitleFont()
          Returns the Off Title font used on the expansion icons.
 nextapp.echo.Color getOffTitleForeground()
          Returns the Off Title foreground used on the expansion icons.
 nextapp.echo.ImageReference getOnIcon()
          Returns the icon to be used when the panel is visible
 java.lang.String getOnTitle()
          Returns the On Title used on the expansion icons.
 nextapp.echo.Font getOnTitleFont()
          Returns the On Title font used on the expansion icons.
 nextapp.echo.Color getOnTitleForeground()
          Returns the On Title foreground used on the expansion icons.
 int getXY()
          Returns the XY property
 boolean isExpanded()
          Returns true of the panel is currently expanded
 boolean isJump()
          Gets whether the HidingSlidingPanel will jump directly to its final position or slide there.
 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 setExpanded(boolean newState)
          Sets the expansion state of the panel.
 void setHidingAlignment(int newHidingAlignment)
          Sets the hiding alignment of the panel.
 void setJump(boolean newValue)
          Sets whether the HidingSlidingPanel will jump directly to its final position or slide there.
 void setOffIcon(nextapp.echo.ImageReference newOffIcon)
          Sets the icon to be used when the panel is hidden (ie not expanded).
 void setOffTitle(java.lang.String string)
          Sets the Off Title used on the expansion icons.
 void setOffTitleFont(nextapp.echo.Font font)
          Sets the Off Title font used on the expansion icons.
 void setOffTitleForeground(nextapp.echo.Color color)
          Sets the Off Title foreground used on the expansion icons.
 void setOnIcon(nextapp.echo.ImageReference newOnIcon)
          Sets the icon to be used when the panel is visible (ie is expanded).
 void setOnTitle(java.lang.String string)
          Sets the On Title used on the expansion icons.
 void setOnTitleFont(nextapp.echo.Font font)
          Sets the On Title font used on the expansion icons.
 void setOnTitleForeground(nextapp.echo.Color color)
          Sets the On Title foreground used on the expansion icons.
 void setXY(int newXy)
          Sets the XY value to be used by the panel.
 
Methods inherited from class echopoint.ScrollableBox
getHorizontalAlignment, getInsets, getVerticalAlignment, setHorizontalAlignment, setInsets, setVerticalAlignment
 
Methods inherited from class echopoint.positionable.AbstractScrollableComponent
add, add, add, add, addImpl, clearPositioning, getBorderColor, getBorderSize, getBorderStyle, getBottom, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getClipRect, getHeight, getLayoutManager, getLeft, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getPositioning, getRight, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getScreenHeight, getScreenHeight, getScreenWidth, getScreenWidth, getScrollBarPolicy, getScrollBarX, getScrollBarY, getTop, getTopBorderColor, getTopBorderSize, getTopBorderStyle, getWidth, getzIndex, isPositioned, remove, remove, setBorderColor, setBorderSize, setBorderStyle, setBottom, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setClipRect, setClipRect, setClipRect, setHeight, setLayoutManager, setLeft, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setPositioning, setRight, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setScrollBarPolicy, setScrollBarX, setScrollBarY, setTop, setTopBorderColor, setTopBorderSize, setTopBorderStyle, setWidth, setzIndex
 
Methods inherited from class echopoint.EchoPointComponent
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText, validate
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface echopoint.positionable.Scrollable
getHeight, getScrollBarPolicy, getScrollBarX, getScrollBarY, getWidth, setHeight, setScrollBarPolicy, setScrollBarX, setScrollBarY, setWidth
 
Methods inherited from interface echopoint.positionable.Positionable
clearPositioning, getBottom, getLeft, getPositioning, getRight, getTop, getzIndex, isPositioned, setBottom, setLeft, setPositioning, setRight, setTop, setzIndex
 
Methods inherited from interface echopoint.positionable.Clippable
getClipRect, setClipRect, setClipRect, setClipRect
 
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

EXPANDED_CHANGED_PROPERTY

public static final java.lang.String EXPANDED_CHANGED_PROPERTY
See Also:
Constant Field Values

HIDING_ALIGMENT_CHANGED_PROPERTY

public static final java.lang.String HIDING_ALIGMENT_CHANGED_PROPERTY
Property change name constants

See Also:
Constant Field Values

JUMP_CHANGED_PROPERTY

public static final java.lang.String JUMP_CHANGED_PROPERTY
See Also:
Constant Field Values

OFF_ICON_CHANGED_PROPERTY

public static final java.lang.String OFF_ICON_CHANGED_PROPERTY
See Also:
Constant Field Values

ON_ICON_CHANGED_PROPERTY

public static final java.lang.String ON_ICON_CHANGED_PROPERTY
See Also:
Constant Field Values

STYLE_EXPANDED

public static final java.lang.String STYLE_EXPANDED
A style constant for the Expanded property. Values of this key must be of type boolean

See Also:
Constant Field Values

STYLE_HIDING_ALIGNMENT

public static final java.lang.String STYLE_HIDING_ALIGNMENT
A style constant for the HidingAlignment property. Values of this key must be of type int

See Also:
Constant Field Values

STYLE_OFF_ICON

public static final java.lang.String STYLE_OFF_ICON
A style constant for the Off Icon property. Values of this key must be of type ImageReference

See Also:
Constant Field Values

STYLE_ON_ICON

public static final java.lang.String STYLE_ON_ICON
A style constant for the On Icon property. Values of this key must be of type ImageReference

See Also:
Constant Field Values

STYLE_XY

public static final java.lang.String STYLE_XY
A style constant for the XY property. Values of this key must be of type int

See Also:
Constant Field Values

XY_CHANGED_PROPERTY

public static final java.lang.String XY_CHANGED_PROPERTY
See Also:
Constant Field Values
Constructor Detail

HidingSlidingPanel

public HidingSlidingPanel()
Constructs a HidingPanel with the hiding alignment site to EchoConstants.LEFT and the XY property set to 10.


HidingSlidingPanel

public HidingSlidingPanel(LayoutManager layoutManager)
Constructs a HidingSlidingPanel with a LayoutManager and with the hiding alignment site to EchoConstants.LEFT and the XY property set to 10.


HidingSlidingPanel

public HidingSlidingPanel(int newHidingAlignment)
Constructs a HidingPanel with the specified hiding alignment and the XY property set to 10.

The hisding alignment can be the following values :

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 ScrollableBox
See Also:
Component.applyStyle(nextapp.echo.Style)

getHidingAlignment

public int getHidingAlignment()
Returns the hiding alignment in place. This can be :


getOffIcon

public nextapp.echo.ImageReference getOffIcon()
Returns the icon to be used when the panel is hidden

Returns:
nextapp.echo.ImageReference

getOffTitle

public java.lang.String getOffTitle()
Returns the Off Title used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Returns:
- the offTitle of the HisingSlidingPanel

getOffTitleFont

public nextapp.echo.Font getOffTitleFont()
Returns the Off Title font used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Returns:
Font - the font of the Title

getOffTitleForeground

public nextapp.echo.Color getOffTitleForeground()
Returns the Off Title foreground used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Returns:
Color the color of the title

getOnIcon

public nextapp.echo.ImageReference getOnIcon()
Returns the icon to be used when the panel is visible

Returns:
nextapp.echo.ImageReference

getOnTitle

public java.lang.String getOnTitle()
Returns the On Title used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Returns:
- the offTitle of the HisingSlidingPanel

getOnTitleFont

public nextapp.echo.Font getOnTitleFont()
Returns the On Title font used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Returns:
Font

getOnTitleForeground

public nextapp.echo.Color getOnTitleForeground()
Returns the On Title foreground used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Returns:
Color

getXY

public int getXY()
Returns the XY property


isExpanded

public boolean isExpanded()
Returns true of the panel is currently expanded


isJump

public boolean isJump()
Gets whether the HidingSlidingPanel will jump directly to its final position or slide there.

By default this is false.

Returns:
whether it will jump directly to its final position

setExpanded

public void setExpanded(boolean newState)
Sets the expansion state of the panel. If its true then the panel will shown expanded on the client window. If its false then the panel will be hidden.


setHidingAlignment

public void setHidingAlignment(int newHidingAlignment)
Sets the hiding alignment of the panel. This can be one of

Throws:
java.lang.IllegalArgumentException - if the hiding alighment is not one of the above

setJump

public void setJump(boolean newValue)
Sets whether the HidingSlidingPanel will jump directly to its final position or slide there.

By default this is false.

Parameters:
newValue -

setOffIcon

public void setOffIcon(nextapp.echo.ImageReference newOffIcon)
Sets the icon to be used when the panel is hidden (ie not expanded).

The icon may null in which case a default one will be rendered. If it is not null then it must have a width and height > 0, otherwise an IllegalArgumentException is thrown.

Throws:
java.lang.IllegalArgumentException - if the width and height are <= 0

setOffTitle

public void setOffTitle(java.lang.String string)
Sets the Off Title used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Parameters:
string -

setOffTitleFont

public void setOffTitleFont(nextapp.echo.Font font)
Sets the Off Title font used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Parameters:
font -

setOffTitleForeground

public void setOffTitleForeground(nextapp.echo.Color color)
Sets the Off Title foreground used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Parameters:
color -

setOnIcon

public void setOnIcon(nextapp.echo.ImageReference newOnIcon)
Sets the icon to be used when the panel is visible (ie is expanded).

The icon may null in which case a default one will be rendered. If it is not null then it must have a width and height > 0, otherwise an IllegalArgumentException is thrown.

Throws:
java.lang.IllegalArgumentException - if the width and height are <= 0

setOnTitle

public void setOnTitle(java.lang.String string)
Sets the On Title used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Parameters:
string -

setOnTitleFont

public void setOnTitleFont(nextapp.echo.Font font)
Sets the On Title font used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Parameters:
font -

setOnTitleForeground

public void setOnTitleForeground(nextapp.echo.Color color)
Sets the On Title foreground used on the expansion icons.

Note that this take effect if the default internal TextImageReference icons are used. if you set your own on and off icons, then this property has no effect.

Parameters:
color -

setXY

public void setXY(int newXy)
Sets the XY value to be used by the panel. This is always opposite to the hidingAlignment.

For example if the hiding alignment is LEFT, then xy will represent the y co-ordinate to place the panel.

if the hiding alignment is TOP, then xy will represent the x co-ordinate to place the panel.

Parameters:
newXy - int

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

EchoPoint
1.0