/*
* 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.
*/
/**
* This is a dumping ground for random stuff we want to use in several places.
*
* @author Steve Wilson
*/
class MetalUtils {
}
/**
* This draws the "Flush 3D Border" which is used throughout the Metal L&F
*/
g.translate( x, y);
g.translate( -x, -y);
}
/**
* This draws a variant "Flush 3D Border"
* It is used for things like pressed buttons.
*/
}
g.translate( x, y);
g.translate(-x, -y);
}
/**
* This draws a variant "Flush 3D Border"
* It is used for things like pressed buttons.
*/
g.translate( x, y);
g.translate( -x, -y);
}
/**
* This draws a variant "Flush 3D Border"
* It is used for things like active toggle buttons.
* This is used rarely.
*/
}
/**
* This draws a variant "Flush 3D Border"
* It is used for things like active toggle buttons.
* This is used rarely.
*/
g.translate( x, y);
g.translate( -x, -y);
}
if (active) {
drawActiveButtonBorder(g, x, y, w, h);
} else {
drawFlush3DBorder(g, x, y, w, h);
}
}
drawFlush3DBorder(g, x, y, w, h);
}
g.translate(x, y);
g.translate(-x, -y);
}
g.translate(x, y);
g.translate(-x, -y);
}
/*
* Convenience function for determining ComponentOrientation. Helps us
* avoid having Munge directives throughout the code.
*/
return c.getComponentOrientation().isLeftToRight();
}
}
try {
} catch (NumberFormatException nfe) {}
}
return defaultValue;
}
//
// Ocean specific stuff.
//
/**
* Draws a radial type gradient. The gradient will be drawn vertically if
* <code>vertical</code> is true, otherwise horizontally.
* The UIManager key consists of five values:
* r1 r2 c1 c2 c3. The gradient is broken down into four chunks drawn
* in order from the origin.
* <ol>
* <li>Gradient r1 % of the size from c1 to c2
* <li>Rectangle r2 % of the size in c2.
* <li>Gradient r1 % of the size from c2 to c1
* <li>The remaining size will be filled with a gradient from c1 to c3.
* </ol>
*
* @param c Component rendering to
* @param g Graphics to draw to.
* @param key UIManager key used to look up gradient values.
* @param x X coordinate to draw from
* @param y Y coordinate to draw from
* @param w Width to draw to
* @param h Height to draw to
* @param vertical Direction of the gradient
* @return true if <code>key</code> exists, otherwise false.
*/
int x, int y, int w, int h, boolean vertical) {
return false;
}
if (w <= 0 || h <= 0) {
return true;
}
return true;
}
/**
* Instance used for painting. This is the only instance that is
* ever created.
*/
// Size of images to create. For vertical gradients this is the width,
// otherwise it's the height.
/**
* This is the actual width we're painting in, or last painted to.
*/
private int w;
/**
* This is the actual height we're painting in, or last painted to
*/
private int h;
super(count);
}
int h, boolean isVertical) {
int imageWidth;
int imageHeight;
if (isVertical) {
imageHeight = h;
}
else {
imageWidth = w;
}
synchronized(c.getTreeLock()) {
this.w = w;
this.h = h;
}
}
// Render to the VolatileImage
if (isVertical) {
}
else {
}
}
// Render to the screen
g.translate(x, y);
if (isVertical) {
}
}
else {
}
}
g.translate(-x, -y);
}
if (mid > 0) {
}
if (mid2 > 0) {
}
if (mid > 0) {
}
(float)0, (float)h, c3));
}
}
if (mid > 0) {
}
if (mid2 > 0) {
}
if (mid > 0) {
}
w, (float)0, c3));
}
}
}
}
/**
* Returns true if the specified widget is in a toolbar.
*/
}
new OceanToolBarImageFilter());
}
int min = 180;
int max = 215;
}
}
/**
* Used to create a disabled Icon with the ocean look.
*/
private float min;
private float factor;
canFilterIndexColorModel = true;
}
// Coefficients are from the sRGB color space:
(gray << 0);
}
}
/**
* Used to create the rollover icons with the ocean look.
*/
canFilterIndexColorModel = true;
}
int b = (rgb & 0xff);
(gray << 0);
}
}
}