/*
* 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.
*/
/**
* A Java L&F implementation of SliderUI.
* <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. As of 1.4, support for long term storage
* of all JavaBeans<sup><font size="-2">TM</font></sup>
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Tom Santos
*/
protected boolean filledSlider = false;
// NOTE: these next five variables are currently unused.
protected static int trackWidth;
protected static int tickLength;
private int safeLength;
/**
* A default horizontal thumb <code>Icon</code>. This field might not be
* used. To change the <code>Icon</code> used by this delgate directly set it
* using the <code>Slider.horizontalThumbIcon</code> UIManager property.
*/
/**
* A default vertical thumb <code>Icon</code>. This field might not be
* used. To change the <code>Icon</code> used by this delgate directly set it
* using the <code>Slider.verticalThumbIcon</code> UIManager property.
*/
return new MetalSliderUI();
}
public MetalSliderUI() {
super( null );
}
return SAFE_HORIZ_THUMB_ICON;
} else {
return horizThumbIcon;
}
}
return SAFE_VERT_THUMB_ICON;
} else {
return vertThumbIcon;
}
}
super.installUI( c );
scrollListener.setScrollByBlock( false );
}
return new MetalPropertyListener();
}
super.propertyChange( e );
}
}
}
private void prepareFilledSliderField() {
// Use true for Ocean theme
if (sliderFillProp != null) {
}
}
}
else {
}
}
/**
* Returns a rectangle enclosing the track that will be painted.
*/
}
else {
}
else {
}
}
}
if (MetalLookAndFeel.usingOcean()) {
oceanPaintTrack(g);
return;
}
int trackLeft = 0;
int trackTop = 0;
int trackRight;
int trackBottom;
// Draw the track
}
else {
if (leftToRight) {
}
else {
}
}
}
else {
}
// Draw the fill
if ( filledSlider ) {
int middleOfThumb;
int fillTop;
int fillLeft;
int fillBottom;
int fillRight;
if ( !drawInverted() ) {
}
else {
}
}
else {
if ( !drawInverted() ) {
}
else {
}
}
}
else {
}
}
}
boolean drawInverted = drawInverted();
"Slider.altTrackColor");
// Translate to the origin of the painting rectangle
// Width and height of the painting rectangle.
int fillMinX;
int fillMaxX;
if (middleOfThumb > 0) {
}
if (middleOfThumb < w) {
}
if (filledSlider) {
if (drawInverted) {
fillMaxX = w - 2;
} else {
fillMinX = 1;
}
if (h == 6) {
}
}
} else {
if (middleOfThumb > 0) {
if (!drawInverted && filledSlider) {
} else {
}
}
if (middleOfThumb < w) {
if (drawInverted && filledSlider) {
} else {
}
}
}
} else {
int fillMinY;
int fillMaxY;
if (middleOfThumb > 0) {
}
if (middleOfThumb < h) {
}
if (filledSlider) {
if (drawInverted()) {
fillMinY = 1;
if (leftToRight) {
} else {
}
} else {
fillMaxY = h - 2;
if (leftToRight) {
} else {
}
}
if (w == 6) {
}
}
} else {
if (middleOfThumb > 0) {
if (drawInverted && filledSlider) {
} else {
}
}
if (middleOfThumb < h) {
if (!drawInverted && filledSlider) {
} else {
}
}
}
}
}
}
}
else {
}
return size;
}
/**
* Gets the height of the tick area for horizontal sliders and the width of the
* tick area for vertical sliders. BasicSliderUI uses the returned value to
* determine the tick area rectangle.
*/
public int getTickLength() {
}
/**
* Returns the shorter dimension of the track.
*/
protected int getTrackWidth() {
// This strange calculation is here to keep the
// track in proportion to the thumb.
final double kIdealTrackWidth = 7.0;
final double kIdealThumbHeight = 16.0;
}
else {
}
}
/**
* Returns the longer dimension of the slide bar. (The slide bar is only the
* part that runs directly under the thumb)
*/
protected int getTrackLength() {
}
}
/**
* Returns the amount that the thumb goes past the slide bar.
*/
protected int getThumbOverhang() {
}
scrollByUnit( dir );
}
}
}
}
else {
}
}
}
else {
}
}
}