javax.rad.genui.container
Class AbstractFrame<C extends IFrame>

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.UIContainer<C>
              extended by javax.rad.genui.container.AbstractWindow<C>
                  extended by javax.rad.genui.container.AbstractFrame<C>
Type Parameters:
C - instance of IFrame
All Implemented Interfaces:
ITranslatable, IFrame, IToolBarPanel, IWindow, IComponent, IContainer, IResource, INamedObject
Direct Known Subclasses:
UIFrame, UIInternalFrame, UILauncher

public abstract class AbstractFrame<C extends IFrame>
extends AbstractWindow<C>
implements IFrame

Platform and technology independent frame. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .


Field Summary
protected  IImage iconImage
          the icon image.
protected  IMenuBar menuBar
          the menu bar.
 
Fields inherited from class javax.rad.genui.UIContainer
components
 
Fields inherited from class javax.rad.genui.UIComponent
lLastTranslationModified, parent
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.ui.container.IFrame
ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, NORMAL
 
Fields inherited from interface javax.rad.ui.container.IToolBarPanel
AREA_BOTTOM, AREA_LEFT, AREA_RIGHT, AREA_TOP
 
Constructor Summary
protected AbstractFrame(C pFrame)
          Creates a new instance of AbstractFrame.
 
Method Summary
 void addNotify()
          Makes this UIComponent displayable by adding it to an UIContainer.
 void addToolBar(IToolBar pToolBar)
          Adds a toolbar to this panel as last component.
 void addToolBar(IToolBar pToolBar, int pIndex)
          Adds a toolbar to this panel at a specified index.
 void beforeAddNotify(IComponent pParent)
          Invoked before this component is added.
 IImage getIconImage()
          Returns the image to be displayed as the icon for this frame.
 IMenuBar getMenuBar()
          Returns the menubar set on this frame.
 int getState()
          Gets the state of this frame (obsolete).
 String getTitle()
          Gets the title of the frame.
 IToolBar getToolBar(int pIndex)
          Gets the IToolBar from a specific index.
 int getToolBarArea()
          Gets the area where the toolbar(s) are added.
 int getToolBarCount()
          Gets the number of IToolBars in this panel.
 int indexOfToolBar(IToolBar pToolBar)
          Gets the nth position of an IToolBar in this panel.
 boolean isResizable()
          Indicates whether this frame is resizable by the user.
 boolean isToolBarMovable()
          Gets whether the toolbars are movable.
 void removeAllToolBars()
          Removes all toolbars from this panel.
 void removeNotify()
          Makes this UIComponent undisplayable by removing it to an UIContainer.
 void removeToolBar(int pIndex)
          Removes a toolbar from this panel.
 void removeToolBar(IToolBar pToolBar)
          Removes a toolbar from this panel.
 void setIconImage(IImage pIconImage)
          Sets the image to be displayed as the icon for this window.
 void setMenuBar(IMenuBar pMenuBar)
          Sets the menubar for this frame.
 void setResizable(boolean pResizable)
          Sets whether this frame is resizable by the user.
 void setState(int pState)
          Sets the state of this frame (obsolete).
 void setTitle(String pTitle)
          Sets the title for this frame to the specified string.
 void setToolBarArea(int pArea)
          Sets the display area where the toolbars will be added.
 void setToolBarMovable(boolean pMovable)
          Sets all toolbars movable or fixed.
 void updateTranslation()
          Notification for updating the translation.
 
Methods inherited from class javax.rad.genui.container.AbstractWindow
centerRelativeTo, dispose, eventWindowActivated, eventWindowClosed, eventWindowClosing, eventWindowDeactivated, eventWindowDeiconified, eventWindowIconified, eventWindowOpened, isActive, isDisposed, pack, setVisible, toBack, toFront, topLevelAddNotify
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, add, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout, setZOrder
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createCellFormatter, createNodeFormatter, debug, error, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getResource, getSize, getToolTipText, getTranslation, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, requestFocus, setBackground, setBounds, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPreferredSize, setPreferredSize, setSize, setSize, setToolTipText, setTranslation, setTranslationEnabled, translate
 
