pagelayout
Class CellVector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Cell>
              extended by pagelayout.CellVector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Cell>, java.util.Collection<Cell>, java.util.List<Cell>, java.util.RandomAccess

public class CellVector
extends java.util.Vector<Cell>

An object of the type CellVector is associated with every cell-container, i.e., a Row or a Column object. It is basically a vector to store the cells that are added to the associated cell-container. However, depending upon the alignment of the row or the column, it transparently inserts suitable flexible gaps whenever a cell is added to it. Thus for example, if the row or the column is justified, it automatically adds a flexible gaps whenever a cell is added to the associated cell-container after the first or before the last addition.

See Also:
Serialized Form

Field Summary
protected  int alignment
          The specified alignment.
protected  Gap flexGap
          The default flexible gap for this object.
static int FLEXGAP
          The preferred length of a flexible gap.
protected static Gap HGAP
          The default flexible horizontal gap.
protected  boolean isCenter
          Is the associated row/colum centered?
protected  boolean isJustified
          Is the associated row/colum justified?
protected  boolean isRight
          Is the associated row/colum right/bottom justified?
protected  boolean noGapsAtEnd
          Does the specified justification require that there be no gaps at the tail end of the vector?
protected static Gap VGAP
          The default flexible vertical gap.
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
protected CellVector(int align, boolean isRow)
          Creates a CellVector for a cell-container with given alignment and orientation.
 
Method Summary
 boolean add(Cell cell)
          Adds a cell to this vector with appropriate flexible gap inserted depending upon the specified alignment.
 void changeAlignment(int newalignment, boolean isRow)
           
 void clear()
           
protected  void init()
           
static boolean isFiller(Cell cell)
           
 void removeElementAt(int i, int n)
           
protected  void removeLastGapIfNeeded()
          Removes the gap at the tail end of the vector if the specified alignment so requires.
 
Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

FLEXGAP

public static final int FLEXGAP
The preferred length of a flexible gap.

See Also:
Constant Field Values

alignment

protected int alignment
The specified alignment.


isCenter

protected boolean isCenter
Is the associated row/colum centered?


isJustified

protected boolean isJustified
Is the associated row/colum justified?


isRight

protected boolean isRight
Is the associated row/colum right/bottom justified?


VGAP

protected static Gap VGAP
The default flexible vertical gap.


HGAP

protected static Gap HGAP
The default flexible horizontal gap.


flexGap

protected Gap flexGap
The default flexible gap for this object.


noGapsAtEnd

protected boolean noGapsAtEnd
Does the specified justification require that there be no gaps at the tail end of the vector?

Constructor Detail

CellVector

protected CellVector(int align,
                     boolean isRow)
Creates a CellVector for a cell-container with given alignment and orientation.

Parameters:
align - specified alignment (horizontal alignment for a row,or vertical alignment for a column).
isRow - true for a row, false otherwise.
Method Detail

init

protected void init()

clear

public void clear()
Specified by:
clear in interface java.util.Collection<Cell>
Specified by:
clear in interface java.util.List<Cell>
Overrides:
clear in class java.util.Vector<Cell>

add

public boolean add(Cell cell)
Adds a cell to this vector with appropriate flexible gap inserted depending upon the specified alignment.

Specified by:
add in interface java.util.Collection<Cell>
Specified by:
add in interface java.util.List<Cell>
Overrides:
add in class java.util.Vector<Cell>
Parameters:
cell - the cell object to be added.
Returns:
true if addition was successful, false otherwise.

removeLastGapIfNeeded

protected void removeLastGapIfNeeded()
Removes the gap at the tail end of the vector if the specified alignment so requires.


isFiller

public static boolean isFiller(Cell cell)

changeAlignment

public void changeAlignment(int newalignment,
                            boolean isRow)

removeElementAt

public void removeElementAt(int i,
                            int n)