/*
* 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.
*/
/**
* The default theme for the {@code MetalLookAndFeel}.
* <p>
* The designers
* of the Metal Look and Feel strive to keep the default look up to
* date, possibly through the use of new themes in the future.
* Therefore, developers should only use this class directly when they
* wish to customize the "Ocean" look, or force it to be the current
* theme, regardless of future updates.
* <p>
* All colors returned by {@code OceanTheme} are completely
* opaque.
*
* @since 1.5
* @see MetalLookAndFeel#setCurrentTheme
*/
new ColorUIResource(0x6382BF);
new ColorUIResource(0xA3B8CC);
new ColorUIResource(0xB8CFE5);
new ColorUIResource(0x7A8A99);
new ColorUIResource(0xB8CFE5);
new ColorUIResource(0xEEEEEE);
new ColorUIResource(0x999999);
new ColorUIResource(0x999999);
new ColorUIResource(0xD2E9FF);
// ComponentOrientation Icon
// Delegates to different icons based on component orientation
super(ltr);
}
if (MetalUtils.isLeftToRight(c)) {
super.paintIcon(c, g, x, y);
} else {
}
}
}
// InternalFrame Icon
// Delegates to different icons based on button state
super(normal);
}
} else {
super.paintIcon(c, g, x, y);
}
}
}
/**
* Creates an instance of <code>OceanTheme</code>
*/
public OceanTheme() {
}
/**
* Add this theme's custom entries to the defaults table.
*
* @param table the defaults table, non-null
* @throws NullPointerException if {@code table} is {@code null}
*/
"javax.swing.plaf.BorderUIResource$LineBorderUIResource",
new Object[] {getPrimary1()});
// .30 0 DDE8F3 white secondary2
// Other possible properties that aren't defined:
//
// Used when generating the disabled Icons, provides the region to
// constrain grays to.
// InternalFrame.inactiveTitleGradient -> Gradient when the
// internal frame is inactive.
"Button.gradient", buttonGradient,
"Button.toolBarBorderBackground", INACTIVE_CONTROL_TEXT_COLOR,
"Button.disabledToolBarBorderBackground", cccccc,
"Button.rolloverIconType", "ocean",
"CheckBox.gradient", buttonGradient,
"CheckBoxMenuItem.gradient", buttonGradient,
// home2
"FileChooser.homeFolderIcon",
// directory2
"FileChooser.newFolderIcon",
// updir2
"FileChooser.upFolderIcon",
// computer2
"FileView.computerIcon",
"FileView.directoryIcon", directoryIcon,
// disk2
"FileView.hardDriveIcon",
"FileView.fileIcon", fileIcon,
// floppy2
"FileView.floppyDriveIcon",
"Label.disabledForeground", getInactiveControlTextColor(),
new ColorUIResource(dadada) }),
"MenuBar.borderColor", cccccc,
"InternalFrame.activeTitleGradient", buttonGradient,
// close2
"InternalFrame.closeIcon",
new UIDefaults.LazyValue() {
}
},
// minimize
"InternalFrame.iconifyIcon",
new UIDefaults.LazyValue() {
}
},
// restore
"InternalFrame.minimizeIcon",
new UIDefaults.LazyValue() {
}
},
// menubutton3
"InternalFrame.icon",
// maximize2
"InternalFrame.maximizeIcon",
new UIDefaults.LazyValue() {
}
},
// paletteclose
"InternalFrame.paletteCloseIcon",
new UIDefaults.LazyValue() {
}
},
"List.focusCellHighlightBorder", focusBorder,
"MenuBarUI", "javax.swing.plaf.metal.MetalMenuBarUI",
"OptionPane.errorIcon",
"OptionPane.informationIcon",
"OptionPane.questionIcon",
"OptionPane.warningIcon",
"RadioButton.gradient", buttonGradient,
"RadioButtonMenuItem.gradient", buttonGradient,
"ScrollBar.gradient", buttonGradient,
"Slider.gradient", sliderGradient,
"Slider.focusGradient", sliderGradient,
"SplitPane.dividerFocusColor", c8ddf2,
"TabbedPane.borderHightlightColor", getPrimary1(),
"TabbedPane.contentAreaColor", c8ddf2,
"TabbedPane.selected", c8ddf2,
"TabbedPane.tabAreaBackground", dadada,
"TabbedPane.unselectedBackground", SECONDARY3,
"Table.focusCellHighlightBorder", focusBorder,
"Table.gridColor", SECONDARY1,
"TableHeader.focusCellBackground", c8ddf2,
"ToggleButton.gradient", buttonGradient,
"ToolBar.borderColor", cccccc,
"Tree.closedIcon", directoryIcon,
"Tree.collapsedIcon",
new UIDefaults.LazyValue() {
}
},
"Tree.expandedIcon",
"Tree.leafIcon", fileIcon,
"Tree.openIcon", directoryIcon,
"Tree.selectionBorderColor", getPrimary1(),
"Tree.dropLineColor", getPrimary1(),
"Table.dropLineColor", getPrimary1(),
"Table.dropLineShortColor", OCEAN_BLACK,
"Table.dropCellBackground", OCEAN_DROP,
"Tree.dropCellBackground", OCEAN_DROP,
"List.dropCellBackground", OCEAN_DROP,
"List.dropLineColor", getPrimary1()
};
}
/**
* Overriden to enable picking up the system fonts, if applicable.
*/
boolean isSystemTheme() {
return true;
}
/**
* Return the name of this theme, "Ocean".
*
* @return "Ocean"
*/
return "Ocean";
}
/**
* Returns the primary 1 color. This returns a color with an rgb hex value
* of {@code 0x6382BF}.
*
* @return the primary 1 color
* @see java.awt.Color#decode
*/
return PRIMARY1;
}
/**
* Returns the primary 2 color. This returns a color with an rgb hex value
* of {@code 0xA3B8CC}.
*
* @return the primary 2 color
* @see java.awt.Color#decode
*/
return PRIMARY2;
}
/**
* Returns the primary 3 color. This returns a color with an rgb hex value
* of {@code 0xB8CFE5}.
*
* @return the primary 3 color
* @see java.awt.Color#decode
*/
return PRIMARY3;
}
/**
* Returns the secondary 1 color. This returns a color with an rgb hex
* value of {@code 0x7A8A99}.
*
* @return the secondary 1 color
* @see java.awt.Color#decode
*/
return SECONDARY1;
}
/**
* Returns the secondary 2 color. This returns a color with an rgb hex
* value of {@code 0xB8CFE5}.
*
* @return the secondary 2 color
* @see java.awt.Color#decode
*/
return SECONDARY2;
}
/**
* Returns the secondary 3 color. This returns a color with an rgb hex
* value of {@code 0xEEEEEE}.
*
* @return the secondary 3 color
* @see java.awt.Color#decode
*/
return SECONDARY3;
}
/**
* Returns the black color. This returns a color with an rgb hex
* value of {@code 0x333333}.
*
* @return the black color
* @see java.awt.Color#decode
*/
return OCEAN_BLACK;
}
/**
* Returns the desktop color. This returns a color with an rgb hex
* value of {@code 0xFFFFFF}.
*
* @return the desktop color
* @see java.awt.Color#decode
*/
return MetalTheme.white;
}
/**
* Returns the inactive control text color. This returns a color with an
* rgb hex value of {@code 0x999999}.
*
* @return the inactive control text color
*/
return INACTIVE_CONTROL_TEXT_COLOR;
}
/**
* Returns the control text color. This returns a color with an
* rgb hex value of {@code 0x333333}.
*
* @return the control text color
*/
return CONTROL_TEXT_COLOR;
}
/**
* Returns the menu disabled foreground color. This returns a color with an
* rgb hex value of {@code 0x999999}.
*
* @return the menu disabled foreground color
*/
return MENU_DISABLED_FOREGROUND;
}
}
// makes use of getIconResource() to fetch an icon and then hastens it
// - calls createValue() on it and returns the actual icon
}
}