public interface IlvActivityRenderer
IlvActivityRenderer
object defines the graphic presentation of a given
activity and its activity graphic
.Modifier and Type | Method and Description |
---|---|
boolean |
contains(IlvActivityGraphic ag,
IlvPoint p,
IlvPoint tp,
IlvTransformer t)
This method is called by an
activity graphic to test whether a point lies within its
boundaries. |
void |
draw(Graphics dst,
IlvActivityGraphic ag,
IlvTransformer t)
This method is called by an
activity graphic to
render itself. |
IlvRect |
getBounds(IlvActivityGraphic ag,
IlvTransformer t)
Returns the bounding rectangle of the activity graphic.
|
JPopupMenu |
getPopupMenu(IlvActivityGraphic ag,
IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
This method is called by an
activity graphic
to return the Swing pop-up menu to display when the pop-up is triggered while the mouse
pointer is at a specified location inside the activity graphic object. |
String |
getPopupMenuName()
This method is called by an
activity graphic
to return the name of the Swing pop-up menu. |
String |
getToolTipText(IlvActivityGraphic ag,
IlvPoint p,
IlvTransformer t)
This method is called by an
activity
graphic to return tooltip text for itself. |
boolean |
isRedrawNeeded(IlvActivityGraphic ag,
ActivityEvent evt)
This method is called by an
activity graphic to determine if
the graphic should redraw itself as a result of the specified activity
event, that is, in situations when isRelayoutNeeded(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.gantt.event.ActivityEvent)
returned false . |
boolean |
isRelayoutNeeded(IlvActivityGraphic ag,
ActivityEvent evt)
This method is called by an
activity graphic to
determine if the layout of the activities in its row needs to be redone
as a result of the specified activity event. |
IlvSelection |
makeSelection(IlvActivityGraphic ag)
This method is called by an
activity graphic
to create and return a selection object for itself. |
IlvRect getBounds(IlvActivityGraphic ag, IlvTransformer t)
This method is called when the renderer needs to assign a bounding rectangle to the activity graphic.
In the typical case, the implementation of this method should apply the
transformer to the
definitionRect
of the
activity graphic. This is shown in the following code example:
return ag.getDefinitionRect(t);
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
Note: when printing, a different transformer than the one set on the Gantt sheet is supplied. Therefore, you should always use the transformer argument supplied to this method and avoid using the Gantt sheet transformer.
ag
- The activity graphic.t
- The transformer.boolean contains(IlvActivityGraphic ag, IlvPoint p, IlvPoint tp, IlvTransformer t)
activity graphic
to test whether a point lies within its
boundaries.ag
- The activity graphic.p
- The point to be tested.tp
- The point p
transformed by the transformer t
.t
- The transformation used to draw the object.true
if the point lies inside this activity graphic.void draw(Graphics dst, IlvActivityGraphic ag, IlvTransformer t)
activity graphic
to
render itself.dst
- The destination into which the presentation will be drawn.ag
- The activity graphic holding the position where the presentation should be
drawn.t
- The transformer.boolean isRelayoutNeeded(IlvActivityGraphic ag, ActivityEvent evt)
activity graphic
to
determine if the layout of the activities in its row needs to be redone
as a result of the specified activity event.
This method should return true
if the event indicates that a
property has changed which has an influence on this renderer's
getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer)
method.ag
- The activity graphic which is affected by the event.evt
- The activity event. Instances of
ActivityTimeIntervalEvent
are already handled
without calling this method.evt
indicates that a property has changed which
has an influence on the getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer)
method for this renderer,
true
is returned.boolean isRedrawNeeded(IlvActivityGraphic ag, ActivityEvent evt)
activity graphic
to determine if
the graphic should redraw itself as a result of the specified activity
event, that is, in situations when isRelayoutNeeded(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.gantt.event.ActivityEvent)
returned false
.ag
- The activity graphic which is affected by the event.evt
- The activity event. Instances of
ActivityTimeIntervalEvent
are already handled
without calling this method.evt
indicates that a property has changed which
has an influence on the draw(java.awt.Graphics, ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer)
method for this renderer, but
not on the getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer)
method, true
is returned.IlvSelection makeSelection(IlvActivityGraphic ag)
This method is called by an activity graphic
to create and return a selection object for itself.
Note, that the selection object must be compatible with all activity renderer
implementations in use, not just the specific renderer implementation this method is
being invoked on. This is because the renderer assigned to an activity graphic may
change while the activity graphic remains selected. The default IlvActivityGraphicSelection
class is generic and is compatible with all renderer
implementations.
ag
- The activity graphic.String getToolTipText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
activity
graphic
to return tooltip text for itself. This method can return null
to turn off the tooltip for the activity graphic.ag
- The activity graphic.p
- The location of the mouse (in view coordinates).t
- The transformer.JPopupMenu getPopupMenu(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t, IlvManagerView view, IlvPopupMenuManager popupManager)
This method is called by an activity graphic
to return the Swing pop-up menu to display when the pop-up is triggered while the mouse
pointer is at a specified location inside the activity graphic object. You can
override this method to display different pop-up menus over different parts of your
graphic object.
This method can return null
to turn off the pop-up menu for this
activity graphic object.
Note that you must enable the pop-up menu mechanism for the manager view by calling
the method IlvGanttSheet.setPopupMenusEnabled(boolean)
.
ag
- The activity graphic.p
- The location of the mouse (in view coordinates).t
- The transformer that converts the coordinate system of this
object (the manager coordinates) into the coordinate system of
the manager view in which the tooltip is about to be displayed
(the view coordinates).view
- The manager view that triggered the pop-up menu.popupManager
- The pop-up menu manager.null
.IlvActivityGraphic.getPopupMenu(IlvPoint,IlvTransformer,IlvManagerView,IlvPopupMenuManager)
String getPopupMenuName()
activity graphic
to return the name of the Swing pop-up menu. This method can return
null
.null
.IlvActivityGraphic.getPopupMenu(IlvPoint,IlvTransformer,IlvManagerView,IlvPopupMenuManager)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.