ilog.views.gantt.graphic.renderer
Class IlvActivityLabel

java.lang.Object
  extended by ilog.views.gantt.graphic.renderer.IlvActivityGraphicRenderer
      extended by ilog.views.gantt.graphic.renderer.IlvBasicActivityLabel
          extended by ilog.views.gantt.graphic.renderer.IlvActivityLabel
All Implemented Interfaces:
IlvActivityRenderer, SwingConstants

public class IlvActivityLabel
extends IlvBasicActivityLabel

IlvActivityLabel is an extension of IlvBasicActivityLabel whose text label is dynamically updated from a property of the activity. The default property is the name as the activity.


Field Summary
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
IlvActivityLabel()
          Creates an IlvActivityLabel that has no main renderer.
IlvActivityLabel(IlvActivityRenderer main)
          Creates an IlvActivityLabel that is positioned relative to the specified main renderer.
 
Method Summary
 IlvRect getBounds(IlvActivityGraphic ag, IlvTransformer t)
          Returns the rectangle in which the activity graphic should be drawn.
 IlvStringProperty getDisplayedProperty()
          Returns the property displayed by this renderer.
 String getLabel()
          Returns the text label that will be rendered if the displayed property is null.
 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 displayed by this renderer.
 void setLabel(String label)
          Sets the text label to be rendered.
 
Methods inherited from class ilog.views.gantt.graphic.renderer.IlvBasicActivityLabel
getFont, getForeground, getHorizontalAlignment, getMainRenderer, getOffset, getVerticalAlignment, setFont, setGraphic, setHorizontalAlignment, setMainRenderer, setOffset, setVerticalAlignment
 
Methods inherited from class ilog.views.gantt.graphic.renderer.IlvActivityGraphicRenderer
contains, draw, getBottomMargin, getGraphic, getPopupMenu, getPopupMenuName, getToolTipText, 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

IlvActivityLabel

public IlvActivityLabel()
Creates an IlvActivityLabel that has no main renderer. Use the IlvBasicActivityLabel.setMainRenderer(ilog.views.gantt.graphic.renderer.IlvActivityRenderer) method to specify the main renderer.


IlvActivityLabel

public IlvActivityLabel(IlvActivityRenderer main)
Creates an IlvActivityLabel that is positioned relative to the specified main renderer.

Parameters:
main - The main renderer.
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 IlvBasicActivityLabel
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 IlvBasicActivityLabel
Since:
JViews 5.5
See Also:
setLabel(java.lang.String)

getDisplayedProperty

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

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

setDisplayedProperty

public void setDisplayedProperty(IlvStringProperty property)
Sets the property displayed by this renderer. The default property is the name of the activity.

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

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 IlvBasicActivityLabel
Parameters:
ag - The activity graphic.
t - The transformer.
Returns:
The bounding box.

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 either an aboutToChange or changed event for the label's displayed property.

Specified by:
isRedrawNeeded in interface IlvActivityRenderer
Overrides:
isRedrawNeeded in class IlvActivityGraphicRenderer
Parameters:
evt - The activity event.
Returns:
Whether the activity graphic should redraw based upon the specified activity change.


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