public class BusyPainter extends AbstractPainter<Object>
JXBusyLabel
AbstractPainter.Interpolation
Constructor | Description |
---|---|
BusyPainter() |
Creates new busy painter initialized to the shape of circle and bounds size 26x26 points.
|
BusyPainter(int height) |
Creates new painter initialized to the shape of circle and bounds of square of specified height.
|
BusyPainter(Shape point,
Shape trajectory) |
Initializes painter to the specified trajectory and and point shape.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
doPaint(Graphics2D g,
Object t,
int width,
int height) |
Subclasses must implement this method and perform custom painting operations
here.
|
Color |
getBaseColor() |
Gets base color.
|
JXBusyLabel.Direction |
getDirection() |
Gets current direction of spinning.
|
int |
getFrame() |
Gets current frame.
|
Color |
getHighlightColor() |
Gets highlight color.
|
int |
getPoints() |
Gets total amount of distinct points in spinner.
|
Shape |
getPointShape() |
Gets shape of current point.
|
protected static Shape |
getScaledDefaultPoint(int height) |
|
protected static Shape |
getScaledDefaultTrajectory(int height) |
|
int |
getTrailLength() |
Gets length of trail in number of points.
|
Shape |
getTrajectory() |
Gets current trajectory.
|
static Point2D.Float |
getXY(float t,
Point2D.Float begin,
Point2D.Float ctrl,
Point2D.Float end) |
Calculates relative position of the point on the quad curve in time t<0,1>.
|
protected void |
init(Shape point,
Shape trajectory,
Color baseColor,
Color highlightColor) |
Initializes painter to provided shapes and default colors.
|
boolean |
isPaintCentered() |
Gets value of centering hint.
|
protected Shape |
provideShape(Graphics2D g,
Object comp,
int width,
int height) |
|
void |
setBaseColor(Color baseColor) |
Sets new base color.
|
void |
setDirection(JXBusyLabel.Direction dir) |
Sets new spinning direction.
|
void |
setFrame(int frame) |
Sets current frame.
|
void |
setHighlightColor(Color highlightColor) |
Sets new highlight color.
|
void |
setPaintCentered(boolean paintCentered) |
Centers shape in the area covered by the painter.
|
void |
setPoints(int points) |
Sets total amount of points in spinner.
|
void |
setPointShape(Shape pointShape) |
Sets new point shape.
|
void |
setTrailLength(int trailLength) |
Sets length of the trail in points.
|
void |
setTrajectory(Shape trajectory) |
Sets new trajectory.
|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
clearCache, configureGraphics, getFilters, getInterpolation, isAntialiasing, isCacheable, isDirty, isVisible, paint, setAntialiasing, setCacheable, setDirty, setFilters, setInterpolation, setVisible, shouldUseCache, validate
public BusyPainter()
public BusyPainter(int height)
height
- Painter height.protected static Shape getScaledDefaultTrajectory(int height)
protected static Shape getScaledDefaultPoint(int height)
protected void init(Shape point, Shape trajectory, Color baseColor, Color highlightColor)
point
- Point shape.trajectory
- Trajectory shape.protected void doPaint(Graphics2D g, Object t, int width, int height)
AbstractPainter
doPaint
in class AbstractPainter<Object>
g
- The Graphics2D object in which to paintpublic boolean isPaintCentered()
public static Point2D.Float getXY(float t, Point2D.Float begin, Point2D.Float ctrl, Point2D.Float end)
t
- distance on the curvectrl
- Control point in rel coordsend
- End point in rel coordspublic int getFrame()
public void setFrame(int frame)
frame
- Current frame.public Color getBaseColor()
public void setBaseColor(Color baseColor)
baseColor
- Base color.public Color getHighlightColor()
public void setHighlightColor(Color highlightColor)
highlightColor
- New highlight color.public int getPoints()
public void setPoints(int points)
points
- Total amount of points.public int getTrailLength()
public void setTrailLength(int trailLength)
trailLength
- Trail length in points.public final Shape getPointShape()
public final void setPointShape(Shape pointShape)
pointShape
- new Shape.public final Shape getTrajectory()
public final void setTrajectory(Shape trajectory)
trajectory
- New trajectory.public void setDirection(JXBusyLabel.Direction dir)
dir
- Spinning direction.public JXBusyLabel.Direction getDirection()
protected Shape provideShape(Graphics2D g, Object comp, int width, int height)
public void setPaintCentered(boolean paintCentered)
paintCentered
- Centering hint.Copyright © 2018. All rights reserved.