javax.rad.genui
Class UILayout<C extends ILayout<CO>,CO>

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UILayout<C,CO>
Type Parameters:
C - instance of ILayout
CO - type of the constraints.
All Implemented Interfaces:
ILayout<CO>, IResource
Direct Known Subclasses:
UIBorderLayout, UIFlowLayout, UIFormLayout, UIGridLayout

public abstract class UILayout<C extends ILayout<CO>,CO>
extends UIResource<C>
implements ILayout<CO>

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


Field Summary
protected  HashMap<IComponent,CO> componentConstraints
          The constraints for all components used by this layout.
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Constructor Summary
protected UILayout(C pLayout)
          Creates a new instance of UILayout.
 
Method Summary
protected  void addInternalComponent(UIContainer pContainer, UIComponent pComponent)
          Give internal add access for the possibility to have additional "not real" added components with automatic translation.
 void addNotify(UIContainer pContainer)
          The container of this layout is added to ui.
 void componentChanged(UIContainer pContainer, UIComponent pComponent)
          This informs the layout, that the visiblilty of an added component is changed.
 CO getConstraints(IComponent pComp)
          Gets the constraints for the specified IComponent.
protected  CO getConstraintsIntern(IComponent pComp)
          Gets the constraints from the correct ui resource.
 int getHorizontalGap()
          Returns the horizontal gap between components.
 IInsets getMargins()
          Gets the margins.
 int getVerticalGap()
          Returns the vertical gap between components.
protected  void removeInternalComponent(UIContainer pContainer, UIComponent pComponent)
          Give internal remove access for the possibility to have additional "not real" added components with automatic translation.
 void removeNotify(UIContainer pContainer)
          The container of this layout is removed from ui.
 void setConstraints(IComponent pComp, CO pConstraints)
          Sets the constraints for the specified IComponent.
protected  void setConstraintsIntern(IComponent pComp, CO pConstraints)
          Sets the constraints from the correct ui resource.
 void setHorizontalGap(int pHorizontalGap)
          Sets the horizontal gap between components.
 void setMargins(IInsets pMargins)
          Sets the margins.
 void setMargins(int pTop, int pLeft, int pBottom, int pRight)
          Sets the insets with primitive types.
 void setVerticalGap(int pVerticalGap)
          Sets the vertical gap between components.
 
Methods inherited from class javax.rad.genui.UIResource
equals, eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getResource, getUIResource, hashCode, hasResourceHandler, putObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Field Detail

componentConstraints

protected HashMap<IComponent,CO> componentConstraints
The constraints for all components used by this layout.

Constructor Detail

UILayout

protected UILayout(C pLayout)
Creates a new instance of UILayout.

Parameters:
pLayout - the ILayout.
See Also:
ILayout
Method Detail

getConstraints

public CO getConstraints(IComponent pComp)
Gets the constraints for the specified IComponent.

Specified by:
getConstraints in interface ILayout<CO>
Parameters:
pComp - the IComponent to be queried
Returns:
the constraint for the specified IComponent, or null if component is null or is not present in this layout

setConstraints

public void setConstraints(IComponent pComp,
                           CO pConstraints)
Sets the constraints for the specified IComponent.

Specified by:
setConstraints in interface ILayout<CO>
Parameters:
pComp - the IComponent
pConstraints - the new constraints for the specified IComponent.

getMargins

public IInsets getMargins()
Gets the margins.

Specified by:
getMargins in interface ILayout<CO>
Returns:
the margins.

setMargins

public void setMargins(IInsets pMargins)
Sets the margins.

Specified by:
setMargins in interface ILayout<CO>
Parameters:
pMargins - the margins.

setMargins

public void setMargins(int pTop,
                       int pLeft,
                       int pBottom,
                       int pRight)
Sets the insets with primitive types.

Parameters:
pTop - the top insets.
pLeft - the left insets.
pBottom - the bottom insets.
pRight - the right insets.

getHorizontalGap

public int getHorizontalGap()
Returns the horizontal gap between components.

Specified by:
getHorizontalGap in interface ILayout<CO>
Returns:
returns the horizontal gap between components.

setHorizontalGap

public void setHorizontalGap(int pHorizontalGap)
Sets the horizontal gap between components.

Specified by:
setHorizontalGap in interface ILayout<CO>
Parameters:
pHorizontalGap - the horizontal gap between components.

getVerticalGap

public int getVerticalGap()
Returns the vertical gap between components.

Specified by:
getVerticalGap in interface ILayout<CO>
Returns:
returns the vertical gap between components.

setVerticalGap

public void setVerticalGap(int pVerticalGap)
Sets the vertical gap between components.

Specified by:
setVerticalGap in interface ILayout<CO>
Parameters:
pVerticalGap - the vertical gap between components

addNotify

public void addNotify(UIContainer pContainer)
The container of this layout is added to ui.

Parameters:
pContainer - the container

removeNotify

public void removeNotify(UIContainer pContainer)
The container of this layout is removed from ui.

Parameters:
pContainer - the container

componentChanged

public void componentChanged(UIContainer pContainer,
                             UIComponent pComponent)
This informs the layout, that the visiblilty of an added component is changed.

Parameters:
pContainer - the container
pComponent - the component

getConstraintsIntern

protected CO getConstraintsIntern(IComponent pComp)
Gets the constraints from the correct ui resource.

Parameters:
pComp - the component
Returns:
the constraint

setConstraintsIntern

protected void setConstraintsIntern(IComponent pComp,
                                    CO pConstraints)
Sets the constraints from the correct ui resource.

Parameters:
pComp - the component
pConstraints - the constraint

addInternalComponent

protected void addInternalComponent(UIContainer pContainer,
                                    UIComponent pComponent)
Give internal add access for the possibility to have additional "not real" added components with automatic translation.

Parameters:
pContainer - the container where to add internally.
pComponent - the component to add.

removeInternalComponent

protected void removeInternalComponent(UIContainer pContainer,
                                       UIComponent pComponent)
Give internal remove access for the possibility to have additional "not real" added components with automatic translation.

Parameters:
pContainer - the container where to remove internally.
pComponent - the component to remove.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.