public class IlvActivityCompositeGraphicRenderer extends IlvActivityGraphicRenderer
IlvActivityCompositeGraphicRenderer
draws a
composite graphic to render the duration of a given activity in a Gantt
sheet. The first child of the composite graphic is the graphic used to
represent the activity duration; the other child graphics are considered as
decorations.Constructor and Description |
---|
IlvActivityCompositeGraphicRenderer()
Creates a new IlvActivityCompositeGraphicRenderer.
|
Modifier and Type | Method and Description |
---|---|
IlvRect |
computeBaseBounds(IlvActivityGraphic ag,
IlvTransformer t)
Returns the bounding rectangle in which the first child, or base
element of the composite graphic should be drawn.
|
IlvSelection |
createSelection(IlvActivityGraphic ag,
String[] properties)
Creates a new selection object for the specified activity graphic.
|
IlvRect |
getBounds(IlvActivityGraphic ag,
IlvTransformer t)
Returns the bounding rectangle of the activity graphic.
|
String |
getToolTipText(IlvActivityGraphic ag,
IlvPoint p,
IlvTransformer t)
This method is called by an
activity graphic
to return tooltip text for itself. |
protected IlvGraphic |
prepareGraphic(IlvActivityGraphic ag,
IlvTransformer t)
Prepares the underlying composite graphic for drawing by resizing and positioning
it's base element according to the results of
computeBaseBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) . |
void |
setGraphic(IlvGraphic graphic)
Sets the
IlvGraphic used to render activities. |
contains, draw, endProcessing, getBaseTextDirection, getBottomMargin, getDefinitionRect, getEndTime, getEndTimeProperty, getGraphic, getPopupMenu, getPopupMenuName, getStartTime, getStartTimeProperty, getToolTipText, getTopMargin, getVisibilityProperty, isPropertyEditable, isRedrawNeeded, isRedrawNeeded, isRelayoutNeeded, makeSelection, prepareGraphicVisibility, setBackground, setBaseTextDirection, setBottomMargin, setEndTimeProperty, setForeground, setPopupMenu, setPopupMenuName, setStartTimeProperty, setToolTipText, setTopMargin, setVisibilityProperty, startProcessing
public IlvActivityCompositeGraphicRenderer()
public IlvRect getBounds(IlvActivityGraphic ag, IlvTransformer t)
Note: unlike the IlvActivityGraphicRenderer
superclass, you should not override this method to customize the position
or sizing of the graphic. You should override the
computeBaseBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer)
method instead.
getBounds
in interface IlvActivityRenderer
getBounds
in class IlvActivityGraphicRenderer
ag
- The activity graphic.t
- The transformer.public IlvRect computeBaseBounds(IlvActivityGraphic ag, IlvTransformer t)
Returns the bounding rectangle in which the first child, or base
element of the composite graphic should be drawn.
The results of this method are used by the
prepareGraphic
method to position the base element of the
underlying composite graphic prior to drawing.
This implementation applies the transformer to the
definitionRect
of the
activity graphic, while taking the top and
bottom margins of the renderer into account.
This defines a bounding box whose x dimensions are specified by the time
interval of the activity and whose y dimensions are specified by the
activity layout algorithm.
You can override this method to modify the position and sizing of the
base element of the composite graphic. If you do so, make sure to use the
transformer argument and avoid using the
transformer currently set on the Gantt sheet
.
This is to ensure that everything prints correctly when the supplied
transformer is different than the Gantt sheet transformer that is used for
screen display. For example, if you want to modify the x position of the
base element's bounding box based upon a Date
value, avoid
using code like following:
rect.x = ganttSheet.getPosition(aDate);
and use this instead:
IlvTimeConverter timeConverter = ag.getGanttRow().getTimeConverter(); rect.x = IlvTimeScrollUtil.getPosition(aDate, timeConverter, t);
ag
- The activity graphic.t
- The transformer.protected IlvGraphic prepareGraphic(IlvActivityGraphic ag, IlvTransformer t)
computeBaseBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer)
.prepareGraphic
in class IlvActivityGraphicRenderer
ag
- The activity graphic holding the position where the presentation should be
drawn.t
- The transformer.public String getToolTipText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
activity graphic
to return tooltip text for itself. If you have set a tooltip by calling the
IlvActivityGraphicRenderer.setToolTipText(java.lang.String)
method, then that text is returned. Otherwise,
this default implementation returns the
tooltip text
from the renderer's underlying graphic
.getToolTipText
in interface IlvActivityRenderer
getToolTipText
in class IlvActivityGraphicRenderer
ag
- The activity graphic.p
- The location of the mouse (in view coordinates).t
- The transformer.public IlvSelection createSelection(IlvActivityGraphic ag, String[] properties)
Date
values in the properties
parameter as positions for displaying the handles.
This implementation returns an IlvActivityGraphicSelection
that is
customized so that the handles are y-positioned on the main horizontal bar
instead of around the composite renderer as a whole.
Note: the selection object must be an instance of
IlvSelection
and of IlvActivitySelection
.
Note: the selection object must be compatible with
all activity renderer implementations in use, and not only the specific
renderer implementation that this method is invoked on. This is because
the renderer assigned to an activity graphic may change while the activity
graphic remains selected. The IlvActivityGraphicSelection
object
returned by this implementation is generic and is compatible with all
renderer implementations.
createSelection
in class IlvActivityGraphicRenderer
ag
- The selected activity graphic.properties
- A list of Date
valued properties of the
activity, or null
.public void setGraphic(IlvGraphic graphic)
IlvGraphic
used to render activities. Only
IlvCompositeGraphic
s are supported by this class.
Any other type of graphic will throw an
IllegalArgumentException
.setGraphic
in class IlvActivityGraphicRenderer
graphic
- The new graphic.IlvActivityGraphicRenderer.getGraphic()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.