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 whenChristmasExtension
is active. Copied from Icedtea-Web.- Since:
- 14581
- See Also:
- Initial commit
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
averageFallSpeed
(package private) static int
averageRotationSpeed
(package private) static int
averageStarWidth
private java.awt.Point
center
private int[]
color
private int
direction
private int
fallSpeed
private int
h
private boolean
haveEight
private int
maxRadiusX
private int
maxRadiusY
private boolean
orientation
private int[]
originalColor
private int
radiusX
private int
radiusY
private static java.util.Random
seed
private int
w
private static java.awt.Color
WATER_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 void
animate()
Animate the object - Cause next step of animationprivate java.awt.Polygon
createPolygon()
private static int
createRadius()
private void
createRadiuses()
(package private) 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 ratioprivate void
interpolateColors(int is, int max)
void
paint(java.awt.Graphics g)
Paint the objectvoid
setExtend(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:IAnimObject
Paint the object- Specified by:
paint
in interfaceIAnimObject
- Parameters:
g
- the graphics object to paint to
-
setExtend
public void setExtend(int w, int h)
Description copied from interface:IAnimObject
Set the extend when window size changed- Specified by:
setExtend
in interfaceIAnimObject
- Parameters:
w
- window widthh
- window height
-
animate
public void animate()
Description copied from interface:IAnimObject
Animate the object - Cause next step of animation- Specified by:
animate
in 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
-
-