getAmountFull(Insets b,
int width,
int height)
This determines the amount of the progress bar that should be filled
based on the percent done gathered from the model.
protected int
getCellLength()
Returns the width (if HORIZONTAL) or height (if VERTICAL)
of each of the indivdual cells/units to be rendered in the
progress bar.
protected int
getCellSpacing()
Returns the spacing between each of the cells/units in the
progress bar.
getStringPlacement(Graphics g,
String progressString,
int x,
int y,
int width,
int height)
Designate the place where the progress string will be drawn.
The "selectionBackground" is the color of the text when it is drawn
over an unfilled area of the progress bar.
getCellLength
protected int getCellLength()
Returns the width (if HORIZONTAL) or height (if VERTICAL)
of each of the indivdual cells/units to be rendered in the
progress bar. However, for text rendering simplification and
aesthetic considerations, this function will return 1 when
the progress string is being rendered.
Returns the spacing between each of the cells/units in the
progress bar. However, for text rendering simplification and
aesthetic considerations, this function will return 0 when
the progress string is being rendered.
protected int getAmountFull(Insets b,
int width,
int height)
This determines the amount of the progress bar that should be filled
based on the percent done gathered from the model. This is a common
operation so it was abstracted out. It assumes that your progress bar
is linear. That is, if you are making a circular progress indicator,
you will want to override this method.
All purpose paint method that should do the right thing for almost
all linear progress bars. By setting a few values in the defaults
table, things should work just fine to paint your progress bar.
Naturally, override this if you are making a circular or
semi-circular progress bar.
protected void paintString(Graphics g,
int x,
int y,
int width,
int height,
int amountFull,
Insets b)
getStringPlacement
protected PointgetStringPlacement(Graphics g,
String progressString,
int x,
int y,
int width,
int height)
Designate the place where the progress string will be drawn.
This implementation places it at the center of the progress
bar (in both x and y). Override this if you want to right,
left, top, or bottom align the progress string or if you need
to nudge it around for any reason.
Submit a bug or feature For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, California, 94303, U.S.A. All Rights Reserved.