public interface IlvTimeScrollable
IlvTimeScrollable
interface defines the behavior of a component whose
time interval can be scrolled. Two scrolling modes are supported:
minimum visible time
and the maximum visible time
. Both values
must be valid and non-null.
In bounded scrolling mode there are four interrelated time properties: minVisibleTime, maxVisibleTime, visibleTime, and visibleDuration. These four values define two nested ranges like this:
minVisibleTime <= visibleTime <= visibleTime+visibleDuration <= maxVisibleTime
The time-scrollable component enforces this relationship by correcting or trimming properties according to the following rules:
setMinVisibleTime(java.util.Date)
and setMaxVisibleTime(java.util.Date)
methods first validate that:
minVisibleTime <= maxVisibleTime
If not, an IllegalArgumentException
is thrown. Next,
the visible time and visible duration properties may be trimmed (in
that order), to fit within the new min-max interval.
setVisibleTime(java.util.Date)
and setVisibleDuration(ilog.views.gantt.IlvDuration)
methods
trim their argument to fit within the limits defined by the other
three properties. For example if
maxVisibleTime.equals(visibleTime.add(IlvDuration.ONE_DAY))
, then setVisibleDuration(IlvDuration.ONE_WEEK)
would change the duration to IlvDuration.ONE_DAY
.
The time-scrollable component should use the
IlvTimeScrollUtil.trimInterval(ilog.views.gantt.IlvTimeInterval, java.util.Date, java.util.Date, ilog.views.gantt.IlvDuration)
method to perform consistent
validation and trimming of the time value arguments.
minimum visible time
and the
maximum visible time
are undefined and are
set to null
. Even in unbounded scrolling mode, there is
an inherent limitation on the
minimum
and maximum
times that can be
scrolled to. As in bounded scrolling mode, this can be enforced by
having the time-scrollable component use the
IlvTimeScrollUtil.trimInterval(ilog.views.gantt.IlvTimeInterval, java.util.Date, java.util.Date, ilog.views.gantt.IlvDuration)
method to perform validation and
trimming of the time value arguments.
Each time-scrollable that is a user interface component is responsible for updating its
own duration value in order to maintain a constant zoom factor when it is resized.
Swing resizes user interface components with indeterminate timing and this avoids
potential time interval desynchronization across multiple components in the same
interface. When a time-scrollable component is resized it must fire a VisibleDurationChangedEvent
that has been created with viewResized=true
.
Modifier and Type | Field and Description |
---|---|
static IlvDuration |
DEFAULT_MINIMUM_DURATION
The default minimum duration that a time scrollable can show.
|
Modifier and Type | Method and Description |
---|---|
void |
addTimeScrollListener(TimeScrollListener listener)
Adds the specified listener to receive visible time and duration events from this
time scrollable.
|
Date |
getMaxVisibleTime()
Returns the maximum time that the time scrollable can show in bounded
scrolling mode.
|
IlvDuration |
getMinVisibleDuration()
Returns the minimum duration that this time scrollable can show.
|
Date |
getMinVisibleTime()
Returns the minimum time that the time scrollable can show in bounded
scrolling mode.
|
IlvDuration |
getVisibleDuration()
Returns the duration of the time interval displayed by the time scrollable.
|
IlvTimeInterval |
getVisibleInterval()
Returns the time interval displayed by the time scrollable.
|
Date |
getVisibleTime()
Returns the beginning of the time interval displayed by the time scrollable.
|
void |
removeTimeScrollListener(TimeScrollListener listener)
Removes the specified listener so that it will no longer receive visible time and
duration events from this time scrollable.
|
void |
setMaxVisibleTime(Date max)
Sets the maximum time that the time scrollable can show in bounded scrolling
mode.
|
void |
setMinVisibleDuration(IlvDuration duration)
Sets the minimum duration that this time scrollable can show.
|
void |
setMinVisibleTime(Date min)
Sets the minimum time that the time scrollable can show in bounded scrolling
mode.
|
void |
setVisibleDuration(IlvDuration duration)
Sets the duration of the time interval displayed by the time scrollable.
|
void |
setVisibleInterval(Date time,
IlvDuration duration)
Sets the time interval displayed by the time scrollable.
|
void |
setVisibleTime(Date time)
Sets the beginning of the time interval displayed by the time scrollable.
|
static final IlvDuration DEFAULT_MINIMUM_DURATION
getMinVisibleDuration()
Date getMinVisibleTime()
null
if the time scrollable is in
unbounded scrolling mode.setMinVisibleTime(java.util.Date)
void setMinVisibleTime(Date min)
time
and duration
are trimmed to fit the new min-max interval by calling the IlvTimeScrollUtil.trimInterval(ilog.views.gantt.IlvTimeInterval, java.util.Date, java.util.Date, ilog.views.gantt.IlvDuration)
method. A minVisibleTimeChanged event
is then fired to all registered listeners
. If min > maxVisibleTime
an
IllegalArgumentException
will be thrown.min
- The minimum visible time or null
to set the time scrollable
to unbounded scrolling mode.getMinVisibleTime()
Date getMaxVisibleTime()
null
if the time scrollable is in
unbounded scrolling mode.setMaxVisibleTime(java.util.Date)
void setMaxVisibleTime(Date max)
time
and duration
are trimmed to fit the new min-max interval by calling the IlvTimeScrollUtil.trimInterval(ilog.views.gantt.IlvTimeInterval, java.util.Date, java.util.Date, ilog.views.gantt.IlvDuration)
method. A maxVisibleTimeChanged event
is then fired to all registered listeners
. If max < minVisibleTime
an
IllegalArgumentException
will be thrown.max
- The maximum visible time or null
to set the time scrollable
to unbounded scrolling mode.getMaxVisibleTime()
IlvDuration getMinVisibleDuration()
setMinVisibleDuration(ilog.views.gantt.IlvDuration)
void setMinVisibleDuration(IlvDuration duration)
duration
- The minimum visible duration.getMinVisibleDuration()
Date getVisibleTime()
setVisibleTime(java.util.Date)
void setVisibleTime(Date time)
min
and
max
visible times and is trimmed if necessary by calling
the IlvTimeScrollUtil.trimInterval(ilog.views.gantt.IlvTimeInterval, java.util.Date, java.util.Date, ilog.views.gantt.IlvDuration)
method. A VisibleTimeChangedEvent
is then fired to all registered listeners
. If you are changing both the visible
time and duration, it is preferable to use the setVisibleInterval(java.util.Date, ilog.views.gantt.IlvDuration)
method
instead.time
- The new time value.getVisibleTime()
IlvDuration getVisibleDuration()
setVisibleDuration(ilog.views.gantt.IlvDuration)
void setVisibleDuration(IlvDuration duration)
min
and max
visible times and is trimmed if necessary by calling the
IlvTimeScrollUtil.trimInterval(ilog.views.gantt.IlvTimeInterval, java.util.Date, java.util.Date, ilog.views.gantt.IlvDuration)
method. A VisibleDurationChangedEvent
is then fired to all registered listeners
. If you are
changing both the visible time and duration, it is preferable to use the setVisibleInterval(java.util.Date, ilog.views.gantt.IlvDuration)
method instead.duration
- The new duration value.getVisibleDuration()
IlvTimeInterval getVisibleInterval()
setVisibleInterval(java.util.Date, ilog.views.gantt.IlvDuration)
void setVisibleInterval(Date time, IlvDuration duration)
min
and max
visible times and is trimmed if necessary by calling the IlvTimeScrollUtil.trimInterval(ilog.views.gantt.IlvTimeInterval, java.util.Date, java.util.Date, ilog.views.gantt.IlvDuration)
method. This method then fires an adjusting VisibleTimeChangedEvent
followed by a VisibleDurationChangedEvent
to all
registered listeners
.time
- The new time value.duration
- The new duration value.void addTimeScrollListener(TimeScrollListener listener)
listener
- The listener that will be subscribed to subsequent time scroll
events.removeTimeScrollListener(ilog.views.gantt.event.TimeScrollListener)
void removeTimeScrollListener(TimeScrollListener listener)
listener
- The listener that will be unsubscribed from receiving time scroll
events.addTimeScrollListener(ilog.views.gantt.event.TimeScrollListener)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.