/*
* 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 Jeff Dinkins
* @author Dave Kloba
*/
{
/* Client Property keys for text and accelerator text widths */
/**
* Draws the point (<b>x</b>, <b>y</b>) in the current color.
*/
g.drawLine(x, y, x, y);
}
/*
* Convenience method for drawing a grooved line
*
*/
{
g.translate(x, y);
g.translate(-x, -y);
}
/** Draws <b>aString</b> in the rectangle defined by
* (<b>x</b>, <b>y</b>, <b>width</b>, <b>height</b>).
* <b>justification</b> specifies the text's justification, one of
* LEFT, CENTER, or RIGHT.
* <b>drawStringInRect()</b> does not clip to the rectangle, but instead
* uses this rectangle and the desired justification to compute the point
* at which to begin drawing the text.
* @see #drawString
*/
}
int justification) {
// throw new InconsistencyException("No font set");
return;
}
if (fontMetrics == null) {
// throw new InconsistencyException("No metrics for Font " + font());
return;
}
if (justification == CENTER) {
}
} else if (justification == RIGHT) {
}
} else {
startX = x;
}
if (delta < 0) {
delta = 0;
}
}
/**
* This method is not being used to paint menu item since
* 6.0 This code left for compatibility only. Do not use or
* override it, this will not cause any visible effect.
*/
int defaultTextIconGap)
{
g.setFont(f);
if (c.isOpaque()) {
g.setColor(background);
} else {
g.setColor(c.getBackground());
}
}
// get Accelerator text
if (accelerator != null) {
if (modifiers > 0) {
acceleratorText += "+";
}
}
// layout the text and icon
acceleratorText, b.getIcon(),
b.getVerticalAlignment(),
? 0 : defaultTextIconGap,
);
// Paint the Check
g.setColor(foreground);
}
// Paint the Icon
icon = b.getDisabledIcon();
icon = b.getPressedIcon();
// Use default icon
}
} else {
}
}
}
// Draw the Text
// Once BasicHTML becomes public, use BasicHTML.propertyKey
// instead of the hardcoded string below!
if (v != null) {
} else {
int mnemIndex = b.getDisplayedMnemonicIndex();
// *** paint the text disabled
} else {
// *** paint the text normally
g.setColor(foreground);
} else {
g.setColor(b.getForeground());
}
textRect.x,
}
}
}
// Draw the Accelerator Text
//Get the maxAccWidth from the parent to calculate the offset.
int accOffset = 0;
//Calculate the offset, with which the accelerator texts will be drawn with.
}
// *** paint the acceleratorText disabled
} else {
// *** paint the acceleratorText normally
{
g.setColor(foreground);
} else {
g.setColor(b.getForeground());
}
acceleratorRect.x - accOffset,
}
}
// Paint the Arrow
g.setColor(foreground);
}
}
/**
* Compute and return the location of the icons origin, the
* location of origin of the text baseline, and a possibly clipped
* version of the compound labels string. Locations are computed
* relative to the viewR rectangle.
*/
JComponent c,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int textIconGap,
int menuItemGap
)
{
fm,
text,
icon,
/* Initialize the acceelratorText bounds rectangle textR. If a null
* or and empty String was specified we substitute "" here
* and use 0,0,0,0 for acceleratorTextR.
*/
acceleratorText = "";
}
else {
}
/* Initialize the checkIcon bounds rectangle checkIconR.
*/
}
else {
}
/* Initialize the arrowIcon bounds rectangle arrowIconR.
*/
}
else {
}
if( MotifGraphicsUtils.isLeftToRight(c) ) {
// Position the Accelerator text rect
// Position the Check and Arrow Icons
checkIconR.x = viewR.x;
- arrowIconR.width;
} else {
// Position the Accelerator text rect
// Position the Check and Arrow Icons
}
// Align the accelertor text and the check and arrow icons vertically
// with the center of the label rect.
/*
System.out.println("Layout: v=" +viewR+" c="+checkIconR+" i="+
iconR+" t="+textR+" acc="+acceleratorR+" a="+arrowIconR);
*/
return text;
}
int x, int y,
{
// shadowed button region
g.setColor(background);
}
/*
* Convenience function for determining ComponentOrientation. Helps us
* avoid having Munge directives throughout the code.
*/
return c.getComponentOrientation().isLeftToRight();
}
}