EchoPoint
1.0

echopoint
Class DialogPanel

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Panel
          extended byechopoint.Panel
              extended byechopoint.ScrollablePanel
                  extended byechopoint.DialogPanel
All Implemented Interfaces:
nextapp.echo.event.ActionListener, Borderable, Clippable, java.util.EventListener, LayoutManageable, MouseCursorable, Positionable, ReflectionSetter, Scrollable, ScrollableContainer, java.io.Serializable

public class DialogPanel
extends ScrollablePanel
implements nextapp.echo.event.ActionListener

DialogPanel, which extends ScrollablePanel is a generic container that implements Scrollable, Positionable and Clippable.

When a DialogPanel is placed into the Component heirarchy, it places itself over all other components and only allows the user to interact with the components within it. It is thus said to be "modal".

Typically you would use the DialogPanel to obtain information from the user while not allowing them to interact further with the application Window until they provide that information.

DialogPanels stack onto top of other DialogPanels. You can add child DialogPanels to parent DialogPanels and the child ones will be "modal" with respect to the parent ones. Hence you can have a DialogPanel invoke another and have it "stack" on top of the original.

DialogPanels use a special zIndex range to "stack" themselves over other content. There are always placed starting at DialogPanel.ZINDEX_RANGE. Therefore any content you want to be "under" the DialogPanel must have a zIndex less that this. In general most components will work however this is something you will want to be aware of. If you choose to set the zIndex parameter yourself, then you will need to manage z-Index values inside your program.

The DialogPanel will center itself vertically and horizontally on the screen, unless its Positionable parameters are set, in which case these will values apply.

DialogPanel uses the DialogListener interface to raise DialogEvent's when it is opened, about to be closed and closed. You can receive this events by implementing DialogListener and adding it to the DialogPanel.

The default TitleBar provide with DialogPanel has a close icon on it. DialogPanel is wired to listen to this TitleBar and will close itself when the close button is pressed. If you replace the default TitleBar, you must rewire the ActionListener interface yourself.

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 java.lang.String ACTION_CLOSE
          This close action command with close the DialogPanel
static nextapp.echo.Color defaultBackground
          default background color is greyish
static nextapp.echo.Color defaultTitleBarBackground
          default titlebar background color is blueish
static nextapp.echo.Font defaultTitleBarFont
          default titlebar font is sans serif 10
static nextapp.echo.Color defaultTitleBarForeground
          default titlebar foreground color is white
static java.lang.String DITHERING_CHANGED_PROPERTY
           
static java.lang.String DRAG_WINDOW_USED_CHANGED_PROPERTY
           
static java.lang.String TITLEBAR_CHANGED_PROPERTY
           
static int ZINDEX_RANGE
          DialogPanels always start out with this ZINDEX value
 
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
DialogPanel()
          DialogPanel constructor.
DialogPanel(int left, int top)
          DialogPanel constructor.
DialogPanel(int left, int top, int right, int bottom)
          DialogPanel constructor.
DialogPanel(int left, int top, int right, int bottom, int zIndex)
          DialogPanel constructor.
DialogPanel(int left, int top, int right, int bottom, int zIndex, int positioning)
          DialogPanel constructor.
DialogPanel(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy)
          DialogPanel constructor.
DialogPanel(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy, int[] clipRect)
          DialogPanel constructor.
DialogPanel(LayoutManager layoutManager)
          Constructs a DialogPanel with a LayoutManager
DialogPanel(java.lang.String dialogTitle)
          DialogPanel constructor.
 
Method Summary
 void actionPerformed(nextapp.echo.event.ActionEvent e)
          The DialogPanel is an ActionListener and it listens for an ActionEvent with a command of DialogPanel.ACTION_CLOSE.
 void addDialogListener(DialogListener l)
          Adds a DialogListener to the dialog
 void close()
          Closes the dialog.
 TitleBar getTitleBar()
          Gets the titlebar used by the DialogPanel
 int getzIndex()
          Returns the z-index of the component
 boolean isBackgroundDithered()
          Retursn true if the background, under the DialogPanel, is to be dithered.
 boolean isDragWindowUsed()
          Returns whether a drag window is used when dragging.
 void removeDialogListener(DialogListener l)
          Removes a DialogListener from the dialog
 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 setBackgroundDithered(boolean newBackgroundDithered)
          Sets whether the background, under the DialogPanel, is to be dithered.
 void setDragWindowUsed(boolean newValue)
          Sets whether a drag window is used when dragging.
 void setTitleBar(TitleBar newTitleBar)
          Sets the titlebar used by the DialogPanel
 void setzIndex(int newValue)
          Sets the z-index of the component
 
Methods inherited from class echopoint.ScrollablePanel
applyStyle, clearPositioning, getBottom, getClipRect, getHeight, getLeft, getPositioning, getRight, getScreenHeight, getScreenWidth, getScrollBarPolicy, getScrollBarX, getScrollBarY, getTop, getWidth, isPositioned, setBottom, setClipRect, setClipRect, setClipRect, setHeight, setLeft, setPositioning, setRight, setScrollBarPolicy, setScrollBarX, setScrollBarY, setTop, setWidth
 
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

