ilog.views.gantt.graphic.renderer
Class IlvActivityBar

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

public class IlvActivityBar
extends IlvBasicActivityBar

IlvActivityBar is an extension of IlvBasicActivityBar whose text label is dynamically updated from a property of the activity. The default property is the name of the activity.

IlvActivityBar
An IlvActivityBar as a shadow rectangle.


Field Summary
 
Fields inherited from class ilog.views.gantt.graphic.renderer.IlvBasicActivityBar
RELIEF, SHADOW
 
Constructor Summary
IlvActivityBar()
          Creates an IlvActivityBar renderer with the default IlvBasicActivityBar.SHADOW style.
 
Method Summary
 void draw(Graphics dst, IlvActivityGraphic g, IlvTransformer t)
          This method is called by an activity graphic to render itself.
 IlvStringProperty getDisplayedProperty()
          Returns the displayed property.
 String getLabel()
          Returns the text label that will be rendered if the displayed property is null.
protected  String getToolTipCenterText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
          Returns the tooltip text for the specified activity graphic when the mouse is in the center of the graphic.
 DateFormat getToolTipDateFormat()
          Returns the format used to display the activity's start time and end time in the tooltip.
protected  String getToolTipEndText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
          Returns the tooltip text for the specified activity graphic when the mouse is near the end time.
protected  String getToolTipStartText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
          Returns the tooltip text for the specified activity graphic when the mouse is near the start time.
 String getToolTipText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
          This method is called by an activity graphic to return tooltip text for itself.
 boolean isRedrawNeeded(ActivityEvent evt)
          This method is called by an activity graphic to determine if it should redraw itself as a result of the specified activity event.
 void setDisplayedProperty(IlvStringProperty property)
          Sets the property to be displayed.
 void setLabel(String label)
          Sets the text label to be rendered.
 void setToolTipDateFormat(DateFormat format)
          Sets the format used to display the activity's start time and end time in the tooltip.
 
Methods inherited from class ilog.views.gantt.graphic.renderer.IlvBasicActivityBar
getBackground, getFont, getForeground, getStyle, getThickness, setFont, setGraphic, setStyle, setThickness
 
Methods inherited from class ilog.views.gantt.graphic.renderer.IlvActivityGraphicRenderer
contains, getBottomMargin, getBounds, getGraphic, getPopupMenu, getPopupMenuName, getToolTipText, getTopMargin, makeSelection, prepareGraphic, 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

IlvActivityBar

public IlvActivityBar()
Creates an IlvActivityBar renderer with the default IlvBasicActivityBar.SHADOW style.

Method Detail

setLabel

public void setLabel(String label)
Sets the text label to be rendered. This text label will only be displayed if the displayed property is null.

Overrides:
setLabel in class IlvBasicActivityBar
Parameters:
label - The label text.
Since:
JViews 5.5
See Also:
getLabel()

getLabel

public String getLabel()
Returns the text label that will be rendered if the displayed property is null.

Overrides:
getLabel in class IlvBasicActivityBar
Returns:
The label text.
Since:
JViews 5.5
See Also:
setLabel(java.lang.String)

setDisplayedProperty

public void setDisplayedProperty(IlvStringProperty property)
Sets the property to be displayed. The default property is the name of the activity.

Parameters:
property - The property of the activity to be displayed. If null, then the text set by calling setLabel(java.lang.String) will be displayed.
See Also:
getDisplayedProperty()

getDisplayedProperty

public IlvStringProperty getDisplayedProperty()
Returns the displayed property. The default property is the name of the activity.

Returns:
The displayed property.
See Also:
setDisplayedProperty(ilog.views.gantt.property.IlvStringProperty)

getToolTipDateFormat

public DateFormat getToolTipDateFormat()
Returns the format used to display the activity's start time and end time in the tooltip. The default is the default date/time style for the default locale.

Returns:
The tooltip date format.
Since:
JViews 3.5
See Also:
setToolTipDateFormat(java.text.DateFormat)

setToolTipDateFormat

public void setToolTipDateFormat(DateFormat format)
Sets the format used to display the activity's start time and end time in the tooltip.

Parameters:
format - The tooltip date format.
Since:
JViews 3.5
See Also:
getToolTipDateFormat()

draw

public void draw(Graphics dst,
                 IlvActivityGraphic g,
                 IlvTransformer t)
This method is called by an activity graphic to render itself.

Specified by:
draw in interface IlvActivityRenderer
Overrides:
draw in class IlvActivityGraphicRenderer
Parameters:
dst - The destination into which the presentation will be drawn.
g - The activity graphic holding the position where the presentation should be drawn.
t - The transformer.

isRedrawNeeded

public boolean isRedrawNeeded(ActivityEvent evt)
This method is called by an activity graphic to determine if it should redraw itself as a result of the specified activity event. This method is overridden to return true if the event is a changed event for the renderer's displayed property.

Specified by:
isRedrawNeeded in interface IlvActivityRenderer
Overrides:
isRedrawNeeded in class IlvActivityGraphicRenderer
Parameters:
evt - The activity event.
Returns:
Whether a redraw of the activity graphic is needed.

getToolTipStartText

protected String getToolTipStartText(IlvActivityGraphic ag,
                                     IlvPoint p,
                                     IlvTransformer t)
Returns the tooltip text for the specified activity graphic when the mouse is near the start time. The start time of the activity is formatted according to the tooltip date format.

Parameters:
ag - The activity graphic.
p - The location of the mouse (in view coordinates).
t - The transformer.
Returns:
The tooltip text near the start of the activity.
Since:
JViews 3.5
See Also:
getToolTipText(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvPoint, ilog.views.IlvTransformer)

getToolTipEndText

protected String getToolTipEndText(IlvActivityGraphic ag,
                                   IlvPoint p,
                                   IlvTransformer t)
Returns the tooltip text for the specified activity graphic when the mouse is near the end time. The end time of the activity is formatted according to the tooltip date format.

Parameters:
ag - The activity graphic.
p - The location of the mouse (in view coordinates).
t - The transformer.
Returns:
The tooltip text near the end of the activity.
Since:
JViews 3.5
See Also:
getToolTipText(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvPoint, ilog.views.IlvTransformer)

getToolTipCenterText

protected String getToolTipCenterText(IlvActivityGraphic ag,
                                      IlvPoint p,
                                      IlvTransformer t)
Returns the tooltip text for the specified activity graphic when the mouse is in the center of the graphic. The name of the activity is returned.

Parameters:
ag - The activity graphic.
p - The location of the mouse (in view coordinates).
t - The transformer.
Returns:
The tooltip text near the center of the activity.
Since:
JViews 3.5
See Also:
getToolTipText(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvPoint, ilog.views.IlvTransformer)

getToolTipText

public String getToolTipText(IlvActivityGraphic ag,
                             IlvPoint p,
                             IlvTransformer t)
This method is called by an activity graphic to return tooltip text for itself. This implementation calls 1 of 5 methods to obtain the text based upon the horizontal location of the mouse:

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.
Since:
JViews 3.5


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