/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Windows rendition of the component.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is appropriate
* for short term storage or RMI between applications running the same
* version of Swing. A future release of Swing will provide support for
* long term persistence.
*
* @author Michael C. Albers
*/
{
return new WindowsProgressBarUI();
}
protected void installDefaults() {
super.installDefaults();
}
}
/**
* Returns the baseline.
*
* @throws NullPointerException {@inheritDoc}
* @throws IllegalArgumentException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
if (progressBar.isIndeterminate()) {
y = -1;
height--;
}
else {
y = 0;
height -= 3;
}
metrics.getLeading() -
}
return baseline;
}
return new Dimension(
(int)super.getPreferredInnerHorizontal().getWidth(),
}
return super.getPreferredInnerHorizontal();
}
return new Dimension(
(int)super.getPreferredInnerVertical().getHeight());
}
return super.getPreferredInnerVertical();
}
// amount of progress to draw
// Paint progress
if (progressBar.isStringPainted()) {
// Do not paint the standard stripes from the skin, because they obscure
// the text
barRectHeight -= 2;
barRectWidth -= 2;
if (!vertical) {
if (isLeftToRight) {
} else {
}
} else {
}
} else {
int thickness;
if (vertical) {
} else {
}
// See if we can squeeze in an extra chunk without spacing after
nChunks++;
}
for (int i = 0; i < nChunks; i++) {
if (vertical) {
} else {
if (isLeftToRight) {
} else {
}
}
}
}
} else {
super.paintDeterminate(g, c);
}
}
/**
* {@inheritDoc}
* @since 1.6
*/
super.setAnimationIndex(newValue);
// get the full repaint area and add it the
// previous one so we can erase it
if (previousFullBox != null) {
}
} else {
}
}
}
/**
* {@inheritDoc}
* @since 1.6
*/
return 6; // an apparently hard coded value in Windows
}
}
/**
* {@inheritDoc}
* @since 1.6
*/
== JProgressBar.VERTICAL);
int currentFrame = getAnimationIndex();
// this code adjusts the chunk size to properly account for the
// size and gap specified in the XP style. It also does it's own
// box placement for the chunk animation. This is required because
// the inherited algorithm from BasicProgressBarUI goes back and
// forth whereas XP only goes in one direction. XP also has ghosted
// trailing chunks to create the illusion of speed. This code
// adjusts the pixel length of the animation to account for the
// trails.
if (!vertical) {
} else {
}
}
return rect;
}
== JProgressBar.VERTICAL);
// Paint the bouncing box.
if (!(g instanceof Graphics2D)) {
return;
}
if (progressBar.isStringPainted()) {
if (!vertical) {
} else {
}
}
}
} else {
super.paintIndeterminate(g, c);
}
}
if (!vertical) {
} else {
}
}
boolean vertical,
// create a new graphics to keep drawing surface state
// calculate the chunk offsets
int deltax = 0;
int deltay = 0;
if (!vertical) {
deltay = 0;
} else {
deltax = 0;
}
// Calculate the area of the chunks combined
// save this box for the next time
// this is the entire progress bar minus the track and borders
// only paint where the chunks overlap with the progress bar drawing area
// adjust the cliprect to chop the chunks when they go off the end
// get the skin
// do the drawing
// get rid of our clip and composite changes
}
int barRectWidth, int barRectHeight) {
// Paint background
}
}