ilog.views.gantt.graphic.renderer.composite
Class IlvActivityCompositeGraphicRenderer

java.lang.Object
  extended by ilog.views.gantt.graphic.renderer.IlvActivityGraphicRenderer
      extended by ilog.views.gantt.graphic.renderer.composite.IlvActivityCompositeGraphicRenderer
All Implemented Interfaces:
IlvActivityRenderer

public class IlvActivityCompositeGraphicRenderer
extends IlvActivityGraphicRenderer

The class 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.

Since:
JViews 6.0

Constructor Summary
IlvActivityCompositeGraphicRenderer()
          Creates a new IlvActivityCompositeGraphicRenderer.
 
Method Summary
 IlvRect getBounds(IlvActivityGraphic ag, IlvTransformer t)
          Returns the rectangle in which the activity graphic should be drawn.
 String getToolTipText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
          This method is called by an activity graphic to return tooltip text for itself.
 IlvSelection makeSelection(IlvActivityGraphic ag)
          This method is called by an activity graphic to create and return a selection object for itself.
protected  IlvGraphic prepareGraphic(IlvActivityGraphic ag, IlvTransformer t)
          Prepares the underlying graphic for drawing by resizing and positioning it according to the renderer's bounds.
 void setGraphic(IlvGraphic graphic)
          Sets the IlvGraphic used to render activities.
 
Methods inherited from class ilog.views.gantt.graphic.renderer.IlvActivityGraphicRenderer
contains, draw, getBottomMargin, getGraphic, getPopupMenu, getPopupMenuName, getToolTipText, getTopMargin, isRedrawNeeded, setBackground, setBottomMargin, setForeground, setPopupMenu, setPopupMenuName, setToolTipText, setTopMargin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvActivityCompositeGraphicRenderer

public IlvActivityCompositeGraphicRenderer()
Creates a new IlvActivityCompositeGraphicRenderer.

Method Detail

getBounds

public IlvRect getBounds(IlvActivityGraphic ag,
                         IlvTransformer t)
Returns the rectangle in which the activity graphic should be drawn.

Specified by:
getBounds in interface IlvActivityRenderer
Overrides:
getBounds in class IlvActivityGraphicRenderer
Parameters:
ag - The activity graphic.
t - The transformer.
Returns:
The bounding box.

prepareGraphic

protected IlvGraphic prepareGraphic(IlvActivityGraphic ag,
                                    IlvTransformer t)
Prepares the underlying graphic for drawing by resizing and positioning it according to the renderer's bounds.

Overrides:
prepareGraphic in class IlvActivityGraphicRenderer
Parameters:
ag - The activity graphic holding the position where the presentation should be drawn.
t - The transformer.
Returns:
The prepared underlying graphic.

getToolTipText

public String getToolTipText(IlvActivityGraphic ag,
                             IlvPoint p,
                             IlvTransformer t)
This method is called by an 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.

Specified by:
getToolTipText in interface IlvActivityRenderer
Overrides:
getToolTipText in class IlvActivityGraphicRenderer
Parameters:
ag - The activity graphic.
p - The location of the mouse (in view coordinates).
t - The transformer.
Returns:
The tooltip text.

makeSelection

public IlvSelection makeSelection(IlvActivityGraphic ag)
This method is called by an activity graphic to create and return a selection object for itself. The standard IlvActivityGraphicSelection is customized so that the handles are y-positioned on the main horizontal bar instead of around the composite renderer as a whole.

Note that the selection object must be compatible with all activity renderer implementations in use, not just the specific renderer implementation this method is invoked on. This is because the renderer assigned to an activity graphic may change while the activity graphic remains selected. The custom selection returned by this implementation is generic and is compatible with all renderer implementations.

Specified by:
makeSelection in interface IlvActivityRenderer
Overrides:
makeSelection in class IlvActivityGraphicRenderer
Parameters:
ag - The activity graphic.
Returns:
The selection object.

setGraphic

public void setGraphic(IlvGraphic graphic)
Sets the IlvGraphic used to render activities. Only IlvCompositeGraphics are supported by this class. Any other type of graphic will throw an IllegalArgumentException.

Overrides:
setGraphic in class IlvActivityGraphicRenderer
Parameters:
graphic - The new graphic.
See Also:
IlvActivityGraphicRenderer.getGraphic()


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.