public static class IlvActivityTileLayout.DefaultTilingPolicy extends Object implements IlvActivityTileLayout.TilingPolicy
DefaultTilingPolicy
takes each given activity graphic and attempts to
place it into the first existing subrow that will accommodate it. If no existing
subrows have adequate space, then a new subrow is added at the end for the
activity.Constructor and Description |
---|
DefaultTilingPolicy()
Creates a new default tiling policy.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addGraphicToSubRowIfFits(IlvActivityTileLayout.GraphicBounds gb,
List<IlvActivityTileLayout.GraphicBounds> subRow,
boolean compareBoundingBoxes)
Adds the specified activity graphic to the specified subrow if it fits.
|
List<List<IlvActivityTileLayout.GraphicBounds>> |
assignGraphicsToSubRows(IlvActivityTileLayout.GraphicBounds[] graphics,
boolean compareBoundingBoxes)
Creates as many subrows as needed to accommodate the given activity graphics and
assigns the activity graphics to the subrows.
|
public DefaultTilingPolicy()
protected boolean addGraphicToSubRowIfFits(IlvActivityTileLayout.GraphicBounds gb, List<IlvActivityTileLayout.GraphicBounds> subRow, boolean compareBoundingBoxes)
gb
- The GraphicBounds that encapsulates the activity
graphic to be added and its current bounding box in
view coordinates. Note, that the bounding box is
provided as input only. Modifying the bounding box of
the IlvActivityTileLayout.GraphicBounds
will not affect how the
activity is positioned.subRow
- The subrow, represented as a list of GraphicBounds
objects.compareBoundingBoxes
- Indicates whether activity overlap is computed by
comparing the graphic bounding boxes. If
false
, activity overlap is computed by
comparing the activity time intervals.public List<List<IlvActivityTileLayout.GraphicBounds>> assignGraphicsToSubRows(IlvActivityTileLayout.GraphicBounds[] graphics, boolean compareBoundingBoxes)
IlvActivityTileLayout.GraphicBounds
. This allows
the tiling policy to take advantage of the precomputed activity bounding boxes when
computing graphic overlap and assigning activity graphics to subrows. The result of
this method is a list of subrows, where each subrow is a list of IlvActivityTileLayout.GraphicBounds
representing the activities assigned to the subrow. All activity
graphics provided as input to the tiling policy must be assigned to one and only
one subrow.assignGraphicsToSubRows
in interface IlvActivityTileLayout.TilingPolicy
graphics
- The activity graphics to be tiled into subrows, as an
array of IlvActivityTileLayout.GraphicBounds
. If compareBoundingBoxes
is true
then the array will be sorted by
the x position of each activity graphic's bounding box.
If compareBoundingBoxes
is
false
then the array will be sorted by the
start time of each activity. Note, that the bounding
boxes are provided as input only. Modifying the
bounding box of a IlvActivityTileLayout.GraphicBounds
will not affect
how an activity is positioned.compareBoundingBoxes
- Indicates whether the tiling policy should compute
activity overlap by comparing the graphic bounding
boxes. If false
, activity overlap should
be computed by comparing the activity time intervals.IlvActivityTileLayout.GraphicBounds
representing the activities assigned to the subrow.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.