net.sf.jeppers.grid
Interface RulerModel

All Known Implementing Classes:
AbstractRulerModel

public interface RulerModel

This interface captures the model for handling a component that can be segmented along the horizontal or vertical axis, with each segment size being separately tunable.

Author:
Cameron Zemek

Method Summary
 void addRulerModelListener(RulerModelListener listener)
           
 int getCount()
          Returns the number of entries.
 int getIndex(int position)
          Returns the index of the entry that contains the specified position.
 int getPosition(int index)
          Returns the start position for the specified entry.
 int getSize(int index)
          Returns the size of the specified entry.
 int getTotalSize()
          Returns the total size of the entries.
 void removeRulerModelListener(RulerModelListener listener)
           
 void setSize(int index, int size)
          Sets the size of the specified entry.
 

Method Detail

addRulerModelListener

public void addRulerModelListener(RulerModelListener listener)

removeRulerModelListener

public void removeRulerModelListener(RulerModelListener listener)

getSize

public int getSize(int index)
Returns the size of the specified entry.

Parameters:
index - the index corresponding to the entry
Returns:
the size of the entry

getIndex

public int getIndex(int position)
Returns the index of the entry that contains the specified position.

Parameters:
position - the position of the entry
Returns:
the index of the entry that occupies the specified position

getPosition

public int getPosition(int index)
Returns the start position for the specified entry.

Parameters:
index - the index of the entry whose position is desired
Returns:
the starting position of the specified entry

getCount

public int getCount()
Returns the number of entries.

Returns:
number of entries

setSize

public void setSize(int index,
                    int size)
Sets the size of the specified entry.

Parameters:
index - the index corresponding to the entry
size - the size of the entry

getTotalSize

public int getTotalSize()
Returns the total size of the entries.

Returns:
the total size of the entries