public class IlvDefaultMilestoneCalendarRenderer extends Object implements IlvMilestoneCalendarRenderer
IlvDefaultMilestoneCalendarRenderer
renders a milestone as a symbol
that is labeled with the activity name.Modifier and Type | Field and Description |
---|---|
static int |
MILESTONE_CIRCLE
Renders the milestone symbol as a circle.
|
static int |
MILESTONE_DIAMOND
Renders the milestone symbol as a diamond.
|
static int |
MILESTONE_SQUARE
Renders the milestone symbol as a square.
|
static int |
MILESTONE_TRIANGLE
Renders the milestone symbol as a triangle.
|
Constructor and Description |
---|
IlvDefaultMilestoneCalendarRenderer()
Creates a new
IlvDefaultMilestoneRendererCalendar . |
IlvDefaultMilestoneCalendarRenderer(Paint fill,
Paint stroke)
Creates a new
IlvDefaultMilestoneCalendarRenderer . |
Modifier and Type | Method and Description |
---|---|
protected Shape |
createSymbolShape(Rectangle2D rect)
Creates the symbol shape within the specified bounding box.
|
void |
draw(Graphics g,
IlvActivity milestone,
boolean isSelected,
Rectangle rect,
Color background,
ComponentOrientation orientation)
This method is called by an
IlvMonthPanel to render a milestone
within the month grid. |
Paint |
getFillPaint()
Returns the paint object used to fill the symbol.
|
Font |
getLabelFont()
Returns the font used to label the symbol.
|
int |
getLabelMargin()
Returns the label margin.
|
Paint |
getLabelPaint()
Returns the paint object used to label the symbol.
|
Paint |
getSelectionFillPaint()
Returns the paint object used to fill the symbol when the milestone
is selected.
|
Paint |
getSelectionStrokePaint()
Returns the paint object used to stroke the symbol when the milestone
is selected.
|
Stroke |
getStroke()
Returns the style used to stroke the symbol.
|
Paint |
getStrokePaint()
Returns the paint object used to stroke the symbol.
|
int |
getSymbol()
Returns the symbol type.
|
String |
getToolTipText(IlvActivity milestone,
IlvGanttModel model,
Calendar calendar,
MouseEvent event)
This method is called by an
IlvMonthPanel to return tooltip text for
a displayed milestone. |
void |
setFillPaint(Paint paint)
Sets the paint object used to fill the symbol.
|
void |
setLabelFont(Font font)
Sets the font used to label the symbol.
|
void |
setLabelMargin(int margin)
Sets the label margin.
|
void |
setLabelPaint(Paint paint)
Sets the paint object used to label the symbol.
|
void |
setSelectionFillPaint(Paint paint)
Sets the paint object used to fill the symbol when the milestone is
selected.
|
void |
setSelectionStrokePaint(Paint paint)
Sets the paint object used to stroke the symbol when the milestone is
selected.
|
void |
setStroke(Stroke stroke)
Sets the style used to stroke the symbol.
|
void |
setStrokePaint(Paint paint)
Sets the paint object used to stroke the symbol.
|
void |
setSymbol(int symbol)
Sets the symbol type.
|
public static final int MILESTONE_CIRCLE
setSymbol(int)
,
Constant Field Valuespublic static final int MILESTONE_SQUARE
setSymbol(int)
,
Constant Field Valuespublic static final int MILESTONE_TRIANGLE
setSymbol(int)
,
Constant Field Valuespublic static final int MILESTONE_DIAMOND
setSymbol(int)
,
Constant Field Valuespublic IlvDefaultMilestoneCalendarRenderer(Paint fill, Paint stroke)
IlvDefaultMilestoneCalendarRenderer
.fill
- The fill paint, or null
to indicate that the symbol will
not be filled.stroke
- The stroke paint, or null
to indicate that the symbol
will not be stroked.public IlvDefaultMilestoneCalendarRenderer()
IlvDefaultMilestoneRendererCalendar
.public int getSymbol()
MILESTONE_CIRCLE
, MILESTONE_DIAMOND
, MILESTONE_SQUARE
,
or MILESTONE_TRIANGLE
. The default value is MILESTONE_DIAMOND
.setSymbol(int)
public void setSymbol(int symbol)
symbol
- The symbol type, which must be one of the constants:
MILESTONE_CIRCLE
, MILESTONE_DIAMOND
, MILESTONE_SQUARE
,
or MILESTONE_TRIANGLE
.getSymbol()
public Paint getFillPaint()
null
if the symbol will not
be filled.setFillPaint(java.awt.Paint)
public void setFillPaint(Paint paint)
GradientPaint
. An alternative is to use an
IlvLinearGradientPaint
and specify that it should
adapt to its display area.paint
- The fill paint, or null
to indicate that the symbol will
not be filled.getFillPaint()
public Paint getSelectionFillPaint()
null
if the symbol will not
be filled when the milestone is selected.setSelectionFillPaint(java.awt.Paint)
public void setSelectionFillPaint(Paint paint)
GradientPaint
. An alternative is
to use an IlvLinearGradientPaint
and specify that it
should adapt to its display area.paint
- The fill paint, or null
to indicate that the symbol will not
be filled when the milestone is selected.getSelectionFillPaint()
public Paint getStrokePaint()
null
if the symbol will not
be stroked.setStrokePaint(java.awt.Paint)
public void setStrokePaint(Paint paint)
GradientPaint
. An alternative is to use an
IlvLinearGradientPaint
and specify that it should
adapt to its display area.paint
- The stroke paint, or null
to indicate that the symbol will
not be stroked.getStrokePaint()
public Paint getSelectionStrokePaint()
null
if the symbol will not
be stroked when the milestone is selected.setSelectionStrokePaint(java.awt.Paint)
public void setSelectionStrokePaint(Paint paint)
GradientPaint
. An alternative is
to use an IlvLinearGradientPaint
and specify that it
should adapt to its display area.paint
- The stroke paint, or null
to indicate that the symbol will not
be stroked when the milestone is selected.getSelectionStrokePaint()
public Stroke getStroke()
BasicStroke
.null
if the symbol will not
be stroked.setStroke(java.awt.Stroke)
public void setStroke(Stroke stroke)
stroke
- The stroke style, or null
to indicate that the symbol will
not be stroked.getStroke()
public Font getLabelFont()
setLabelFont(java.awt.Font)
public void setLabelFont(Font font)
font
- The font.getLabelFont()
public Paint getLabelPaint()
setLabelPaint(java.awt.Paint)
public void setLabelPaint(Paint paint)
GradientPaint
. An alternative is to use an
IlvLinearGradientPaint
and specify that it should
adapt to its display area.paint
- The label paint.getLabelPaint()
public int getLabelMargin()
setLabelMargin(int)
public void setLabelMargin(int margin)
margin
- The margin.getLabelMargin()
protected Shape createSymbolShape(Rectangle2D rect)
rect
- The bounding box of the symbol.public void draw(Graphics g, IlvActivity milestone, boolean isSelected, Rectangle rect, Color background, ComponentOrientation orientation)
IlvMonthPanel
to render a milestone
within the month grid.draw
in interface IlvMilestoneCalendarRenderer
g
- The graphics context in which to paint.milestone
- The milestone to be rendered.isSelected
- Indicates whether the milestone is selected.rect
- The bounding box of the milestone.background
- The background color of the milestone. If null
, the
milestone should render itself non-opaquely.orientation
- The component orientation of the month panel that is asking
the milestone to be rendered.public String getToolTipText(IlvActivity milestone, IlvGanttModel model, Calendar calendar, MouseEvent event)
IlvMonthPanel
to return tooltip text for
a displayed milestone. This method can return null
to disable the
tooltip for the milestone.getToolTipText
in interface IlvMilestoneCalendarRenderer
milestone
- The milestone.model
- The data model that contains the milestone.calendar
- The date that corresponds to the mouse position.event
- The mouse event that caused the ToolTipManager
to
show the tooltip.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.