Class SpinningClock
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.graphics.SpinningClock
-
public class SpinningClock extends java.lang.ObjectProvides a utility to display an animated clock with spinning hour and minute hands. The size of the clock as well as individual movement speed of the hands can be customized.
-
-
Constructor Summary
Constructors Constructor Description SpinningClock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.geom.Point2D[]computeHandSegment(double angle)intgetClockHeight()Returns the clock's heightintgetClockWidth()Sets the clock's heightdoublegetHourHandSpeed()Returns the clock´s hour hand speeddoublegetMinuteHandSpeed()Returns the clock´s minute hand speedjava.awt.geom.Point2DgetTopLeftCorner()Returns the top left corner position for this spinning clock.protected voidpaintClockFace(java.awt.Graphics2D g2)protected voidpaintClockHands(java.awt.Graphics2D g2)longrender(java.awt.Graphics2D g)voidsetClockSize(int width, int height)Sets the new width and height for the indicator.voidsetHourHandSpeed(double seconds)Sets the clock´s hour hand speedvoidsetMinuteHandSpeed(double seconds)Sets the clock´s minute hand speedvoidsetTopLeftCorner(java.awt.geom.Point2D topLeftCorner)Sets the top left corner position for this spinning clock.voidupdate(long elapsedTime)Refreshes the clock hands
-
-
-
Method Detail
-
update
public void update(long elapsedTime)
Refreshes the clock hands- Parameters:
elapsedTime-
-
render
public long render(java.awt.Graphics2D g)
-
paintClockFace
protected void paintClockFace(java.awt.Graphics2D g2)
-
paintClockHands
protected void paintClockHands(java.awt.Graphics2D g2)
-
computeHandSegment
protected java.awt.geom.Point2D[] computeHandSegment(double angle)
-
setClockSize
public void setClockSize(int width, int height)Sets the new width and height for the indicator. The default is 32 by 32 pixels.- Parameters:
width- the new width in pixelheight- the new height in pixel
-
setMinuteHandSpeed
public void setMinuteHandSpeed(double seconds)
Sets the clock´s minute hand speed- Parameters:
seconds-
-
getMinuteHandSpeed
public double getMinuteHandSpeed()
Returns the clock´s minute hand speed- Returns:
-
setHourHandSpeed
public void setHourHandSpeed(double seconds)
Sets the clock´s hour hand speed- Parameters:
seconds-
-
getHourHandSpeed
public double getHourHandSpeed()
Returns the clock´s hour hand speed- Returns:
-
getTopLeftCorner
public java.awt.geom.Point2D getTopLeftCorner()
Returns the top left corner position for this spinning clock.- Returns:
-
setTopLeftCorner
public void setTopLeftCorner(java.awt.geom.Point2D topLeftCorner)
Sets the top left corner position for this spinning clock.- Parameters:
topLeftCorner-
-
getClockHeight
public int getClockHeight()
Returns the clock's height- Returns:
-
getClockWidth
public int getClockWidth()
Sets the clock's height- Returns:
-
-