public class IlvBasicTimeScaleVisibilityPolicy extends Object implements IlvTimeScaleVisibilityPolicy
IlvTimeScale
.
This policy determines which rows are visible when the time scale
is resized, based on visibility predicates applied to the
paint context object.
This policy keeps track of each visibility predicate in a specified order,
with its set of visible rows.
When asked to adjust the visibility of the rows, the first visibility
predicate that evaluates to true
is the one used for adjusting
the rows.
A particular IlvBasicTimeScaleVisibilityPolicy
instance is tied
to a specific IlvTimeScale
.
IlvTimeScale.setVisibilityPolicy(ilog.views.gantt.scale.IlvTimeScaleVisibilityPolicy)
,
IlvVisibleTimeScaleRows
Constructor and Description |
---|
IlvBasicTimeScaleVisibilityPolicy()
Initializes a new
IlvBasicTimeScaleVisibilityPolicy . |
Modifier and Type | Method and Description |
---|---|
void |
addVisibleTimeScaleRows(IlvVisibleTimeScaleRows visibleTsRows)
Appends a
IlvVisibleTimeScaleRows object to the list
of visible time scale rows. |
void |
adjustRows(Graphics dst,
IlvTimeScale.PaintContext context)
Adjusts the visible time scale rows for the specified time scale.
|
IlvVisibleTimeScaleRows |
getVisibleTimeScaleRows(int index)
Returns the visibility predicate and its associated visible rows defined
at the specified index in this visibility policy.
|
int |
getVisibleTimeScaleRowsSize()
Returns the number of defined visible time scale rows contained in the
visibility policy.
|
void |
insertVisibleTimeScaleRowsAt(IlvVisibleTimeScaleRows visibleTsRows,
int index)
Inserts a
IlvVisibleTimeScaleRows at the specified
index in the list of visible time scale rows. |
void |
rowsChanged(IlvTimeScale timeScale)
This method is called when some rows of the time scale have changed.
|
void |
setVisibleTimeScaleRows(int index,
IlvVisibleTimeScaleRows visibleTsRows)
Sets an
IlvVisibleTimeScaleRows at the specified index in the
list of IlvVisibleTimeScaleRows . |
protected void |
updateRows(IlvTimeScale timeScale,
int index)
Updates the rows in the time scale.
|
public IlvBasicTimeScaleVisibilityPolicy()
IlvBasicTimeScaleVisibilityPolicy
.public int getVisibleTimeScaleRowsSize()
public IlvVisibleTimeScaleRows getVisibleTimeScaleRows(int index)
null
is returned.index
- The index of the visible time scale rows.IndexOutOfBoundsException
- if index < 0
.public void addVisibleTimeScaleRows(IlvVisibleTimeScaleRows visibleTsRows)
IlvVisibleTimeScaleRows
object to the list
of visible time scale rows.visibleTsRows
- The visibility predicate and its associated
visible rows to be appended.public void insertVisibleTimeScaleRowsAt(IlvVisibleTimeScaleRows visibleTsRows, int index)
IlvVisibleTimeScaleRows
at the specified
index in the list of visible time scale rows. The
IlvVisibleTimeScaleRows
at that position and all subsequent
IlvVisibleTimeScaleRows
are
shifted to the right, having their indices incremented.visibleTsRows
- The visible time scale rows to be inserted.index
- The index to insert the visible rows at.IndexOutOfBoundsException
- if index < 0 || index >
getVisibleTimeScaleRowsSize()
.public void setVisibleTimeScaleRows(int index, IlvVisibleTimeScaleRows visibleTsRows)
IlvVisibleTimeScaleRows
at the specified index in the
list of IlvVisibleTimeScaleRows
. The old visible time scale
rows at this position will be removed. If the position is greater than
the last visible time scale rows position, null
visible
time scale rows are added in-between.index
- The index at which the IlvVisibleTimeScaleRows
should be set.visibleTsRows
- The visible time scale rows to be set.IndexOutOfBoundsException
- if index < 0
.public void adjustRows(Graphics dst, IlvTimeScale.PaintContext context)
updateRows(ilog.views.gantt.scale.IlvTimeScale, int)
method.adjustRows
in interface IlvTimeScaleVisibilityPolicy
dst
- The destination graphics, can be null
.context
- The IlvTimeScale.PaintContext
context in which
the time scale paints.protected void updateRows(IlvTimeScale timeScale, int index)
IlvVisibleTimeScaleRows
, and changes the time scale rows.timeScale
- The time scale.index
- The index in the visible time scale rows where to get the
visible rows from.public void rowsChanged(IlvTimeScale timeScale)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.