com.imagero.gui.flowin
Class RowCollection

java.lang.Object
  extended bycom.imagero.gui.flowin.RowCollection

public class RowCollection
extends java.lang.Object

RowCollection. Helps to put and manage Objects in rows.


Constructor Summary
RowCollection()
           
 
Method Summary
 int computeRowHeight(int row, boolean horizontal)
           
 java.lang.Object get(int row, int index)
          get object from specified row and position
 int getRowCount()
          get number of rows in this RowCollection
 int getRowForObject(java.lang.Object o)
          get row number which contains supplied Object
 int getRowSize(int row)
          get number of Objects in row
 void insert(int row, java.lang.Object o)
          insert Object between rows
 void put(int row, java.lang.Object o)
          put supplied Object into row
 java.lang.Object remove(int row, int index)
          remove Object at specified position (index) from given row in RowCollection
 boolean remove(int row, java.lang.Object o)
          remove Object from given row in RowCollection
 boolean remove(java.lang.Object o)
          remove Object from RowCollection
 boolean removeEmptyRows()
          remove empty rows from RowCollection
 int size()
          get number of Objects in all rows
 void sort(int row, java.util.Comparator c)
          sort Objects in row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowCollection

public RowCollection()
Method Detail

computeRowHeight

public int computeRowHeight(int row,
                            boolean horizontal)

get

public java.lang.Object get(int row,
                            int index)
get object from specified row and position

Parameters:
row - row number
index - index of element
Returns:
object or null

getRowCount

public int getRowCount()
get number of rows in this RowCollection

Returns:
row count

getRowForObject

public int getRowForObject(java.lang.Object o)
get row number which contains supplied Object

Parameters:
o - object
Returns:
row number

getRowSize

public int getRowSize(int row)
get number of Objects in row

Parameters:
row - row number
Returns:
number of Objects in row

insert

public void insert(int row,
                   java.lang.Object o)
insert Object between rows

Parameters:
row - row number
o - Object to insert

put

public void put(int row,
                java.lang.Object o)
put supplied Object into row

Parameters:
row - row number
o - Object

remove

public java.lang.Object remove(int row,
                               int index)
remove Object at specified position (index) from given row in RowCollection

Parameters:
row - row from which should be removed Object
index - Object index
Returns:
Object or null

remove

public boolean remove(int row,
                      java.lang.Object o)
remove Object from given row in RowCollection

Parameters:
o - object to remove
Returns:
true if empty row was removed

remove

public boolean remove(java.lang.Object o)
remove Object from RowCollection

Parameters:
o - object to remove
Returns:
true if empty row was removed

removeEmptyRows

public boolean removeEmptyRows()
remove empty rows from RowCollection

Returns:
true if some rows were removed

size

public int size()
get number of Objects in all rows

Returns:
total object count

sort

public void sort(int row,
                 java.util.Comparator c)
sort Objects in row

Parameters:
row - row number
c - Comparator