public class SynthProgressBarUI extends BasicProgressBarUIimplements SynthUI , PropertyChangeListener
JProgressBar.
BasicProgressBarUI.ChangeHandler boxRect, changeListener, progressBarDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED| Constructor and Description |
|---|
SynthProgressBarUI()
|
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent
Creates a new UI object for the given component.
|
int |
getBaseline(JComponent
Returns the baseline.
|
protected Rectangle |
getBox(Rectangle
Stores the position and size of the bouncing box that would be painted for the current animation index in
r and returns
r.
|
SynthContext |
getContext(JComponent
Returns the Context for the specified component.
|
Dimension |
getPreferredSize(JComponent
Returns the specified component's preferred size appropriate for the look and feel.
|
protected void |
installDefaults()
|
protected void |
installListeners()
|
void |
paint(Graphics
Paints the specified component according to the Look and Feel.
|
protected void |
paint(SynthContext
Paints the specified component.
|
void |
paintBorder(SynthContext
Paints the border.
|
protected void |
paintText(SynthContext
Paints the component's text.
|
void |
propertyChange(PropertyChangeEvent
This method gets called when a bound property is changed.
|
protected void |
setAnimationIndex(int newValue)
Sets the index of the current animation frame to the specified value and requests that the progress bar be repainted.
|
protected void |
uninstallDefaults()
|
protected void |
uninstallListeners()
Removes all listeners installed by this object.
|
void |
update(Graphics
Notifies this UI delegate to repaint the specified component.
|
getAmountFull, getAnimationIndex, getBaselineResizeBehavior, getBoxLength, getCellLength, getCellSpacing, getFrameCount, getMaximumSize, getMinimumSize, getPreferredInnerHorizontal, getPreferredInnerVertical, getSelectionBackground, getSelectionForeground, getStringPlacement, incrementAnimationIndex, installUI, paintDeterminate, paintIndeterminate, paintString, setCellLength, setCellSpacing, startAnimationTimer, stopAnimationTimer, uninstallUIcontains, getAccessibleChild, getAccessibleChildrenCountpublic static ComponentUIcreateUI(JComponent x)
x - component to create UI object for
protected void installListeners()
protected void uninstallListeners()
protected void installDefaults()
protected void uninstallDefaults()
public SynthContextgetContext(JComponent c)
getContext in interface
SynthUI
c - Component requesting SynthContext.
public int getBaseline(JComponentc, int width, int height)
getBaseline in class
BasicProgressBarUI
c -
JComponent baseline is being requested for
width - the width to get the baseline for
height - the height to get the baseline for
JComponent.getBaseline(int, int)
protected RectanglegetBox(Rectangle r)
r and returns
r. Subclasses that add to the painting performed in this class's implementation of
paintIndeterminate -- to draw an outline around the bouncing box, for example -- can use this method to get the location of the bouncing box that was just painted. By overriding this method, you have complete control over the size and position of the bouncing box, without having to reimplement
paintIndeterminate.
getBox in class
BasicProgressBarUI
r - the Rectangle instance to be modified; may be
null
null if no box should be drawn; otherwise, returns the passed-in rectangle (if non-null) or a new rectangle
BasicProgressBarUI.setAnimationIndex(int)
protected void setAnimationIndex(int newValue)
repaint method is invoked.
setAnimationIndex in class
BasicProgressBarUI
newValue - the new animation index; no checking is performed on its value
BasicProgressBarUI.incrementAnimationIndex()
public void update(Graphicsg, JComponent c)
paint(SynthContext,Graphics) method.
In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.
update in class
ComponentUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
public void paint(Graphicsg, JComponent c)
This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext,Graphics) method.
paint in class
BasicProgressBarUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
protected void paint(SynthContextcontext, Graphics g)
context - context for the component being painted
g - the
Graphics object used for painting
update(Graphics,JComponent)
protected void paintText(SynthContextcontext, Graphics g, String title)
context - context for the component being painted
g -
Graphics object used for painting
title - the text to paint
public void paintBorder(SynthContextcontext, Graphics g, int x, int y, int w, int h)
paintBorder in interface
SynthUI
context - a component context
g -
Graphics to paint on
x - the X coordinate
y - the Y coordinate
w - width of the border
h - height of the border
public void propertyChange(PropertyChangeEvente)
propertyChange in interface
PropertyChangeListener
e - A PropertyChangeEvent object describing the event source and the property that has changed.
public DimensiongetPreferredSize(JComponent c)
null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns
null.
getPreferredSize in class
BasicProgressBarUI
c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
JComponent.getPreferredSize() ,
LayoutManager.preferredLayoutSize(java.awt.Container)