2362N/A * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Factory object that vends <code>Icon</code>s for 0N/A * the Java<sup><font size="-2">TM</font></sup> look and feel (Metal). 0N/A * These icons are used extensively in Metal via the defaults mechanism. 0N/A * While other look and feels often use GIFs for icons, creating icons 0N/A * in code facilitates switching to other themes. 0N/A * Each method in this class returns 0N/A * either an <code>Icon</code> or <code>null</code>, 0N/A * where <code>null</code> implies that there is no default icon. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * @author Michael C. Albers 0N/A // List of code-drawn Icons 0N/A public static final boolean DARK =
false;
0N/A public static final boolean LIGHT =
true;
0N/A // Accessor functions for Icons. Does the caching work. 0N/A * Returns a checkbox icon. 0N/A * Returns an icon to be used by <code>JCheckBoxMenuItem</code>. 0N/A * @return the default icon for check box menu items, 0N/A * or <code>null</code> if no default exists 0N/A // don't cache these, bumps don't get updated otherwise 0N/A // don't cache these, bumps don't get updated otherwise 0N/A // File Chooser Detail View code 0N/A // Draw outside edge of each of the documents 0N/A // Draw little dots next to documents 0N/A // Same color as outside edge 0N/A // Draw inner highlight on documents 0N/A // Draw inner inner highlight on documents 0N/A }
// End class FileChooserDetailViewIcon 0N/A // File Chooser Home Folder code 0N/A // Draw outside edge of house 0N/A // same color as edge of house 0N/A // same color as roof body 0N/A }
// End class FileChooserHomeFolderIcon 0N/A // File Chooser List View code 0N/A // Draw outside edge of each of the documents 0N/A // Draw little dots next to documents 0N/A // Same color as outside edge 0N/A // Draw inner highlight on documents 0N/A // Draw inner inner highlight on documents 0N/A }
// End class FileChooserListViewIcon 0N/A // File Chooser New Folder code 0N/A // Draw outside edge of folder 0N/A // Draw inner folder highlight 0N/A // Draw tab on folder 0N/A }
// End class FileChooserNewFolderIcon 0N/A // File Chooser Up Folder code 0N/A // Draw outside edge of folder 0N/A // Draw the UP arrow 0N/A // same color as edge 0N/A // Draw inner folder highlight 0N/A // Draw tab on folder 0N/A }
// End class FileChooserUpFolderIcon 0N/A * Defines an icon for Palette close 0N/A // Internal Frame Close code 0N/A // if the inactive window 0N/A // if inactive and pressed 0N/A // darkHighlightColor is still "getBlack()" 0N/A // Some calculations that are needed more than once later on. 0N/A // fill inside of box area 0N/A // the top/left dark higlight - some of this will get overwritten 0N/A // draw the "normal" box 0N/A // one pixel over from the body 0N/A // Upper left to lower right 0N/A // Lower left to upper right 0N/A }
// End class InternalFrameCloseIcon 0N/A // Internal Frame Alternate Maximize code (actually, the un-maximize icon) 0N/A // ul = Upper Left and lr = Lower Right 0N/A // if the internal frame is inactive 0N/A // if inactive and pressed 0N/A // if the button is pressed and the mouse is over it 0N/A // darkHighlightColor is still "getBlack()" 0N/A // fill inside the box 0N/A // draw dark highlight color 0N/A // draw lower right light highlight 0N/A // draw upper left light highlight 0N/A // draw the main box 0N/A // Six extraneous pixels to deal with 0N/A // do the shaft first 0N/A // draw the dark highlight 0N/A // draw the light highlight 0N/A }
// End class InternalFrameAltMaximizeIcon 0N/A // Code for the default icons that goes in the upper left corner 0N/A // draw background color for title area 0N/A // catch four corners and title area 0N/A // fill body of window 0N/A // draw light parts of two "bumps" 0N/A // draw line around edge of title and icon 0N/A // draw dark part of four "bumps" (same color) 0N/A }
// End class InternalFrameDefaultMenuIcon 0N/A // Internal Frame Maximize code 0N/A // ul = Upper Left and lr = Lower Right 0N/A // if the internal frame is inactive 0N/A // if inactive and pressed 0N/A // if the button is pressed and the mouse is over it 0N/A // darkHighlightColor is still "getBlack()" 0N/A // fill inside the box 0N/A // down,left to up,right - inside box 0N/A // down,left to up,right - outside box 0N/A // outside edge of arrow head 0N/A // outside edge of arrow head 0N/A // down,left to up,right - inside box 0N/A // main part of arrow 0N/A }
// End class InternalFrameMaximizeIcon 0N/A // Internal Frame Minimize code 0N/A // ul = Upper Left and lr = Lower Right 0N/A // if the internal frame is inactive 0N/A // if inactive and pressed 0N/A // if the button is pressed and the mouse is over it 0N/A // darkHighlightColor is still "getBlack()" 0N/A // fill inside the box 0N/A // do the shaft first 0N/A // draw the dark highlight 0N/A // draw the light highlight 0N/A }
// End class InternalFrameMinimizeIcon 0N/A }
// End class CheckBoxIcon 0N/A // Radio button code 0N/A // PENDING: this isn't quite right, when we're sure it won't 0N/A // change it needs to be cleaned. 0N/A 1,
1,
10,
10,
true);
0N/A // draw Dark Circle (start at top, go clockwise) 0N/A // Set up colors per RadioButtonModel condition 0N/A // draw Dark Circle (start at top, go clockwise) 0N/A // draw Inner Left (usually) White Arc 0N/A // start at lower left corner, go clockwise 0N/A // draw Outer Right White Arc 0N/A // start at upper right corner, go clockwise 0N/A }
// End class RadioButtonIcon 0N/A // Tree Computer Icon code 0N/A // Fill glass portion of monitor 0N/A // Draw outside edge of monitor 0N/A // Draw the edge of the glass 0N/A // Draw the edge of the CPU 0N/A // Draw the disk drives 0N/A }
// End class TreeComputerIcon 0N/A // Tree HardDrive Icon code 0N/A // Draw edges of the disks 0N/A // Draw the down right shadows 0N/A // Draw the up left highlight 0N/A }
// End class TreeHardDriveIcon 0N/A // Tree FloppyDrive Icon code 0N/A // Fill body of floppy 0N/A // Draw outside edge of floppy 0N/A // Draw grey-ish highlights 0N/A // Draw label and exposed disk 0N/A // Draw text on label 0N/A }
// End class TreeFloppyDriveIcon 0N/A * Utility class for caching icon images. This is necessary because 0N/A * we need a new image whenever we are rendering into a new 0N/A * GraphicsConfiguration, but we do not want to keep recreating icon 0N/A * images for GC's that we have already seen (for example, 0N/A * dragging a window back and forth between monitors on a multimon 0N/A * system, or drawing an icon to different Components that have different 0N/A * So now whenever we create a new icon image for a given GC, we 0N/A * cache that image with the GC for later retrieval. 0N/A // PENDING: Replace this class with CachedPainter. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A // Draw folder front 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A // This data member should not have been exposed. It's called 0N/A // isLight, but now it really means isCollapsed. Since we can't change 0N/A // any APIs... that's life. 0N/A // g.setColor( c.getBackground() ); 0N/A // g.drawLine( 16, 7, 16, 8 ); 0N/A // g.setColor( c.getBackground() ); 0N/A // g.drawLine( xoff + 7, 16, xoff + 8, 16 ); 0N/A }
// End class MenuArrowIcon 0N/A }
// End class MenuItemArrowIcon 0N/A }
// End class CheckBoxMenuItemIcon 0N/A }
// End class RadioButtonMenuItemIcon 0N/A // Fill in the background 0N/A // Draw the highlight 0N/A // Fill in the background 0N/A // Draw the highlight 0N/A // Used for clipping when the orientation is left to right 0N/A // Used for clipping when the orientation is right to left 0N/A new int[] {
0,
0,
7,
14,
14 },
5);
0N/A new int[] {
0,
14,
14,
7,
0},
5);
0N/A 1,
1,
14,
14,
false);
0N/A 1,
1,
14,
14,
false);
0N/A // Used for clipping 0N/A new int[] {
0,
0,
8,
15,
8 },
5);
0N/A // Fill in the background 0N/A 1,
1,
13,
14,
true);
0N/A 1,
1,
13,
14,
true);