public class IlvTimeScrollUtil extends Object
IlvTimeScrollUtil
class consists of static methods that
are of general use when working with IlvTimeScrollable
objects.
This class is a singleton and instances of this class cannot be created.Modifier and Type | Field and Description |
---|---|
static IlvDuration |
DEFAULT_DURATION
The default scrollable duration.
|
static Date |
DEFAULT_TIME
The default scrollable time.
|
Modifier and Type | Method and Description |
---|---|
static Date |
getMaxUnboundedTime()
Returns the maximum scrollable time for components that are in unbounded
scrolling mode.
|
static Date |
getMinUnboundedTime()
Returns the minimum scrollable time for components that are in unbounded
scrolling mode.
|
static long |
getPosition(Date t,
IlvTimeConverter timeConverter,
double x0,
double x11)
Returns the x position, in pixels, that corresponds to the specified time.
|
static long |
getPosition(Date t,
IlvTimeConverter timeConverter,
IlvTransformer transform)
Returns the x position, in pixels, that corresponds to the specified time.
|
static Date |
getTime(long x,
IlvTimeConverter timeConverter,
double x0,
double x11)
Returns the time that corresponds to the specified x position.
|
static Date |
getTime(long x,
IlvTimeConverter timeConverter,
IlvTransformer transform)
Returns the time that corresponds to the specified x position.
|
static double |
getX0(IlvTimeConverter timeConverter,
Date startTime,
int viewStart,
double x11)
Computes the offset used to transform an x position in world coordinates to its
corresponding position in pixel display coordinates.
|
static double |
getX0(IlvTimeConverter timeConverter,
Date startTime,
int viewStart,
int viewWidth,
double x11)
Computes the offset used to transform an x position in world coordinates to its
corresponding position in pixel display coordinates.
|
static double |
getX11(IlvTimeConverter timeConverter,
Date startTime,
IlvDuration duration,
int viewWidth)
Computes the scaling factor used to transform an x position in world coordinates to
its corresponding position in pixel display coordinates.
|
static IlvTimeInterval |
trimInterval(Date start,
IlvDuration duration,
Date min,
Date max)
Deprecated.
Beginning with Perforce JViews 8.5, use the
trimInterval(Date, IlvDuration, Date, Date, IlvDuration)
method instead. |
static IlvTimeInterval |
trimInterval(Date start,
IlvDuration duration,
Date min,
Date max,
IlvDuration minDuration)
Constrains the specified time interval to fit within the specified
minimum/maximum range.
|
static void |
trimInterval(IlvTimeInterval interval,
Date min,
Date max)
Deprecated.
Beginning with Perforce JViews 8.5, use the
trimInterval(IlvTimeInterval, Date, Date, IlvDuration)
method instead. |
static void |
trimInterval(IlvTimeInterval interval,
Date min,
Date max,
IlvDuration minDuration)
Constrains the specified time interval to fit within the specified
minimum/maximum range.
|
static IlvTimeInterval |
trimInterval(IlvTimeScrollable scrollable,
Date start,
IlvDuration duration)
Constrains the specified time interval to fit within the specified
scrollable's min/max range. |
static void |
trimInterval(IlvTimeScrollable scrollable,
IlvTimeInterval interval)
Constrains the specified time interval to fit within the specified
scrollable's min/max range. |
public static final Date DEFAULT_TIME
public static final IlvDuration DEFAULT_DURATION
public static double getX0(IlvTimeConverter timeConverter, Date startTime, int viewStart, double x11)
viewStart
and the beginning of the time interval in world
coordinates multiplied by the x11
scaling factor. This value aligns the beginning of the time interval
with viewStart
in screen coordinates.
Therefore, this method is only valid for left-to-right orientations and when
x11
is positive. Use getX0(IlvTimeConverter, Date, int, int, double)
instead if you need to support both left-to-right and right-to-left orientations.timeConverter
- The timeConverter that converts between world coordinates and
time.startTime
- The beginning of the time interval.viewStart
- The beginning of the view in screen coordinates.x11
- The scaling factor used to transform an x position in world
coordinates to its corresponding position in pixel display
coordinates. The value must be positive.getX0(IlvTimeConverter, Date, int, int, double)
,
getX11(IlvTimeConverter, Date, IlvDuration, int)
public static double getX0(IlvTimeConverter timeConverter, Date startTime, int viewStart, int viewWidth, double x11)
viewStart
and the beginning of the time interval in world coordinates
multiplied by the x11
scaling factor, and aligns the beginning of the time interval
with viewStart
in screen coordinates. For right-to-left orientations,
this is expressed as viewWidth
plus the screen coordinate offset between
viewStart
and the beginning of the time interval in world coordinates multiplied
by the x11
scaling factor, and aligns the beginning of the time interval with
viewStart+viewWidth
in screen coordinates.
The orientation is specified by the polarity of x11
.timeConverter
- The timeConverter that converts between world coordinates and
time.startTime
- The beginning of the time interval.viewStart
- The beginning of the view in screen coordinates.viewWidth
- The width of the view in screen coordinates.x11
- The scaling factor used to transform an x position in world
coordinates to its corresponding position in pixel display
coordinates. A positive value indicates left-to-right
orientation and a negative value indicates right-to-left
orientation.getX0(IlvTimeConverter, Date, int, double)
,
getX11(IlvTimeConverter, Date, IlvDuration, int)
public static double getX11(IlvTimeConverter timeConverter, Date startTime, IlvDuration duration, int viewWidth)
The value returned by this method will always be positive and represents the scaling factor for left-to-right orientations. Negate the returned value to obtain the scaling factor for right-to-left orientations.
timeConverter
- The time converter that converts between world coordinates and
time.startTime
- The beginning of the time interval.duration
- The duration of the time interval.viewWidth
- The width of the view in screen coordinates.getX0(IlvTimeConverter, Date, int, double)
,
getX0(IlvTimeConverter, Date, int, int, double)
public static Date getTime(long x, IlvTimeConverter timeConverter, double x0, double x11)
x
- The position defined in pixels.timeConverter
- The time converter that converts between world
coordinates and time.x0
- The offset used to transform an x position in world coordinates
to its corresponding position in pixel display coordinates.x11
- The scaling factor used to transform an x position in world
coordinates to its corresponding position in pixel display coordinates.getPosition(java.util.Date, ilog.views.gantt.graphic.IlvTimeConverter, double, double)
public static Date getTime(long x, IlvTimeConverter timeConverter, IlvTransformer transform)
x
- The position defined in pixels.timeConverter
- The time converter that converts between world
coordinates and time.transform
- The transformer from world coordinates to pixel display
coordinates.getPosition(java.util.Date, ilog.views.gantt.graphic.IlvTimeConverter, double, double)
public static long getPosition(Date t, IlvTimeConverter timeConverter, double x0, double x11)
t
- The time.timeConverter
- The time converter that converts between world
coordinates and time.x0
- The offset used to transform an x position in world coordinates
to its corresponding position in pixel display coordinates.x11
- The scaling factor used to transform an x position in world
coordinates to its corresponding position in pixel display coordinates.getTime(long, ilog.views.gantt.graphic.IlvTimeConverter, double, double)
public static long getPosition(Date t, IlvTimeConverter timeConverter, IlvTransformer transform)
t
- The time.timeConverter
- The time converter that converts between world
coordinates and time.transform
- The transformer from world coordinates to pixel display
coordinates.getTime(long, ilog.views.gantt.graphic.IlvTimeConverter, double, double)
public static Date getMinUnboundedTime()
public static Date getMaxUnboundedTime()
public static void trimInterval(IlvTimeInterval interval, Date min, Date max, IlvDuration minDuration)
interval
- The time interval that will be constrained.min
- The minimum time that can be displayed in bounded
scrolling mode or null
for unbounded
scrolling mode.max
- The maximum time that can be displayed in bounded
scrolling mode or null
for unbounded
scrolling mode.minDuration
- The minimum time duration that can be displayed.@Deprecated public static void trimInterval(IlvTimeInterval interval, Date min, Date max)
trimInterval(IlvTimeInterval, Date, Date, IlvDuration)
method instead.interval
- The time interval that will be constrained.min
- The minimum time that can be displayed in bounded
scrolling mode or null
for unbounded scrolling mode.max
- The maximum time that can be displayed in bounded
scrolling mode or null
for unbounded scrolling mode.public static IlvTimeInterval trimInterval(Date start, IlvDuration duration, Date min, Date max, IlvDuration minDuration)
start
- The start of the time interval to be constrained.duration
- The duration of the time interval to be constrained.min
- The minimum time that can be displayed in bounded
scrolling mode or null
for unbounded
scrolling mode.max
- The maximum time that can be displayed in bounded
scrolling mode or null
for unbounded
scrolling mode.minDuration
- The minimum time duration that can be displayed.@Deprecated public static IlvTimeInterval trimInterval(Date start, IlvDuration duration, Date min, Date max)
trimInterval(Date, IlvDuration, Date, Date, IlvDuration)
method instead.start
- The start of the time interval.duration
- The duration of the time interval.min
- The minimum time that can be displayed in bounded
scrolling mode or null
for unbounded scrolling mode.max
- The maximum time that can be displayed in bounded
scrolling mode or null
for unbounded scrolling mode.public static void trimInterval(IlvTimeScrollable scrollable, IlvTimeInterval interval)
scrollable's
min/max range.scrollable
- The time scrollable.interval
- The time interval that will be constrained.public static IlvTimeInterval trimInterval(IlvTimeScrollable scrollable, Date start, IlvDuration duration)
scrollable's
min/max range.scrollable
- The time scrollable.start
- The start of the time interval to be constrained.duration
- The duration of the time interval to be constrained.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.