|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.CalendarDayButton
public class CalendarDayButton
The CalendarDayButton class extends the JButton to provide a specialized representation of a day of the month. This class is written specifically for use with with the CalendarPanel, although it may be used elsewhere as applicable. A day has an associated date, which provides the number to be shown in the button, and the full date is shown as a tooltip for the button. Use the setText() methods to set the date. The class supports three modes for the button: normal, selected and disabled. Disabled days are not selectable by the user. The selected day is rendered with a blue border to make it stand out from other days. Use the setType(int) method to specify the mode.
Field Summary | |
---|---|
protected java.awt.Color |
backgroundDisabled
|
protected java.awt.Color |
backgroundHoover
|
protected java.awt.Color |
backgroundNormal
|
protected java.awt.Color |
backgroundToday
|
protected java.awt.Color |
CALENDAR_FORECOLOR
|
protected java.util.GregorianCalendar |
date
|
protected java.lang.String |
dateFormat
|
static int |
DISABLED
A disabled display mode for a calendar day. |
protected boolean |
enabled
|
protected java.awt.Font |
fontDisabled
|
protected java.awt.Font |
fontNormal
|
protected java.awt.Font |
fontToday
|
protected java.awt.Color |
foregroundDisabled
|
protected java.awt.Color |
foregroundNormal
|
protected java.awt.Color |
foregroundToday
|
protected boolean |
isSelected
|
protected boolean |
mouseOver
|
static int |
NORMAL
The normal, enabled display mode for a calendar day. |
protected java.awt.Color |
outlineColor
|
static int |
OUTLINED
An outlined, enabled display mode for a calendar day. |
protected int |
type
|
Constructor Summary | |
---|---|
CalendarDayButton()
Default constructor. |
|
CalendarDayButton(java.util.GregorianCalendar aDate)
Constructor that takes a specified date as the initial selected date. |
Method Summary | |
---|---|
protected void |
addListeners()
Add Listeners to the class |
boolean |
canSelect()
Deprecated. This property is no longer needed or available. |
java.util.GregorianCalendar |
getDate()
Returns the date for this button. |
java.awt.Color |
getOutlineColor()
Returns the color used for the outline when the component's type is set to OUTLINED. |
protected void |
init()
|
protected void |
initializeUI()
|
protected boolean |
isEffectivelyEnabled()
Returns true if the component is effectively enabled; that is, if it's enabled at the component level and its type is not marked as DISABLED. |
boolean |
isSelected()
Returns whether or not this button is selected. |
protected void |
paintComponent(java.awt.Graphics g)
Need to paint this component's background in the case where it is selected. |
protected void |
setBackground()
|
protected void |
setBorder()
|
void |
setCanSelect(boolean selectable)
Deprecated. This property is no longer needed or available. |
void |
setEnabled(boolean mode)
Sets the enabled state of this component. |
void |
setForeColor(java.awt.Color color)
Method to set the foreground color of the component. |
void |
setOutlineColor(java.awt.Color color)
Sets the color used for the outline when the component's type is set to OUTLINED. |
void |
setSelected(boolean selected)
Set this button as the selected button. |
void |
setSelected(boolean selected,
boolean fireChangeEvent)
Set this button as the selected button. |
void |
setText(java.util.GregorianCalendar aDate)
Sets the date for this button using a GregorianCalendar representation of the date. |
void |
setText(java.lang.String ddMMyyyy)
Sets the date for this button using a string representation of the date. |
void |
setType(int type)
Sets the type of this text field. |
java.lang.String |
toString()
|
Field Detail |
---|
protected java.util.GregorianCalendar date
protected java.awt.Color CALENDAR_FORECOLOR
protected boolean isSelected
protected boolean mouseOver
public static final int NORMAL
public static final int OUTLINED
public static final int DISABLED
protected int type
protected boolean enabled
protected java.awt.Color outlineColor
protected java.awt.Color backgroundHoover
protected java.awt.Color foregroundNormal
protected java.awt.Color backgroundNormal
protected java.awt.Font fontNormal
protected java.awt.Color foregroundToday
protected java.awt.Color backgroundToday
protected java.awt.Font fontToday
protected java.awt.Color foregroundDisabled
protected java.awt.Color backgroundDisabled
protected java.awt.Font fontDisabled
protected java.lang.String dateFormat
Constructor Detail |
---|
public CalendarDayButton()
public CalendarDayButton(java.util.GregorianCalendar aDate)
aDate
- The date to use as the intial selected date.Method Detail |
---|
protected void init()
protected void initializeUI() throws java.lang.Exception
java.lang.Exception
public void setType(int type)
type
- The value to set for this field's type.protected void setBorder()
protected void setBackground()
public void setSelected(boolean selected)
setSelected
in class javax.swing.AbstractButton
selected
- The value representing whether or not this field is the selected one.public void setSelected(boolean selected, boolean fireChangeEvent)
selected
- The value representing whether or not this field is the selected one.fireChangeEvent
- Set to true to fire the "selectedState" propertyChangeEvent, false otherwise.public boolean isSelected()
isSelected
in class javax.swing.AbstractButton
public void setCanSelect(boolean selectable)
public boolean canSelect()
public void setText(java.lang.String ddMMyyyy)
setText
in class javax.swing.AbstractButton
ddMMyyyy
- the date in the ddMMyyyy String format.public void setText(java.util.GregorianCalendar aDate)
aDate
- the date in a GregorianCalendar format.public java.util.GregorianCalendar getDate()
public java.lang.String toString()
toString
in class java.awt.Component
protected void addListeners()
public void setForeColor(java.awt.Color color)
color
- the color to use.public void setOutlineColor(java.awt.Color color)
color
- The color to use for the outlinepublic java.awt.Color getOutlineColor()
public void setEnabled(boolean mode)
setEnabled
in class javax.swing.AbstractButton
mode
- Set to true to enable the component, false otherwise.protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
protected boolean isEffectivelyEnabled()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |