001: /*
002: * Copyright (C) 2004 NNL Technology AB
003: * Visit www.infonode.net for information about InfoNode(R)
004: * products and how to contact NNL Technology AB.
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
019: * MA 02111-1307, USA.
020: */
021:
022: // $Id: BlueHighlightDockingTheme.java,v 1.11 2005/12/04 13:46:04 jesper Exp $
023: package net.infonode.docking.theme;
024:
025: import net.infonode.docking.properties.RootWindowProperties;
026: import net.infonode.docking.properties.WindowTabProperties;
027: import net.infonode.gui.icon.button.CloseIcon;
028: import net.infonode.gui.icon.button.MinimizeIcon;
029: import net.infonode.gui.icon.button.RestoreIcon;
030: import net.infonode.tabbedpanel.theme.BlueHighlightTheme;
031:
032: import java.awt.*;
033:
034: /**
035: * A theme where the tab of the focused window has a blue background.
036: *
037: * @author $Author: jesper $
038: * @version $Revision: 1.11 $
039: */
040: public final class BlueHighlightDockingTheme extends
041: DockingWindowsTheme {
042: private RootWindowProperties rootWindowProperties;
043:
044: public BlueHighlightDockingTheme() {
045: rootWindowProperties = createRootWindowProperties();
046: }
047:
048: public String getName() {
049: return "Blue Highlight Theme";
050: }
051:
052: public RootWindowProperties getRootWindowProperties() {
053: return rootWindowProperties;
054: }
055:
056: /**
057: * Create a root window properties object with the property values for this theme.
058: *
059: * @return the root window properties object
060: */
061: public static final RootWindowProperties createRootWindowProperties() {
062: BlueHighlightTheme blueHighlightTheme = new BlueHighlightTheme();
063: BlueHighlightTheme greyHighlightTheme = new BlueHighlightTheme(
064: new Color(150, 150, 150));
065:
066: RootWindowProperties properties = new RootWindowProperties();
067:
068: properties.getTabWindowProperties().getTabbedPanelProperties()
069: .addSuperObject(
070: greyHighlightTheme.getTabbedPanelProperties());
071:
072: WindowTabProperties tabProperties = properties
073: .getTabWindowProperties().getTabProperties();
074: tabProperties.getTitledTabProperties().addSuperObject(
075: greyHighlightTheme.getTitledTabProperties());
076:
077: // tabProperties.getTitledTabProperties().getHighlightedProperties().setFont(UIManager.getFont("font"));
078:
079: /* tabProperties.getFocusedProperties()
080: .setForegroundColor(Color.WHITE)
081: .setBackgroundColor(new Color(100, 130, 220));
082: */
083:
084: tabProperties.getFocusedProperties().addSuperObject(
085: blueHighlightTheme.getTitledTabProperties()
086: .getHighlightedProperties());
087:
088: tabProperties
089: .getHighlightedButtonProperties()
090: .getCloseButtonProperties()
091: .setIcon(
092: new CloseIcon(
093: Color.WHITE,
094: RootWindowProperties.DEFAULT_WINDOW_TAB_BUTTON_ICON_SIZE));
095:
096: tabProperties
097: .getHighlightedButtonProperties()
098: .getMinimizeButtonProperties()
099: .setIcon(
100: new MinimizeIcon(
101: Color.WHITE,
102: RootWindowProperties.DEFAULT_WINDOW_TAB_BUTTON_ICON_SIZE));
103:
104: tabProperties
105: .getHighlightedButtonProperties()
106: .getRestoreButtonProperties()
107: .setIcon(
108: new RestoreIcon(
109: Color.WHITE,
110: RootWindowProperties.DEFAULT_WINDOW_TAB_BUTTON_ICON_SIZE));
111:
112: properties.getComponentProperties().setBackgroundColor(
113: new Color(180, 190, 220));
114:
115: return properties;
116: }
117:
118: }
|