|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jmex.bui.BComponent
com.jmex.bui.BContainer
public class BContainer
A user interface element that is meant to contain other interface elements.
| Nested Class Summary | |
|---|---|
protected static interface |
BContainer.ChildOp
Used in wasAdded() and wasRemoved(). |
| Field Summary | |
|---|---|
protected ArrayList<BComponent> |
_children
|
protected BLayoutManager |
_layout
|
| Fields inherited from class com.jmex.bui.BComponent |
|---|
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Constructor Summary | |
|---|---|
BContainer()
Creates a container with no layout manager. |
|
BContainer(BLayoutManager layout)
Creates a container with the supplied layout manager. |
|
| Method Summary | |
|---|---|
void |
add(BComponent child)
Adds a child to this container. |
void |
add(BComponent child,
Object constraints)
Adds a child to this container with the specified layout constraints. |
void |
add(int index,
BComponent child)
Adds a child to this container at the specified position. |
void |
add(int index,
BComponent child,
Object constraints)
Adds a child to this container at the specified position, with the specified layout constraints. |
protected void |
applyOperation(BContainer.ChildOp op)
Applies an operation to all of our children. |
protected Dimension |
computePreferredSize(int whint,
int hhint)
Computes and returns a preferred size for this component. |
BComponent |
getComponent(int index)
Returns the indexth component from this container. |
int |
getComponentCount()
Returns the number of components contained in this container. |
int |
getComponentIndex(BComponent component)
Returns the index of the specified component in this container or -1 if the component count not be found. |
protected String |
getDefaultStyleClass()
Returns the default stylesheet class to be used for all instances of this component. |
BComponent |
getHitComponent(int mx,
int my)
Returns the component "hit" by the specified mouse coordinates which might be this component or any of its children. |
BLayoutManager |
getLayoutManager()
Returns the layout manager configured for this container. |
protected BComponent |
getNextFocus(BComponent current)
Returns the next component that should receive focus in this container given the current focus owner. |
protected BComponent |
getPreviousFocus(BComponent current)
Returns the previous component that should receive focus in this container given the current focus owner. |
protected void |
layout()
Instructs this component to lay itself out. |
void |
remove(BComponent child)
Removes the specified child from this container. |
void |
remove(int index)
Removes the child at a specific position from this container. |
void |
removeAll()
Removes all children of this container. |
protected void |
renderComponent(Renderer renderer)
Renders any custom bits for this component. |
boolean |
replace(BComponent oldc,
BComponent newc)
Replaces a given old component with a new component (if the old component exits). |
void |
setAlpha(float alpha)
Sets the alpha level for this component. |
void |
setEnabled(boolean enabled)
Sets this components enabled state. |
void |
setLayoutManager(BLayoutManager layout)
Configures this container with an entity that will set the size and position of its children. |
void |
setVisible(boolean visible)
Sets this component's visibility state. |
void |
validate()
Instructs this component to lay itself out and then mark itself as valid. |
protected void |
wasAdded()
This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up). |
protected void |
wasRemoved()
This method is called when we are removed from a hierarchy that is connected to a top-level window. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList<BComponent> _children
protected BLayoutManager _layout
| Constructor Detail |
|---|
public BContainer()
setLayoutManager(com.jmex.bui.layout.BLayoutManager).
public BContainer(BLayoutManager layout)
| Method Detail |
|---|
public void setLayoutManager(BLayoutManager layout)
public BLayoutManager getLayoutManager()
public void add(BComponent child)
public void add(int index,
BComponent child)
public void add(BComponent child,
Object constraints)
public void add(int index,
BComponent child,
Object constraints)
public void remove(int index)
public boolean replace(BComponent oldc,
BComponent newc)
public void remove(BComponent child)
public int getComponentCount()
public BComponent getComponent(int index)
indexth component from this container.
public int getComponentIndex(BComponent component)
public void removeAll()
public void setAlpha(float alpha)
BComponent
setAlpha in class BComponentpublic void setEnabled(boolean enabled)
BComponent
setEnabled in class BComponentpublic void setVisible(boolean visible)
BComponent
setVisible in class BComponent
public BComponent getHitComponent(int mx,
int my)
BComponent
getHitComponent in class BComponentpublic void validate()
BComponent
validate in class BComponentprotected String getDefaultStyleClass()
BComponent
getDefaultStyleClass in class BComponentprotected void layout()
BComponent
layout in class BComponentprotected void renderComponent(Renderer renderer)
BComponent
renderComponent in class BComponent
protected Dimension computePreferredSize(int whint,
int hhint)
BComponent
computePreferredSize in class BComponentprotected void wasAdded()
BComponent
wasAdded in class BComponentprotected void wasRemoved()
BComponentBComponent.wasAdded(), this is a fine place
to do so.
wasRemoved in class BComponentprotected BComponent getNextFocus(BComponent current)
BComponent.getNextFocus() to search further up the hierarchy.
protected BComponent getPreviousFocus(BComponent current)
BComponent.getPreviousFocus() to search further up the hierarchy.
protected void applyOperation(BContainer.ChildOp op)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||