/*
* 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.
*/
/*
* <p>These classes are designed to be used while the
* corresponding <code>LookAndFeel</code> class has been installed
* (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
* Using them while a different <code>LookAndFeel</code> is installed
* may produce unexpected results, including exceptions.
* Additionally, changing the <code>LookAndFeel</code>
* maintained by the <code>UIManager</code> without updating the
* corresponding <code>ComponentUI</code> of any
* <code>JComponent</code>s may also produce unexpected results,
* such as the wrong colors showing up, and is generally not
* encouraged.
*
*/
/**
* Implements Windows XP Styles for the Windows Look and Feel.
*
* @author Leif Samuelsson
*/
class XPStyle {
// Singleton instance of this class
// Singleton instance of SkinPainter
private boolean flatMenus;
static {
}
/** Static method for clearing the hashmap and loading the
* current XP style and theme
*/
static synchronized void invalidateStyle() {
themeActive = null;
skinPainter.flush();
}
/** Get the singleton instance of this class
*
* @return the singleton instance of this class or null if XP styles
* are not active or if this is not Windows XP
*/
if (themeActive == null) {
if (themeActive == null) {
}
if (themeActive.booleanValue()) {
new GetPropertyAction("swing.noxp");
ThemeReader.isThemed() &&
instanceof WindowsClassicLookAndFeel)) {
}
}
}
return xp;
}
static boolean isVista() {
}
/** Get a named <code>String</code> value from the current style
*
* @param part a <code>Part</code>
* @param state a <code>String</code>
* @param attributeKey a <code>String</code>
* @return a <code>String</code> or null if key is not found
* in the current style
*
* This is currently only used by WindowsInternalFrameTitlePane for painting
* title foregound and can be removed when no longer needed
*/
}
}
if (enumValue == -1) {
return null;
}
}
/** Get a named <code>int</code> value from the current style
*
* @param part a <code>Part</code>
* @return an <code>int</code> or null if key is not found
* in the current style
*/
}
/** Get a named <code>Dimension</code> value from the current style
*
* @param key a <code>String</code>
* @return a <code>Dimension</code> or null if key is not found
* in the current style
*
* This is currently only used by WindowsProgressBarUI and the value
* should probably be cached there instead of here.
*/
}
/** Get a named <code>Point</code> (e.g. a location or an offset) value
* from the current style
*
* @param key a <code>String</code>
* @return a <code>Point</code> or null if key is not found
* in the current style
*
* This is currently only used by WindowsInternalFrameTitlePane for painting
* title foregound and can be removed when no longer needed
*/
if (d != null) {
} else {
return null;
}
}
/** Get a named <code>Insets</code> value from the current style
*
* @param key a <code>String</code>
* @return an <code>Insets</code> object or null if key is not found
* in the current style
*
* This is currently only used to create borders and by
* WindowsInternalFrameTitlePane for painting title foregound.
* The return value is already cached in those places.
*/
}
/** Get a named <code>Color</code> value from the current style
*
* @param part a <code>Part</code>
* @return a <code>Color</code> or null if key is not found
* in the current style
*/
}
}
}
}
/** Get a named <code>Border</code> value from the current style
*
* @param part a <code>Part</code>
* @return a <code>Border</code> or null if key is not found
* in the current style or if the style for the particular
* part is not defined as "borderfill".
*/
// Special case because XP has no skin for menus
if (flatMenus) {
// TODO: The classic border uses this color, but we should
// create a new UI property called "PopupMenu.borderColor"
// instead.
1);
} else {
return null; // Will cause L&F to use classic border
}
}
}
if (m != null) {
} else {
} else {
border = new XPEmptyBorder(m);
}
}
}
}
}
}
return border;
}
}
//
// Ideally we'd have an interface defined for classes which
// support margins (to avoid this hackery), but we've
// decided against it for simplicity
//
if (c instanceof AbstractButton) {
} else if (c instanceof JToolBar) {
} else if (c instanceof JTextComponent) {
}
return insets;
}
}
}
// special casing for comboboxes.
// there may be more special cases in the future
if(c instanceof JComboBox) {
// note. in the future this should be replaced with a call
// to BasicLookAndFeel.getUIOfType()
}
}
}
}
}
}
if(borderInsets == null) {
}
//
// Ideally we'd have an interface defined for classes which
// support margins (to avoid this hackery), but we've
// decided against it for simplicity
//
if (c instanceof AbstractButton) {
} else if (c instanceof JToolBar) {
} else if (c instanceof JTextComponent) {
}
return insets;
}
}
}
if (c instanceof AbstractButton) {
// if this is a toolbar button then ignore getMargin()
// and subtract the padding added by the constructor
&& ! (c instanceof JRadioButton)
&& ! (c instanceof JCheckBox)
&& m instanceof InsetsUIResource) {
} else {
margin = m;
}
} else if (c instanceof JToolBar) {
} else if (c instanceof JTextComponent) {
}
}
return insets;
}
}
}
/** Get a <code>Skin</code> object from the current style
* for a named part (component type)
*
* @param part a <code>Part</code>
* @return a <code>Skin</code> object
*/
}
}
/** A class which encapsulates attributes for a given part
* (component type) and which provides methods for painting backgrounds
* and glyphs
*/
static class Skin {
}
}
}
}
/* idk: it seems margins are the same for all 'big enough'
* bounding rectangles.
*/
int boundingWidth = 100;
int boundingHeight = 100;
}
}
}
int getWidth() {
}
}
}
int getHeight() {
}
return string;
}
}
public int hashCode() {
}
/** Paint a skin at x, y.
*
* @param g the graphics context to use for painting
* @param dx the destination <i>x</i> coordinate
* @param dy the destination <i>y</i> coordinate
* @param state which state to paint
*/
}
}
/** Paint a skin in an area defined by a rectangle.
*
* @param g the graphics context to use for painting
* @param r a <code>Rectangle</code> defining the area to fill,
* may cause the image to be stretched or tiled
* @param state which state to paint
*/
}
/** Paint a skin at a defined position and size
* This method supports animation.
*
* @param g the graphics context to use for painting
* @param dx the destination <i>x</i> coordinate
* @param dy the destination <i>y</i> coordinate
* @param dw the width of the area to fill, may cause
* the image to be stretched or tiled
* @param dh the height of the area to fill, may cause
* the image to be stretched or tiled
* @param state which state to paint
*/
&& component instanceof JComponent
} else {
}
}
/** Paint a skin at a defined position and size. This method
* does not trigger animation. It is needed for the animation
* support.
*
* @param g the graphics context to use for painting
* @param dx the destination <i>x</i> coordinate.
* @param dy the destination <i>y</i> coordinate.
* @param dw the width of the area to fill, may cause
* the image to be stretched or tiled
* @param dh the height of the area to fill, may cause
* the image to be stretched or tiled
* @param state which state to paint
*/
}
/** Paint a skin at a defined position and size
*
* @param g the graphics context to use for painting
* @param dx the destination <i>x</i> coordinate
* @param dy the destination <i>y</i> coordinate
* @param dw the width of the area to fill, may cause
* the image to be stretched or tiled
* @param dh the height of the area to fill, may cause
* the image to be stretched or tiled
* @param state which state to paint
* @param borderFill should test if the component uses a border fill
and skip painting if it is
*/
boolean borderFill) {
return;
}
}
}
SkinPainter() {
super(30);
flush();
}
public void flush() {
super.flush();
}
boolean accEnabled = false;
}
if (c == null) {
}
// Note that stealData() requires a markDirty() afterwards
// since we modify the data in it.
0, 0, w, h, w);
}
}
}
setContentAreaFilled(false);
}
public boolean isFocusTraversable() {
return false;
}
if (!isEnabled()) {
} else if (getModel().isRollover()) {
}
return state;
}
}
revalidate();
repaint();
}
}
}
// Private constructor
private XPStyle() {
// Note: All further access to the maps must be synchronized
}
}
}
// We can use any widget name here, I guess.
}
}