Package org.jdesktop.swingx.plaf.basic
Class CalendarCellContext
java.lang.Object
org.jdesktop.swingx.renderer.CellContext
org.jdesktop.swingx.plaf.basic.CalendarCellContext
- All Implemented Interfaces:
Serializable
MonthView specific CellContext. This is internally used by BasisMonthViewUI rendering.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The padding for month traversal icons.private int
private CalendarState
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Color
Returns the background color of the renderered component or null if the component is nullprotected Border
Returns the default border of the renderered component depending on cell state.Returns the component the cell resides on, may be null.protected Color
Returns the special color used for flagged days or per weekday or null if none is set, the component or the calendar are null.protected Color
Returns the foreground color of the renderered component or null if the component is nullprotected Color
Returns the default selection background color of the renderered component.protected Color
Returns the default selection foreground color of the renderered component.private Border
private Color
getUIColor
(String key) protected String
Returns the component type specific prefix of keys for lookup in the UIManager.void
installContext
(JXMonthView component, Calendar value, boolean selected, boolean focused, CalendarState dayState) protected boolean
isToday()
Methods inherited from class org.jdesktop.swingx.renderer.CellContext
getCellRendererName, getColumn, getDropCellBackground, getDropCellForeground, getFocusBackground, getFocusBorder, getFocusForeground, getFont, getIcon, getRow, getUIKey, getValue, installState, isDropOn, isEditable, isExpanded, isFocused, isLeaf, isSelected, replaceValue
-
Field Details
-
arrowPaddingX
private int arrowPaddingXThe padding for month traversal icons. PENDING JW: decouple rendering and hit-detection. As is, these are hard-coded "magic numbers" which must be the same in both the ui-delegate (which does the hit-detection) and here (which returns the default title border) Added as preliminary fix for #1028-swingx: title border incorrect if box-padding 0 -
arrowPaddingY
private int arrowPaddingY -
dayState
-
-
Constructor Details
-
CalendarCellContext
CalendarCellContext()
-
-
Method Details
-
installContext
public void installContext(JXMonthView component, Calendar value, boolean selected, boolean focused, CalendarState dayState) -
getComponent
Description copied from class:CellContext
Returns the component the cell resides on, may be null. Subclasses are expected to override and return the component type they are handling.- Overrides:
getComponent
in classCellContext
- Returns:
- the component the cell resides on, may be null.
-
getCalendarState
-
getCalendar
-
getForeground
Description copied from class:CellContext
Returns the foreground color of the renderered component or null if the component is nullPENDING: fallback to UI properties if comp == null?
- Overrides:
getForeground
in classCellContext
- Returns:
- the foreground color of the rendered component.
-
getUIColor
- Parameters:
key
-- Returns:
-
getFlaggedOrPerDayForeground
Returns the special color used for flagged days or per weekday or null if none is set, the component or the calendar are null.- Returns:
- the special foreground color for flagged days or per dayOfWeek.
-
getBackground
Description copied from class:CellContext
Returns the background color of the renderered component or null if the component is nullPENDING: fallback to UI properties if comp == null?
- Overrides:
getBackground
in classCellContext
- Returns:
- the background color of the rendered component.
-
getSelectionBackground
Description copied from class:CellContext
Returns the default selection background color of the renderered component. Typically, the color is LF specific. It's up to subclasses to look it up. Here: returns null.PENDING: return UI properties here?
- Overrides:
getSelectionBackground
in classCellContext
- Returns:
- the selection background color of the rendered component.
-
getSelectionForeground
Description copied from class:CellContext
Returns the default selection foreground color of the renderered component. Typically, the color is LF specific. It's up to subclasses to look it up. Here: returns null.PENDING: return UI properties here?
- Overrides:
getSelectionForeground
in classCellContext
- Returns:
- the selection foreground color of the rendered component.
-
getBorder
Description copied from class:CellContext
Returns the default border of the renderered component depending on cell state. Typically, the border is LF specific.Here: returns the focus border if the cell is focused, the context defined no focus border otherwise.
- Overrides:
getBorder
in classCellContext
- Returns:
- the default border of the rendered component.
-
getTitleBorder
- Returns:
-
isToday
protected boolean isToday()- Returns:
-
getUIPrefix
Description copied from class:CellContext
Returns the component type specific prefix of keys for lookup in the UIManager. Subclasses must override, here: returns the empty String.- Overrides:
getUIPrefix
in classCellContext
- Returns:
- the component type specific prefix.
-