public class ItemDrawContext
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
drawBorder(java.awt.Rectangle destination)
Renders the frame around the specified rectangle.
|
boolean |
drawContentsText(java.awt.Rectangle destination,
boolean useSettings,
boolean rotate)
Renders the item's contents text at the specified location.
|
void |
drawDefault()
Renders the item in its default appearance.
|
void |
drawDefault(java.awt.Rectangle bounds)
Renders the item in its default appearance in the specified rectangle.
|
boolean |
drawEndClock(java.awt.Rectangle destination,
boolean useSettings)
Draws a clock icon representing the item's end time at the specified location.
|
boolean |
drawFormattedContentsText(java.awt.Rectangle destination,
boolean useSettings)
Renders the item's contents text at the specified location.
|
void |
drawHeaderBorder(java.awt.Rectangle destination)
Renders the header frame around the specified rectangle.
|
boolean |
drawHeaderText(java.awt.Rectangle destination,
boolean useSettings,
boolean rotate)
Renders the item's header text at the specified location.
|
void |
drawImage(java.awt.Image image,
java.awt.Rectangle bounds,
ImageAlignment alignment)
Draws the specified image in the specified rectangle, using the specified alignment.
|
boolean |
drawRecurrenceIcon(java.awt.Rectangle destination,
boolean useSettings)
Draws an icon representing the item's recurrence state at the specified location.
|
boolean |
drawReminderIcon(java.awt.Rectangle destination,
boolean useSettings)
Draws an icon representing the item's reminder at the specified location.
|
boolean |
drawStartClock(java.awt.Rectangle destination,
boolean useSettings)
Draws a clock icon representing the item's start time at the specified location.
|
java.awt.Rectangle |
getBounds()
Gets the rectangle bounding the item contents.
|
Calendar |
getCalendar()
Gets the
Calendar component, associated with the item. |
boolean |
getEndsHere()
Gets a value indicating whether the item part being drawn is the last part of the item.
|
java.awt.Graphics2D |
getGraphics()
Gets the target graphics object.
|
boolean |
getIsAllDayEvent()
Gets a value indicating whether the item is an all day event or not.
|
boolean |
getIsHorizontal()
Gets a value indicating the item's orientation.
|
boolean |
getIsMilestone()
Gets a value indicating whether the item is rendered in milestone mode.
|
Item |
getItem()
Gets the item that is being drawn.
|
boolean |
getPointed()
Gets a value indicating whether the mouse is over the drawn item.
|
boolean |
getStartsHere()
Gets a value indicating whether the item part being drawn is the first part of the item.
|
Style |
getStyle()
Gets the style that should be used to draw the item.
|
void |
setGraphics(java.awt.Graphics2D value)
Sets the target graphics object.
|
public void drawDefault()
public void drawDefault(java.awt.Rectangle bounds)
bounds
- The rectangle in which to render the item.public void drawHeaderBorder(java.awt.Rectangle destination)
This method renders a border around the specified rectangle using the settings
from the underlying style, such as Style.getHeaderBorderLeftColor()
,
Style.getHeaderBorderLeftWidth()
, and so on. Since the style is based
on the current theme, the rendered frame is guaranteed to be theme independent,
that is, the color and thickness of the frame, unless overridden, are the same
as those specified in the current theme. If the theme is changed, the color
and thickness are updated accordingly.
destination
- The rectangle in which to render the item.public void drawBorder(java.awt.Rectangle destination)
This method renders a border around the specified rectangle using the settings
from the underlying style, such as Style.getBorderLeftColor()
,
Style.getBorderLeftWidth()
, and so on. Since the style is based
on the current theme, the rendered frame is guaranteed to be theme independent,
that is, the color and thickness of the frame, unless overridden, are the same
as those specified in the current theme. If the theme is changed, the color
and thickness are updated accordingly.
destination
- The rectangle around which to render a border.public boolean drawHeaderText(java.awt.Rectangle destination, boolean useSettings, boolean rotate)
destination
- A reference to the destination rectangle.
This rectangle might be changed in the process of rendering.useSettings
- Specifies whether to take into consideration validation
properties, such as ItemSettings.getEnableDefaultRendering()
. Specify
false for this property to perform unconditional rendering.rotate
- Specifies whether to rotate the text at 90 degree.public boolean drawContentsText(java.awt.Rectangle destination, boolean useSettings, boolean rotate)
This method renders the Item.getDescriptionText()
of the underlying
item using the settings from the underlying style, such as Style.getTextColor()
,
Style.getTextAlignment()
, and so on. Since the style is based on the current
theme, the rendered text is guaranteed to be theme independent, that is, the color
and font of the text, unless overridden, are the same as those specified in the
current theme. If the theme is changed, the font and color are updated accordingly.
destination
- A reference to the destination rectangle.
This rectangle might be changed in the process of rendering.useSettings
- Specifies whether to take into consideration validation
properties, such as ItemSettings.getEnableDefaultRendering()
. Specify
false for this property to perform unconditional rendering.rotate
- Specifies whether to rotate the text at 90 degree.public boolean drawFormattedContentsText(java.awt.Rectangle destination, boolean useSettings)
This method renders the Item.getDescriptionText()
of the underlying
item using the settings from the underlying style, such as Style.getTextColor()
,
Style.getTextAlignment()
, and so on. The method also takes into consideration
some HTML formatting tags, such as <b>, <i> and <color>. Since the
style is based on the current theme, the rendered text is guaranteed to be theme
independent, that is, the color and font of the text, unless overridden, are the same
as those specified in the current theme. If the theme is changed, the font and color
are updated accordingly.
destination
- A reference to the destination rectangle.
This rectangle might be changed in the process of rendering.useSettings
- Specifies whether to take into consideration validation
properties, such as ItemSettings.getEnableDefaultRendering()
. Specify
false for this property to perform the rendering unconditionally.public void drawImage(java.awt.Image image, java.awt.Rectangle bounds, ImageAlignment alignment)
image
- The image to draw.bounds
- The destination rectangle.alignment
- The alignment to use when drawing.public boolean drawStartClock(java.awt.Rectangle destination, boolean useSettings)
destination
- A reference to the destination rectangle.
This rectangle might be changed in the process of rendering.useSettings
- Specifies whether to take into consideration validation
properties, such as ItemSettings.getEnableDefaultRendering()
and
ItemSettings.getShowClocks()
. Specify false for this property to
perform unconditional rendering.public boolean drawEndClock(java.awt.Rectangle destination, boolean useSettings)
destination
- A reference to the destination rectangle.
This rectangle might be changed in the process of rendering.useSettings
- Specifies whether to take into consideration validation
properties, such as ItemSettings.getEnableDefaultRendering()
and
ItemSettings.getShowClocks()
. Specify false for this property to
perform unconditional rendering.public boolean drawRecurrenceIcon(java.awt.Rectangle destination, boolean useSettings)
destination
- A reference to the destination rectangle.
This rectangle might be changed in the process of rendering.useSettings
- Specifies whether to take into consideration validation
properties, such as ItemSettings.getEnableDefaultRendering()
,
ItemSettings.getShowRecurrenceIcons()
and
ItemSettings.getShowRecurrenceExceptionIcons()
. Specify false for this
property to perform unconditional rendering.public boolean drawReminderIcon(java.awt.Rectangle destination, boolean useSettings)
destination
- A reference to the destination rectangle.
This rectangle might be changed in the process of rendering.useSettings
- Specifies whether to take into consideration validation
properties, such as ItemSettings.getEnableDefaultRendering()
and
ItemSettings.getShowReminderIcons()
. Specify false for this property
to perform unconditional rendering.public Calendar getCalendar()
Calendar
component, associated with the item.
A class can be set as an item viewer using the ItemViewerAttribute
attribute.
Calendar
object associated with the item viewer.public Item getItem()
public java.awt.Graphics2D getGraphics()
A custom item viewer should use this Graphics2D instance to draw a schedule item.
public void setGraphics(java.awt.Graphics2D value)
A custom item viewer should use this Graphics2D instance to draw a schedule item.
value
- An instance of the Graphics2D interface that must be used to paint the item.public java.awt.Rectangle getBounds()
The item viewer must paint the item inside these bounds.
public Style getStyle()
Style
for the item being painted.public boolean getIsAllDayEvent()
Timetable
view.public boolean getIsHorizontal()
Items are painted horizontally or vertically depending on the orientation of the current view.
public boolean getStartsHere()
Items consist of several parts when they span several time cells in the month, list and week range views.
public boolean getEndsHere()
Items consist of several parts when they span several time cells in the month, list and week range views.
public boolean getIsMilestone()
EnableMilestoneMode
property
of the ListViewSettings
class is set to true; otherwise, false.public boolean getPointed()
You can inspect the value of this property if you intend to change the appearance of your items when the mouse hovers over them. For example, you might wish to implement some form of highlighting.