com.sibvisions.rad.ui.swing.impl.container
Class SwingAbstractFrame<C extends Container>

java.lang.Object
  extended by com.sibvisions.rad.ui.awt.impl.AwtResource<C>
      extended by com.sibvisions.rad.ui.awt.impl.AwtComponent<C>
          extended by com.sibvisions.rad.ui.awt.impl.AwtContainer<C>
              extended by com.sibvisions.rad.ui.swing.impl.container.SwingAbstractFrame<C>
Type Parameters:
C - the Container.
All Implemented Interfaces:
ComponentListener, KeyListener, MouseListener, EventListener, IFrame, IToolBarPanel, IWindow, IAlignmentConstants, IComponent, IContainer, IResource, INamedObject
Direct Known Subclasses:
SwingApplet.SwingAppletLauncher, SwingFrame, SwingInternalFrame

public abstract class SwingAbstractFrame<C extends Container>
extends AwtContainer<C>
implements IFrame

The SwingAbstractFrame is the IFrame implementation for swing.
I is a top-level window with a title and a border.

The size of the frame includes any area designated for the border.

See Also:
JFrame, IFrame

Field Summary
protected  boolean bDisposed
          indicates whether the frame is disposed.
protected  WindowHandler eventWindowActivated
          EventHandler for windowActivated.
protected  WindowHandler eventWindowClosed
          EventHandler for windowClosed.
protected  WindowHandler eventWindowClosing
          EventHandler for windowClosing.
protected  WindowHandler eventWindowDeactivated
          EventHandler for windowDeactivated.
protected  WindowHandler eventWindowDeiconified
          EventHandler for windowDeiconified.
protected  WindowHandler eventWindowIconified
          EventHandler for windowIconified.
protected  WindowHandler eventWindowOpened
          EventHandler for windowOpened.
protected  IImage iconImage
          the icon image.
protected  IMenuBar menuBar
          the menu bar.
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
eventComponentMoved, eventComponentResized, eventSource, factory, parent
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
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
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
SwingAbstractFrame(C pContainer)
          Creates a new instance of SwingAbstractFrame.
 
Method Summary
protected  void addIntern(Component pComponent, Object pConstraints, int pIndex)
          Internal function, for adding physical component and supporting layers.
 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.
protected  void addToolBarIntern(JToolBar pToolBar, int pIndex)
          Adds the toolbar at a specific index.
 void dispose()
          Marks the frame as disposed.
 WindowHandler eventWindowActivated()
          The EventHandler for the window activated event.
 WindowHandler eventWindowClosed()
          The EventHandler for the window closed event.
 WindowHandler eventWindowClosing()
          The EventHandler for the window closing event.
 WindowHandler eventWindowDeactivated()
          The EventHandler for the window deactivated event.
 WindowHandler eventWindowDeiconified()
          The EventHandler for the window deiconified event.
 WindowHandler eventWindowIconified()
          The EventHandler for the window iconified event.
 WindowHandler eventWindowOpened()
          The EventHandler for the window opened event.
 IImage getIconImage()
          Returns the image to be displayed as the icon for this frame.
 IMenuBar getMenuBar()
          Returns the menubar set on this 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 isDisposed()
          Checks whether the window is disposed already.
 void removeAllToolBars()
          Removes all toolbars from this panel.
protected  void removeIntern(Component pComponent)
          Internal function, for adding physical component and supporting layers.
 void removeToolBar(int pIndex)
          Removes a toolbar from this panel.
 void removeToolBar(IToolBar pToolBar)
          Removes a toolbar from this panel.
protected  void removeToolBarIntern(JToolBar pToolBar)
          Removes the toolbar from the panel.
 void setCursor(ICursor pCursor)
          Sets the cursor of the glass pane as "global" cursor.
protected  void setLayoutIntern(LayoutManager pLayoutManager)
          Internal function, for setting the layout.
 void setToolBarArea(int pArea)
          Sets the display area where the toolbars will be added.
 void setVisible(boolean pVisible)
          Shows or hides this component depending on the value of parameter b.
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtContainer
add, add, add, add, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
capture, componentHidden, componentMoved, componentResized, componentShown, createImage, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getHorizontalAlignment, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, getVerticalAlignment, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, requestFocus, setBackground, setBounds, setEnabled, setEventSource, setFactory, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVerticalAlignment, validate
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
equals, getResource, 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.IFrame
getState, getTitle, isResizable, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from interface javax.rad.ui.container.IWindow
centerRelativeTo, isActive, 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, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Field Detail

eventWindowOpened

protected WindowHandler eventWindowOpened
EventHandler for windowOpened.


eventWindowClosing

protected WindowHandler eventWindowClosing
EventHandler for windowClosing.


eventWindowClosed

protected WindowHandler eventWindowClosed
EventHandler for windowClosed.


