|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
rcx.rcxtools.share.gui.ProgressBar
public class ProgressBar
The progress bar component is a lightweight component that can be easily incorporated into most Java programs. A progress bar is made up of a rectangle boarder, background color, a foreground color, and a percentage displayed in the center of the rectangle. The foreground color expands or contracts to fill the rectangle depending on the percentage passed in the updatebar method (for example if 50% is passed the progress bar will show the left half as the foreground color and the right half as the background color). The string percentage displayed inside the progress bar will change colors when the foreground color of the progress bar paints over it.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ProgressBar(int progrWidth,
int progrHeight)
Creates a progress bar using the passed width and height. |
|
ProgressBar(int progrWidth,
int progrHeight,
java.awt.Color canvasColor,
java.awt.Color progrColor,
java.awt.Color progrBackground)
Creates a progress bar using the passed width, height, canvas color, progress bar foreground color, and progress bar background color. |
Method Summary | |
---|---|
void |
paint(java.awt.Graphics g)
Paints the progress bar on the canvas. |
void |
paintNow()
|
void |
setBackground(java.awt.Color progressBackground)
|
void |
setBackGroundColor(java.awt.Color progressBackground)
Sets the background color of the progress bar. |
void |
setCanvasColor(java.awt.Color color)
Sets the background color of the canvas the progress bar is drawn on. |
void |
setForeground(java.awt.Color progressForeground)
|
void |
setProgressColor(java.awt.Color progressColor)
Sets the foreground color of the progress bar. |
void |
update(java.awt.Graphics g)
|
void |
updateBar(float percentage)
This method is called when another component wants to update the progress bar. |
Methods inherited from class java.awt.Canvas |
---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProgressBar(int progrWidth, int progrHeight)
public ProgressBar(int progrWidth, int progrHeight, java.awt.Color canvasColor, java.awt.Color progrColor, java.awt.Color progrBackground)
Method Detail |
---|
public void updateBar(float percentage)
public void setCanvasColor(java.awt.Color color)
public void setProgressColor(java.awt.Color progressColor)
public void setBackGroundColor(java.awt.Color progressBackground)
public void setForeground(java.awt.Color progressForeground)
setForeground
in class java.awt.Component
public void setBackground(java.awt.Color progressBackground)
setBackground
in class java.awt.Component
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public void update(java.awt.Graphics g)
update
in class java.awt.Canvas
public void paintNow()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |