de.javagl.swogl.layout
Class GridLayout3D

java.lang.Object
  extended by de.javagl.swogl.layout.GridLayout3D
All Implemented Interfaces:
LayoutManager3D

public class GridLayout3D
extends java.lang.Object
implements LayoutManager3D

An implementation of the LayoutManager3D interface that lays out the SwoglComponents in a grid.


Constructor Summary
GridLayout3D(int rows, int columns)
          Creates a new GridLayout3D that lays out the SwoglComponents of a SwoglContainer in a grid with the given number of rows and columns and with no space between the components.
GridLayout3D(int rows, int columns, int hGap, int vGap)
          Creates a new GridLayout3D that lays out the SwoglComponents of a SwoglContainer in a grid with the given number of rows and columns and with the given spacing between the components.
 
Method Summary
 void doLayout3D()
          Lays out the SwoglComponents in a SwoglContainer
 void setSwoglContainer(SwoglContainer swoglContainer)
          This method will assign the given SwoglContainer to this LayoutManager3D.
 void zoomTo(SwoglComponent swoglComponent)
          Zoom to the given SwoglComponent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridLayout3D

public GridLayout3D(int rows,
                    int columns,
                    int hGap,
                    int vGap)
Creates a new GridLayout3D that lays out the SwoglComponents of a SwoglContainer in a grid with the given number of rows and columns and with the given spacing between the components.

Parameters:
rows - The rows of the grid
columns - The columns of the grid.
hGap - The horizontal gap between components
vGap - The vertical gap between components

GridLayout3D

public GridLayout3D(int rows,
                    int columns)
Creates a new GridLayout3D that lays out the SwoglComponents of a SwoglContainer in a grid with the given number of rows and columns and with no space between the components.

Parameters:
rows - The rows of the grid
columns - The columns of the grid.
Method Detail

setSwoglContainer

public void setSwoglContainer(SwoglContainer swoglContainer)
Description copied from interface: LayoutManager3D
This method will assign the given SwoglContainer to this LayoutManager3D. When this LayoutManager3D is assigned to a SwoglContainer using the SwoglContainer.setLayout3D(LayoutManager3D) method, the SwoglContainer will pass itself to this method. When a different LayoutManager3D is assigned to the SwoglContainer, then the SwoglContainer will call this method and pass 'null' as the argument. This allows implementations of this interface to perform an initialization when this LayoutManager3D becomes assigned to a SwoglContainer, and necessary cleanup operations when they are detached from a SwoglContainer.

Specified by:
setSwoglContainer in interface LayoutManager3D
Parameters:
swoglContainer - The SwoglContainer for this LayoutManager3D

doLayout3D

public void doLayout3D()
Description copied from interface: LayoutManager3D
Lays out the SwoglComponents in a SwoglContainer

Specified by:
doLayout3D in interface LayoutManager3D

zoomTo

public void zoomTo(SwoglComponent swoglComponent)
Zoom to the given SwoglComponent. If the given SwoglComponent is null, then this GridLayout3D will zoom to the overview.

Parameters:
swoglComponent - The SwoglComponent to zoom to.