/*
* 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 collection of static utility methods used for rendering the Windows look
* and feel.
*
* @author Mark Davidson
* @since 1.4
*/
public class WindowsGraphicsUtils {
/**
* Renders a text String in Windows without the mnemonic.
* This is here because the WindowsUI hiearchy doesn't match the Component heirarchy. All
* the overriden paintText methods of the ButtonUI delegates will call this static method.
* <p>
* @param g Graphics context
* @param b Current button to render
* @param textRect Bounding rectangle to render the text.
* @param text String to render
*/
int textShiftOffset) {
int mnemIndex = b.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
if (WindowsLookAndFeel.isMnemonicHidden() == true) {
mnemIndex = -1;
}
} else {
}
}
/* Draw the Text */
/*** paint the text normally */
/* We shall not set foreground color for selected menu or
* armed menuitem. Foreground must be set in appropriate
* Windows* class because these colors passes from
* BasicMenuItemUI as protected fields and we can't
* reach them from this class */
g.setColor(b.getForeground());
}
} else { /*** paint the text disabled ***/
} else {
}
x + 1, y + 1);
}
}
}
}
}
if (textColor instanceof UIResource) {
// to work around an apparent bug in Windows, use the pushbutton
// color for disabled toolbar buttons if the disabled color is the
// same as the enabled color
}
}
// only draw shadow if developer hasn't changed the foreground color
// and if the current style has text shadows.
g.setColor(shadowColor);
x + offset.x,
y + offset.y);
}
}
}
}
return c.getComponentOrientation().isLeftToRight();
}
/*
* Repaints all the components with the mnemonics in the given window and
* all its owned windows.
*/
return;
}
}
}
/*
* Repaints all the components with the mnemonics in container.
* Recursively searches for all the subcomponents.
*/
Component c;
c = cont.getComponent(i);
continue;
}
if(c instanceof AbstractButton
c.repaint();
continue;
} else if(c instanceof JLabel
c.repaint();
continue;
}
if(c instanceof Container) {
}
}
}
}