java.lang.Object
jcurses.widgets.GridLayoutManager
- All Implemented Interfaces:
- LayoutManager, WidgetsConstants
- public class GridLayoutManager
- extends java.lang.Object
- implements LayoutManager, WidgetsConstants
This class is a layout manager that works like as the DefaultLayoutManager
with an difference: the painting rectangle is shared in many grid cells and the constraints
are stated not in real coodinates on the painting rectangle, but in 'grid-coordinates'
|
Method Summary |
void |
addWidget(Widget widget,
int x,
int y,
int width,
int height,
int verticalConstraint,
int horizontalConstraint)
Adds a widget to the boundeb container |
void |
bindToContainer(WidgetContainer container)
The method is called by framework by binding the layout manager
to an container. |
void |
layout(Widget widget,
java.lang.Object constraint)
The method layouts a widget within a container, dependet of layouting constraints. |
void |
removeWidget(Widget widget)
Removes a widget |
void |
unbindFromContainer()
The method is called by framework by unbinding the layout manager
from its container. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_defLayout
private DefaultLayoutManager _defLayout
_father
private WidgetContainer _father
_width
private int _width
_height
private int _height
_grid
private Grid _grid
GridLayoutManager
public GridLayoutManager(int width,
int height)
- The constructor
bindToContainer
public void bindToContainer(WidgetContainer container)
- Description copied from interface:
LayoutManager
- The method is called by framework by binding the layout manager
to an container. The implementing class must register, whether this is
already bound or not, and throw an exception by a try to bind it second time.
This is because the framework restricts, that a lyout manager can be bound only
to one container at a time.
- Specified by:
bindToContainer in interface LayoutManager
unbindFromContainer
public void unbindFromContainer()
- Description copied from interface:
LayoutManager
- The method is called by framework by unbinding the layout manager
from its container. The implementing class must register, whether this is
already bound or not, and throw an exception by a try to bind it second time.
This is because the framework restricts, that a lyout manager can be bound only
to one container at a time.
- Specified by:
unbindFromContainer in interface LayoutManager
layout
public void layout(Widget widget,
java.lang.Object constraint)
- Description copied from interface:
LayoutManager
- The method layouts a widget within a container, dependet of layouting constraints.
- Specified by:
layout in interface LayoutManager
addWidget
public void addWidget(Widget widget,
int x,
int y,
int width,
int height,
int verticalConstraint,
int horizontalConstraint)
- Adds a widget to the boundeb container
removeWidget
public void removeWidget(Widget widget)
- Removes a widget