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.
An IlvActivityBar
as a shadow rectangle.
RELIEF, SHADOW
Constructor and Description |
---|
IlvActivityBar()
Creates an
IlvActivityBar renderer with the default
IlvBasicActivityBar.SHADOW style. |
Modifier and Type | Method and Description |
---|---|
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(IlvActivityGraphic ag,
ActivityEvent evt)
This method is called by an
activity graphic to
determine if the graphic should redraw itself as a result of the specified activity
event, that is, in situations when IlvActivityGraphicRenderer.isRelayoutNeeded(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.gantt.event.ActivityEvent) returned
false . |
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. |
getBackground, getFont, getForeground, getStyle, getThickness, isAntialiasing, setAntialiasing, setFont, setGraphic, setStyle, setThickness
contains, createSelection, endProcessing, getBaseTextDirection, getBottomMargin, getBounds, getDefinitionRect, getEndTime, getEndTimeProperty, getGraphic, getPopupMenu, getPopupMenuName, getStartTime, getStartTimeProperty, getToolTipText, getTopMargin, getVisibilityProperty, isPropertyEditable, isRedrawNeeded, isRelayoutNeeded, makeSelection, prepareGraphic, prepareGraphicVisibility, setBackground, setBaseTextDirection, setBottomMargin, setEndTimeProperty, setForeground, setPopupMenu, setPopupMenuName, setStartTimeProperty, setToolTipText, setTopMargin, setVisibilityProperty, startProcessing
public IlvActivityBar()
IlvActivityBar
renderer with the default
IlvBasicActivityBar.SHADOW
style.public void setLabel(String label)
displayed property
is
null
.setLabel
in class IlvBasicActivityBar
label
- The label text.getLabel()
public String getLabel()
displayed property
is null
.getLabel
in class IlvBasicActivityBar
setLabel(java.lang.String)
public void setDisplayedProperty(IlvStringProperty property)
name of the activity
.property
- The property of the activity to be displayed. If
null
, then the text set by calling setLabel(java.lang.String)
will be
displayed.getDisplayedProperty()
public IlvStringProperty getDisplayedProperty()
name of the activity
.setDisplayedProperty(ilog.views.gantt.property.IlvStringProperty)
public DateFormat getToolTipDateFormat()
start time
and end time
in the tooltip. The default is the
default date/time style for the default locale.setToolTipDateFormat(java.text.DateFormat)
public void setToolTipDateFormat(DateFormat format)
start time
and end time
in the tooltip.format
- The tooltip date format.getToolTipDateFormat()
public void draw(Graphics dst, IlvActivityGraphic g, IlvTransformer t)
activity
graphic
to render itself.draw
in interface IlvActivityRenderer
draw
in class IlvActivityGraphicRenderer
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.public boolean isRedrawNeeded(IlvActivityGraphic ag, ActivityEvent evt)
activity graphic
to
determine if the graphic should redraw itself as a result of the specified activity
event, that is, in situations when IlvActivityGraphicRenderer.isRelayoutNeeded(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.gantt.event.ActivityEvent)
returned
false
. This method is overridden to return true
if the event
is a changed event for the renderer's displayed property.isRedrawNeeded
in interface IlvActivityRenderer
isRedrawNeeded
in class IlvActivityGraphicRenderer
ag
- The activity graphic.evt
- The activity event.protected String getToolTipStartText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
tooltip date format
.ag
- The activity graphic.p
- The location of the mouse (in view coordinates).t
- The transformer.getToolTipText(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvPoint, ilog.views.IlvTransformer)
protected String getToolTipEndText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
tooltip date format
.ag
- The activity graphic.p
- The location of the mouse (in view coordinates).t
- The transformer.getToolTipText(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvPoint, ilog.views.IlvTransformer)
protected String getToolTipCenterText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
ag
- The activity graphic.p
- The location of the mouse (in view coordinates).t
- The transformer.getToolTipText(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvPoint, ilog.views.IlvTransformer)
public String getToolTipText(IlvActivityGraphic ag, IlvPoint p, IlvTransformer t)
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:
getToolTipStartText
is called if the mouse
is near the start time of the activity graphic.getToolTipEndText
is called if the mouse
is near the end time of the activity graphic.getToolTipCenterText
is called
when the mouse is not near the ends of the activity graphic.null
, then the
text set by calling IlvActivityGraphicRenderer.setToolTipText(java.lang.String)
will be used.null
, then the
tooltip text
is obtained from the renderer's underlying graphic
.getToolTipText
in interface IlvActivityRenderer
getToolTipText
in class IlvActivityGraphicRenderer
ag
- The activity graphic.p
- The location of the mouse (in view coordinates).t
- The transformer.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.