Class Star
- java.lang.Object
-
- org.openstreetmap.josm.gui.animation.Star
-
- All Implemented Interfaces:
IAnimObject
class Star extends java.lang.Object implements IAnimObject
A star displayed whenChristmasExtensionis active. Copied from Icedtea-Web.- Since:
- 14581
- See Also:
- Initial commit
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intaverageFallSpeed(package private) static intaverageRotationSpeed(package private) static intaverageStarWidthprivate java.awt.Pointcenterprivate int[]colorprivate intdirectionprivate intfallSpeedprivate inthprivate booleanhaveEightprivate intmaxRadiusXprivate intmaxRadiusYprivate booleanorientationprivate int[]originalColorprivate intradiusXprivate intradiusYprivate static java.util.Randomseedprivate intwprivate static java.awt.ColorWATER_LIVE_COLOR
-
Constructor Summary
Constructors Constructor Description Star(int w, int h)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanimate()Animate the object - Cause next step of animationprivate java.awt.PolygoncreatePolygon()private static intcreateRadius()private voidcreateRadiuses()(package private) static doubleinterpol(double origSize, double currentSize, double from, double to)Interpolation is root ratio is r= (currentSize / origSize) then value to-from is interpolated from to to from according to ratioprivate voidinterpolateColors(int is, int max)voidpaint(java.awt.Graphics g)Paint the objectvoidsetExtend(int w, int h)Set the extend when window size changed
-
-
-
Field Detail
-
seed
private static final java.util.Random seed
-
averageStarWidth
static final int averageStarWidth
- See Also:
- Constant Field Values
-
averageFallSpeed
static final int averageFallSpeed
- See Also:
- Constant Field Values
-
averageRotationSpeed
static final int averageRotationSpeed
- See Also:
- Constant Field Values
-
WATER_LIVE_COLOR
private static final java.awt.Color WATER_LIVE_COLOR
-
w
private int w
-
h
private int h
-
radiusX
private int radiusX
-
radiusY
private int radiusY
-
maxRadiusX
private int maxRadiusX
-
maxRadiusY
private int maxRadiusY
-
center
private final java.awt.Point center
-
fallSpeed
private final int fallSpeed
-
orientation
private final boolean orientation
-
originalColor
private final int[] originalColor
-
color
private final int[] color
-
direction
private int direction
-
haveEight
private final boolean haveEight
-
-
Constructor Detail
-
Star
Star(int w, int h)
-
-
Method Detail
-
paint
public void paint(java.awt.Graphics g)
Description copied from interface:IAnimObjectPaint the object- Specified by:
paintin interfaceIAnimObject- Parameters:
g- the graphics object to paint to
-
setExtend
public void setExtend(int w, int h)
Description copied from interface:IAnimObjectSet the extend when window size changed- Specified by:
setExtendin interfaceIAnimObject- Parameters:
w- window widthh- window height
-
animate
public void animate()
Description copied from interface:IAnimObjectAnimate the object - Cause next step of animation- Specified by:
animatein interfaceIAnimObject
-
createRadius
private static int createRadius()
-
createPolygon
private java.awt.Polygon createPolygon()
-
interpolateColors
private void interpolateColors(int is, int max)
-
createRadiuses
private void createRadiuses()
-
interpol
static double interpol(double origSize, double currentSize, double from, double to)
Interpolation is root ratio is r= (currentSize / origSize) then value to-from is interpolated from to to from according to ratio- Parameters:
origSize- original sizecurrentSize- current sizefrom- starting valueto- ending value- Returns:
- interpolated value
-
-