EchoPoint API - 3.0.0b5
App Webcontainer

echopoint
Class BorderLayout

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by echopoint.internal.AbstractContainer
          extended by echopoint.BorderLayout
All Implemented Interfaces:
Serializable, RenderIdSupport

public class BorderLayout
extends AbstractContainer

An implementation of BorderLayout using a HTML table with three rows, and three columns. Note that similar to pane containers, this component supports only one child component per region.

The following shows sample use of this container component.

  import echopoint.BorderLayout;
  import echopoint.HtmlLabel;
  import nextapp.echo.app.Alignment;
  import nextapp.echo.app.Color;
  import nextapp.echo.app.Extent;
  import nextapp.echo.app.layout.TableLayoutData;

    ...
    final BorderLayout container = new BorderLayout();
    container.setWidth( new Extent( 500 ) );

    HtmlLabel label = new HtmlLabel( "North" );
    TableLayoutData layout = new TableLayoutData();
    layout.setAlignment( Alignment.ALIGN_CENTER );
    layout.setBackground( new Color( 0x0000ff ) );
    label.setLayoutData( layout );
    container.add( label, BorderLayout.Region.north );

    ...

    parent.add( container );
 

Since:
3.0.0a11
Version:
$Id: BorderLayout.java 146 2009-04-07 16:00:41Z sptrakesh $
Author:
Rakesh 2009-04-02
See Also:
Serialized Form

Nested Class Summary
static class BorderLayout.Region
          Enumeration for the regions in a border layout.
 
Field Summary
 
Fields inherited from class echopoint.internal.AbstractContainer
ACTION_COMMAND_PROPERTY, ACTION_LISTENERS_CHANGED_PROPERTY, INPUT_ACTION, PROPERTY_ALIGNMENT, PROPERTY_BACKGROUND_IMAGE, PROPERTY_BORDER, PROPERTY_HEIGHT, PROPERTY_INSETS, PROPERTY_WIDTH
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
BorderLayout()
          Default constructor.
BorderLayout(List<Component> list)
          Create a new instance using the specified list of child components in order BorderLayout.Region.north, BorderLayout.Region.west, BorderLayout.Region.center, BorderLayout.Region.east, and BorderLayout.Region.south.
 
Method Summary
 void add(Component component)
          Over-ridden to add the component to BorderLayout.Region.center.
 void add(Component component, BorderLayout.Region region)
          Add the specified child component to the specified region.
 void add(Component component, int index)
          Over-ridden to add the component to BorderLayout.Region.center.
 void dispose()
          Over-ridden to clear the maps used to maintain region to child index relationships.
 Component getComponent(BorderLayout.Region region)
          Return the child component for the specified region.
 
Methods inherited from class echopoint.internal.AbstractContainer
addActionListener, fireActionPerformed, getAlignment, getBackgroundImage, getBorder, getHeight, getInsets, getWidth, hasActionListeners, removeActionListener, setAlignment, setBackgroundImage, setBorder, setHeight, setInsets, setWidth
 
Methods inherited from class nextapp.echo.app.Component
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, processInput, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BorderLayout

public BorderLayout()
Default constructor. No special actions required.


BorderLayout

public BorderLayout(List<Component> list)
Create a new instance using the specified list of child components in order BorderLayout.Region.north, BorderLayout.Region.west, BorderLayout.Region.center, BorderLayout.Region.east, and BorderLayout.Region.south. If the specified list has only one child, it is added to the BorderLayout.Region.center area.

Parameters:
list - The list of child components.
Throws:
IllegalArgumentException - If the list contains more than 5 components.
Method Detail

add

public void add(Component component,
                BorderLayout.Region region)
Add the specified child component to the specified region.

Parameters:
component - The child component to add to the layout container.
region - The region to which the component is to be added.
Throws:
IllegalArgumentException - If a component already exists at the specified region index.

add

public void add(Component component,
                int index)
         throws IllegalChildException
Over-ridden to add the component to BorderLayout.Region.center.

Overrides:
add in class Component
Throws:
IllegalArgumentException - If invoked more than once or if the index is greater than 0.
IllegalChildException

add

public void add(Component component)
Over-ridden to add the component to BorderLayout.Region.center.

Overrides:
add in class Component
Throws:
IllegalArgumentException - If invoked more than once.

getComponent

public Component getComponent(BorderLayout.Region region)
Return the child component for the specified region.

Parameters:
region - The region for which the child component is to be retrieved.
Returns:
Returns the child component or null if no child exists.

dispose

public void dispose()
Over-ridden to clear the maps used to maintain region to child index relationships.

Overrides:
dispose in class Component

EchoPoint API - 3.0.0b5
App Webcontainer