eventWindowActivated

protected WindowHandler eventWindowActivated
EventHandler for windowActivated.


eventWindowDeactivated

protected WindowHandler eventWindowDeactivated
EventHandler for windowDeactivated.


eventWindowIconified

protected WindowHandler eventWindowIconified
EventHandler for windowIconified.


eventWindowDeiconified

protected WindowHandler eventWindowDeiconified
EventHandler for windowDeiconified.


iconImage

protected IImage iconImage
the icon image.


menuBar

protected IMenuBar menuBar
the menu bar.


bDisposed

protected boolean bDisposed
indicates whether the frame is disposed.

Constructor Detail

SwingAbstractFrame

public SwingAbstractFrame(C pContainer)
Creates a new instance of SwingAbstractFrame.

Parameters:
pContainer - the Container
Method Detail

isDisposed

public boolean isDisposed()
Checks whether the window is disposed already.

Specified by:
isDisposed in interface IWindow
Returns:
true if the window is disposed, otherwiese false

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)

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)

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(IToolBar pToolBar)
Removes a toolbar from this panel.

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

removeToolBar

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

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

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

eventWindowOpened

public WindowHandler eventWindowOpened()
The EventHandler for the window opened event.

Specified by:
eventWindowOpened in interface IWindow
Returns:
the EventHandler for the window opened event.

eventWindowClosing

public WindowHandler eventWindowClosing()
The EventHandler for the window closing event.

Specified by:
eventWindowClosing in interface IWindow
Returns:
the EventHandler for the window closing event.

eventWindowClosed

public WindowHandler eventWindowClosed()
The EventHandler for the window closed event.

Specified by:
eventWindowClosed in interface IWindow
Returns:
the EventHandler for the window closed event.

eventWindowIconified

public WindowHandler eventWindowIconified()
The EventHandler for the window iconified event.

Specified by:
eventWindowIconified in interface IWindow
Returns:
the EventHandler for the window iconified event.

eventWindowDeiconified

public WindowHandler eventWindowDeiconified()
The EventHandler for the window deiconified event.

Specified by:
eventWindowDeiconified in interface IWindow
Returns:
the EventHandler for the window deiconified event.

eventWindowActivated

public WindowHandler eventWindowActivated()
The EventHandler for the window activated event.

Specified by:
eventWindowActivated in interface IWindow
Returns:
the EventHandler for the window activated event.

eventWindowDeactivated

public WindowHandler eventWindowDeactivated()
The EventHandler for the window deactivated event.

Specified by:
eventWindowDeactivated in interface IWindow
Returns:
the EventHandler for the window deactivated event.

setCursor

public void setCursor(ICursor pCursor)
Sets the cursor of the glass pane as "global" cursor.

Specified by:
setCursor in interface IComponent
Overrides:
setCursor in class AwtComponent<C extends Container>
Parameters:
pCursor - the "global" cursor
See Also:
IComponent.isEnabled(), IComponent.getCursor(), Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String), ICursor

setVisible

public void setVisible(boolean pVisible)
Shows or hides this component depending on the value of parameter b.

Specified by:
setVisible in interface IComponent
Overrides:
setVisible in class AwtComponent<C extends Container>
Parameters:
pVisible - if true, shows this component; otherwise, hides this component
See Also:
IComponent.isVisible()

setLayoutIntern

protected void setLayoutIntern(LayoutManager pLayoutManager)
Internal function, for setting the layout.

Overrides:
setLayoutIntern in class AwtContainer<C extends Container>
Parameters:
pLayoutManager - the layout

addIntern

protected void addIntern(Component pComponent,
                         Object pConstraints,
                         int pIndex)
Internal function, for adding physical component and supporting layers.

Overrides:
addIntern in class AwtContainer<C extends Container>
Parameters:
pComponent - the Component to be added
pConstraints - an object expressing layout contraints for this
pIndex - the position in the container's list at which to insert the Component; -1 means insert at the end component
See Also:
AwtContainer.add(IComponent, Object, int)

removeIntern

protected void removeIntern(Component pComponent)
Internal function, for adding physical component and supporting layers.

Overrides:
removeIntern in class AwtContainer<C extends Container>
Parameters:
pComponent - the Component to be removed
See Also:
AwtContainer.remove(int)

dispose

public void dispose()
Marks the frame as disposed.

Specified by:
dispose in interface IWindow
See Also:
IWindow.pack(), IComponent.setVisible(boolean)

addToolBarIntern

protected void addToolBarIntern(JToolBar pToolBar,
                                int pIndex)
Adds the toolbar at a specific index.

Parameters:
pToolBar - the toolbar to be added
pIndex - the position

removeToolBarIntern

protected void removeToolBarIntern(JToolBar pToolBar)
Removes the toolbar from the panel.

Parameters:
pToolBar - the toolbar to be removed


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.