com.sibvisions.rad.ui.awt.impl
Class AwtContainer<C extends java.awt.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>
Type Parameters:
C - AWT Container implementation
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener, IAlignmentConstants, IComponent, IContainer, IResource, INamedObject
Direct Known Subclasses:
SwingAbstractFrame, SwingComponent

public class AwtContainer<C extends java.awt.Container>
extends AwtComponent<C>
implements IContainer

A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT components.


Field Summary
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
bComponentListener, bFocusListener, bKeyListener, bMouseListener, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, eventSource, factory, parent
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
protected AwtContainer(C pContainer)
          Creates a new instance of AwtContainer.
 
Method Summary
 void add(IComponent pComponent)
          Adds the specified IComponent to the end of this container.
 void add(IComponent pComponent, int pIndex)
          Adds the specified IComponent to this container at the specified index.
 void add(IComponent pComponent, java.lang.Object pConstraints)
          Adds the specified IComponent to the end of this container.
 void add(IComponent pComponent, java.lang.Object pConstraints, int pIndex)
          Adds the specified IComponent to this container with the specified constraints at the specified index.
protected  void addIntern(java.awt.Component pComponent, java.lang.Object pConstraints, int pIndex)
          Internal function, for adding physical component and supporting layers.
protected  void checkAdd(IComponent pComponent, java.lang.Object pConstraints, int pIndex)
          Checks if it's allowed to add a specific component to this container.
 IComponent getComponent(int pIndex)
          Gets the nth IComponent in this container.
 int getComponentCount()
          Gets the number of IComponents in this panel.
 ILayout getLayout()
          Gets the layout manager for this container.
 int indexOf(IComponent pComponent)
          Gets the nth position of an IComponent in this container.
 void remove(IComponent pComponent)
          Removes the specified component from this container.
 void remove(int pIndex)
          Removes the IComponent, specified by index, from this container.
 void removeAll()
          Removes all the components from this container.
protected  void removeIntern(java.awt.Component pComponent)
          Internal function, for adding physical component and supporting layers.
 void setLayout(ILayout pLayout)
          Sets the layout manager for this container.
protected  void setLayoutIntern(java.awt.LayoutManager pLayoutManager)
          Internal function, for setting the layout.
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
addComponentListener, addFocusListener, addKeyListener, addMouseListener, capture, componentHidden, componentMoved, componentResized, componentShown, createImage, createMouseEvent, equals, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, focusGained, focusLost, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getHorizontalAlignment, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getToolTipText, getVerticalAlignment, hashCode, invalidateLayout, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFactory, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setTabIndex, setToolTipText, setVerticalAlignment, setVisible, validate
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
getResource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, 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, setStyle, setTabIndex, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

AwtContainer

protected AwtContainer(C pContainer)
Creates a new instance of AwtContainer.

Parameters:
pContainer - AWT Container implementation
Method Detail

getLayout

public ILayout getLayout()
Gets the layout manager for this container.

Specified by:
getLayout in interface IContainer
Returns:
the ILayout
See Also:
ILayout, IContainer.setLayout(javax.rad.ui.ILayout)

setLayout

public void setLayout(ILayout pLayout)
Sets the layout manager for this container.

Specified by:
setLayout in interface IContainer
Parameters:
pLayout - the specified layout manager
See Also:
ILayout, IContainer.getLayout()

add

public void add(IComponent pComponent)
Adds the specified IComponent to the end of this container.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
See Also:
IComponent

add

public void add(IComponent pComponent,
                java.lang.Object pConstraints)
Adds the specified IComponent to the end of this container. Also notifies the layout manager to add the component to this container's layout using the specified constraints object.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
pConstraints - an object expressing layout contraints for this component
See Also:
IComponent

add

public void add(IComponent pComponent,
                int pIndex)
Adds the specified IComponent to this container at the specified index. Also notifies the layout manager to add the component to the this container's layout.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
pIndex - the position in the container's list at which to insert the IComponent; -1 means insert at the end component
See Also:
IComponent

add

public void add(IComponent pComponent,
                java.lang.Object pConstraints,
                int pIndex)
Adds the specified IComponent to this container with the specified constraints at the specified index. Also notifies the layout manager to add the component to the this container's layout using the specified constraints object.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
pConstraints - an object expressing layout contraints for this
pIndex - the position in the container's list at which to insert the IComponent; -1 means insert at the end component
See Also:
IComponent

remove

public void remove(int pIndex)
Removes the IComponent, specified by index, from this container. This method also notifies the layout manager to remove the component from this container's layout via the removeLayoutComponent method.

Specified by:
remove in interface IContainer
Parameters:
pIndex - the index of the IComponent to be removed
See Also:
IContainer.add(javax.rad.ui.IComponent), IContainer.getComponentCount()

remove

public void remove(IComponent pComponent)
Removes the specified component from this container.

Specified by:
remove in interface IContainer
Parameters:
pComponent - the IComponent to be removed
See Also:
IContainer.add(javax.rad.ui.IComponent), IContainer.remove(int)

removeAll

public void removeAll()
Removes all the components from this container. This method also notifies the layout manager to remove the components from this container's layout via the removeLayoutComponent method.

Specified by:
removeAll in interface IContainer
See Also:
IContainer.add(javax.rad.ui.IComponent), IContainer.remove(int)

getComponentCount

public int getComponentCount()
Gets the number of IComponents in this panel.

Specified by:
getComponentCount in interface IContainer
Returns:
the number of components in this panel.
See Also:
IContainer.getComponent(int)

getComponent

public IComponent getComponent(int pIndex)
Gets the nth IComponent in this container.

Specified by:
getComponent in interface IContainer
Parameters:
pIndex - the index of the IComponent to get.
Returns:
the nth component in this container.

indexOf

public int indexOf(IComponent pComponent)
Gets the nth position of an IComponent in this container.

Specified by:
indexOf in interface IContainer
Parameters:
pComponent - the IComponent to search
Returns:
the nth position of pComponent in this container or -1 if pComponent is not added

checkAdd

protected void checkAdd(IComponent pComponent,
                        java.lang.Object pConstraints,
                        int pIndex)
Checks if it's allowed to add a specific component to this container.

Parameters:
pComponent - the component to be added
pConstraints - an object expressing layout constraints
pIndex - the position in the container's list at which to insert the IComponent; -1 means insert at the end component

setLayoutIntern

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

Parameters:
pLayoutManager - the layout

addIntern

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

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:
add(IComponent, Object, int)

removeIntern

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

Parameters:
pComponent - the Component to be removed
See Also:
remove(int)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.