APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.synth

public Class SynthProgressBarUI

extends BasicProgressBarUI
implements SynthUI, PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.plaf.synth.SynthUI, javax.swing.plaf.synth.SynthConstants
Imports
java.awt.*, java.awt.geom.AffineTransform, javax.swing.*, javax.swing.plaf.*, javax.swing.plaf.basic.BasicProgressBarUI, java.beans.PropertyChangeListener, .PropertyChangeEvent, sun.swing.SwingUtilities2

Provides the Synth L&F UI delegate for javax.swing.JProgressBar.
Author
Joshua Outwater
Since
1.7

Field Summary

Modifier and TypeField and Description
private int
private Dimension
private boolean
private int
private boolean
private SynthStyle
private boolean
private int
Inherited from javax.swing.plaf.basic.BasicProgressBarUI:
boxRectchangeListenerprogressBar

Constructor Summary

AccessConstructor and Description
public
SynthProgressBarUI()

Constructs a SynthProgressBarUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

the UI object
createUI
(JComponent
component to create UI object for
x
)

Hides javax.swing.plaf.basic.BasicProgressBarUI.createUI.

Creates a new UI object for the given component.

public int
getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.getBaseline.

Returns the baseline.

protected Rectangle
getBox(Rectangle r)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.getBox.

Stores the position and size of the bouncing box that would be painted for the current animation index in r and returns r.

private int
public SynthContext
getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

private SynthContext
getContext(JComponent c, int state)

public Dimension
getPreferredSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel.

protected void
protected void
public void
paint(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.paint.

Paints the specified component according to the Look and Feel.

protected void
paint(SynthContext
context for the component being painted
context
,
Graphics
the Graphics object used for painting
g
)

Paints the specified component.

public void
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

protected void
paintText(SynthContext
context for the component being painted
context
,
Graphics
Graphics object used for painting
g
,
String
the text to paint
title
)

Paints the component's text.

public void
propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

protected void
setAnimationIndex(int newValue)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex.

Sets the index of the current animation frame to the specified value and requests that the progress bar be repainted.

protected void
protected void
uninstallListeners()

Overrides javax.swing.plaf.basic.BasicProgressBarUI.uninstallListeners.

Removes all listeners installed by this object.

public void
update(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component.

private void
Inherited from javax.swing.plaf.basic.BasicProgressBarUI:
getAmountFullgetAnimationIndexgetBaselineResizeBehaviorgetBoxLengthgetCellLengthgetCellSpacinggetFrameCountgetMaximumSizegetMinimumSizegetPreferredInnerHorizontalgetPreferredInnerVerticalgetSelectionBackgroundgetSelectionForegroundgetStringPlacementincrementAnimationIndexinstallUIpaintDeterminatepaintIndeterminatepaintStringsetCellLengthsetCellSpacingstartAnimationTimerstopAnimationTimeruninstallUI

Field Detail

glowWidthback to summary
private int glowWidth
minBarSizeback to summary
private Dimension minBarSize
paintOutsideClipback to summary
private boolean paintOutsideClip
progressPaddingback to summary
private int progressPadding
rotateTextback to summary
private boolean rotateText
styleback to summary
private SynthStyle style
tileWhenIndeterminateback to summary
private boolean tileWhenIndeterminate
tileWidthback to summary
private int tileWidth

Constructor Detail

SynthProgressBarUIback to summary
public SynthProgressBarUI()

Constructs a SynthProgressBarUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent x)

Hides javax.swing.plaf.basic.BasicProgressBarUI.createUI.

Creates a new UI object for the given component.

Parameters
x:JComponent

component to create UI object for

Returns:ComponentUI

the UI object

getBaselineback to summary
public int getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.getBaseline.

Doc from javax.swing.plaf.basic.BasicProgressBarUI.getBaseline.

Returns the baseline.

Annotations
@Override
getBoxback to summary
protected Rectangle getBox(Rectangle r)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.getBox.

Doc from javax.swing.plaf.basic.BasicProgressBarUI.getBox.

Stores the position and size of the bouncing box that would be painted for the current animation index in 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.

Annotations
@Override
getComponentStateback to summary
private int getComponentState(JComponent c)
getContextback to summary
public SynthContext getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Doc from javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

Annotations
@Override
getContextback to summary
private SynthContext getContext(JComponent c, int state)
getPreferredSizeback to summary
public Dimension getPreferredSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize.

Doc from javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel. If 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.

Annotations
@Override
installDefaultsback to summary
protected void installDefaults()

Overrides javax.swing.plaf.basic.BasicProgressBarUI.installDefaults.

Doc from javax.swing.plaf.basic.BasicProgressBarUI.installDefaults.

Installs default properties.

Annotations
@Override
installListenersback to summary
protected void installListeners()

Overrides javax.swing.plaf.basic.BasicProgressBarUI.installListeners.

Doc from javax.swing.plaf.basic.BasicProgressBarUI.installListeners.

Registers listeners.

Annotations
@Override
paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.paint.

Paints the specified component according to the Look and Feel.

This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext, Graphics) method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
paintback to summary
protected void paint(SynthContext context, Graphics g)

Paints the specified component.

Parameters
context:SynthContext

context for the component being painted

g:Graphics

the Graphics object used for painting

See Also
update(Graphics, JComponent)
paintBorderback to summary
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Doc from javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

Annotations
@Override
paintTextback to summary
protected void paintText(SynthContext context, Graphics g, String title)

Paints the component's text.

Parameters
context:SynthContext

context for the component being painted

g:Graphics

Graphics object used for painting

title:String

the text to paint

propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Annotations
@Override
setAnimationIndexback to summary
protected void setAnimationIndex(int newValue)

Overrides javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex.

Doc from javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex.

Sets the index of the current animation frame to the specified value and requests that the progress bar be repainted. Subclasses that don't use the default painting code might need to override this method to change the way that the repaint method is invoked.

Annotations
@Override
uninstallDefaultsback to summary
protected void uninstallDefaults()

Overrides javax.swing.plaf.basic.BasicProgressBarUI.uninstallDefaults.

Doc from javax.swing.plaf.basic.BasicProgressBarUI.uninstallDefaults.

Unintalls default properties.

Annotations
@Override
uninstallListenersback to summary
protected void uninstallListeners()

Overrides javax.swing.plaf.basic.BasicProgressBarUI.uninstallListeners.

Doc from javax.swing.plaf.basic.BasicProgressBarUI.uninstallListeners.

Removes all listeners installed by this object.

Annotations
@Override
updateback to summary
public void update(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls the 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.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
updateStyleback to summary
private void updateStyle(JProgressBar c)