Methods inherited from class javax.rad.genui.UIResource
equals, getUIResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.container.IWindow
centerRelativeTo, dispose, eventWindowActivated, eventWindowClosed, eventWindowClosing, eventWindowDeactivated, eventWindowDeiconified, eventWindowIconified, eventWindowOpened, isActive, isDisposed, pack, toBack, toFront
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Field Detail

iconImage

protected IImage iconImage
the icon image.


menuBar

protected IMenuBar menuBar
the menu bar.

Constructor Detail

AbstractFrame

protected AbstractFrame(C pFrame)
Creates a new instance of AbstractFrame.

Parameters:
pFrame - the IFrame.
See Also:
IFrame
Method Detail

getTitle

public String getTitle()
Gets the title of the frame. The title is displayed in the frame's border.

Specified by:
getTitle in interface IFrame
Returns:
the title of this frame, or an empty string ("") if this frame doesn't have a title.
See Also:
IFrame.setTitle(String)

setTitle

public void setTitle(String pTitle)
Sets the title for this frame to the specified string.

Specified by:
setTitle in interface IFrame
Parameters:
pTitle - the title to be displayed in the frame's border. A null value is treated as an empty string, "".
See Also:
IFrame.getTitle()

getIconImage

public IImage getIconImage()
Returns the image to be displayed as the icon for this frame.

Specified by:
getIconImage in interface IFrame
Returns:
the icon image for this frame, or null if this frame doesn't have an icon image.
See Also:
IFrame.setIconImage(IImage)

setIconImage

public void setIconImage(IImage pIconImage)
Sets the image to be displayed as the icon for this window.

Specified by:
setIconImage in interface IFrame
Parameters:
pIconImage - the icon image to be displayed. If this parameter is null then the icon image is set to the default image, which may vary with platform.
See Also:
IFrame.getIconImage()

getState

public int getState()
Gets the state of this frame (obsolete).

In older versions of JDK a frame state could only be NORMAL or ICONIFIED. Since JDK 1.4 set of supported frame states is expanded and frame state is represented as a bitwise mask.

For compatibility with old programs this method still returns Frame.NORMAL and Frame.ICONIFIED but it only reports the iconic state of the frame, other aspects of frame state are not reported by this method.

Specified by:
getState in interface IFrame
Returns:
Frame.NORMAL or Frame.ICONIFIED.
See Also:
IFrame.setState(int)

setState

public void setState(int pState)
Sets the state of this frame (obsolete).

In older versions of JDK a frame state could only be NORMAL or ICONIFIED. Since JDK 1.4 set of supported frame states is expanded and frame state is represented as a bitwise mask.

For compatibility with old programs this method still accepts Frame.NORMAL and Frame.ICONIFIED but it only changes the iconic state of the frame, other aspects of frame state are not affected by this method.

Specified by:
setState in interface IFrame
Parameters:
pState - either Frame.NORMAL or Frame.ICONIFIED.
See Also:
IFrame.getState(), IFrame.setState(int)

isResizable

public boolean isResizable()
Indicates whether this frame is resizable by the user. By default, all frames are initially resizable.

Specified by:
isResizable in interface IFrame
Returns:
true if the user can resize this frame; false otherwise.
See Also:
IFrame.setResizable(boolean)

setResizable

public void setResizable(boolean pResizable)
Sets whether this frame is resizable by the user.

Specified by:
setResizable in interface IFrame
Parameters:
pResizable - true if this frame is resizable; false otherwise.
See Also:
IFrame.isResizable()

getMenuBar

public IMenuBar getMenuBar()
Returns the menubar set on this frame.

Specified by:
getMenuBar in interface IFrame
Returns:
the menubar for this frame
See Also:
IFrame.setMenuBar(javax.rad.ui.menu.IMenuBar)

setMenuBar

public void setMenuBar(IMenuBar pMenuBar)
Sets the menubar for this frame.

Specified by:
setMenuBar in interface IFrame
Parameters:
pMenuBar - the menubar being placed in the frame
See Also:
IFrame.getMenuBar()

addToolBar