defaultBackground

public static nextapp.echo.Color defaultBackground
default background color is greyish


defaultTitleBarBackground

public static nextapp.echo.Color defaultTitleBarBackground
default titlebar background color is blueish


defaultTitleBarFont

public static nextapp.echo.Font defaultTitleBarFont
default titlebar font is sans serif 10


ZINDEX_RANGE

public static int ZINDEX_RANGE
DialogPanels always start out with this ZINDEX value


ACTION_CLOSE

public static java.lang.String ACTION_CLOSE
This close action command with close the DialogPanel


defaultTitleBarForeground

public static nextapp.echo.Color defaultTitleBarForeground
default titlebar foreground color is white


DITHERING_CHANGED_PROPERTY

public static java.lang.String DITHERING_CHANGED_PROPERTY

DRAG_WINDOW_USED_CHANGED_PROPERTY

public static java.lang.String DRAG_WINDOW_USED_CHANGED_PROPERTY

TITLEBAR_CHANGED_PROPERTY

public static java.lang.String TITLEBAR_CHANGED_PROPERTY
Constructor Detail

DialogPanel

public DialogPanel()
DialogPanel constructor.


DialogPanel

public DialogPanel(LayoutManager layoutManager)
Constructs a DialogPanel with a LayoutManager


DialogPanel

public DialogPanel(int left,
                   int top)
DialogPanel constructor.

Parameters:
left - int
top - int

DialogPanel

public DialogPanel(int left,
                   int top,
                   int right,
                   int bottom)
DialogPanel constructor.

Parameters:
left - int
top - int
right - int
bottom - int

DialogPanel

public DialogPanel(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex)
DialogPanel constructor.

Parameters:
left - int
top - int
right - int
bottom - int
zIndex - int

DialogPanel

public DialogPanel(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex,
                   int positioning)
DialogPanel constructor.

Parameters:
left - int
top - int
right - int
bottom - int
zIndex - int
positioning - int

DialogPanel

public DialogPanel(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex,
                   int positioning,
                   int scrollBarPolicy)
DialogPanel constructor.

Parameters:
left - int
top - int
right - int
bottom - int
zIndex - int
positioning - int
scrollBarPolicy - int

DialogPanel

public DialogPanel(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex,
                   int positioning,
                   int scrollBarPolicy,
                   int[] clipRect)
DialogPanel constructor.

Parameters:
left - int
top - int
right - int
bottom - int
zIndex - int
positioning - int
scrollBarPolicy - int
clipRect - int[]

DialogPanel

public DialogPanel(java.lang.String dialogTitle)
DialogPanel constructor.

Method Detail

addDialogListener

public void addDialogListener(DialogListener l)
Adds a DialogListener to the dialog

Parameters:
l - The DialogListener to be added.

close

public void close()
Closes the dialog.

This helper method removes the dialog from its parent, if it has one, and hence the dialog will not longer appear.


getTitleBar

public TitleBar getTitleBar()
Gets the titlebar used by the DialogPanel

Returns:
echopoint.TitleBar

isBackgroundDithered

public boolean isBackgroundDithered()
Retursn true if the background, under the DialogPanel, is to be dithered.

Returns:
boolean

removeDialogListener

public void removeDialogListener(DialogListener l)
Removes a DialogListener from the dialog

Parameters:
l - The DialogListener to be removed.

setBackgroundDithered

public void setBackgroundDithered(boolean newBackgroundDithered)
Sets whether the background, under the DialogPanel, is to be dithered.

Parameters:
newBackgroundDithered - boolean

setTitleBar

public void setTitleBar(TitleBar newTitleBar)
Sets the titlebar used by the DialogPanel

Parameters:
newTitleBar - echopoint.TitleBar

isDragWindowUsed

public boolean isDragWindowUsed()
Returns whether a drag window is used when dragging.

Returns:
- boolean

setDragWindowUsed

public void setDragWindowUsed(boolean newValue)
Sets whether a drag window is used when dragging. This is a semi-transparent visual artifact that indicates where DialogPanel can be dragged.

Parameters:
newValue - - whether a drag window is used while dragging.

getzIndex

public int getzIndex()
Description copied from class: ScrollablePanel
Returns the z-index of the component

Specified by:
getzIndex in interface Positionable
Overrides:
getzIndex in class ScrollablePanel
See Also:
Positionable.getzIndex()

setzIndex

public void setzIndex(int newValue)
Description copied from class: ScrollablePanel
Sets the z-index of the component

Specified by:
setzIndex in interface Positionable
Overrides:
setzIndex in class ScrollablePanel
See Also:
ScrollablePanel.setzIndex(int)

actionPerformed

public void actionPerformed(nextapp.echo.event.ActionEvent e)
The DialogPanel is an ActionListener and it listens for an ActionEvent with a command of DialogPanel.ACTION_CLOSE. If it receives such an event then it will close itself.

Specified by:
actionPerformed in interface nextapp.echo.event.ActionListener
See Also:
ActionListener.actionPerformed(nextapp.echo.event.ActionEvent)

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