/*
* 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.
*/
/*
* @author Hans Muller
*/
public class BasicGraphicsUtils
{
{
g.translate(x, y);
g.setColor(darkShadow);
g.translate(-x, -y);
}
/**
* Returns the amount of space taken up by a border drawn by
* <code>drawEtchedRect()</code>
*
* @return the inset of an etched rect
*/
return ETCHED_INSETS;
}
{
g.translate(x, y);
g.translate(-x, -y);
}
/**
* Returns the amount of space taken up by a border drawn by
* <code>drawGroove()</code>
*
* @return the inset of a groove border
*/
return GROOVE_INSETS;
}
{
g.translate(x, y);
g.setColor(darkShadow);
} else if (isPressed) {
drawLoweredBezel(g, x, y, w, h,
} else if (isDefault) {
g.setColor(darkShadow);
g.setColor(darkShadow);
} else {
g.setColor(darkShadow);
}
g.translate(-x, -y);
}
g.setColor(darkShadow);
}
/** Draw a string with the graphics <code>g</code> at location (x,y)
* just like <code>g.drawString</code> would.
* The first occurrence of <code>underlineChar</code>
* in text will be underlined. The matching algorithm is
* not case sensitive.
*/
int index=-1;
if (underlinedChar != '\0') {
if(uci == -1) {
}
else if(lci == -1) {
}
else {
}
}
}
/**
* Draw a string with the graphics <code>g</code> at location
* (<code>x</code>, <code>y</code>)
* just like <code>g.drawString</code> would.
* The character at index <code>underlinedIndex</code>
* in text will be underlined. If <code>index</code> is beyond the
* bounds of <code>text</code> (including < 0), nothing will be
* underlined.
*
* @param g Graphics to draw with
* @param text String to draw
* @param underlinedIndex Index of character in text to underline
* @param x x coordinate to draw at
* @param y y coordinate to draw at
* @since 1.4
*/
int underlinedIndex, int x,int y) {
underlinedIndex, x, y);
}
// draw upper and lower horizontal dashes
}
// draw left and right vertical dashes
}
}
{
if(b.getComponentCount() > 0) {
return null;
}
b.getVerticalAlignment(), b.getHorizontalAlignment(),
);
/* The preferred size of the button is the size of
* the text and icon rectangles plus the buttons insets.
*/
return r.getSize();
}
/*
* Convenience function for determining ComponentOrientation. Helps us
* avoid having Munge directives throughout the code.
*/
return c.getComponentOrientation().isLeftToRight();
}
return (event.getModifiers() &
}
}