|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IlvActivityLayout
An IlvActivityLayout defines a strategy for how activity
graphics are arranged within an IlvGanttRow. An
IlvActivityLayout object is used by an IlvGanttRow
to compute the positions and z-order of its activity graphics. When you add
an activity graphic object to a Gantt row, the activity layout is used
to determine the position of the new inserted activity graphic. When you
change the time interval of an activity, the activity layout is also used to
readjust the position of the associated activity graphic.
| Method Summary | |
|---|---|
void |
arrange(IlvGanttRow row,
IlvActivityGraphic graphic)
This method is called to layout the position of a single activity graphic within a row. |
void |
arrange(IlvGanttRow row,
IlvActivityGraphic[] graphics)
This method is called to layout the position of all the activity graphics within a row. |
| Method Detail |
|---|
void arrange(IlvGanttRow row,
IlvActivityGraphic graphic)
Here is an example of how the activity layout should set the definition rectangle of the graphic and modify its drawing order:
public void arrange(IlvGanttRow row, IlvActivityGraphic graphic) {
IlvTimeConverter converter = row.getTimeConverter();
if (converter == null)
return;
IlvActivity activity = graphic.getActivity();
float start = (float)converter.getUnits(activity.getStartTime());
float end = (float)converter.getUnits(activity.getEndTime());
IlvRect defRect = new IlvRect(start, row.getTop(),
end-start, row.getHeight());
graphic.setDefinitionRect(defRect);
// Move the graphic to the top of the z-order
row.setActivityGraphicIndex(graphic, row.getActivityGraphicCount()-1);
}
row - The Gantt row that contains the graphic.graphic - The activity graphic to be arranged.
void arrange(IlvGanttRow row,
IlvActivityGraphic[] graphics)
The ordering of the graphics in the array indicates the z-order in which the activity graphics currently draw. Graphics at a higher index in the array are drawn after graphics at a lower index. This method can reorder the graphics in the array to change their z-order.
Here is an example of how the activity layout should set the definition rectangle of each graphic:
public void arrange(IlvGanttRow row, IlvActivityGraphic[] graphics) {
IlvTimeConverter converter = row.getTimeConverter();
if (converter == null)
return;
for (int i = 0; i < graphics.length; i++) {
IlvActivityGraphic graphic = graphics[i];
IlvActivity activity = graphic.getActivity();
float start = (float)converter.getUnits(activity.getStartTime());
float end = (float)converter.getUnits(activity.getEndTime());
IlvRect defRect = new IlvRect(start, row.getTop(),
end-start, row.getHeight());
graphic.setDefinitionRect(defRect);
}
}
row - The Gantt row that contains the graphics.graphics - The array of activity graphics in the row.
The ordering of the graphics in the array indicates the z-order in which
the activity graphics draw. Graphics at a higher index in the array are
drawn after graphics at a lower index. This method can rearrange the
graphics in the array to change their drawing order.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||