|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.keang.gui.AnalogueClockPainter
class AnalogueClockPainter
Paints an analogue clock face and hands using the graphics object provided by another component.
Constructor Summary | |
---|---|
AnalogueClockPainter()
Constructs a default clock painter for this time zone |
|
AnalogueClockPainter(java.util.TimeZone timezone)
Constructs a clock painter for the given time zone |
Method Summary | |
---|---|
void |
paint(java.awt.Graphics g)
Paint the clock, repainting everything, not just what changed since the last call to paint. |
void |
setExternalTickColor(java.awt.Color[] c)
Set the colors for the external ticks. |
void |
setExternalTicks(long[] times)
Set the times of the ticks to show on the exterior of the rim. |
void |
setExternalTicksEnabled(boolean enable)
|
void |
setFaceColor(java.awt.Color c)
Set the color for the dial's face. |
void |
setFontMetrics(java.awt.FontMetrics fm)
Set the font for the numbers |
void |
setHandsColor(java.awt.Color c)
Set the color of the minute and hour hand |
void |
setNumbersEnabled(boolean state)
Turn display of clock face numbers on or off. |
void |
setRadius(int rad)
Set the radius of this analogue clock face |
void |
setRimColor(java.awt.Color c)
Set the color for the dial's rim. |
void |
setSecondsEnabled(boolean state)
Turn display of seconds and seconds hand on or off. |
void |
setTextColor(java.awt.Color c)
Set the color for the text and the seconds hand. |
void |
setTime(java.util.Date d)
Set the clock to a certain time. |
void |
setTimeZone(java.util.TimeZone tz)
Set the clock to a certain time zone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnalogueClockPainter()
public AnalogueClockPainter(java.util.TimeZone timezone)
timezone
- - the timezone to useMethod Detail |
---|
public void setRadius(int rad)
rad
- - the radius in pixelspublic void setExternalTicks(long[] times)
times
- - an array of times in seconds denoting the position of a tickpublic void setSecondsEnabled(boolean state)
state
- - true to show seconds handpublic void setNumbersEnabled(boolean state)
state
- - true to show clock face numbers 1 to 12public void setTimeZone(java.util.TimeZone tz)
clock.setTimeZone(TimeZone.getTimeZone(tz));
tz
- the time zonepublic void setTime(java.util.Date d)
d
- the time to displaypublic void setFontMetrics(java.awt.FontMetrics fm)
f
- the font to usepublic void setHandsColor(java.awt.Color c)
c
- - the color for the clock handspublic void setTextColor(java.awt.Color c)
c
- - the color for the text and the seconds handpublic void setFaceColor(java.awt.Color c)
c
- - the color of the dial or null for a transparent facepublic void setRimColor(java.awt.Color c)
c
- - the color of the rim or null for no rimpublic void setExternalTickColor(java.awt.Color[] c)
c
- - the colors of the external tickspublic void paint(java.awt.Graphics g)
public void setExternalTicksEnabled(boolean enable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |