ilog.views.gantt.graphic.renderer
Class IlvBasicActivityLabel

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

public class IlvBasicActivityLabel
extends IlvActivityGraphicRenderer
implements SwingConstants

An IlvBasicActivityLabel renders a text label by delegating to an IlvLabel object. An IlvBasicActivityLabel is positioned relative to a main activity renderer. It can be positioned horizontally or vertically using the constants defined in SwingConstants: LEFT, RIGHT, TOP, BOTTOM, or CENTER. The default alignment is horizontally LEFT and vertically CENTER.

The text label of this renderer is not computed dynamically from the activity that is being rendered. Therefore, this renderer is primarily intended to be used when you apply CSS style sheets to the Gantt or Schedule chart. In this case, the CSS styling mechanism will handle dynamic updates to the renderer based upon its interpretation of the style sheets and the data model. If you are not using CSS styling and you want the text label of the renderer to be dynamically computed from a property of the activity, you should use the IlvActivityLabel renderer instead.

Since:
JViews 5.5

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
IlvBasicActivityLabel()
          Creates an IlvBasicActivityLabel that has no main renderer.
IlvBasicActivityLabel(IlvActivityRenderer main)
          Creates an IlvBasicActivityLabel 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.
 Font getFont()
          Returns the font of the label.
 Color getForeground()
          Returns the foreground color of the label.
 int getHorizontalAlignment()
          Returns the alignment of the label along the X-axis relative to the main activity renderer.
 String getLabel()
          Returns the label being rendered.
 IlvActivityRenderer getMainRenderer()
          Returns the label's main activity renderer.
 float getOffset()
          Returns the horizontal distance between the label and the main renderer.
 int getVerticalAlignment()
          Returns the alignment of the label along the Y-axis relative to the main activity renderer.
 void setFont(Font font)
          Sets the font of the label.
 void setGraphic(IlvGraphic graphic)
          Sets the IlvGraphic used to render activities.
 void setHorizontalAlignment(int alignment)
          Sets the alignment of the label along the X-axis relative to the main activity renderer.
 void setLabel(String label)
          Sets the label to be rendered.
 void setMainRenderer(IlvActivityRenderer renderer)
          Sets the label's main activity renderer.
 void setOffset(float offset)
          Sets the horizontal distance between the label and the main renderer.
 void setVerticalAlignment(int alignment)
          Sets the alignment of the label along the Y-axis relative to the main activity renderer.
 
Methods inherited from class ilog.views.gantt.graphic.renderer.IlvActivityGraphicRenderer
contains, draw, getBottomMargin, getGraphic, getPopupMenu, getPopupMenuName, getToolTipText, getToolTipText, getTopMargin, isRedrawNeeded, 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

IlvBasicActivityLabel

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


IlvBasicActivityLabel

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

Parameters:
main - The main renderer.
Method Detail

getMainRenderer

public IlvActivityRenderer getMainRenderer()
Returns the label's main activity renderer.

See Also:
setMainRenderer(ilog.views.gantt.graphic.renderer.IlvActivityRenderer)

setMainRenderer

public void setMainRenderer(IlvActivityRenderer renderer)
Sets the label's main activity renderer.

Parameters:
renderer - The new main activity renderer.
See Also:
getMainRenderer()

getForeground

public Color getForeground()
Returns the foreground color of the label.


getFont

public Font getFont()
Returns the font of the label.

See Also:
setFont(java.awt.Font)

setFont

public void setFont(Font font)
Sets the font of the label.

Parameters:
font - The new font to render the label.
See Also:
getFont()

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the alignment of the label along the X-axis relative to the main activity renderer. The default value is LEFT.

Returns:
The horizontal alignment of the label. The value will be one of the following constants defined in SwingConstants: LEFT, CENTER, or RIGHT.
See Also:
setHorizontalAlignment(int)

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Sets the alignment of the label along the X-axis relative to the main activity renderer. If the alignment is set to LEFT, the label will be drawn to the left of the main renderer. If it is set to RIGHT, the label will be drawn to the right of the main renderer. If it is set to CENTER, the label will be centered horizontally across the main renderer. The default value is LEFT.

Parameters:
alignment - One of the following constants defined in SwingConstants: LEFT, CENTER, or RIGHT.
See Also:
getHorizontalAlignment()

getVerticalAlignment

public int getVerticalAlignment()
Returns the alignment of the label along the Y-axis relative to the main activity renderer. The default value is CENTER

Returns:
The vertical alignment of the label. The value will be one of the following constants defined in SwingConstants: TOP, CENTER, or BOTTOM.
See Also:
setVerticalAlignment(int)

setVerticalAlignment

public void setVerticalAlignment(int alignment)
Sets the alignment of the label along the Y-axis relative to the main activity renderer. If the alignment is set to TOP, the top edge of the label will be aligned with the top of the main renderer. If it is set to BOTTOM, the bottom edge of the label will be aligned with the bottom of the main renderer. If it is set to CENTER, the label will be centered vertically with the main renderer. The default value is CENTER.

Parameters:
alignment - One of the following constants defined in SwingConstants: TOP, CENTER, or BOTTOM.
See Also:
getVerticalAlignment()

getOffset

public float getOffset()
Returns the horizontal distance between the label and the main renderer.

See Also:
setOffset(float)

setOffset

public void setOffset(float offset)
Sets the horizontal distance between the label and the main renderer.

Parameters:
offset - The new horizontal offset.
See Also:
getOffset()

getLabel

public String getLabel()
Returns the label being rendered.

See Also:
setLabel(java.lang.String)

setLabel

public void setLabel(String label)
Sets the label to be rendered.

See Also:
getLabel()

setGraphic

public void setGraphic(IlvGraphic graphic)
Sets the IlvGraphic used to render activities. Only IlvLabels 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()

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.


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