|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.plaf.ComponentUI
org.jdesktop.swingx.plaf.MonthViewUI
org.jdesktop.swingx.plaf.basic.BasicMonthViewUI
public class BasicMonthViewUI
Field Summary | |
---|---|
protected static SimpleDateFormat |
dayOfMonthFormatter
Formatter used to format the day of the week to a numerical value. |
protected long |
firstDisplayedDate
|
protected int |
firstDisplayedMonth
|
protected int |
firstDisplayedYear
|
protected long |
lastDisplayedDate
|
protected JXMonthView |
monthView
|
protected DateSpan |
selection
|
protected long |
today
|
Constructor Summary | |
---|---|
BasicMonthViewUI()
|
Method Summary | |
---|---|
long |
calculateLastDisplayedDate()
Calculate the last possible date that can be displayed. |
protected LayoutManager |
createLayoutManager()
|
protected MouseListener |
createMouseListener()
|
protected MouseMotionListener |
createMouseMotionListener()
|
protected PropertyChangeListener |
createPropertyChangeListener()
|
static ComponentUI |
createUI(JComponent c)
|
long |
getDayAt(int x,
int y)
Return a long representing the date at the specified x/y position. |
protected int |
getDayOfTheWeek()
Convenience method so subclasses can get the currently painted day's day of the week. |
protected int |
getTraversableButtonAt(int x,
int y)
Returns an index defining which, if any, of the buttons for traversing the month was pressed. |
protected void |
installComponents()
|
protected void |
installDefaults()
|
protected void |
installKeyboardActions()
|
protected void |
installListeners()
|
void |
installUI(JComponent c)
|
protected boolean |
isToday(long date)
Returns true if the date passed in is the same as today. |
boolean |
isUsingKeyboard()
|
void |
paint(Graphics g,
JComponent c)
|
protected void |
paintDayBackground(Graphics g,
int x,
int y,
int width,
int height,
long date)
Paint the background for the specified day. |
protected void |
paintDayForeground(Graphics g,
int x,
int y,
int width,
int height,
long date)
Paint the foreground for the specified day. |
protected void |
paintFlaggedDayBackground(Graphics g,
int x,
int y,
int width,
int height,
long date)
Paint the background for the specified flagged day. |
protected void |
paintFlaggedDayForeground(Graphics g,
int x,
int y,
int width,
int height,
long date)
Paint the foreground for the specified flagged day. |
protected void |
paintMonthStringBackground(Graphics g,
int x,
int y,
int width,
int height)
Paints the background of the month string. |
void |
setUsingKeyboard(boolean val)
|
protected void |
uninstallComponents()
|
protected void |
uninstallDefaults()
|
protected void |
uninstallKeyboardActions()
|
protected void |
uninstallListeners()
|
void |
uninstallUI(JComponent c)
|
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final SimpleDateFormat dayOfMonthFormatter
protected JXMonthView monthView
protected long firstDisplayedDate
protected int firstDisplayedMonth
protected int firstDisplayedYear
protected long lastDisplayedDate
protected long today
protected DateSpan selection
Constructor Detail |
---|
public BasicMonthViewUI()
Method Detail |
---|
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
installUI
in class ComponentUI
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
protected void installComponents()
protected void uninstallComponents()
protected void installDefaults()
protected void uninstallDefaults()
protected void installKeyboardActions()
protected void uninstallKeyboardActions()
protected void installListeners()
protected void uninstallListeners()
protected PropertyChangeListener createPropertyChangeListener()
protected LayoutManager createLayoutManager()
protected MouseListener createMouseListener()
protected MouseMotionListener createMouseMotionListener()
public boolean isUsingKeyboard()
public void setUsingKeyboard(boolean val)
protected boolean isToday(long date)
date
- long representing the date you want to compare to today.
public long getDayAt(int x, int y)
MonthViewUI
getDayAt
in class MonthViewUI
x
- X positiony
- Y position
protected int getDayOfTheWeek()
Calendar
protected int getTraversableButtonAt(int x, int y)
setTraversable
is set to true.
x
- x position of the pointery
- y position of the pointer
public long calculateLastDisplayedDate()
MonthViewUI
calculateLastDisplayedDate
in class MonthViewUI
public void paint(Graphics g, JComponent c)
paint
in class ComponentUI
protected void paintMonthStringBackground(Graphics g, int x, int y, int width, int height)
g
- Graphics object to paint to.x
- x-coordinate of upper left corner.y
- y-coordinate of upper left corner.width
- width of the bounding box.height
- height of the bounding box.JXMonthView.setMonthStringBackground(java.awt.Color)
,
JXMonthView.setMonthStringInsets(java.awt.Insets)
protected void paintDayBackground(Graphics g, int x, int y, int width, int height, long date)
g
- Graphics object to paint tox
- x-coordinate of upper left cornery
- y-coordinate of upper left cornerwidth
- width of bounding box for the dayheight
- height of bounding box for the daydate
- long value representing the day being paintedJXMonthView.isSelectedDate(long)
,
isToday(long)
protected void paintDayForeground(Graphics g, int x, int y, int width, int height, long date)
g
- Graphics object to paint tox
- x-coordinate of upper left cornery
- y-coordinate of upper left cornerwidth
- width of bounding box for the dayheight
- height of bounding box for the daydate
- long value representing the day being paintedprotected void paintFlaggedDayBackground(Graphics g, int x, int y, int width, int height, long date)
paintDayBackground
.
g
- Graphics object to paint tox
- x-coordinate of upper left cornery
- y-coordinate of upper left cornerwidth
- width of bounding box for the dayheight
- height of bounding box for the daydate
- long value representing the flagged day being paintedprotected void paintFlaggedDayForeground(Graphics g, int x, int y, int width, int height, long date)
g
- Graphics object to paint tox
- x-coordinate of upper left cornery
- y-coordinate of upper left cornerwidth
- width of bounding box for the dayheight
- height of bounding box for the daydate
- long value representing the flagged day being painted
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |