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: BlueHighlightTheme.java,v 1.24 2005/12/04 13:46:05 jesper Exp $
023: package net.infonode.tabbedpanel.theme;
024:
025: import net.infonode.gui.border.HighlightBorder;
026: import net.infonode.tabbedpanel.TabbedPanelProperties;
027: import net.infonode.tabbedpanel.border.TabAreaLineBorder;
028: import net.infonode.tabbedpanel.titledtab.TitledTabProperties;
029:
030: import javax.swing.border.CompoundBorder;
031: import javax.swing.border.LineBorder;
032: import java.awt.*;
033:
034: /**
035: * A theme with dark borders and blue (or custom color) background for the
036: * highlighted state.
037: *
038: * @author $Author: jesper $
039: * @version $Revision: 1.24 $
040: */
041: public class BlueHighlightTheme extends TabbedPanelTitledTabTheme {
042: private TitledTabProperties tabProperties = new TitledTabProperties();
043: private TabbedPanelProperties tabbedPanelProperties = new TabbedPanelProperties();
044:
045: /**
046: * Constructs a BlueHighlightTheme
047: */
048: public BlueHighlightTheme() {
049: this (new Color(90, 120, 200));
050: }
051:
052: /**
053: * Constructs a BlueHighlightTheme
054: *
055: * @param backgroundColor the background color for the highlighted tab
056: */
057: public BlueHighlightTheme(Color backgroundColor) {
058: tabProperties.getHighlightedProperties()
059: .getComponentProperties().setForegroundColor(
060: Color.WHITE)
061: .setBackgroundColor(backgroundColor).setBorder(
062: new TabAreaLineBorder(Color.BLACK));
063:
064: tabbedPanelProperties.getContentPanelProperties()
065: .getComponentProperties().setBorder(
066: new CompoundBorder(new LineBorder(Color.BLACK),
067: new HighlightBorder()));
068: tabbedPanelProperties.getTabAreaComponentsProperties()
069: .getComponentProperties().setBorder(
070: new TabAreaLineBorder(Color.BLACK));
071: }
072:
073: /**
074: * Gets the name for this theme
075: *
076: * @return the name
077: * @since ITP 1.1.0
078: */
079: public String getName() {
080: return "Blue Highlight Theme";
081: }
082:
083: /**
084: * Gets the TitledTabProperties for this theme
085: *
086: * @return the TitledTabProperties
087: */
088: public TitledTabProperties getTitledTabProperties() {
089: return tabProperties;
090: }
091:
092: /**
093: * Gets the TabbedPanelProperties for this theme
094: *
095: * @return the TabbedPanelProperties
096: */
097: public TabbedPanelProperties getTabbedPanelProperties() {
098: return tabbedPanelProperties;
099: }
100: }
|