77 |
*/ |
*/ |
78 |
public CheckBoxMenuItemIcon() |
public CheckBoxMenuItemIcon() |
79 |
{ |
{ |
80 |
|
// Nothing to do here. |
81 |
} |
} |
82 |
|
|
83 |
/** |
/** |
145 |
* |
* |
146 |
* @see MetalIconFactory#getFileChooserDetailViewIcon() |
* @see MetalIconFactory#getFileChooserDetailViewIcon() |
147 |
*/ |
*/ |
148 |
private static class FileChooserDetailViewIcon |
private static class FileChooserDetailViewIcon implements Icon, Serializable |
149 |
implements Icon, Serializable { |
{ |
150 |
|
|
151 |
/** |
/** |
152 |
* Creates a new icon. |
* Creates a new icon. |
153 |
*/ |
*/ |
154 |
public FileChooserDetailViewIcon() |
public FileChooserDetailViewIcon() |
155 |
{ |
{ |
156 |
|
// Nothing to do here. |
157 |
} |
} |
158 |
|
|
159 |
/** |
/** |
225 |
* |
* |
226 |
* @see MetalIconFactory#getFileChooserHomeFolderIcon() |
* @see MetalIconFactory#getFileChooserHomeFolderIcon() |
227 |
*/ |
*/ |
228 |
private static class FileChooserHomeFolderIcon |
private static class FileChooserHomeFolderIcon implements Icon, Serializable |
229 |
implements Icon, Serializable { |
{ |
230 |
|
|
231 |
/** |
/** |
232 |
* Creates a new icon. |
* Creates a new icon. |
233 |
*/ |
*/ |
234 |
public FileChooserHomeFolderIcon() |
public FileChooserHomeFolderIcon() |
235 |
{ |
{ |
236 |
|
// Nothing to do here. |
237 |
} |
} |
238 |
|
|
239 |
/** |
/** |
321 |
*/ |
*/ |
322 |
public FileChooserListViewIcon() |
public FileChooserListViewIcon() |
323 |
{ |
{ |
324 |
|
// Nothing to do here. |
325 |
} |
} |
326 |
|
|
327 |
/** |
/** |
410 |
* |
* |
411 |
* @see MetalIconFactory#getFileChooserNewFolderIcon() |
* @see MetalIconFactory#getFileChooserNewFolderIcon() |
412 |
*/ |
*/ |
413 |
private static class FileChooserNewFolderIcon |
private static class FileChooserNewFolderIcon implements Icon, Serializable |
|
implements Icon, Serializable |
|
414 |
{ |
{ |
415 |
/** |
/** |
416 |
* Creates a new icon. |
* Creates a new icon. |
417 |
*/ |
*/ |
418 |
public FileChooserNewFolderIcon() |
public FileChooserNewFolderIcon() |
419 |
{ |
{ |
420 |
|
// Nothing to do here. |
421 |
} |
} |
422 |
|
|
423 |
/** |
/** |
482 |
* |
* |
483 |
* @see MetalIconFactory#getFileChooserNewFolderIcon() |
* @see MetalIconFactory#getFileChooserNewFolderIcon() |
484 |
*/ |
*/ |
485 |
private static class FileChooserUpFolderIcon |
private static class FileChooserUpFolderIcon extends FileChooserNewFolderIcon |
|
extends FileChooserNewFolderIcon |
|
486 |
implements Icon, Serializable |
implements Icon, Serializable |
487 |
{ |
{ |
488 |
/** |
/** |
490 |
*/ |
*/ |
491 |
public FileChooserUpFolderIcon() |
public FileChooserUpFolderIcon() |
492 |
{ |
{ |
493 |
|
// Nothing to do here. |
494 |
} |
} |
495 |
|
|
496 |
/** |
/** |
535 |
} |
} |
536 |
|
|
537 |
/** |
/** |
538 |
* Returns the height of the icon, in pixels. |
* Returns the height of the icon, in pixels. The height returned is |
539 |
|
* <code>16</code> plus the value returned by |
540 |
|
* {@link #getAdditionalHeight()}. |
541 |
* |
* |
542 |
* @return The height of the icon. |
* @return The height of the icon. |
543 |
*/ |
*/ |
544 |
public int getIconHeight() |
public int getIconHeight() |
545 |
{ |
{ |
546 |
return 16; |
return 16 + getAdditionalHeight(); |
547 |
} |
} |
548 |
|
|
549 |
/** |
/** |
576 |
} |
} |
577 |
|
|
578 |
/** |
/** |
579 |
* Returns the additional height (???). |
* Returns the additional height for the icon. The |
580 |
|
* {@link #getIconHeight()} method adds this value to the icon height it |
581 |
|
* returns. Subclasses can override this method to adjust the icon height. |
582 |
* |
* |
583 |
* @return The additional height. |
* @return The additional height (<code>0</code> unless overridden). |
584 |
*/ |
*/ |
585 |
public int getAdditionalHeight() |
public int getAdditionalHeight() |
586 |
{ |
{ |
614 |
} |
} |
615 |
|
|
616 |
/** |
/** |
617 |
* Returns the height of the icon, in pixels. |
* Returns the height of the icon, in pixels. The height returned is |
618 |
|
* <code>16</code> plus the value returned by |
619 |
|
* {@link #getAdditionalHeight()}. |
620 |
* |
* |
621 |
* @return The height of the icon. |
* @return The height of the icon. |
622 |
*/ |
*/ |
623 |
public int getIconHeight() |
public int getIconHeight() |
624 |
{ |
{ |
625 |
return 16; |
return 16 + getAdditionalHeight(); |
626 |
} |
} |
627 |
|
|
628 |
/** |
/** |
653 |
} |
} |
654 |
|
|
655 |
/** |
/** |
656 |
* Returns the additional height (???). |
* Returns the additional height for the icon. The |
657 |
|
* {@link #getIconHeight()} method adds this value to the icon height it |
658 |
|
* returns. Subclasses can override this method to adjust the icon height. |
659 |
* |
* |
660 |
* @return The additional height. |
* @return The additional height (<code>0</code> unless overridden). |
661 |
*/ |
*/ |
662 |
public int getAdditionalHeight() |
public int getAdditionalHeight() |
663 |
{ |
{ |
682 |
* |
* |
683 |
* @since 1.3 |
* @since 1.3 |
684 |
*/ |
*/ |
685 |
public static class PaletteCloseIcon |
public static class PaletteCloseIcon |
686 |
implements Icon, Serializable, UIResource |
implements Icon, Serializable, UIResource |
687 |
{ |
{ |
688 |
/** |
/** |
744 |
* |
* |
745 |
* @author Roman Kennke (roman@kennke.org) |
* @author Roman Kennke (roman@kennke.org) |
746 |
*/ |
*/ |
747 |
static class RadioButtonIcon |
static class RadioButtonIcon implements Icon, UIResource, Serializable |
|
implements Icon, UIResource, Serializable |
|
748 |
{ |
{ |
749 |
|
|
750 |
/** |
/** |
858 |
/** |
/** |
859 |
* An icon displayed for {@link JRadioButtonMenuItem} components. |
* An icon displayed for {@link JRadioButtonMenuItem} components. |
860 |
*/ |
*/ |
861 |
private static class RadioButtonMenuItemIcon |
private static class RadioButtonMenuItemIcon implements Icon, Serializable |
|
implements Icon, Serializable |
|
862 |
{ |
{ |
863 |
/** |
/** |
864 |
* Creates a new icon instance. |
* Creates a new icon instance. |
865 |
*/ |
*/ |
866 |
public RadioButtonMenuItemIcon() |
public RadioButtonMenuItemIcon() |
867 |
{ |
{ |
868 |
|
// Nothing to do here. |
869 |
} |
} |
870 |
|
|
871 |
/** |
/** |
935 |
* The icon used to display the thumb control on a horizontally oriented |
* The icon used to display the thumb control on a horizontally oriented |
936 |
* {@link JSlider} component. |
* {@link JSlider} component. |
937 |
*/ |
*/ |
938 |
private static class HorizontalSliderThumbIcon |
private static class HorizontalSliderThumbIcon implements Icon, Serializable |
|
implements Icon, Serializable |
|
939 |
{ |
{ |
940 |
|
|
941 |
/** |
/** |
943 |
*/ |
*/ |
944 |
public HorizontalSliderThumbIcon() |
public HorizontalSliderThumbIcon() |
945 |
{ |
{ |
946 |
|
// Nothing to do here. |
947 |
} |
} |
948 |
|
|
949 |
/** |
/** |
1053 |
* An icon used for the 'close' button in the title frame of a |
* An icon used for the 'close' button in the title frame of a |
1054 |
* {@link JInternalFrame}. |
* {@link JInternalFrame}. |
1055 |
*/ |
*/ |
1056 |
private static class InternalFrameCloseIcon implements Icon, Serializable |
private static class InternalFrameCloseIcon implements Icon, Serializable |
1057 |
{ |
{ |
1058 |
/** The icon size in pixels. */ |
/** The icon size in pixels. */ |
1059 |
private int size; |
private int size; |
1169 |
/** |
/** |
1170 |
* The icon displayed at the top-left corner of a {@link JInternalFrame}. |
* The icon displayed at the top-left corner of a {@link JInternalFrame}. |
1171 |
*/ |
*/ |
1172 |
private static class InternalFrameDefaultMenuIcon |
private static class InternalFrameDefaultMenuIcon |
1173 |
implements Icon, Serializable |
implements Icon, Serializable |
1174 |
{ |
{ |
1175 |
|
|
1176 |
/** |
/** |
1178 |
*/ |
*/ |
1179 |
public InternalFrameDefaultMenuIcon() |
public InternalFrameDefaultMenuIcon() |
1180 |
{ |
{ |
1181 |
|
// Nothing to do here. |
1182 |
} |
} |
1183 |
|
|
1184 |
/** |
/** |
1241 |
* maximise an internal frame, this icon will replace the 'maximise' icon to |
* maximise an internal frame, this icon will replace the 'maximise' icon to |
1242 |
* provide a 'restore' option. |
* provide a 'restore' option. |
1243 |
*/ |
*/ |
1244 |
private static class InternalFrameAltMaximizeIcon |
private static class InternalFrameAltMaximizeIcon |
1245 |
implements Icon, Serializable |
implements Icon, Serializable |
1246 |
{ |
{ |
1247 |
/** The icon size in pixels. */ |
/** The icon size in pixels. */ |
1248 |
private int size; |
private int size; |
1352 |
* An icon used for the 'maximize' button in the title frame of a |
* An icon used for the 'maximize' button in the title frame of a |
1353 |
* {@link JInternalFrame}. |
* {@link JInternalFrame}. |
1354 |
*/ |
*/ |
1355 |
private static class InternalFrameMaximizeIcon |
private static class InternalFrameMaximizeIcon implements Icon, Serializable |
|
implements Icon, Serializable |
|
1356 |
{ |
{ |
1357 |
|
|
1358 |
/** |
/** |
1360 |
*/ |
*/ |
1361 |
public InternalFrameMaximizeIcon() |
public InternalFrameMaximizeIcon() |
1362 |
{ |
{ |
1363 |
|
// Nothing to do here. |
1364 |
} |
} |
1365 |
|
|
1366 |
/** |
/** |
1464 |
/** |
/** |
1465 |
* An icon used in the title frame of a {@link JInternalFrame}. |
* An icon used in the title frame of a {@link JInternalFrame}. |
1466 |
*/ |
*/ |
1467 |
private static class InternalFrameMinimizeIcon |
private static class InternalFrameMinimizeIcon implements Icon, Serializable |
|
implements Icon, Serializable |
|
1468 |
{ |
{ |
1469 |
|
|
1470 |
/** |
/** |
1472 |
*/ |
*/ |
1473 |
public InternalFrameMinimizeIcon() |
public InternalFrameMinimizeIcon() |
1474 |
{ |
{ |
1475 |
|
// Nothing to do here. |
1476 |
} |
} |
1477 |
|
|
1478 |
/** |
/** |
1568 |
* The icon used to display the thumb control on a horizontally oriented |
* The icon used to display the thumb control on a horizontally oriented |
1569 |
* {@link JSlider} component. |
* {@link JSlider} component. |
1570 |
*/ |
*/ |
1571 |
private static class VerticalSliderThumbIcon implements Icon, Serializable |
private static class VerticalSliderThumbIcon implements Icon, Serializable |
1572 |
{ |
{ |
1573 |
/** |
/** |
1574 |
* Creates a new instance. |
* Creates a new instance. |
1575 |
*/ |
*/ |
1576 |
public VerticalSliderThumbIcon() |
public VerticalSliderThumbIcon() |
1577 |
{ |
{ |
1578 |
|
// Nothing to do here. |
1579 |
} |
} |
1580 |
|
|
1581 |
/** |
/** |
1686 |
* A tree control icon. This icon can be in one of two states: expanded and |
* A tree control icon. This icon can be in one of two states: expanded and |
1687 |
* collapsed. |
* collapsed. |
1688 |
*/ |
*/ |
1689 |
public static class TreeControlIcon implements Icon, Serializable |
public static class TreeControlIcon implements Icon, Serializable |
1690 |
{ |
{ |
1691 |
|
|
1692 |
/** ???. */ |
/** ???. */ |
1819 |
/** |
/** |
1820 |
* A tree folder icon. |
* A tree folder icon. |
1821 |
*/ |
*/ |
1822 |
public static class TreeFolderIcon extends FolderIcon16 |
public static class TreeFolderIcon extends FolderIcon16 |
1823 |
{ |
{ |
1824 |
/** |
/** |
1825 |
* Creates a new instance. |
* Creates a new instance. |
1826 |
*/ |
*/ |
1827 |
public TreeFolderIcon() |
public TreeFolderIcon() |
1828 |
{ |
{ |
1829 |
|
// Nothing to do here. |
1830 |
} |
} |
1831 |
|
|
1832 |
/** |
/** |
1833 |
* Returns the additional height (???). |
* Returns the additional height for this icon, in this case <code>2</code> |
1834 |
|
* pixels. |
1835 |
* |
* |
1836 |
* @return The additional height. |
* @return <code>2</code>. |
1837 |
*/ |
*/ |
1838 |
public int getAdditionalHeight() |
public int getAdditionalHeight() |
1839 |
{ |
{ |
1854 |
/** |
/** |
1855 |
* A tree leaf icon. |
* A tree leaf icon. |
1856 |
*/ |
*/ |
1857 |
public static class TreeLeafIcon extends FileIcon16 |
public static class TreeLeafIcon extends FileIcon16 |
1858 |
{ |
{ |
1859 |
/** |
/** |
1860 |
* Creates a new instance. |
* Creates a new instance. |
1861 |
*/ |
*/ |
1862 |
public TreeLeafIcon() |
public TreeLeafIcon() |
1863 |
{ |
{ |
1864 |
|
// Nothing to do here. |
1865 |
} |
} |
1866 |
|
|
1867 |
/** |
/** |
1868 |
* Returns the additional height (???). |
* Returns the additional height for this icon, in this case <code>4</code> |
1869 |
|
* pixels. |
1870 |
* |
* |
1871 |
* @return The additional height. |
* @return <code>4</code>. |
1872 |
*/ |
*/ |
1873 |
public int getAdditionalHeight() |
public int getAdditionalHeight() |
1874 |
{ |
{ |
1885 |
return 2; |
return 2; |
1886 |
} |
} |
1887 |
} |
} |
1888 |
|
|
1889 |
|
/** |
1890 |
|
* An icon representing a hard disk. |
1891 |
|
* |
1892 |
|
* @see MetalIconFactory#getTreeHardDriveIcon() |
1893 |
|
*/ |
1894 |
|
private static class TreeHardDriveIcon implements Icon, Serializable |
1895 |
|
{ |
1896 |
|
|
1897 |
|
/** |
1898 |
|
* Creates a new icon instance. |
1899 |
|
*/ |
1900 |
|
public TreeHardDriveIcon() |
1901 |
|
{ |
1902 |
|
// Nothing to do here. |
1903 |
|
} |
1904 |
|
|
1905 |
|
/** |
1906 |
|
* Returns the width of the icon, in pixels. |
1907 |
|
* |
1908 |
|
* @return <code>16</code>. |
1909 |
|
*/ |
1910 |
|
public int getIconWidth() |
1911 |
|
{ |
1912 |
|
return 16; |
1913 |
|
} |
1914 |
|
|
1915 |
|
/** |
1916 |
|
* Returns the height of the icon, in pixels. |
1917 |
|
* |
1918 |
|
* @return <code>16</code>. |
1919 |
|
*/ |
1920 |
|
public int getIconHeight() |
1921 |
|
{ |
1922 |
|
return 16; |
1923 |
|
} |
1924 |
|
|
1925 |
|
/** |
1926 |
|
* Paints the icon at the specified location, using colors from the |
1927 |
|
* current theme. |
1928 |
|
* |
1929 |
|
* @param c the component (ignored). |
1930 |
|
* @param g the graphics device. |
1931 |
|
* @param x the x-coordinate for the top-left of the icon. |
1932 |
|
* @param y the y-coordinate for the top-left of the icon. |
1933 |
|
*/ |
1934 |
|
public void paintIcon(Component c, Graphics g, int x, int y) |
1935 |
|
{ |
1936 |
|
Color saved = g.getColor(); |
1937 |
|
g.setColor(MetalLookAndFeel.getBlack()); |
1938 |
|
g.drawLine(x + 1, y + 4, x + 1, y + 5); |
1939 |
|
g.drawLine(x + 14, y + 4, x + 14, y + 5); |
1940 |
|
g.drawLine(x + 1, y + 7, x + 1, y + 8); |
1941 |
|
g.drawLine(x + 14, y + 7, x + 14, y + 8); |
1942 |
|
g.drawLine(x + 1, y + 10, x + 1, y + 11); |
1943 |
|
g.drawLine(x + 14, y + 10, x + 14, y + 11); |
1944 |
|
|
1945 |
|
g.drawLine(x + 2, y + 3, x + 3, y + 3); |
1946 |
|
g.drawLine(x + 12, y + 3, x + 13, y + 3); |
1947 |
|
g.drawLine(x + 2, y + 6, x + 3, y + 6); |
1948 |
|
g.drawLine(x + 12, y + 6, x + 13, y + 6); |
1949 |
|
g.drawLine(x + 2, y + 9, x + 3, y + 9); |
1950 |
|
g.drawLine(x + 12, y + 9, x + 13, y + 9); |
1951 |
|
g.drawLine(x + 2, y + 12, x + 3, y + 12); |
1952 |
|
g.drawLine(x + 12, y + 12, x + 13, y + 12); |
1953 |
|
|
1954 |
|
g.drawLine(x + 4, y + 2, x + 11, y + 2); |
1955 |
|
g.drawLine(x + 4, y + 7, x + 11, y + 7); |
1956 |
|
g.drawLine(x + 4, y + 10, x + 11, y + 10); |
1957 |
|
g.drawLine(x + 4, y + 13, x + 11, y + 13); |
1958 |
|
|
1959 |
|
g.setColor(MetalLookAndFeel.getWhite()); |
1960 |
|
g.fillRect(x + 4, y + 3, 2, 2); |
1961 |
|
g.drawLine(x + 6, y + 4, x + 6, y + 4); |
1962 |
|
g.drawLine(x + 7, y + 3, x + 9, y + 3); |
1963 |
|
g.drawLine(x + 8, y + 4, x + 8, y + 4); |
1964 |
|
g.drawLine(x + 11, y + 3, x + 11, y + 3); |
1965 |
|
g.fillRect(x + 2, y + 4, 2, 2); |
1966 |
|
g.fillRect(x + 2, y + 7, 2, 2); |
1967 |
|
g.fillRect(x + 2, y + 10, 2, 2); |
1968 |
|
g.drawLine(x + 4, y + 6, x + 4, y + 6); |
1969 |
|
g.drawLine(x + 4, y + 9, x + 4, y + 9); |
1970 |
|
g.drawLine(x + 4, y + 12, x + 4, y + 12); |
1971 |
|
|
1972 |
|
g.setColor(MetalLookAndFeel.getControlShadow()); |
1973 |
|
g.drawLine(x + 13, y + 4, x + 13, y + 4); |
1974 |
|
g.drawLine(x + 12, y + 5, x + 13, y + 5); |
1975 |
|
g.drawLine(x + 13, y + 7, x + 13, y + 7); |
1976 |
|
g.drawLine(x + 12, y + 8, x + 13, y + 8); |
1977 |
|
g.drawLine(x + 13, y + 10, x + 13, y + 10); |
1978 |
|
g.drawLine(x + 12, y + 11, x + 13, y + 11); |
1979 |
|
|
1980 |
|
g.drawLine(x + 10, y + 5, x + 10, y + 5); |
1981 |
|
g.drawLine(x + 7, y + 6, x + 7, y + 6); |
1982 |
|
g.drawLine(x + 9, y + 6, x + 9, y + 6); |
1983 |
|
g.drawLine(x + 11, y + 6, x + 11, y + 6); |
1984 |
|
|
1985 |
|
g.drawLine(x + 10, y + 8, x + 10, y + 8); |
1986 |
|
g.drawLine(x + 7, y + 9, x + 7, y + 9); |
1987 |
|
g.drawLine(x + 9, y + 9, x + 9, y + 9); |
1988 |
|
g.drawLine(x + 11, y + 9, x + 11, y + 9); |
1989 |
|
|
1990 |
|
g.drawLine(x + 10, y + 11, x + 10, y + 11); |
1991 |
|
g.drawLine(x + 7, y + 12, x + 7, y + 12); |
1992 |
|
g.drawLine(x + 9, y + 12, x + 9, y + 12); |
1993 |
|
g.drawLine(x + 11, y + 12, x + 11, y + 12); |
1994 |
|
|
1995 |
|
g.setColor(saved); |
1996 |
|
} |
1997 |
|
} |
1998 |
|
|
1999 |
|
/** |
2000 |
|
* An icon representing a floppy disk. |
2001 |
|
* |
2002 |
|
* @see MetalIconFactory#getTreeFloppyDriveIcon() |
2003 |
|
*/ |
2004 |
|
private static class TreeFloppyDriveIcon implements Icon, Serializable |
2005 |
|
{ |
2006 |
|
|
2007 |
|
/** |
2008 |
|
* Creates a new icon instance. |
2009 |
|
*/ |
2010 |
|
public TreeFloppyDriveIcon() |
2011 |
|
{ |
2012 |
|
// Nothing to do here. |
2013 |
|
} |
2014 |
|
|
2015 |
|
/** |
2016 |
|
* Returns the width of the icon, in pixels. |
2017 |
|
* |
2018 |
|
* @return <code>16</code>. |
2019 |
|
*/ |
2020 |
|
public int getIconWidth() |
2021 |
|
{ |
2022 |
|
return 16; |
2023 |
|
} |
2024 |
|
|
2025 |
|
/** |
2026 |
|
* Returns the height of the icon, in pixels. |
2027 |
|
* |
2028 |
|
* @return <code>16</code>. |
2029 |
|
*/ |
2030 |
|
public int getIconHeight() |
2031 |
|
{ |
2032 |
|
return 16; |
2033 |
|
} |
2034 |
|
|
2035 |
|
/** |
2036 |
|
* Paints the icon at the specified location, using colors from the |
2037 |
|
* current theme. |
2038 |
|
* |
2039 |
|
* @param c the component (ignored). |
2040 |
|
* @param g the graphics device. |
2041 |
|
* @param x the x-coordinate for the top-left of the icon. |
2042 |
|
* @param y the y-coordinate for the top-left of the icon. |
2043 |
|
*/ |
2044 |
|
public void paintIcon(Component c, Graphics g, int x, int y) |
2045 |
|
{ |
2046 |
|
Color saved = g.getColor(); |
2047 |
|
|
2048 |
|
g.setColor(MetalLookAndFeel.getBlack()); |
2049 |
|
g.drawLine(x + 1, y + 1, x + 13, y + 1); |
2050 |
|
g.drawLine(x + 1, y + 1, x + 1, y + 14); |
2051 |
|
g.drawLine(x + 1, y + 14, x + 14, y + 14); |
2052 |
|
g.drawLine(x + 14, y + 2, x + 14, y + 14); |
2053 |
|
|
2054 |
|
g.setColor(MetalLookAndFeel.getPrimaryControl()); |
2055 |
|
g.fillRect(x + 2, y + 2, 12, 12); |
2056 |
|
|
2057 |
|
g.setColor(MetalLookAndFeel.getControlShadow()); |
2058 |
|
g.fillRect(x + 5, y + 2, 6, 5); |
2059 |
|
g.drawLine(x + 4, y + 8, x + 11, y + 8); |
2060 |
|
g.drawLine(x + 3, y + 9, x + 3, y + 13); |
2061 |
|
g.drawLine(x + 12, y + 9, x + 12, y + 13); |
2062 |
|
|
2063 |
|
g.setColor(MetalLookAndFeel.getWhite()); |
2064 |
|
g.fillRect(x + 8, y + 3, 2, 3); |
2065 |
|
g.fillRect(x + 4, y + 9, 8, 5); |
2066 |
|
|
2067 |
|
g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); |
2068 |
|
g.drawLine(x + 5, y + 10, x + 9, y + 10); |
2069 |
|
g.drawLine(x + 5, y + 12, x + 8, y + 12); |
2070 |
|
|
2071 |
|
g.setColor(saved); |
2072 |
|
} |
2073 |
|
} |
2074 |
|
|
2075 |
|
/** |
2076 |
|
* An icon representing a computer. |
2077 |
|
* |
2078 |
|
* @see MetalIconFactory#getTreeComputerIcon() |
2079 |
|
*/ |
2080 |
|
private static class TreeComputerIcon implements Icon, Serializable |
2081 |
|
{ |
2082 |
|
|
2083 |
|
/** |
2084 |
|
* Creates a new icon instance. |
2085 |
|
*/ |
2086 |
|
public TreeComputerIcon() |
2087 |
|
{ |
2088 |
|
// Nothing to do here. |
2089 |
|
} |
2090 |
|
|
2091 |
|
/** |
2092 |
|
* Returns the width of the icon, in pixels. |
2093 |
|
* |
2094 |
|
* @return <code>16</code>. |
2095 |
|
*/ |
2096 |
|
public int getIconWidth() |
2097 |
|
{ |
2098 |
|
return 16; |
2099 |
|
} |
2100 |
|
|
2101 |
|
/** |
2102 |
|
* Returns the height of the icon, in pixels. |
2103 |
|
* |
2104 |
|
* @return <code>16</code>. |
2105 |
|
*/ |
2106 |
|
public int getIconHeight() |
2107 |
|
{ |
2108 |
|
return 16; |
2109 |
|
} |
2110 |
|
|
2111 |
|
/** |
2112 |
|
* Paints the icon at the specified location, using colors from the |
2113 |
|
* current theme. |
2114 |
|
* |
2115 |
|
* @param c the component (ignored). |
2116 |
|
* @param g the graphics device. |
2117 |
|
* @param x the x-coordinate for the top-left of the icon. |
2118 |
|
* @param y the y-coordinate for the top-left of the icon. |
2119 |
|
*/ |
2120 |
|
public void paintIcon(Component c, Graphics g, int x, int y) |
2121 |
|
{ |
2122 |
|
Color saved = g.getColor(); |
2123 |
|
|
2124 |
|
g.setColor(MetalLookAndFeel.getBlack()); |
2125 |
|
g.drawLine(x + 3, y + 1, x + 12, y + 1); |
2126 |
|
g.drawLine(x + 2, y + 2, x + 2, y + 8); |
2127 |
|
g.drawLine(x + 13, y + 2, x + 13, y + 8); |
2128 |
|
g.drawLine(x + 3, y + 9, x + 3, y + 9); |
2129 |
|
g.drawLine(x + 12, y + 9, x + 12, y + 9); |
2130 |
|
g.drawRect(x + 1, y + 10, 13, 4); |
2131 |
|
g.drawLine(x + 5, y + 3, x + 10, y + 3); |
2132 |
|
g.drawLine(x + 5, y + 8, x + 10, y + 8); |
2133 |
|
g.drawLine(x + 4, y + 4, x + 4, y + 7); |
2134 |
|
g.drawLine(x + 11, y + 4, x + 11, y + 7); |
2135 |
|
|
2136 |
|
g.setColor(MetalLookAndFeel.getPrimaryControl()); |
2137 |
|
g.fillRect(x + 5, y + 4, 6, 4); |
2138 |
|
|
2139 |
|
g.setColor(MetalLookAndFeel.getControlShadow()); |
2140 |
|
g.drawLine(x + 6, y + 12, x + 8, y + 12); |
2141 |
|
g.drawLine(x + 10, y + 12, x + 12, y + 12); |
2142 |
|
g.setColor(saved); |
2143 |
|
} |
2144 |
|
} |
2145 |
|
|
2146 |
|
/** The icon returned by {@link #getCheckBoxIcon()}. */ |
2147 |
|
private static Icon checkBoxIcon; |
2148 |
|
|
2149 |
|
/** The icon returned by {@link #getCheckBoxMenuItemIcon()}. */ |
2150 |
|
private static Icon checkBoxMenuItemIcon; |
2151 |
|
|
2152 |
|
/** The icon returned by {@link #getFileChooserDetailViewIcon()}. */ |
2153 |
|
private static Icon fileChooserDetailViewIcon; |
2154 |
|
|
2155 |
|
/** The icon returned by {@link #getFileChooserHomeFolderIcon()}. */ |
2156 |
|
private static Icon fileChooserHomeFolderIcon; |
2157 |
|
|
2158 |
|
/** The icon returned by {@link #getFileChooserListViewIcon()}. */ |
2159 |
|
private static Icon fileChooserListViewIcon; |
2160 |
|
|
2161 |
|
/** The icon returned by {@link #getFileChooserNewFolderIcon()}. */ |
2162 |
|
private static Icon fileChooserNewFolderIcon; |
2163 |
|
|
2164 |
|
/** The icon returned by {@link #getFileChooserUpFolderIcon()}. */ |
2165 |
|
private static Icon fileChooserUpFolderIcon; |
2166 |
|
|
2167 |
/** The cached RadioButtonIcon instance. */ |
/** The cached RadioButtonIcon instance. */ |
2168 |
private static RadioButtonIcon radioButtonIcon; |
private static RadioButtonIcon radioButtonIcon; |
2169 |
|
|
2170 |
|
/** The icon returned by {@link #getRadioButtonMenuItemIcon()}. */ |
2171 |
|
private static Icon radioButtonMenuItemIcon; |
2172 |
|
|
2173 |
|
/** The icon returned by {@link #getInternalFrameDefaultMenuIcon()}. */ |
2174 |
|
private static Icon internalFrameDefaultMenuIcon; |
2175 |
|
|
2176 |
|
/** The icon returned by {@link #getTreeComputerIcon()}. */ |
2177 |
|
private static Icon treeComputerIcon; |
2178 |
|
|
2179 |
|
/** The icon instance returned by {@link #getTreeFloppyDriveIcon()}. */ |
2180 |
|
private static Icon treeFloppyDriveIcon; |
2181 |
|
|
2182 |
|
/** The icon instance returned by {@link #getTreeHardDriveIcon()}. */ |
2183 |
|
private static Icon treeHardDriveIcon; |
2184 |
|
|
2185 |
/** |
/** |
2186 |
* Creates a new instance. All the methods are static, so creating an |
* Creates a new instance. All the methods are static, so creating an |
2187 |
* instance isn't necessary. |
* instance isn't necessary. |
2188 |
*/ |
*/ |
2189 |
public MetalIconFactory() |
public MetalIconFactory() |
2190 |
{ |
{ |
2191 |
|
// Nothing to do here. |
2192 |
} |
} |
2193 |
|
|
2194 |
/** |
/** |
2200 |
*/ |
*/ |
2201 |
public static Icon getCheckBoxIcon() |
public static Icon getCheckBoxIcon() |
2202 |
{ |
{ |
2203 |
return new MetalCheckBoxIcon(); |
if (checkBoxIcon == null) |
2204 |
|
checkBoxIcon = new MetalCheckBoxIcon(); |
2205 |
|
return checkBoxIcon; |
2206 |
} |
} |
2207 |
|
|
2208 |
/** |
/** |
2213 |
*/ |
*/ |
2214 |
public static Icon getCheckBoxMenuItemIcon() |
public static Icon getCheckBoxMenuItemIcon() |
2215 |
{ |
{ |
2216 |
return new CheckBoxMenuItemIcon(); |
if (checkBoxMenuItemIcon == null) |
2217 |
|
checkBoxMenuItemIcon = new CheckBoxMenuItemIcon(); |
2218 |
|
return checkBoxMenuItemIcon; |
2219 |
} |
} |
2220 |
|
|
2221 |
/** |
/** |
2225 |
*/ |
*/ |
2226 |
public static Icon getFileChooserDetailViewIcon() |
public static Icon getFileChooserDetailViewIcon() |
2227 |
{ |
{ |
2228 |
return new FileChooserDetailViewIcon(); |
if (fileChooserDetailViewIcon == null) |
2229 |
|
fileChooserDetailViewIcon = new FileChooserDetailViewIcon(); |
2230 |
|
return fileChooserDetailViewIcon; |
2231 |
} |
} |
2232 |
|
|
2233 |
/** |
/** |
2237 |
*/ |
*/ |
2238 |
public static Icon getFileChooserHomeFolderIcon() |
public static Icon getFileChooserHomeFolderIcon() |
2239 |
{ |
{ |
2240 |
return new FileChooserHomeFolderIcon(); |
if (fileChooserHomeFolderIcon == null) |
2241 |
|
fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon(); |
2242 |
|
return fileChooserHomeFolderIcon; |
2243 |
} |
} |
2244 |
|
|
2245 |
/** |
/** |
2249 |
*/ |
*/ |
2250 |
public static Icon getFileChooserListViewIcon() |
public static Icon getFileChooserListViewIcon() |
2251 |
{ |
{ |
2252 |
return new FileChooserListViewIcon(); |
if (fileChooserListViewIcon == null) |
2253 |
|
fileChooserListViewIcon = new FileChooserListViewIcon(); |
2254 |
|
return fileChooserListViewIcon; |
2255 |
} |
} |
2256 |
|
|
2257 |
/** |
/** |
2261 |
*/ |
*/ |
2262 |
public static Icon getFileChooserNewFolderIcon() |
public static Icon getFileChooserNewFolderIcon() |
2263 |
{ |
{ |
2264 |
return new FileChooserNewFolderIcon(); |
if (fileChooserNewFolderIcon == null) |
2265 |
|
fileChooserNewFolderIcon = new FileChooserNewFolderIcon(); |
2266 |
|
return fileChooserNewFolderIcon; |
2267 |
} |
} |
2268 |
|
|
2269 |
/** |
/** |
2273 |
*/ |
*/ |
2274 |
public static Icon getFileChooserUpFolderIcon() |
public static Icon getFileChooserUpFolderIcon() |
2275 |
{ |
{ |
2276 |
return new FileChooserUpFolderIcon(); |
if (fileChooserUpFolderIcon == null) |
2277 |
|
fileChooserUpFolderIcon = new FileChooserUpFolderIcon(); |
2278 |
|
return fileChooserUpFolderIcon; |
2279 |
} |
} |
2280 |
|
|
2281 |
/** |
/** |
2297 |
*/ |
*/ |
2298 |
public static Icon getRadioButtonMenuItemIcon() |
public static Icon getRadioButtonMenuItemIcon() |
2299 |
{ |
{ |
2300 |
return new RadioButtonMenuItemIcon(); |
if (radioButtonMenuItemIcon == null) |
2301 |
|
radioButtonMenuItemIcon = new RadioButtonMenuItemIcon(); |
2302 |
|
return radioButtonMenuItemIcon; |
2303 |
} |
} |
2304 |
|
|
2305 |
/** |
/** |
2334 |
*/ |
*/ |
2335 |
public static Icon getInternalFrameDefaultMenuIcon() |
public static Icon getInternalFrameDefaultMenuIcon() |
2336 |
{ |
{ |
2337 |
return new InternalFrameDefaultMenuIcon(); |
if (internalFrameDefaultMenuIcon == null) |
2338 |
|
internalFrameDefaultMenuIcon = new InternalFrameDefaultMenuIcon(); |
2339 |
|
return internalFrameDefaultMenuIcon; |
2340 |
} |
} |
2341 |
|
|
2342 |
/** |
/** |
2425 |
return new TreeControlIcon(isCollapsed); |
return new TreeControlIcon(isCollapsed); |
2426 |
} |
} |
2427 |
|
|
2428 |
|
/** |
2429 |
|
* Returns a <code>16x16</code> icon representing a computer. |
2430 |
|
* |
2431 |
|
* @return The icon. |
2432 |
|
*/ |
2433 |
|
public static Icon getTreeComputerIcon() |
2434 |
|
{ |
2435 |
|
if (treeComputerIcon == null) |
2436 |
|
treeComputerIcon = new TreeComputerIcon(); |
2437 |
|
return treeComputerIcon; |
2438 |
|
} |
2439 |
|
|
2440 |
|
/** |
2441 |
|
* Returns a <code>16x16</code> icon representing a floppy disk. |
2442 |
|
* |
2443 |
|
* @return The icon. |
2444 |
|
*/ |
2445 |
|
public static Icon getTreeFloppyDriveIcon() |
2446 |
|
{ |
2447 |
|
if (treeFloppyDriveIcon == null) |
2448 |
|
treeFloppyDriveIcon = new TreeFloppyDriveIcon(); |
2449 |
|
return treeFloppyDriveIcon; |
2450 |
|
} |
2451 |
|
|
2452 |
|
/** |
2453 |
|
* Returns a <code>16x16</code> icon representing a hard disk. |
2454 |
|
* |
2455 |
|
* @return The icon. |
2456 |
|
*/ |
2457 |
|
public static Icon getTreeHardDriveIcon() |
2458 |
|
{ |
2459 |
|
if (treeHardDriveIcon == null) |
2460 |
|
treeHardDriveIcon = new TreeHardDriveIcon(); |
2461 |
|
return treeHardDriveIcon; |
2462 |
|
} |
2463 |
|
|
2464 |
} |
} |