thinwire.ui
Interface Container<T extends Component>

All Superinterfaces:
Component, ItemChangeEventComponent
All Known Subinterfaces:
Window
All Known Implementing Classes:
Dialog, FileChooser, Frame, Panel, TabFolder, TabSheet

public interface Container<T extends Component>
extends ItemChangeEventComponent

A Container is a Component that maintains a collection of other Components as a group. Additionally, Container is the foundation of all other container types in the framework such as Panel, Frame, Dialog, TabSheet, etc. It is worth noting that components within a Container, maintain there X and Y coordinates relative to the Container itself. Therefore, a Component with an X value of 5 that is placed in a Container with an X value of 10, will actually be positioned at X coordinate 15.


Nested Class Summary
static class Container.ScrollType
           
 
Field Summary
static java.lang.String PROPERTY_LAYOUT
          Contains the formal property name for the layout manager of the container.
static java.lang.String PROPERTY_SCROLL_TYPE
          Contains the formal property name for the scroll type of the container.
 
Fields inherited from interface thinwire.ui.Component
ACTION_CLICK, ACTION_DOUBLE_CLICK, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_CAPABLE, PROPERTY_HEIGHT, PROPERTY_LIMIT, PROPERTY_USER_OBJECT, PROPERTY_VISIBLE, PROPERTY_WIDTH, PROPERTY_X, PROPERTY_Y
 
Method Summary
 java.util.List<T> getChildren()
          Returns a list of components in the container.
 T getChildWithFocus()
          Get the child Component for this container that currently has the focus.
 T getComponentWithFocus()
          Get the Component at the bottom of the component hiearchy that has the focus.
 int getInnerHeight()
          Returns the usable inner height of the Container.
 int getInnerWidth()
          Returns the usable inner width of the Container.
 Layout getLayout()
          Gets the current layout manager that is responsible for sizing and positioning components of this Container.
 Container.ScrollType getScrollType()
          Gets the current scrollType defined for the Container.
 void setLayout(Layout layout)
          Sets the layout manager that is used to size and position components of this Container.
 void setScrollType(Container.ScrollType scrollType)
          Sets the scrollType for the X and Y axis of this Container.
 
Methods inherited from interface thinwire.ui.ItemChangeEventComponent
addItemChangeListener, removeItemChangeListener
 
Methods inherited from interface thinwire.ui.Component
addActionListener, addActionListener, addDropListener, addDropListener, addKeyPressListener, addKeyPressListener, addPropertyChangeListener, addPropertyChangeListener, fireAction, fireAction, fireAction, fireDrop, fireDrop, fireDrop, fireKeyPress, fireKeyPress, getContainer, getHeight, getLabel, getLimit, getParent, getStyle, getUserObject, getWidth, getX, getY, isEnabled, isFocus, isFocusCapable, isVisible, removeActionListener, removeDropListener, removeKeyPressListener, removePropertyChangeListener, setBounds, setEnabled, setFocus, setFocusCapable, setHeight, setLimit, setPosition, setSize, setUserObject, setVisible, setWidth, setX, setY
 

Field Detail

PROPERTY_SCROLL_TYPE

static final java.lang.String PROPERTY_SCROLL_TYPE
Contains the formal property name for the scroll type of the container.

See Also:
setScrollType(ScrollType), getScrollType(), Container.ScrollType, Constant Field Values

PROPERTY_LAYOUT

static final java.lang.String PROPERTY_LAYOUT
Contains the formal property name for the layout manager of the container.

See Also:
setLayout(Layout), getLayout(), Layout, Constant Field Values
Method Detail

getScrollType

Container.ScrollType getScrollType()
Gets the current scrollType defined for the Container.

Returns:
the current scrollType defined for the Container.

setScrollType

void setScrollType(Container.ScrollType scrollType)
Sets the scrollType for the X and Y axis of this Container. By default the scroll type is ScrollType.NONE.

Parameters:
scrollType - one of the enum ScrollType constants.
See Also:
#PROPERTY_SCROLL, PropertyChangeEvent

getLayout

Layout getLayout()
Gets the current layout manager that is responsible for sizing and positioning components of this Container.

Returns:
the Layout implementation used by this Container.
See Also:
setLayout(Layout), Component.getLimit(), Component.setLimit(Object), Layout

setLayout

void setLayout(Layout layout)
Sets the layout manager that is used to size and position components of this Container. If a Layout is not specified for a container, then you must size and position of the components within a container manually. Default: null (i.e. fixed absolute coordinate positioning)

Parameters:
layout - any class implementing the Layout interface, or null.
See Also:
PROPERTY_LAYOUT, Component.getLimit(), Component.setLimit(Object), Layout, PropertyChangeEvent

getChildren

java.util.List<T> getChildren()
Returns a list of components in the container.

Returns:
this Container's children.

getChildWithFocus

T getChildWithFocus()
Get the child Component for this container that currently has the focus. If this container contains another container and that container contains the Component at the bottom of the component hiearchy with the focus, this method will return the Container contained by this container, not the Component. If you want the component at the bottom of the component hiearchy that has the focus, use getComponentWithFocus().

Returns:
the child Component with focus, or null if there is no child with focus.

getComponentWithFocus

T getComponentWithFocus()
Get the Component at the bottom of the component hiearchy that has the focus. This method first walks up the component hiearchy to find the root Container, then it walks down the hiearchy to locate the component at the bottom of the component hiearchy that has the focus.

Returns:
the Component at the bottom of component hiearchy that has the focus, or null if no component does.

getInnerWidth

int getInnerWidth()
Returns the usable inner width of the Container.

Returns:
the usable inner width of the Container.

getInnerHeight

int getInnerHeight()
Returns the usable inner height of the Container.

Returns:
the usable inner height of the Container.


ThinWire® is a registered of Custom Credit Systems  Copyright © 2007 All rights reserved.
ThinWire_is_Open_Source_under_the_terms_of_the_LGPLv2.1 SourceForge.net_Project_Page java.net_Member Support_ThinWire,_Digg_our_Story