public class IlvBasicActivityLabel extends IlvActivityGraphicRenderer implements SwingConstants
IlvBasicActivityLabel
renders a text label by delegating to
an IlvLabel
or IlvText
object. An
IlvBasicActivityLabel
is positioned relative to a
main activity renderer
.
The default horizontal alignment is SwingConstants.LEFT
and the default vertical
alignment is SwingConstants.CENTER
. A label can be positioned horizontally
using the following constants.
SwingConstants.LEFT
: the label is drawn to the left of the main renderer. The
right edge of the label is aligned with the left edge of the main renderer.INSIDE_LEFT
: the label is drawn inside the main renderer at its
left side. The left edge of the label is aligned with the left edge of the
main renderer.SwingConstants.CENTER
: the label is centered horizontally across the main
renderer.INSIDE_RIGHT
: the label is drawn inside the main renderer at its
right side. The right edge of the label is aligned with the right edge of the
main renderer.SwingConstants.RIGHT
: the label is drawn to the right of the main renderer. The
left edge of the label is aligned with the right edge of the main renderer.Similarly, the label can be positioned vertically
using the following constants:
ABOVE
: the label is drawn above the main renderer. The
bottom edge of the label is aligned with the top edge of the main renderer.SwingConstants.TOP
: the label is drawn inside the main renderer at its
top. The top edge of the label is aligned with the top edge of the
main renderer.SwingConstants.CENTER
: the label is centered vertically across the main
renderer.SwingConstants.BOTTOM
: the label is drawn inside the main renderer at its
bottom. The bottom edge of the label is aligned with the bottom edge of the
main renderer.BELOW
: the label is drawn to below the main renderer. The
top edge of the label is aligned with the bottom edge of the main renderer.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 handles 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, use the IlvActivityLabel
renderer.
Modifier and Type | Field and Description |
---|---|
static int |
ABOVE
The box-orientation constant used to specify that the label is drawn
above the
main activity renderer . |
static int |
BELOW
The box-orientation constant used to specify that the label is drawn
below the
main activity renderer . |
static int |
INSIDE_LEADING
The box-orientation constant used to specify that the label is drawn inside the
main activity renderer on the leading text edge. |
static int |
INSIDE_LEFT
The box-orientation constant used to specify that the label is drawn
inside the
main activity renderer on the left. |
static int |
INSIDE_RIGHT
The box-orientation constant used to specify that the label is drawn
inside the
main activity renderer on the right. |
static int |
INSIDE_TRAILING
The box-orientation constant used to specify that the label is drawn inside the
main activity renderer on the trailing text edge. |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
IlvBasicActivityLabel()
Creates an
IlvBasicActivityLabel that has no main renderer. |
IlvBasicActivityLabel(IlvActivityRenderer main)
Creates an
IlvBasicActivityLabel that is positioned relative to the
specified main renderer. |
Modifier and Type | Method and Description |
---|---|
IlvRect |
getBounds(IlvActivityGraphic ag,
IlvTransformer t)
Returns the bounding rectangle of the activity graphic.
|
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.
|
double |
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 . |
double |
getYOffset()
Returns the vertical distance between the label and the main renderer.
|
boolean |
isAntialiasing()
Tests if label anti-aliasing is enabled.
|
void |
setAntialiasing(boolean set)
Changes the anti-aliasing mode of the label.
|
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(double 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 . |
void |
setYOffset(double offset)
Sets the vertical distance between the label and the main renderer.
|
contains, createSelection, draw, endProcessing, getBaseTextDirection, getBottomMargin, getDefinitionRect, getEndTime, getEndTimeProperty, getGraphic, getPopupMenu, getPopupMenuName, getStartTime, getStartTimeProperty, getToolTipText, getToolTipText, getTopMargin, getVisibilityProperty, isPropertyEditable, isRedrawNeeded, isRedrawNeeded, isRelayoutNeeded, makeSelection, prepareGraphic, prepareGraphicVisibility, setBackground, setBaseTextDirection, setBottomMargin, setEndTimeProperty, setForeground, setPopupMenu, setPopupMenuName, setStartTimeProperty, setToolTipText, setTopMargin, setVisibilityProperty, startProcessing
public static final int INSIDE_LEFT
main activity renderer
on the left.
The left edge of the label is aligned with the left edge of the main
renderer.public static final int INSIDE_RIGHT
main activity renderer
on the right.
The right edge of the label is aligned with the right edge of the
main renderer.public static final int INSIDE_LEADING
main activity renderer
on the leading text edge. The
leading text edge of the label is aligned with the leading text edge of the main
renderer.public static final int INSIDE_TRAILING
main activity renderer
on the trailing text edge. The
trailing text edge of the label is aligned with the leading text edge of the main
renderer.public static final int ABOVE
main activity renderer
.
The bottom edge of the label is aligned with the top edge of the
main renderer.public static final int BELOW
main activity renderer
. The top edge of
the label is aligned with the bottom edge of the main renderer.public IlvBasicActivityLabel()
IlvBasicActivityLabel
that has no main renderer. Use the
setMainRenderer(ilog.views.gantt.graphic.renderer.IlvActivityRenderer)
method to specify the main renderer.public IlvBasicActivityLabel(IlvActivityRenderer main)
IlvBasicActivityLabel
that is positioned relative to the
specified main renderer.main
- The main renderer.public IlvActivityRenderer getMainRenderer()
public void setMainRenderer(IlvActivityRenderer renderer)
renderer
- The new main activity renderer.getMainRenderer()
public Color getForeground()
public Font getFont()
setFont(java.awt.Font)
public void setFont(Font font)
font
- The new font to render the label.getFont()
public final boolean isAntialiasing()
false
.true
is returned.setAntialiasing(boolean)
public void setAntialiasing(boolean set)
false
.set
- Set to true
to enable anti-aliasing.isAntialiasing()
public int getHorizontalAlignment()
main activity renderer
. The default value is SwingConstants.LEFT
.SwingConstants.LEFT
, INSIDE_LEFT
, SwingConstants.LEADING
,
INSIDE_LEADING
, SwingConstants.CENTER
, INSIDE_TRAILING
, SwingConstants.TRAILING
, INSIDE_RIGHT
, or SwingConstants.RIGHT
.setHorizontalAlignment(int)
public void setHorizontalAlignment(int alignment)
main activity renderer
.
Set alignment
to one of the following constants:
SwingConstants.LEFT
: the label is drawn to the left of the main renderer. The
right edge of the label is aligned with the left edge of the main renderer.INSIDE_LEFT
: the label is drawn inside the main renderer at its
left side. The left edge of the label is aligned with the left edge of the
main renderer.SwingConstants.LEADING
: the label is drawn on the leading side of the main renderer.
The trailing edge of the label is aligned with the leading edge of the main
renderer.INSIDE_LEADING
: the label is drawn inside the main renderer at its
leading side. The leading edge of the label is aligned with the leading edge of the
main renderer.SwingConstants.CENTER
: the label is centered horizontally across the main
renderer.INSIDE_TRAILING
: the label is drawn inside the main renderer at its
trailing side. The trailing edge of the label is aligned with the trailing edge of
the main renderer.SwingConstants.TRAILING
: the label is drawn to the trailing side of the main renderer.
The leading edge of the label is aligned with the trailing edge of the main
renderer.INSIDE_RIGHT
: the label is drawn inside the main renderer at its
right side. The right edge of the label is aligned with the right edge of the
main renderer.SwingConstants.RIGHT
: the label is drawn to the right of the main renderer. The
left edge of the label is aligned with the right edge of the main renderer.alignment
- One of the following constants: SwingConstants.LEFT
, INSIDE_LEFT
,
SwingConstants.LEADING
, INSIDE_LEADING
, SwingConstants.CENTER
,
INSIDE_TRAILING
, SwingConstants.TRAILING
, INSIDE_RIGHT
,
or SwingConstants.RIGHT
.getHorizontalAlignment()
public int getVerticalAlignment()
main activity renderer
. The default value is SwingConstants.CENTER
.ABOVE
, SwingConstants.TOP
, SwingConstants.CENTER
, SwingConstants.BOTTOM
,
or BELOW
.setVerticalAlignment(int)
public void setVerticalAlignment(int alignment)
Sets the alignment of the label along the Y-axis relative to the main activity renderer
.
Set the alignment
parameter to one of the following constants:
ABOVE
: the label is drawn above the main renderer. The
bottom edge of the label is aligned with the top edge of the main renderer.SwingConstants.TOP
: the label is drawn inside the main renderer at its
top. The top edge of the label is aligned with the top edge of the
main renderer.SwingConstants.CENTER
: the is centered vertically across the main
renderer.SwingConstants.BOTTOM
: the label is drawn inside the main renderer at its
bottom. The bottom edge of the label is aligned with the bottom edge of the
main renderer.BELOW
: the label is drawn to below the main renderer. The
top edge of the label is aligned with the bottom edge of the main renderer.alignment
- One of the following constants: ABOVE
, SwingConstants.TOP
,
SwingConstants.CENTER
, SwingConstants.BOTTOM
, or BELOW
.getVerticalAlignment()
public double getOffset()
setOffset(double)
public void setOffset(double offset)
offset
- The new horizontal offset.getOffset()
public double getYOffset()
setYOffset(double)
public void setYOffset(double offset)
offset
- The vertical offset between the label and the main renderer.getYOffset()
public String getLabel()
setLabel(java.lang.String)
public void setLabel(String label)
getLabel()
public void setGraphic(IlvGraphic graphic)
IlvGraphic
used to render activities. Only
IlvLabel
s and IlvText
s are supported by this class. Any
other type of graphic will throw an IllegalArgumentException
.setGraphic
in class IlvActivityGraphicRenderer
graphic
- The new graphic.IlvActivityGraphicRenderer.getGraphic()
public IlvRect getBounds(IlvActivityGraphic ag, IlvTransformer t)
getBounds
in interface IlvActivityRenderer
getBounds
in class IlvActivityGraphicRenderer
ag
- The activity graphic.t
- The transformer.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.