Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jcurses.widgets
Class GridLayoutManager  view GridLayoutManager download GridLayoutManager.java

java.lang.Object
  extended byjcurses.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'


Field Summary
private  DefaultLayoutManager _defLayout
           
private  WidgetContainer _father
           
private  Grid _grid
           
private  int _height
           
private  int _width
           
 
Fields inherited from interface jcurses.widgets.WidgetsConstants
ALIGNMENT_BOTTOM, ALIGNMENT_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_TOP
 
Constructor Summary
GridLayoutManager(int width, int height)
          The constructor
 
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
 

Field Detail

_defLayout

private DefaultLayoutManager _defLayout

_father

private WidgetContainer _father

_width

private int _width

_height

private int _height

_grid

private Grid _grid
Constructor Detail

GridLayoutManager

public GridLayoutManager(int width,
                         int height)
The constructor

Method Detail

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