org.omegahat.Graphics.Layouts
Class GridAllocator
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--org.omegahat.Environment.Utils.OrderedTable
|
+--org.omegahat.Graphics.Layouts.BasicAllocator
|
+--org.omegahat.Graphics.Layouts.GridAllocator
- All Implemented Interfaces:
- Activable, AssignableSubset, java.lang.Cloneable, Database, EnumeratedRegionAllocator, java.util.Iterator, java.util.Map, RegionAllocator, java.io.Serializable, ShallowCopyable, Subsettable
- public class GridAllocator
- extends BasicAllocator
- implements RegionAllocator
Lay out regions in a two-way grid of cells,
with each row having the same height and each column
have the same width.
- See Also:
- Serialized Form
| Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
|
Method Summary |
Region |
createRegion(double x,
double y,
double width,
double height)
|
protected RegionDescriptionInt |
createRegionDescription(int i,
int j)
|
void |
make()
|
Region[] |
rectRegions(double widthCM,
double heightCM,
double fontSize)
Compute the cells as rectangular regions associated with this grid
based on the dimensions of the container
it serves, provided to as centimeters and font height. |
RegionDescriptionInt |
setDescription(java.lang.Object which,
GraphicalComponentInt child,
GraphicalContainerInt parent)
General indexing, such as int[] for a GridAllocator,
which is supported differently by the different allocators. |
| Methods inherited from class org.omegahat.Environment.Utils.OrderedTable |
add, add, addListListener, assign, assignSubset, attach, clear, copy, copy, detach, elementAt, exists, get, getName, getState, keys, listeners, listeners, notifyListeners, objects, ordered, orderedKeys, put, put, put, remove, remove, removeElement, removeElement, removeElementAt, removeElementAt, removeListListener, setElementAt, setName, setState, subset, subset, subset |
| Methods inherited from class java.util.Hashtable |
clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, rehash, size, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.omegahat.Environment.Databases.Database |
size |
GridAllocator
public GridAllocator()
GridAllocator
public GridAllocator(int numCols,
int numRows)
- Constructor specifying the number of columns and rows.
GridAllocator
public GridAllocator(int numCols,
int numRows,
boolean make)
make
public void make()
createRegionDescription
protected RegionDescriptionInt createRegionDescription(int i,
int j)
rectRegions
public Region[] rectRegions(double widthCM,
double heightCM,
double fontSize)
- Compute the cells as rectangular regions associated with this grid
based on the dimensions of the container
it serves, provided to as centimeters and font height.
createRegion
public Region createRegion(double x,
double y,
double width,
double height)
setDescription
public RegionDescriptionInt setDescription(java.lang.Object which,
GraphicalComponentInt child,
GraphicalContainerInt parent)
- Description copied from interface:
RegionAllocator
- General indexing, such as int[] for a
GridAllocator,
which is supported differently by the different allocators.
- Specified by:
setDescription in interface RegionAllocator- Overrides:
setDescription in class BasicAllocator