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:
java.io.Serializable
class CalendarCellContext extends CellContext
MonthView specific CellContext. This is internally used by BasisMonthViewUI rendering.
-
-
Field Summary
Fields Modifier and Type Field Description private intarrowPaddingXThe padding for month traversal icons.private intarrowPaddingYprivate CalendarStatedayState
-
Constructor Summary
Constructors Constructor Description CalendarCellContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.ColorgetBackground()Returns the background color of the renderered component or null if the component is nullprotected javax.swing.border.BordergetBorder()Returns the default border of the renderered component depending on cell state.java.util.CalendargetCalendar()CalendarStategetCalendarState()JXMonthViewgetComponent()Returns the component the cell resides on, may be null.protected java.awt.ColorgetFlaggedOrPerDayForeground()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 java.awt.ColorgetForeground()Returns the foreground color of the renderered component or null if the component is nullprotected java.awt.ColorgetSelectionBackground()Returns the default selection background color of the renderered component.protected java.awt.ColorgetSelectionForeground()Returns the default selection foreground color of the renderered component.private javax.swing.border.BordergetTitleBorder()private java.awt.ColorgetUIColor(java.lang.String key)protected java.lang.StringgetUIPrefix()Returns the component type specific prefix of keys for lookup in the UIManager.voidinstallContext(JXMonthView component, java.util.Calendar value, boolean selected, boolean focused, CalendarState dayState)protected booleanisToday()-
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 Detail
-
arrowPaddingX
private int arrowPaddingX
The 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
private CalendarState dayState
-
-
Method Detail
-
installContext
public void installContext(JXMonthView component, java.util.Calendar value, boolean selected, boolean focused, CalendarState dayState)
-
getComponent
public JXMonthView getComponent()
Description copied from class:CellContextReturns the component the cell resides on, may be null. Subclasses are expected to override and return the component type they are handling.- Overrides:
getComponentin classCellContext- Returns:
- the component the cell resides on, may be null.
-
getCalendarState
public CalendarState getCalendarState()
-
getCalendar
public java.util.Calendar getCalendar()
-
getForeground
protected java.awt.Color getForeground()
Description copied from class:CellContextReturns the foreground color of the renderered component or null if the component is nullPENDING: fallback to UI properties if comp == null?
- Overrides:
getForegroundin classCellContext- Returns:
- the foreground color of the rendered component.
-
getUIColor
private java.awt.Color getUIColor(java.lang.String key)
- Parameters:
key-- Returns:
-
getFlaggedOrPerDayForeground
protected java.awt.Color 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
protected java.awt.Color getBackground()
Description copied from class:CellContextReturns the background color of the renderered component or null if the component is nullPENDING: fallback to UI properties if comp == null?
- Overrides:
getBackgroundin classCellContext- Returns:
- the background color of the rendered component.
-
getSelectionBackground
protected java.awt.Color getSelectionBackground()
Description copied from class:CellContextReturns 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:
getSelectionBackgroundin classCellContext- Returns:
- the selection background color of the rendered component.
-
getSelectionForeground
protected java.awt.Color getSelectionForeground()
Description copied from class:CellContextReturns 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:
getSelectionForegroundin classCellContext- Returns:
- the selection foreground color of the rendered component.
-
getBorder
protected javax.swing.border.Border getBorder()
Description copied from class:CellContextReturns 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:
getBorderin classCellContext- Returns:
- the default border of the rendered component.
-
getTitleBorder
private javax.swing.border.Border getTitleBorder()
- Returns:
-
isToday
protected boolean isToday()
- Returns:
-
getUIPrefix
protected java.lang.String getUIPrefix()
Description copied from class:CellContextReturns the component type specific prefix of keys for lookup in the UIManager. Subclasses must override, here: returns the empty String.- Overrides:
getUIPrefixin classCellContext- Returns:
- the component type specific prefix.
-
-