summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-01-23 17:02:33 +0000
committerRoman Kennke <roman@kennke.org>2006-01-23 17:02:33 +0000
commit7b12ac008b96ed1cfa181228e65bc24a160b49b5 (patch)
tree7bec380614471ce12bfa9379f1456cfeebffda38
parent05acf9a8e512d9d906a98ca8343d54126235b681 (diff)
downloadclasspath-7b12ac008b96ed1cfa181228e65bc24a160b49b5.tar.gz
2006-01-23 Roman Kennke <kennke@aicas.com>
* javax/swing/plaf/synth/ColorType.java, * javax/swing/plaf/synth/Region.java, * javax/swing/plaf/synth/SynthConstants.java, * javax/swing/plaf/synth/SynthContext.java * javax/swing/plaf/synth/SynthGraphicsUtils.java, * javax/swing/plaf/synth/SynthLookAndFeel.java, * javax/swing/plaf/synth/SynthPainter.java, * javax/swing/plaf/synth/SynthStyle.java, * javax/swing/plaf/synth/SynthStyleFactory.java, * javax/swing/plaf/synth/package.html: New files. Added the public API and framework classes for the Synth look and feel.
-rw-r--r--ChangeLog15
-rw-r--r--javax/swing/plaf/synth/ColorType.java130
-rw-r--r--javax/swing/plaf/synth/Region.java474
-rw-r--r--javax/swing/plaf/synth/SynthConstants.java85
-rw-r--r--javax/swing/plaf/synth/SynthContext.java134
-rw-r--r--javax/swing/plaf/synth/SynthGraphicsUtils.java283
-rw-r--r--javax/swing/plaf/synth/SynthLookAndFeel.java272
-rw-r--r--javax/swing/plaf/synth/SynthPainter.java80
-rw-r--r--javax/swing/plaf/synth/SynthStyle.java144
-rw-r--r--javax/swing/plaf/synth/SynthStyleFactory.java64
-rw-r--r--javax/swing/plaf/synth/package.html47
11 files changed, 1728 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6236d8ab3..57cfc7989 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2006-01-23 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/synth/ColorType.java,
+ * javax/swing/plaf/synth/Region.java,
+ * javax/swing/plaf/synth/SynthConstants.java,
+ * javax/swing/plaf/synth/SynthContext.java
+ * javax/swing/plaf/synth/SynthGraphicsUtils.java,
+ * javax/swing/plaf/synth/SynthLookAndFeel.java,
+ * javax/swing/plaf/synth/SynthPainter.java,
+ * javax/swing/plaf/synth/SynthStyle.java,
+ * javax/swing/plaf/synth/SynthStyleFactory.java,
+ * javax/swing/plaf/synth/package.html:
+ New files. Added the public API and framework classes for the
+ Synth look and feel.
+
2006-01-23 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/text/Segment.java: API docs all over.
diff --git a/javax/swing/plaf/synth/ColorType.java b/javax/swing/plaf/synth/ColorType.java
new file mode 100644
index 000000000..954e309e1
--- /dev/null
+++ b/javax/swing/plaf/synth/ColorType.java
@@ -0,0 +1,130 @@
+/* ColorType.java -- En enumeration of color types
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+/**
+ * A typesafe enumeration of color types.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public class ColorType
+{
+
+ /**
+ * A constant used to identify the foreground color of a component.
+ */
+ public static final ColorType FOREGROUND = new ColorType("Foreground");
+
+ /**
+ * A constant used to identify the background color of a component.
+ */
+ public static final ColorType BACKGROUND = new ColorType("Background");
+
+ /**
+ * A constant used to identify the foreground color of text of a component.
+ */
+ public static final ColorType TEXT_FOREGROUND
+ = new ColorType("TextForeground");
+
+ /**
+ * A constant used to identify the background color of text of a component.
+ */
+ public static final ColorType TEXT_BACKGROUND
+ = new ColorType("TextBackground");
+
+ /**
+ * A constant used to identify the focus color of a component.
+ */
+ public static final ColorType FOCUS = new ColorType("Focus");
+
+ /**
+ * The maximum number of color types.
+ */
+ public static final int MAX_COUNT = 5;
+
+ /**
+ * A counter used to assign an ID to the created color types.
+ */
+ private static int count = 0;
+
+ /**
+ * The ID of the color type.
+ */
+ private int id;
+
+ /**
+ * The description of the color type.
+ */
+ private String description;
+
+ /**
+ * Creates a new <code>Color</code> color type with the specified
+ * description.
+ *
+ * @param desc the textual description of the color type
+ */
+ protected ColorType(String desc)
+ {
+ description = desc;
+ id = count;
+ count++;
+ }
+
+ /**
+ * Returns the unique ID of the color type.
+ *
+ * @return the unique ID of the color type
+ */
+ public final int getID()
+ {
+ return id;
+ }
+
+ /**
+ * Returns the textual description of the color type.
+ *
+ * @return the textual description of the color type
+ */
+ public String toString()
+ {
+ return description;
+ }
+}
diff --git a/javax/swing/plaf/synth/Region.java b/javax/swing/plaf/synth/Region.java
new file mode 100644
index 000000000..7ede65fc8
--- /dev/null
+++ b/javax/swing/plaf/synth/Region.java
@@ -0,0 +1,474 @@
+/* Region.java -- Describes a region within a component
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+/**
+ * Describes a region of a component or the complete component.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public class Region
+{
+
+ // FIXME: What should ui be for the non-component regions that have
+ // subregion==false?
+
+ /**
+ * Specifies an arrow button region.
+ */
+ public static final Region ARROW_BUTTON =
+ new Region("ArrowButton", null, false);
+
+ /**
+ * Specifies the region of a standard button.
+ */
+ public static final Region BUTTON =
+ new Region("Button", "ButtonUI", false);
+
+ /**
+ * Specifies the region of a check box.
+ */
+ public static final Region CHECK_BOX =
+ new Region("CheckBox", "CheckBoxUI", false);
+
+ /**
+ * Specifies the region of a check box menu item.
+ */
+ public static final Region CHECK_BOX_MENU_ITEM =
+ new Region("CheckBoxMenuItem", "CheckBoxMenuItemUI", false);
+
+ /**
+ * Specifies the region of a colorchooser.
+ */
+ public static final Region COLOR_CHOOSER =
+ new Region("ColorChooser", "ColorChooserUI", false);
+
+ /**
+ * Specifies the region of a combo box.
+ */
+ public static final Region COMBO_BOX =
+ new Region("ComboBox", "ComboBoxUI", false);
+
+ /**
+ * Specifies the region of a desktop pane.
+ */
+ public static final Region DESKTOP_PANE =
+ new Region("DesktopPane", "DesktopPaneUI", false);
+
+ /**
+ * Specifies the region of a desktop icon.
+ */
+ public static final Region DESKTOP_ICON =
+ new Region("DesktopIcon", "DesktopIconUI", false);
+
+ /**
+ * Specifies the region of an editor pane.
+ */
+ public static final Region EDITOR_PANE =
+ new Region("EditorPane", "EditorPaneUI", false);
+
+ /**
+ * Specifies the region of a file chooser.
+ */
+ public static final Region FILECHOOSER =
+ new Region("FileChooser", "FileChooserUI", false);
+
+ /**
+ * Specifies the region of a formatted text field.
+ */
+ public static final Region FormattedTextField =
+ new Region("FormattedTextField", "FormattedTextFieldUI", false);
+
+ /**
+ * Specifies the region of an internal frame.
+ */
+ public static final Region INTERNAL_FRAME =
+ new Region("InternalFrame", "InternalFrameUI", false);
+
+ /**
+ * Specifies the region of the title pane of an internal frame.
+ */
+ public static final Region INTERNAL_FRAME_TITLE_PANE =
+ new Region("InternalFrameTitlePane", "InternalFrameTitlePaneUI", false);
+
+ /**
+ * Specifies the region of a label.
+ */
+ public static final Region LABEL =
+ new Region("Label", "LabelUI", false);
+
+ /**
+ * Specifies the region of a list.
+ */
+ public static final Region LIST =
+ new Region("List", "ListUI", false);
+
+ /**
+ * Specifies the region of a menu.
+ */
+ public static final Region MENU =
+ new Region("Menu", "MenuUI", false);
+
+ /**
+ * Specifies the region of a menu bar.
+ */
+ public static final Region MENU_BAR =
+ new Region("MenuBar", "MenuBarUI", false);
+
+ /**
+ * Specifies the region of a menu item.
+ */
+ public static final Region MENU_ITEM =
+ new Region("MenuItem", "MenuItemUI", false);
+
+ /**
+ * Specifies the region of a menu item accelerator. This is a subregion
+ * of menu item.
+ */
+ public static final Region MENU_ITEM_ACCELERATOR =
+ new Region("MenuItemAccelerator", null, true);
+
+ /**
+ * Specifies the region of an option pane.
+ */
+ public static final Region OPTION_PANE =
+ new Region("OptionPane", "OptionPaneUI", false);
+
+ /**
+ * Specifies the region of a panel.
+ */
+ public static final Region PANEL =
+ new Region("Panel", "PanelUI", false);
+
+ /**
+ * Specifies the region of a password field.
+ */
+ public static final Region PASSWORD_FIELD =
+ new Region("PasswordField", "PasswordFieldUI", false);
+
+ /**
+ * Specifies the region of a popup menu.
+ */
+ public static final Region POPUP_MENU =
+ new Region("PopupMenu", "PopupMenuUI", false);
+
+ /**
+ * Specifies the region of a popup menu separator.
+ */
+ public static final Region POPUP_MENU_SEPARATOR =
+ new Region("PopupMenuSeparator", null, false);
+
+ /**
+ * Specifies the region of a progress bar.
+ */
+ public static final Region PROGRESS_BAR =
+ new Region("ProgressBar", "ProgressBarUI", false);
+
+ /**
+ * Specifies the region of a radio button.
+ */
+ public static final Region RADIO_BUTTON =
+ new Region("RadioButton", "RadioButtonUI", false);
+
+ /**
+ * Specifies the region of a radio button menu item.
+ */
+ public static final Region RADIO_BUTTON_MENU_ITEM =
+ new Region("RadioButtonMenuItem", "RadioButtonMenuItemUI", false);
+
+ /**
+ * Specifies the region of a root pane.
+ */
+ public static final Region ROOT_PANE =
+ new Region("RootPane", "RootPaneUI", false);
+
+ /**
+ * Specifies the region of a scroll bar.
+ */
+ public static final Region SCROLL_BAR =
+ new Region("ScrollBar", "ScrollBarUI", false);
+
+ /**
+ * Specifies the region of a scroll bar track. This is a subregion of
+ * scroll bars.
+ */
+ public static final Region SCROLL_BAR_TRACK =
+ new Region("ScrollBarTrack", null, true);
+
+ /**
+ * Specifies the region of a scroll bar thumb. This is a subregion of
+ * scroll bars.
+ */
+ public static final Region SCROLL_BAR_THUMB =
+ new Region("ScrollBarThumb", null, true);
+
+ /**
+ * Specifies the region of a scroll pane.
+ */
+ public static final Region SCROLL_PANE =
+ new Region("ScrollPane", "ScrollPaneUI", false);
+
+ /**
+ * Specifies the region of a separator.
+ */
+ public static final Region SEPARATOR =
+ new Region("Separator", "SeparatorUI", false);
+
+ /**
+ * Specifies the region of a slider.
+ */
+ public static final Region SLIDER =
+ new Region("Slider", "SliderUI", false);
+
+ /**
+ * Specifies the region of a slider track. This is a subregion of a slider.
+ */
+ public static final Region SLIDER_TRACK =
+ new Region("SliderTrack", null, true);
+
+ /**
+ * Specifies the region of a slider thumb. This is a subregion of a slider.
+ */
+ public static final Region SLIDER_THUMB =
+ new Region("SliderThumb", null, true);
+
+ /**
+ * Specifies the region of a spinner.
+ */
+ public static final Region SPINNER =
+ new Region("Spinner", "SpinnerUI", false);
+
+ /**
+ * Specifies the region of a split pane.
+ */
+ public static final Region SPLIT_PANE =
+ new Region("SplitPane", "SplitPaneUI", false);
+
+ /**
+ * Specifies the region of a split pane divider. This is a subregion of
+ * a split pane.
+ */
+ public static final Region SPLIT_PANE_DIVIDER =
+ new Region("SplitPaneDivider", null, true);
+
+ /**
+ * Specifies the region of a tabbed pane.
+ */
+ public static final Region TABBED_PANE =
+ new Region("TabbedPane", "TabbedPaneUI", false);
+
+ /**
+ * This specifies the region of a tab of a tabbed pane. This is a subregion
+ * of a tabbed pane.
+ */
+ public static final Region TABBED_PANE_TAB =
+ new Region("TabbedPaneTab", null, true);
+
+ /**
+ * This specifies the region underneath the tabs of a tabbed pane. This is a
+ * subregion of a tabbed pane.
+ */
+ public static final Region TABBED_PANE_TAB_AREA =
+ new Region("TabbedPaneTabArea", null, true);
+
+ /**
+ * This specifies the region for the content of a tabbed pane. This is a
+ * subregion of a tabbed pane.
+ */
+ public static final Region TABBED_PANE_CONTENT =
+ new Region("TabbedPaneContent", null, true);
+
+ /**
+ * Specifies the region of a table.
+ */
+ public static final Region TABLE =
+ new Region("Table", "TableUI", false);
+
+ /**
+ * Specifies the region of a table header.
+ */
+ public static final Region TABLE_HEADER =
+ new Region("TableHeader", "TableHeaderUI", false);
+
+ /**
+ * Specifies the region of a text area.
+ */
+ public static final Region TEXT_AREA =
+ new Region("TextArea", "TextAreaUI", false);
+
+ /**
+ * Specifies the region of a text field.
+ */
+ public static final Region TEXT_FIELD =
+ new Region("TextField", "TextFieldUI", false);
+
+ /**
+ * Specifies the region of a text pane.
+ */
+ public static final Region TEXT_PANE =
+ new Region("TextPane", "TextPaneUI", false);
+
+ /**
+ * Specifies the region of a toggle button.
+ */
+ public static final Region TOGGLE_BUTTON =
+ new Region("ToggleButton", "ToggleButtonUI", false);
+
+ /**
+ * Specifies the region of a tool bar.
+ */
+ public static final Region TOOL_BAR =
+ new Region("ToolBar", "ToolBarUI", false);
+
+ /**
+ * Specifies the content region of a tool bar. This is a subregion of a tool
+ * bar.
+ */
+ public static final Region TOOL_BAR_CONTENT =
+ new Region("ToolBarContent", null, true);
+
+ /**
+ * Specifies the drag window region of a tool bar. This is a subregion of a
+ * tool bar.
+ */
+ public static final Region TOOL_BAR_DRAG_WINDOW =
+ new Region("ToolBarDragWindow", null, false);
+
+ /**
+ * Specifies the region of a tool tip.
+ */
+ public static final Region TOOL_TIP =
+ new Region("ToolTip", "ToolTipUI", false);
+
+ /**
+ * Specifies the region of a separator of a tool bar. This is a subregion of
+ * a tool bar.
+ */
+ public static final Region TOOL_BAR_SEPARATOR =
+ new Region("ToolBarSeparator", null, false);
+
+ /**
+ * Specifies the region of a tree.
+ */
+ public static final Region TREE =
+ new Region("Tree", "TreeUI", false);
+
+ /**
+ * Specifies the region of a tree cell. This is a subregion of a tree.
+ */
+ public static final Region TREE_CELL =
+ new Region("TreeCell", null, true);
+
+ /**
+ * Specifies the region of a viewport.
+ */
+ public static final Region VIEWPORT =
+ new Region("Viewport", "ViewportUI", false);
+
+
+ /**
+ * The UI class id for the region. This is package private because this will
+ * be used by other classes in that package.
+ */
+ String ui;
+
+ /**
+ * The name of the region.
+ */
+ private String name;
+
+ /**
+ * If this region is a subregion or not.
+ */
+ private boolean subregion;
+
+ /**
+ * Creates a new <code>Region</code> with the specified name and ui ID.
+ * The <code>ui</code> must be the same what
+ * {@link javax.swing.JComponent#getUIClassID()} returns for toplevel regions. For
+ * subregions this should be <code>null</code>.
+ *
+ * @param name the name of the region
+ * @param ui the UI class ID of the region or <code>null</code> for
+ * subregions
+ * @param subregion <code>true</code> if this region is a subregion,
+ * <code>false</code> otherwise
+ */
+ protected Region(String name, String ui, boolean subregion)
+ {
+ this.name = name;
+ this.ui = ui;
+ this.subregion = subregion;
+ }
+
+ /**
+ * Returns <code>true</code> if this region describes a subregion of a
+ * component, <code>false</code> if it describes a component region itself.
+ *
+ * @return <code>true</code> if this region describes a subregion of a
+ * component, <code>false</code> if it describes a component region
+ * itself
+ */
+ public boolean isSubregion()
+ {
+ return subregion;
+ }
+
+ /**
+ * Returns the name of the region.
+ *
+ * @return the name of the region
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Returns the name of the region.
+ *
+ * @return the name of the region
+ */
+ public String toString()
+ {
+ return name;
+ }
+}
diff --git a/javax/swing/plaf/synth/SynthConstants.java b/javax/swing/plaf/synth/SynthConstants.java
new file mode 100644
index 000000000..306024c00
--- /dev/null
+++ b/javax/swing/plaf/synth/SynthConstants.java
@@ -0,0 +1,85 @@
+/* SynthConstants.java -- A couple of constants used by Synth
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+/**
+ * A couple of constants used by the Synth Look and Feel.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public interface SynthConstants
+{
+ /**
+ * A primary state indicating that a component is enabled.
+ */
+ static final int ENABLED = 1;
+
+ /**
+ * A primary state indicating that a component is disabled.
+ */
+ static final int DISABLED = 8;
+
+ /**
+ * A primary state indicating that the mouse is over a region.
+ */
+ static final int MOUSE_OVER = 2;
+
+ /**
+ * A primary state indicating that the component is in a pressed state (which
+ * does not necessarily mean that the mouse is pressed over the component).
+ */
+ static final int PRESSED = 4;
+
+ /**
+ * Indicates that a region has focus.
+ */
+ static final int FOCUSED = 256;
+
+ /**
+ * Indicates that a region is selected.
+ */
+ static final int SELECTED = 512;
+
+ /**
+ * Indicates that a region is in its default state.
+ */
+ static final int DEFAULT = 1024;
+}
diff --git a/javax/swing/plaf/synth/SynthContext.java b/javax/swing/plaf/synth/SynthContext.java
new file mode 100644
index 000000000..83536dae9
--- /dev/null
+++ b/javax/swing/plaf/synth/SynthContext.java
@@ -0,0 +1,134 @@
+/* SynthContext.java -- Contextual information about a region
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+import javax.swing.JComponent;
+
+/**
+ * Contains some contextual information about a region. The information passed
+ * in objects of this class can only be considered valid during the method call
+ * that it was passed to.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public class SynthContext
+{
+
+ /**
+ * The component.
+ */
+ private JComponent component;
+
+ /**
+ * The region of the component.
+ */
+ private Region region;
+
+ /**
+ * The style of the component.
+ */
+ private SynthStyle style;
+
+ /**
+ * The state of the component.
+ */
+ private int state;
+
+ /**
+ * Creates a new <code>SynthContext</code> object.
+ *
+ * @param component the component for which this context is used
+ * @param region the region of the component
+ * @param style the style associated with the component
+ * @param state a or'ed bitmask of the constants from {@link SynthConstants}
+ */
+ public SynthContext(JComponent component, Region region, SynthStyle style,
+ int state)
+ {
+ this.component = component;
+ this.region = region;
+ this.style = style;
+ this.state = state;
+ }
+
+ /**
+ * Returns the component that contains the region.
+ *
+ * @return the component that contains the region
+ */
+ public JComponent getComponent()
+ {
+ return component;
+ }
+
+ /**
+ * Returns the region that identifies this state.
+ *
+ * @return the region that identifies this state
+ */
+ public Region getRegion()
+ {
+ return region;
+ }
+
+ /**
+ * Returns the style of the region.
+ *
+ * @return the style of the region
+ */
+ public SynthStyle getStyle()
+ {
+ return style;
+ }
+
+ /**
+ * Returns the state of the component. This is a or'ed bitmask of the
+ * constants defined in {@link SynthConstants}.
+ *
+ * @return the state of the component
+ *
+ * @see SynthConstants
+ */
+ public int getComponentState()
+ {
+ return state;
+ }
+}
diff --git a/javax/swing/plaf/synth/SynthGraphicsUtils.java b/javax/swing/plaf/synth/SynthGraphicsUtils.java
new file mode 100644
index 000000000..a68b6f6ec
--- /dev/null
+++ b/javax/swing/plaf/synth/SynthGraphicsUtils.java
@@ -0,0 +1,283 @@
+/* SynthGraphicsUtils.java -- Wrapper for graphics primitives used in Synth
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+
+import javax.swing.Icon;
+import javax.swing.SwingUtilities;
+
+/**
+ * Wrapper for graphics primitives used in Synth.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public class SynthGraphicsUtils
+
+{
+ /**
+ * Creates a new <code>SynthGraphicsUtils</code> object.
+ */
+ public SynthGraphicsUtils()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * Draws a line from (x1,y1) to (x2,y2).
+ *
+ * @param ctx the synth context, identifies the region
+ * @param paintKey identifies the portion of the component to be painted, may
+ * be <code>null</code>
+ * @param g the graphics context to use for painting
+ * @param x1 the x coordinate of the start point
+ * @param y1 the y coordinate of the start point
+ * @param x2 the x coordinate of the end point
+ * @param y2 the y coordinate of the end point
+ */
+ public void drawLine(SynthContext ctx, Object paintKey, Graphics g, int x1,
+ int y1, int x2, int y2)
+ {
+ // TODO: Correct?
+ g.drawLine(x1, y1, x2, y2);
+ }
+
+ /**
+ * Lays out a label and (if non-null) an icon. The calculated coordinates are
+ * then stored in <code>viewR</code>, <code>iconR</code> and
+ * <code>textR</code>.
+ *
+ * The alignment and position parameters may be one of the alignment or
+ * position constants defined in {@link javax.swing.SwingConstants}.
+ *
+ * @param ctx the synth context, identifies the current region
+ * @param fm the font metrics to use to fetch the text measures
+ * @param text the text to lay out, may be <code>null</code>
+ * @param icon the icon to lay out, may be <code>null</code>
+ * @param hAlign the horizontal alignment of the label
+ * @param vAlign the vertical alignment of the label
+ * @param hTextPos the horizontal text position
+ * @param vTextPos the vertical text position
+ * @param viewR the view rectangle (return parameter)
+ * @param iconR the icon rectangle (return parameter)
+ * @param textR the text rectangle (return parameter)
+ * @param iconTextGap the gap between text and label
+ *
+ * @return the label text, may be shortened
+ */
+ public String layoutText(SynthContext ctx, FontMetrics fm, String text,
+ Icon icon, int hAlign, int vAlign, int hTextPos,
+ int vTextPos, Rectangle viewR, Rectangle iconR,
+ Rectangle textR, int iconTextGap)
+ {
+ return SwingUtilities.layoutCompoundLabel(fm, text, icon, vAlign, hAlign,
+ vTextPos, hTextPos, viewR, iconR,
+ textR, iconTextGap);
+ }
+
+ /**
+ * Returns the width of the string <code>text</code> for the specified font
+ * and font metrics.
+ *
+ * @param ctx identifies the current region
+ * @param font the font
+ * @param fm the font metrics to use
+ * @param text the text to be measured
+ *
+ * @return the width of the string <code>text</code> for the specified font
+ * and font metrics
+ */
+ public int computeStringWidth(SynthContext ctx, Font font, FontMetrics fm,
+ String text)
+ {
+ return fm.stringWidth(text);
+ }
+
+ /**
+ * Calculates the minimums size that is needed to render the label with
+ * <code>text</code> and <code>icon</code> correctly.
+ *
+ * @param ctx identifies the current region
+ * @param font the font to use
+ * @param text the label text
+ * @param icon the label icon
+ * @param hAlign the horizontal alignment
+ * @param vAlign the vertical alignment
+ * @param hTextPosition the horizontal text position
+ * @param vTextPosition the vertical text position
+ * @param iconTextGap the gap between icon and text
+ * @param mnemonicIndex index to the mnemonic character within
+ * <code>text</code>
+ *
+ * @return the minimums size that is needed to render the label with
+ * <code>text</code> and <code>icon</code> correctly
+ */
+ public Dimension getMinimumSize(SynthContext ctx, Font font, String text,
+ Icon icon, int hAlign, int vAlign,
+ int hTextPosition,int vTextPosition,
+ int iconTextGap,int mnemonicIndex)
+ {
+ // FIXME: Implement this correctly.
+ return new Dimension(0, 0);
+ }
+
+ /**
+ * Calculates the preferred size that is needed to render the label with
+ * <code>text</code> and <code>icon</code> correctly.
+ *
+ * @param ctx identifies the current region
+ * @param font the font to use
+ * @param text the label text
+ * @param icon the label icon
+ * @param hAlign the horizontal alignment
+ * @param vAlign the vertical alignment
+ * @param hTextPosition the horizontal text position
+ * @param vTextPosition the vertical text position
+ * @param iconTextGap the gap between icon and text
+ * @param mnemonicIndex index to the mnemonic character within
+ * <code>text</code>
+ *
+ * @return the preferred size that is needed to render the label with
+ * <code>text</code> and <code>icon</code> correctly
+ */
+ public Dimension getPreferredSize(SynthContext ctx, Font font, String text,
+ Icon icon, int hAlign, int vAlign,
+ int hTextPosition,int vTextPosition,
+ int iconTextGap,int mnemonicIndex)
+ {
+ // FIXME: Implement this correctly.
+ return new Dimension(0, 0);
+ }
+
+ /**
+ * Calculates the maximum size that is needed to render the label with
+ * <code>text</code> and <code>icon</code> correctly.
+ *
+ * @param ctx identifies the current region
+ * @param font the font to use
+ * @param text the label text
+ * @param icon the label icon
+ * @param hAlign the horizontal alignment
+ * @param vAlign the vertical alignment
+ * @param hTextPosition the horizontal text position
+ * @param vTextPosition the vertical text position
+ * @param iconTextGap the gap between icon and text
+ * @param mnemonicIndex index to the mnemonic character within
+ * <code>text</code>
+ *
+ * @return the maximum size that is needed to render the label with
+ * <code>text</code> and <code>icon</code> correctly
+ */
+ public Dimension getMaximumSize(SynthContext ctx, Font font, String text,
+ Icon icon, int hAlign, int vAlign,
+ int hTextPosition,int vTextPosition,
+ int iconTextGap,int mnemonicIndex)
+ {
+ // FIXME: Implement this correctly.
+ return new Dimension(0, 0);
+ }
+
+ /**
+ * Returns the maximum character height of the font from the component of the
+ * passed in <code>context</code>.
+ *
+ * @param context identifies the current component and region
+ *
+ * @return the maximum character height of the font from the component of the
+ * passed in <code>context</code>
+ */
+ public int getMaximumCharHeight(SynthContext context)
+ {
+ Component comp = context.getComponent();
+ Font font = comp.getFont();
+ return comp.getFontMetrics(font).getHeight();
+ }
+
+ /**
+ * Renders the specified <code>text</code> within the <code>bounds</code>.
+ *
+ * @param ctx identifies the component and region
+ * @param g the graphics context for drawing the tetx
+ * @param text the text to be rendered
+ * @param bounds the bounds within which the text should be rendered
+ * @param mnemonicIndex the index of the mnemonic character within
+ * <code>text</code>
+ */
+ public void paintText(SynthContext ctx, Graphics g, String text,
+ Rectangle bounds, int mnemonicIndex)
+ {
+ // FIXME: This is very primitive and should be improved to paint the
+ // mnemonic char.
+ g.drawString(text, bounds.x, bounds.y);
+ }
+
+ /**
+ * Renders the specified <code>text</code> at the specified location.
+ *
+ * @param ctx identifies the component and region
+ * @param g the graphics context for drawing the tetx
+ * @param text the text to be rendered
+ * @param x the X location where the text should be rendered
+ * @param y the Y location where the text should be rendered
+ * @param mnemonicIndex the index of the mnemonic character within
+ * <code>text</code>
+ */
+ public void paintText(SynthContext ctx, Graphics g, String text,
+ int x, int y, int mnemonicIndex)
+ {
+ // FIXME: This is very primitive and should be improved to paint the
+ // mnemonic char.
+ g.drawString(text, x, y);
+ }
+
+ public void paintText(SynthContext ctx, Graphics g, String text, Icon icon,
+ int hAlign, int vAlign, int hTextPosition,
+ int vTextPosition, int iconTextGap, int mnemonicIndex,
+ int textOffset)
+ {
+ // FIXME: Implement this correctly.
+ }
+}
diff --git a/javax/swing/plaf/synth/SynthLookAndFeel.java b/javax/swing/plaf/synth/SynthLookAndFeel.java
new file mode 100644
index 000000000..8d0596d41
--- /dev/null
+++ b/javax/swing/plaf/synth/SynthLookAndFeel.java
@@ -0,0 +1,272 @@
+/* SynthLookAndFeel.java -- A skinnable Swing look and feel
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+import java.awt.Component;
+import java.io.InputStream;
+import java.text.ParseException;
+
+import javax.swing.JComponent;
+import javax.swing.UIDefaults;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicLookAndFeel;
+
+
+/**
+ * A look and feel that can be customized either by providing a file to
+ * {@link #load} or by setting a {@link SynthStyleFactory} using
+ * {@link #setStyleFactory}.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public class SynthLookAndFeel
+ extends BasicLookAndFeel
+{
+
+ /**
+ * The style factory that will be used by the UI classes to load their
+ * style sets from.
+ */
+ private static SynthStyleFactory styleFactory;
+
+ /**
+ * Creates a new instance of <code>SynthLookAndFeel</code>. In order to use
+ * the Synth look and feel you either need to call {@link #load} to load a
+ * set of styles from an XML file, or you need to call
+ * {@link #setStyleFactory} to provide your own style factory.
+ */
+ public SynthLookAndFeel()
+ {
+ // FIXME: What to do here, if anything?
+ }
+
+ /**
+ * Sets the style factory that the UI classes of Synth will use to load their
+ * sets of styles.
+ *
+ * @param sf the style factory to set
+ */
+ public static void setStyleFactory(SynthStyleFactory sf)
+ {
+ styleFactory = sf;
+ }
+
+ /**
+ * Returns the current style factory that the UI classes of Synth will use to
+ * load their sets of styles.
+ *
+ * @return the current style factory
+ */
+ public static SynthStyleFactory getStyleFactory()
+ {
+ return styleFactory;
+ }
+
+ /**
+ * Returns the style for the specified component and region.
+ *
+ * @param c the component for which to return the style
+ * @param r the region of the component for which to return the style
+ *
+ * @return the style for the specified component and region
+ */
+ public static SynthStyle getStyle(JComponent c, Region r)
+ {
+ return getStyleFactory().getStyle(c, r);
+ }
+
+ /**
+ * Updates all style information of the component and it's children.
+ *
+ * @param c the componenent for which to update the style
+ */
+ public static void updateStyles(Component c)
+ {
+ // FIXME: Implement this properly.
+ }
+
+ /**
+ * Returns the region for a given Swing component.
+ *
+ * @param c the Swing component for which to fetch the region
+ *
+ * @return the region for a given Swing component
+ */
+ public static Region getRegion(JComponent c)
+ {
+ // FIXME: This can be implemented as soon as we have the component UI
+ // classes in place, since this region will be matched via the UI classes.
+ return null;
+ }
+
+ /**
+ * Creates the Synth look and feel component UI instance for the given
+ * component.
+ *
+ * @param c the component for which to create a UI instance
+ *
+ * @return the Synth look and feel component UI instance for the given
+ * component
+ */
+ public static ComponentUI createUI(JComponent c)
+ {
+ // FIXME: This can be implemented as soon as we have the component UI
+ // classes in place.
+ return null;
+ }
+
+ /**
+ * Initializes this look and feel.
+ */
+ public void initialize()
+ {
+ super.initialize();
+ // TODO: Implement at least the following here:
+ // if (styleFactory != null)
+ // styleFactory = new DefaultStyleFactory();
+ }
+
+ /**
+ * Uninitializes the look and feel.
+ */
+ public void uninitialize()
+ {
+ super.uninitialize();
+ // TODO: What to do here?
+ }
+
+ /**
+ * Returns the UI defaults of this look and feel.
+ *
+ * @return the UI defaults of this look and feel
+ */
+ public UIDefaults getDefaults()
+ {
+ // FIXME: This is certainly wrong. The defaults should be fetched/merged
+ // from the file from which the l&f is loaded.
+ return super.getDefaults();
+ }
+
+ /**
+ * FIXME: DOCUMENT ME!
+ *
+ * @return FIXME
+ */
+ public boolean shouldUpdateStyleOnAncestorChanged()
+ {
+ return false;
+ }
+
+ /**
+ * Loads a set of {@link SynthStyle}s that are used for the look and feel of
+ * the components. The <code>resourceBase</code> parameter is used to resolve
+ * references against, like icons and other files.
+ *
+ * @param in the input stream from where to load the styles
+ * @param resourceBase the base against which references are resolved.
+ *
+ * @throws ParseException if the input stream cannot be parsed
+ * @throws IllegalArgumentException if one of the parameters is
+ * <code>null</code>
+ */
+ // FIXME: The signature in the JDK has a Class<?> here. Should be fixed as
+ // soon as we switch to the generics branch.
+ public void load(InputStream in, Class resourceBase)
+ throws ParseException, IllegalArgumentException
+ {
+ // FIXME: Implement this correctly.
+ }
+
+ /**
+ * Returns a textual description of the Synth look and feel. This returns
+ * &quot;Synt look and feel&quot;.
+ *
+ * @return a textual description of the Synth look and feel
+ */
+ public String getDescription()
+ {
+ return "Synth look and feel";
+ }
+
+ /**
+ * Returns the ID of the Synth look and feel. This returns &quot;Synth&quot;.
+ *
+ * @return the ID of the Synth look and feel
+ */
+ public String getID()
+ {
+ return "Synth";
+ }
+
+ /**
+ * Returns the name of the Synth look and feel. This returns
+ * &quot;Synt look and feel&quot;.
+ *
+ * @return the name of the Synth look and feel
+ */
+ public String getName()
+ {
+ return "Synth look and feel";
+ }
+
+ /**
+ * Returns <code>false</code> since the Synth look and feel is not a native
+ * look and feel.
+ *
+ * @return <code>false</code>
+ */
+ public boolean isNativeLookAndFeel()
+ {
+ return false;
+ }
+
+ /**
+ * Returns <code>true</code> since the Synth look and feel is always a
+ * supported look and feel.
+ *
+ * @return <code>true</code>
+ */
+ public boolean isSupportedLookAndFeel()
+ {
+ return true;
+ }
+
+}
diff --git a/javax/swing/plaf/synth/SynthPainter.java b/javax/swing/plaf/synth/SynthPainter.java
new file mode 100644
index 000000000..0d63c6db7
--- /dev/null
+++ b/javax/swing/plaf/synth/SynthPainter.java
@@ -0,0 +1,80 @@
+/* SynthPainter.java -- An abstract painter for synth components
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+import java.awt.Graphics;
+
+/**
+ * The abstract definition of a delegate that takes the responsibility of
+ * painting for the components.
+ *
+ * This class is defined to be abstract and all methods are no-ops.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public abstract class SynthPainter
+{
+
+ /**
+ * Creates a new <code>SynthPainter</code> object.
+ */
+ public SynthPainter()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * Paints the background of an arrow button.
+ *
+ * @param ctx the synth context identifying the component and region for
+ * painting
+ * @param g the graphics context to use for painting
+ * @param x the X coordinate of the area to paint
+ * @param y the Y coordinate of the area to paint
+ * @param w the width of the area to paint
+ * @param h the height of the area to paint
+ */
+ public void paintArrowButtonBackground(SynthContext ctx, Graphics g, int x,
+ int y, int w, int h)
+ {
+ // Nothing to do here.
+ }
+}
diff --git a/javax/swing/plaf/synth/SynthStyle.java b/javax/swing/plaf/synth/SynthStyle.java
new file mode 100644
index 000000000..e0a8dbcc7
--- /dev/null
+++ b/javax/swing/plaf/synth/SynthStyle.java
@@ -0,0 +1,144 @@
+/* SynthStyle.java -- A set of style properties
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Insets;
+
+import javax.swing.Icon;
+
+/**
+ * A set of style properties that can be installed on a component.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.5
+ */
+public abstract class SynthStyle
+{
+
+ /**
+ * Creates a new <code>SynthStyle</code> object.
+ */
+ public SynthStyle()
+ {
+ // FIXME: Implement this correctly.
+ }
+
+ public SynthGraphicsUtils getGraphicsUtils(SynthContext ctx)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+
+ public Color getColor(SynthContext ctx, ColorType type)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+
+ public abstract Color getColorForState(SynthContext ctx, ColorType type);
+
+ public Font getFont(SynthContext ctx)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+
+ public abstract Font getFontForState(SynthContext ctx);
+
+ public Insets getInsets(SynthContext ctx)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+
+ public SynthPainter getPainted(SynthContext ctx)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+
+ public boolean isOpaque(SynthContext ctx)
+ {
+ // FIXME: Implement this correctly.
+ return true;
+ }
+
+ public Object get(SynthContext ctx, Object key)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+
+ public void installDefaults(SynthContext ctx)
+ {
+ // FIXME: Implement this correctly.
+ }
+
+ public void uninstallDefaults(SynthContext ctx)
+ {
+ // FIXME: Implement this correctly.
+ }
+
+ public int getInt(SynthContext ctx, Object key, int defaultValue)
+ {
+ // FIXME: Implement this correctly.
+ return -1;
+ }
+
+ public boolean getBoolean(SynthContext ctx, Object key, boolean defaultValue)
+ {
+ // FIXME: Implement this correctly.
+ return false;
+ }
+
+ public Icon getIcon(SynthContext ctx, Object key)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+
+ public String getString(SynthContext ctx, Object key, String defaultValue)
+ {
+ // FIXME: Implement this correctly.
+ return null;
+ }
+}
diff --git a/javax/swing/plaf/synth/SynthStyleFactory.java b/javax/swing/plaf/synth/SynthStyleFactory.java
new file mode 100644
index 000000000..569753d8a
--- /dev/null
+++ b/javax/swing/plaf/synth/SynthStyleFactory.java
@@ -0,0 +1,64 @@
+/* SynthStyleFactory.java -- A factory for SynthStyles
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.synth;
+
+import javax.swing.JComponent;
+
+public abstract class SynthStyleFactory
+{
+
+ /**
+ * Creates a new <code>SynthStyleFactory</code>.
+ */
+ public SynthStyleFactory()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * Returns a {@link SynthStyle} for the specified region of the specified
+ * component.
+ *
+ * @param c the component for which to create a style
+ * @param id the region of the component
+ *
+ * @return a style for the specified region of the specified component
+ */
+ public abstract SynthStyle getStyle(JComponent c, Region id);
+}
diff --git a/javax/swing/plaf/synth/package.html b/javax/swing/plaf/synth/package.html
new file mode 100644
index 000000000..b977e468c
--- /dev/null
+++ b/javax/swing/plaf/synth/package.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in javax.swing.plaf.metal package.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - javax.swing.plaf.synth</title></head>
+
+<body>
+<p>Provides a look and feel that can be customized by and XML file or by
+ providing a custom {@link SynthStyleFactory}.
+</p>
+</body>
+</html>