|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
eu.hansolo.custom.AnimatedProgress
public class AnimatedProgress extends JComponent
| Fields inherited from class JComponent | |
|---|---|
| WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT |
| Fields inherited from class Container | |
|---|---|
| TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT |
| Constructor Summary | |
AnimatedProgress()
Creates new form AnimatedProgressBar |
|
| Method Summary | |
|---|---|
void
|
actionPerformed(ActionEvent EVENT)
|
private double
|
calcFactor()
|
Color
|
getColor()
|
int
|
getCornerRadius()
Get the radius of the rounded rectangle which is used for the bar. |
Color
|
getCycleFirstColor()
|
Color
|
getCycleSecondColor()
|
Color
|
getForegroundColor()
|
private int
|
getGrayScaleIntensity(Color COLOR)
|
String
|
getInfiniteText()
|
Color
|
getInfiniteTextColor()
|
double
|
getMaxValue()
|
Dimension
|
getMinimumSize()
|
double
|
getPercentage()
|
double
|
getValue()
Get the current value of the bar @return |
private void
|
initComponents()
|
boolean
|
isInfinite()
|
boolean
|
isInfiniteTextVisible()
|
boolean
|
isPercentageVisible()
|
boolean
|
isRoundedCorners()
|
boolean
|
isTilted()
|
boolean
|
isValueVisible()
|
protected void
|
paintComponent(Graphics g)
|
private void
|
prepareForms()
Prepare all forms for the given width |
private void
|
recalc()
|
void
|
reset()
Reset the bar so that you can restart it with different parameters again. |
private void
|
setBarWidth(int BAR_WIDTH)
Set the width of the bar in pixels |
void
|
setColor(Color COLOR)
Set the color of the gradient by using the given color as cycleSecondColor and a darkened version of the given color as cycleFirstColor. |
void
|
setCornerRadius(int CORNER_RADIUS)
Set the radius of the rounded rectangle which is used for the bar |
void
|
setCycleFirstColor(Color CYCLE_FIRST_COLOR)
Set the first color of the gradient. |
void
|
setCycleSecondColor(Color CYCLE_SECOND_COLOR)
Set the second color of the gradient. |
private void
|
setCyclicStart(float CYCLE_POS_X)
Redefine the start position of the gradient paint and repaint the bar in dependence of showValue and showPercent variable. |
void
|
setForegroundColor(Color FOREGROUND_COLOR)
Set the color of the text to the given value |
void
|
setInfinite(boolean INFINITE)
Enable or disable the infinite progress which means it is tilted, there is no value and it is only a 100% |
void
|
setInfiniteText(String INFINITE_TEXT)
|
void
|
setInfiniteTextColor(Color INFINITE_TEXT_COLOR)
|
void
|
setInfiniteTextVisible(boolean INFINITE_TEXT_VISIBLE)
|
void
|
setMaxValue(double MAX_VALUE)
Set the maximum value for the bar |
void
|
setPercentage(double PERCENTAGE)
Set the current value of the bar as a percentage value (0 - 100). |
void
|
setPercentageVisible(boolean PERCENTAGE_VISIBLE)
Enable or disable the visibility of the value as a percentage value in the center of the bar. |
void
|
setRoundedCorners(boolean ROUNDED_CORNERS)
|
void
|
setTilted(boolean tilted)
Enable or disable a tilted gradient |
void
|
setValue(double VALUE)
Set the current value of the bar |
void
|
setValueVisible(boolean VALUE_VISIBLE)
Enable or disable the visibility of the value as a number in the center of the bar. |
String
|
toString()
|
| Field Detail |
|---|
private Color[] COLORS_BOTTOM_LIGHTS
private Color[] COLORS_CENTER_SHADOW
private Color[] COLORS_TOP_LIGHTS
private final ComponentAdapter COMPONENT_LISTENER
private final Timer CYCLE_TIMER
private float[] DIST_BOTTOM_LIGHTS
private float[] DIST_CENTER_SHADOW
private float[] DIST_FINISHED
private float[] DIST_STANDARD
private float[] DIST_TILTED
private float[] DIST_TOP_LIGHTS
private Color FRAME_COLOR
private Color OUTER_SHADOW_1_COLOR
private float PERIOD
private Font STD_FONT
private int alpha
private int barHeight
private int barWidth
private Area bottomLightArea
private LinearGradientPaint bottomLightGradient
private LinearGradientPaint centerShadowGradient
private Shape centerShadowRoundedRect
private Color color
private int cornerRadius
private Color[] cycleColors
private Color cycleFirstColor
private double cycleLimit
private float cyclePosX
private Color cycleSecondColor
private LinearGradientPaint cyclicJava6
private Point2D endPoint
private double factor
private boolean fadeOut
private Area fixedBar
private Color foregroundColor
private boolean infinite
private String infiniteText
private Color infiniteTextColor
private boolean infiniteTextVisible
private double maxValue
private FontMetrics metrics
private double percentage
private boolean percentageVisible
private float posX
private float posY
private Shape roundRectFixedBar
private Shape roundRectVariableBar
private boolean roundedCorners
private Point2D startPoint
private Rectangle2D textBoundary
private boolean tilted
private Area topLightArea
private LinearGradientPaint topLightGradient
private Line2D upperDarkLine
private double value
private boolean valueVisible
private Area variableBar
private int x
| Constructor Detail |
|---|
public AnimatedProgress()
| Method Detail |
|---|
@Override public void actionPerformed(ActionEvent EVENT)
private double calcFactor()
public Color getColor()
public int getCornerRadius()
public Color getCycleFirstColor()
public Color getCycleSecondColor()
public Color getForegroundColor()
private int getGrayScaleIntensity(Color COLOR)
public String getInfiniteText()
public Color getInfiniteTextColor()
public double getMaxValue()
@Override public Dimension getMinimumSize()
public double getPercentage()
public double getValue()
private void initComponents()
public boolean isInfinite()
public boolean isInfiniteTextVisible()
public boolean isPercentageVisible()
public boolean isRoundedCorners()
public boolean isTilted()
public boolean isValueVisible()
@Override protected void paintComponent(Graphics g)
private void prepareForms()
private void recalc()
public void reset()
private void setBarWidth(int BAR_WIDTH)
public void setColor(Color COLOR)
public void setCornerRadius(int CORNER_RADIUS)
public void setCycleFirstColor(Color CYCLE_FIRST_COLOR)
public void setCycleSecondColor(Color CYCLE_SECOND_COLOR)
private void setCyclicStart(float CYCLE_POS_X)
public void setForegroundColor(Color FOREGROUND_COLOR)
public void setInfinite(boolean INFINITE)
public void setInfiniteText(String INFINITE_TEXT)
public void setInfiniteTextColor(Color INFINITE_TEXT_COLOR)
public void setInfiniteTextVisible(boolean INFINITE_TEXT_VISIBLE)
public void setMaxValue(double MAX_VALUE)
public void setPercentage(double PERCENTAGE)
public void setPercentageVisible(boolean PERCENTAGE_VISIBLE)
public void setRoundedCorners(boolean ROUNDED_CORNERS)
public void setTilted(boolean tilted)
public void setValue(double VALUE)
public void setValueVisible(boolean VALUE_VISIBLE)
@Override public String toString()
Groovy Documentation