|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.
This is meant for Scrollable components with a
large number of segments, in which it would be necessary to move
quickly and easily from pixel to logical
units (segments).
The API is an extension of the Intervals API, adding preferred,
minimum, and maximum sizes for each item, a hidden/visible attribute,
and global orientation, margin, and resizing behavior.
| Inner Class Summary | |
static class |
RulerModel.Factory
A factory to clone ruler model objects and create default ones |
| Inner classes inherited from class com.eliad.util.Intervals |
Intervals.Factory |
| Fields inherited from class com.eliad.util.RulerConstants |
AUTO_RESIZE_ALL,
AUTO_RESIZE_LAST,
AUTO_RESIZE_NEXT,
AUTO_RESIZE_OFF,
AUTO_RESIZE_SUBSEQUENT,
HORIZONTAL,
VERTICAL |
| Method Summary | |
void |
addRulerModelListener(RulerModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs. |
java.lang.Object |
clone()
Necessary to allow public access to the clone method. |
int |
getAutoResizeMode()
Returns the resizing mode of the ruler. |
int |
getDraggingDistance()
Returns the distance that the "dragged" items are from their normal position. |
int |
getFirstDraggingItem()
Returns the first of a continuous range of items that should be considered "dragged" out of its normal position. |
int |
getIndex(int position)
Returns the index of the entry that corresponds to the specified position. |
int |
getLastDraggingItem()
Returns the last of a continuous range of items that should be considered "dragged" out of its normal position. |
int |
getMargin()
Returns the global margin value |
int |
getMaxSize(int index)
Returns the maximum size of a specific entry. |
int |
getMinSize(int index)
Returns the minimum size of a specific entry. |
int |
getOrientation()
Returns the orientation of the ruler. |
int |
getPreferredSize(int index)
Returns the preferred size of a specific entry. |
int |
getScrollableBlockIncrement(int start,
int length,
int direction)
Returns the scroll increment (in pixels) that completely exposes one new "page". |
int |
getScrollableUnitIncrement(int start,
int length,
int direction)
Returns the scroll increment (in pixels) that completely exposes one new item. |
int |
getSize(int i)
Returns the size of the specified entry. |
int |
getTotalMaxSize()
Returns the total maximum size of the items in the most optimized way |
int |
getTotalMinSize()
Returns the total minimum size of the items in the most optimized way |
int |
getTotalPreferredSize()
Returns the total preferred size of the items in the most optimized way |
int |
getTotalSize()
Returns the total size of the items in the most optimized way |
void |
insertEntries(int start,
int count,
int value)
Adds a continuous group of entries to this Intervals.
|
void |
insertEntries(int start,
int count,
int value,
boolean visible)
Adds a continuous group of entries to this Intervals. |
boolean |
isResizable(int index)
Returns the resizable attribute for a specific item. |
boolean |
isVisible(int index)
Returns true if the item with the given index is visible. |
void |
removeRulerModelListener(RulerModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs. |
void |
resetDragging()
Resets all dragging parameters. |
void |
setActiveRange(int start,
int count)
For an implementation about the area of interest, where subsequent queries should be answered very efficiently Invoke this method each time the bounds of the component
change.
|
void |
setAutoResizeMode(int mode)
Sets the resizing mode of the ruler. |
void |
setDraggingDistance(int d)
Sets the distance the "dragged" items are from their normal position. |
void |
setFirstDraggingItem(int index)
Sets the first of a continuous range of items that have been "dragged" out of its normal position. |
void |
setLastDraggingItem(int index)
Sets the last of a continuous range of items that have been "dragged" out of its normal position. |
void |
setMargin(int m)
Sets the global margin value |
int |
setMaxSize(int index,
int maxSize)
Sets the maximum size of a specific entry but must leave all sizes consistent. |
int |
setMinSize(int index,
int minSize)
Sets the minimum size of a specific entry but must leave all sizes consistent. |
int |
setPreferredSize(int index,
int size)
Sets the preferred size of a specific entry which must be constrained between the minimum and maximum sizes. |
void |
setResizable(int index,
boolean flag)
Allows to interactively change the resizable attribute for a specific item. |
void |
setSize(int i,
int size)
Sets the size of the specified entry. |
void |
setUniformMaxSize(int maxSize)
Sets a uniform maximum size for all entries. |
void |
setUniformMinSize(int minSize)
Sets a uniform minimum size for all entries. |
void |
setVisible(int index,
boolean flag)
Set the visible property of an item. |
void |
sizeToFit(int totalSize)
Handles global resizing |
| Methods inherited from interface com.eliad.util.Intervals |
getCount,
getDefaultSize,
getPosition,
getSizes,
hasFixedSize,
removeEntries,
setFixedSize,
setSizes |
| Methods inherited from interface com.eliad.model.GridModelListener |
gridDataChanged,
gridModelChanged,
gridStructureChanged |
| Methods inherited from interface java.beans.PropertyChangeListener |
propertyChange |
| Method Detail |
public int getSize(int i)
Intervals API,
but with slightly different post-conditions.i - the index corresponding to the entry
public void setSize(int i,
int size)
Intervals API,
but with slightly different post-conditions.
Implementation must coerce the value between the minimum and maximum
sizes to preserve the invariants.
If the item is not visible, it stays that way, the method call only affects the size that it will be once it is made visible again.
i - the index corresponding to the entrysize - the size of the entrypublic int getIndex(int position)
Intervals API,
but with slightly enhanced post-conditions.position - the position of the entryIntervals.getIndex(int)public int getOrientation()
RulerConstants.HORIZONTAL || return == RulerConstants.VERTICALRulerConstants
public int getScrollableUnitIncrement(int start,
int length,
int direction)
This method is called each time the user requests a unit scroll.
start - the start of the view area visible within the viewportlength - the length of the view area visible within the viewportdirection - less than zero to scroll up/left,
greater than zero for down/rightScrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)
public int getScrollableBlockIncrement(int start,
int length,
int direction)
This method is called each time the user requests a page scroll.
start - the start of the view area visible within the viewportlength - the length of the view area visible within the viewportdirection - less than zero to scroll up/left,
greater than zero for down/rightScrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)public int getAutoResizeMode()
public void setAutoResizeMode(int mode)
mode - The resize mode.
May be one of those values:public int getPreferredSize(int index)
index - the index of the entry.Intervals.getIndex(int)
public int setPreferredSize(int index,
int size)
index - the index of the entry. Should be non-negative.size - the preferred size of the entryIntervals.getIndex(int)public int getMinSize(int index)
index - the index of the entry. Should be non-negative.
public int setMinSize(int index,
int minSize)
index - the index of the entry.minSize - the minimum size of the entryIntervals.getIndex(int)public void setUniformMinSize(int minSize)
minSize - the uniform minimum sizepublic int getMaxSize(int index)
index - the index of the entry.
public int setMaxSize(int index,
int maxSize)
index - the index of the entry.maxSize - the maximum size of the entryIntervals.getIndex(int)public void setUniformMaxSize(int maxSize)
maxSize - the uniform maximum sizepublic boolean isResizable(int index)
index - the index of the item
public void setResizable(int index,
boolean flag)
index - the index of the itemflag - whether the user will be allowed to resize this item,
subject to the overall resizing strategy
and the minimum and maximum size constraintspublic int getMargin()
public void setMargin(int m)
m - the number of empty pixels between any two items
This will be subtracted from the item sizes, so
it should be nonnegative, but smaller than the
least of the minimum sizespublic int getTotalSize()
public int getTotalMinSize()
public int getTotalPreferredSize()
public int getTotalMaxSize()
public void setActiveRange(int start,
int count)
Invoke this method each time the bounds of the component
change.
start - the start of the range where we want subsequent queriescount - the length of the range where we want subsequent queriespublic boolean isVisible(int index)
index - the index where we want to know the visible property
public void setVisible(int index,
boolean flag)
index - the index where we want to set the visible propertyflag - the visible property for the indexpublic void sizeToFit(int totalSize)
totalSize - The size we want to fit intoRulerSizeManager.sizeToFit(int),
Container.doLayout()public int getFirstDraggingItem()
public int getLastDraggingItem()
public int getDraggingDistance()
public void setFirstDraggingItem(int index)
index - the index of the first dragged itempublic void setLastDraggingItem(int index)
index - the index of the last dragged itempublic void setDraggingDistance(int d)
d - the number of size units (presumably pixels) between the actual
position of the dragged items and their normal position as
given by getPositionpublic void resetDragging()
public void insertEntries(int start,
int count,
int value,
boolean visible)
Intervals.start - the index to be assigned to the first entry
in the groupcount - the number of entries in the groupvalue - the size to be assigned to each new entryvisible - whether the new entries are initially visible
public void insertEntries(int start,
int count,
int value)
Intervals.
This method is a part of the Intervals interface.
It should be equivalent to:insertEntries(start,count,value,true);
start - the index to be assigned to the first entry
in the groupcount - the number of entries in the groupvalue - the size to be assigned to each new entrypublic void addRulerModelListener(RulerModelListener l)
l - the RulerModelListenerRulerModelEvent,
RulerModelListenerpublic void removeRulerModelListener(RulerModelListener l)
addXXX
function.l - the RulerModelListenerRulerModelEvent,
RulerModelListener
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||