public void addToolBar(IToolBar pToolBar)
Adds a toolbar to this panel as last component.

Specified by:
addToolBar in interface IToolBarPanel
Parameters:
pToolBar - the toolbar to be added

addToolBar

public void addToolBar(IToolBar pToolBar,
                       int pIndex)
Adds a toolbar to this panel at a specified index.

Specified by:
addToolBar in interface IToolBarPanel
Parameters:
pToolBar - the toolbar to be added
pIndex - the index for the toolbar

removeToolBar

public void removeToolBar(int pIndex)
Removes a toolbar from this panel.

Specified by:
removeToolBar in interface IToolBarPanel
Parameters:
pIndex - the index

removeToolBar

public void removeToolBar(IToolBar pToolBar)
Removes a toolbar from this panel.

Specified by:
removeToolBar in interface IToolBarPanel
Parameters:
pToolBar - the toolbar

removeAllToolBars

public void removeAllToolBars()
Removes all toolbars from this panel.

Specified by:
removeAllToolBars in interface IToolBarPanel

getToolBarCount

public int getToolBarCount()
Gets the number of IToolBars in this panel.

Specified by:
getToolBarCount in interface IToolBarPanel
Returns:
the number of toolbars

getToolBar

public IToolBar getToolBar(int pIndex)
Gets the IToolBar from a specific index.

Specified by:
getToolBar in interface IToolBarPanel
Parameters:
pIndex - the index
Returns:
the toolbar at pIndex

indexOfToolBar

public int indexOfToolBar(IToolBar pToolBar)
Gets the nth position of an IToolBar in this panel.

Specified by:
indexOfToolBar in interface IToolBarPanel
Parameters:
pToolBar - the IToolBar to search
Returns:
the nth position of pToolBar in this panel or -1 if pToolBar is not added

setToolBarArea

public void setToolBarArea(int pArea)
Sets the display area where the toolbars will be added.

Specified by:
setToolBarArea in interface IToolBarPanel
Parameters:
pArea - an area constant IToolBarPanel.AREA_TOP, IToolBarPanel.AREA_LEFT, IToolBarPanel.AREA_BOTTOM, IToolBarPanel.AREA_RIGHT

getToolBarArea

public int getToolBarArea()
Gets the area where the toolbar(s) are added.

Specified by:
getToolBarArea in interface IToolBarPanel
Returns:
an area constant IToolBarPanel.AREA_TOP, IToolBarPanel.AREA_LEFT, IToolBarPanel.AREA_BOTTOM, IToolBarPanel.AREA_RIGHT

updateTranslation

public void updateTranslation()
Notification for updating the translation. This method will be called when the UIComponent will be added to a displayable containment hierarchy, when its containment hierarchy is made displayable or the translation table will be changed.

Overrides:
updateTranslation in class UIContainer<C extends IFrame>
See Also:
UIComponent.setTranslation(TranslationMap), UIComponent.addNotify()

beforeAddNotify

public void beforeAddNotify(IComponent pParent)
Invoked before this component is added.

Overrides:
beforeAddNotify in class UIContainer<C extends IFrame>
Parameters:
pParent - the parent

addNotify

public void addNotify()
Makes this UIComponent displayable by adding it to an UIContainer. This method is called internally by the genui and should not be called directly.

Overrides:
addNotify in class UIContainer<C extends IFrame>
See Also:
UIComponent.removeNotify(), UIComponent.isNotified()

removeNotify

public void removeNotify()
Makes this UIComponent undisplayable by removing it to an UIContainer.

This method is called by the genui internally and should not be called directly. Code overriding this method should call super.removeNotify as the first line of the overriding method.

Overrides:
removeNotify in class UIContainer<C extends IFrame>
See Also:
UIComponent.addNotify(), UIComponent.isNotified()

setToolBarMovable

public void setToolBarMovable(boolean pMovable)
Sets all toolbars movable or fixed.

Parameters:
pMovable - true to move the toolbars, false otherwise

isToolBarMovable

public boolean isToolBarMovable()
Gets whether the toolbars are movable.

Returns:
true if the toolbars are movable, false otherwise


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.