classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: gtk-plaf cleanup


From: Mark Wielaard
Subject: [cp-patches] FYI: gtk-plaf cleanup
Date: Sun, 24 Jul 2005 17:59:00 +0200

Hi,

As discussed on the list and on irc this cleans up the lib/Makefile.am
dist-hook to not remove anything from standard.omit. And removes the
gtk-plaf files which actually did compile, but didn't work. Consensus
was that it was better to start over with a clean gtk-plaf then to reuse
these files (sorry Brian).

2005-07-23  Mark Wielaard  <address@hidden>

       * lib/standard.omit: Don't omit gnu/javax/swing/plaf/gtk files.
       * lib/Makefile.am (dist-hook): Don't remove standard.omit dirs.

       * gnu/javax/swing/plaf/gtk/GtkBorders.java: Removed.
       * gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java: Likewise.
       * gnu/javax/swing/plaf/gtk/GtkIconFactory.java: Likewise.
       * gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java: Likewise.
       * gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java: Likewise.
       * gnu/javax/swing/plaf/gtk/GtkSliderUI.java: Likewise.
       * gnu/javax/swing/plaf/gtk/README: Likewise.
       * gnu/javax/swing/plaf/gtk/SliderTest.java: Likewise.

Committed,

Mark
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.94
diff -u -r1.94 Makefile.am
--- lib/Makefile.am     12 Jul 2005 18:58:00 -0000      1.94
+++ lib/Makefile.am     24 Jul 2005 14:52:03 -0000
@@ -148,5 +148,3 @@
        $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax 
$(top_distdir)/org $(top_distdir)/vm -name class-dependencies.conf -print | 
xargs rm -f
        rm -f $(top_distdir)/gnu/classpath/Configuration.java
        rm -f $(top_distdir)/java/util/LocaleData.java
-# Omit files listed in standard.omit.
-       ( cd $(top_distdir)/lib ; cat $(top_builddir)/lib/standard.omit | sed 
-e 's/\$$//' | sed -e 's/\/\.\*//' | xargs rm -fr )
Index: lib/standard.omit
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/standard.omit,v
retrieving revision 1.41
diff -u -r1.41 standard.omit
--- lib/standard.omit   15 Jul 2005 11:17:45 -0000      1.41
+++ lib/standard.omit   24 Jul 2005 14:52:03 -0000
@@ -1,4 +1,2 @@
 ../gnu/test/.*$
-../gnu/javax/swing/plaf/gtk/.*java$
-../gnu/javax/swing/plaf/gtk/README$
 ../gnu/classpath/jdwp/.*$
Index: gnu/javax/swing/plaf/gtk/GtkBorders.java
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/GtkBorders.java
diff -N gnu/javax/swing/plaf/gtk/GtkBorders.java
--- gnu/javax/swing/plaf/gtk/GtkBorders.java    2 Jul 2005 20:32:15 -0000       
1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,83 +0,0 @@
-/* GtkBorders.java
-   Copyright (c) 1999 by 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 gnu.javax.swing.plaf.gtk;
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-
-/**
- * Optional class, can be used to define nifty borders.
- * 
- * @author Brian Jones
- * @see javax.swing.LookAndFeel
- */
-public class GtkBorders
-{
-    public static class ButtonBorder extends AbstractBorder 
-       implements UIResource
-    {
-       private Border raised;  // use by default
-       private Border lowered;  // use this one when pressed
-
-       // creat the border
-        public ButtonBorder() 
-       {
-           raised = BorderFactory.createRaisedBevelBorder();
-           lowered = BorderFactory.createLoweredBevelBorder();
-       }
-
-       // define the insets (in terms of one of the others)
-       public Insets getBorderInsets(Component c)
-       {
-           return raised.getBorderInsets(c);
-       }
-       
-       public void paintBorder(Component c, Graphics g, int x, int y, 
-                               int width, int height)
-       {
-           AbstractButton b = (AbstractButton)c;
-           ButtonModel model = b.getModel();
-           
-           if (model.isPressed() && model.isArmed()) 
-               lowered.paintBorder(c, g, x, y, width, height);
-           else
-               raised.paintBorder(c, g, x, y, width, height);
-       }
-    }
-}
Index: gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java
diff -N gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java
--- gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java 2 Jul 2005 20:32:15 -0000       
1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,69 +0,0 @@
-/* GtkCheckBoxUI.java
-   Copyright (c) 1999 by 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 gnu.javax.swing.plaf.gtk;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-/**
- *
- * @author Brian Jones
- * @see javax.swing.LookAndFeel
- */
-public class GtkCheckBoxUI extends GtkRadioButtonUI
-{
-    public GtkCheckBoxUI() 
-    {
-       super();
-    }
-
-    public static ComponentUI createUI(JComponent c)
-    {
-       return new GtkCheckBoxUI();
-    }
-
-    public String getPropertyPrefix()
-    {
-       // FIXME
-       System.err.println(super.getPropertyPrefix());
-       return super.getPropertyPrefix();
-    }
-}
-
Index: gnu/javax/swing/plaf/gtk/GtkIconFactory.java
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/GtkIconFactory.java
diff -N gnu/javax/swing/plaf/gtk/GtkIconFactory.java
--- gnu/javax/swing/plaf/gtk/GtkIconFactory.java        2 Jul 2005 20:32:15 
-0000       1.5
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,99 +0,0 @@
-/* GtkIconFactory.java
-   Copyright (c) 1999 by 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 gnu.javax.swing.plaf.gtk;
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import java.io.Serializable;
-
-/**
- *
- * @author Brian Jones
- * @see javax.swing.LookAndFeel
- */
-public class GtkIconFactory implements Serializable
-{
-    private static Icon radioButtonIcon;
-    private static Icon checkBoxIcon;
-
-    public static Icon getRadioButtonIcon() 
-    {
-       if (radioButtonIcon == null)
-           radioButtonIcon = new RadioButtonIcon();
-       return radioButtonIcon;
-    }
-    
-    private static class RadioButtonIcon 
-       implements Icon, UIResource, Serializable
-    {
-       private static final int size = 15;
-       
-       public int getIconWidth() { return size; }
-       public int getIconHeight() { return size; }
-
-       public void paintIcon(Component c, Graphics g, int x, int y) 
-       {
-           System.out.println("radiobuttonicon: paintIcon()");
-           // get the button and model containing the state we are 
-           // supposed to show
-           AbstractButton b = (AbstractButton)c;
-           ButtonModel model = b.getModel();
-
-           // If the button is being pressed (& armed), change the 
-           // background color 
-           // Note: could also do something different if the button is 
-           // disabled
-           
-           if (model.isPressed() && model.isArmed())
-               {
-                   System.out.println("radiobuttonicon: pressed & armed");
-                   g.setColor(UIManager.getColor("RadioButton.pressed"));
-                   g.fillOval(x,y,size-1, size-1);
-               }
-           // draw an outer circle
-           g.setColor(UIManager.getColor("RadioButton.foreground"));
-           g.drawOval(x,y,size-1, size-1);
-           
-           // fill a small circle inside if the button is selected
-           if (model.isSelected()) {
-               g.fillOval(x+4, y+4, size-8, size-8);
-               System.out.println("radiobuttonicon: is selected");
-           }
-       }
-    }
-}
Index: gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java
diff -N gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java
--- gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java        2 Jul 2005 20:32:15 
-0000       1.6
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,241 +0,0 @@
-/* GtkLookAndFeel.java
-   Copyright (c) 1999 by 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 gnu.javax.swing.plaf.gtk;
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-/**
- *
- * @author Brian Jones
- * @see javax.swing.LookAndFeel
- */
-public class GtkLookAndFeel extends BasicLookAndFeel
-{
-    private UIDefaults uiDefaults;
-
-    /**
-     */
-    public GtkLookAndFeel()
-    {
-       super();
-    }
-
-    /**
-     * A short string to identify this look and feel, for example in a 
-     * drop down list to choose between several look and feels.
-     */
-    public String getName() { return "GIMP Toolkit"; }
-
-    /**
-     * A much longer description of the look and feel.
-     */
-    public String getDescription() 
-    { 
-       return new String("The GIMP Toolkit Look and Feel for Java, " + 
-                         "written by Brian Jones (address@hidden), " + 
-                         "(c) 1999 by Free Software Foundation, Inc.  " +
-                         "http://www.classpath.org";);
-    }
-
-    /**
-     * Return a unique string identifying this look and feel as different
-     * from and not a subclass of any other look and feel.  Usually, a 
-     * subclass will return the same <code>String</code> here as the
-     * original look and feel if only a few changes are being made rather 
-     * than something completely new and different.
-     */
-    public String getID()
-    {
-       return "Gtk";
-    }
-
-    public boolean isNativeLookAndFeel()
-    {
-       return false;
-    }
-
-    public boolean isSupportedLookAndFeel()
-    {
-       return true;
-    }
-
-    protected void initClassDefaults(UIDefaults table)
-    {
-       super.initClassDefaults(table);
-
-       String gtkPkgName = "gnu.javax.swing.plaf.gtk.";
-
-       
-       Object[] defaults = { 
-           "SliderUI", gtkPkgName + "GtkSliderUI"
-       };
-       /*
-           "CheckBoxUI", gtkPkgName + "GtkCheckBoxUI",
-           "ButtonUI", gtkPkgName + "GtkButtonUI"
-               "ColorChooserUI", "MetalColorChooserUI",
-               "MenuBarUI", "MetalMenuBarUI",
-               "MenuUI", "MetalMenuUI", 
-               "MenuItemUI", "MetalMenuItemUI", 
-               "CheckBoxMenuItemUI", "MetalCheckBoxMenuItemUI", 
-               "RadioButtonMenuItemUI", "MetalRadioButtonMenuItemUI", 
-               "RadioButtonUI", "MetalRadioButtonUI", 
-               "ToggleButtonUI", "MetalToggleButtonUI",
-               "PopupMenuUI", "MetalPopupMenuUI",
-               "ProgressBarUI", "MetalProgressBarUI",
-               "ScrollBarUI", "MetalScrollBarUI",
-               "ScrollPaneUI", "MetalScrollPaneUI",
-               "SplitPaneUI", "MetalSplitPaneUI",
-               "SeparatorUI", "MetalSeparatorUI",
-               "ToolBarSeparatorUI", "MetalToolBarSeparatorUI",
-               "PopupMenuSeparatorUI", "MetalPopupMenuSeparatorUI", 
-               "TabbedPaneUI", "MetalTabbedPaneUI",
-               "TextAreaUI", "MetalTextAreaUI",
-               "TextFieldUI", "MetalTextFieldUI",
-               "PasswordFieldUI", "MetalPasswordFieldUI",
-               "TextPaneUI", "MetalTextPaneUI",
-               "EditorPaneUI", "MetalEditorPaneUI",
-               "TreeUI", "MetalTreeUI",
-               "LabelUI", "MetalLabelUI",
-               "ListUI", "MetalListUI",
-               "ToolBarUI", "MetalToolBarUI",
-               "ToolTipUI", "MetalToolTipUI",
-               "ComboBoxUI", "MetalComboBoxUI",
-               "TableUI", "MetalTableUI",
-               "TableHeaderUI", "MetalTableHeaderUI",
-               "InternalFrameUI", "GtkInternalFrameUI",
-               "StandardDialogUI", "GtkStandardDialogUI",
-               "DesktopPaneUI", "GtkDesktopPaneUI",
-               "DesktopIconUI", "GtkDesktopIconUI",
-               "DirectoryPaneUI", "GtkDirectoryPaneUI",
-               "FileChooserUI", "GtkFileChooserUI",
-               "OptionPaneUI", "GtkOptionPaneUI" }
-       */
-       table.putDefaults(defaults);
-
-    }
-
-    protected void initSystemColorDefaults(UIDefaults table)
-    {
-       String[] colors = {
-           "desktop", "#000000",
-           "activeCaption", "#163555",
-           "activeCaptionText", "#FFFFFF",
-           "activeCaptionBorder", "#000000",
-           "inactiveCaption", "#375676",
-           "inactiveCaptionText", "#999999",
-           "inactiveCaptionBorder", "#000000",
-           "window", "#FFFFFF",
-           "windowBorder", "#969696",
-           "windowText", "#000000",
-           "menu", "#d6d6d6",
-           "menuText", "#000000",
-           "text", "#FFFFFF",
-           "textText", "#000000",
-           "textHighlight", "#00009c",
-           "textHighlightText", "#FFFFFF",
-           "textInactiveText", "#999999",
-           "control", "#d6d6d6",
-           "controlText", "#000000",
-           "controlHighlight", "#eaeaea",
-           "controlLtHighlight", "#eaeaea",
-           "controlShadow", "#c3c3c3",
-           "controlDkShadow", "#888888",
-           "scrollbar", "#c3c3c3",
-           "info", "#d6d6d6",
-           "infoText", "#000000"
-       };
-
-       loadSystemColors(table, colors, false);
-    }
-
-    protected void initComponentDefaults(UIDefaults table)
-    {
-       super.initComponentDefaults(table);
-
-       // define common resources
-       // fonts
-       FontUIResource sansSerifPlain10 = 
-           new FontUIResource("SansSerif", Font.PLAIN, 10);
-       FontUIResource serifPlain10 = 
-           new FontUIResource("Serif", Font.PLAIN, 10);
-       // insets
-       // borders
-       // colors
-       ColorUIResource controlDkShadow = new 
ColorUIResource(table.getColor("controlDkShadow"));
-       ColorUIResource controlShadow = new 
ColorUIResource(table.getColor("controlShadow"));
-       ColorUIResource control = new 
ColorUIResource(table.getColor("control"));
-       ColorUIResource scrollbar = new 
ColorUIResource(table.getColor("scrollbar"));
-       ColorUIResource controlHighlight = new 
ColorUIResource(table.getColor("controlHighlight"));
-       if (scrollbar == null)
-           System.out.println("scrollbar is null");
-
-       ColorUIResource white = new ColorUIResource(Color.white);
-       ColorUIResource black = new ColorUIResource(Color.black);
-       ColorUIResource blue = new ColorUIResource(Color.blue);
-
-       // icons
-       Object errorIcon = LookAndFeel.makeIcon(getClass(), "icons/error.gif");
-       // any other resources like dimensions and integer values
-
-       // define defaults
-       Object[] defaults = 
-       { 
-           "Button.font", sansSerifPlain10,
-           "CheckBox.font", sansSerifPlain10,
-           "RadioButton.pressed", black,
-           "Slider.focus", blue,
-           "Slider.foreground", control,
-           "Slider.highlight", controlHighlight,
-           "Slider.shadow", controlShadow,
-           "Slider.background", controlDkShadow
-          
-//         "Slider.background", "#888888",
-//         "Slider.focus", "#c3c3c3",
-//         "Slider.foreground", "#d6d6d6",
-//         "Slider.highlight", "#ffffff",
-//         "Slider.shadow", "#000000"
-
-
-       };
-
-       table.putDefaults(defaults);
-    }
-}
Index: gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java
diff -N gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java
--- gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java      2 Jul 2005 20:32:15 
-0000       1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,69 +0,0 @@
-/* GtkRadioButtonUI.java
-   Copyright (c) 1999 by 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 gnu.javax.swing.plaf.gtk;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-/**
- *
- * @author Brian Jones
- * @see javax.swing.LookAndFeel
- */
-public class GtkRadioButtonUI extends BasicRadioButtonUI
-{
-    public GtkRadioButtonUI() 
-    {
-       super();
-    }
-
-    public static ComponentUI createUI(JComponent c)
-    {
-       return new GtkRadioButtonUI();
-    }
-
-    public String getPropertyPrefix()
-    {
-       // FIXME
-       System.err.println(super.getPropertyPrefix());
-       return super.getPropertyPrefix();
-    }
-}
-
Index: gnu/javax/swing/plaf/gtk/GtkSliderUI.java
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/GtkSliderUI.java
diff -N gnu/javax/swing/plaf/gtk/GtkSliderUI.java
--- gnu/javax/swing/plaf/gtk/GtkSliderUI.java   2 Jul 2005 20:32:15 -0000       
1.7
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,230 +0,0 @@
-/* GtkSliderUI.java
-   Copyright (c) 1999 by 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 gnu.javax.swing.plaf.gtk;
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-/**
- * Gtk-like slider
- *
- * @author Brian Jones
- * @see javax.swing.LookAndFeel
- */
-public class GtkSliderUI extends BasicSliderUI
-{
-    private static Color thumbFgColor;
-    private static Color thumbBgColor;
-    private static Color thumbHighlight;
-    private static Color thumbFocus;
-
-    private static Color bgColor;
-    private static Color fgColor;
-    private static Color focusColor;
-    private static Color highlight;
-    private static Color shadow;
-
-    private static final Dimension PREF_HORIZ = new Dimension(250, 15);
-    private static final Dimension PREF_VERT = new Dimension(15, 250);
-    private static final Dimension MIN_HORIZ = new Dimension(25, 15);
-    private static final Dimension MIN_VERT = new Dimension(15, 25);
-
-    public GtkSliderUI() 
-    {
-       super(null);
-       bgColor = UIManager.getColor("Slider.background");
-       fgColor = UIManager.getColor("Slider.foreground");
-       focusColor = UIManager.getColor("Slider.focus");
-       highlight = UIManager.getColor("Slider.highlight");
-       shadow = UIManager.getColor("Slider.shadow");
-
-       System.out.println("bgColor: " + bgColor);
-       System.out.println("fgColor: " + fgColor);
-       System.out.println("focusColor: " + focusColor);
-       System.out.println("highlight: " + highlight);
-       System.out.println("shadow: " + shadow);
-    }
-
-    public static ComponentUI createUI(JComponent c)
-    {
-       return new GtkSliderUI();
-    }
-
-    // methods not overridden here, using Basic defaults
-    // installUI()
-    // uninstall()
-
-    public Dimension getPreferredHorizontalSize()
-    {
-       /*
-       Dimension thumbSize = getThumbSize();
-       Dimenstion labelSize = getLabelSize();
-       // getTickLength()
-       int width = thumbSize.width + 
-       getWidthOfWidestLabel
-       */
-       return PREF_HORIZ;
-    }
-
-    public Dimension getPreferredVerticalSize()
-    {
-       return PREF_VERT;
-    }
-
-    public Dimension getMinimumHorizontalSize()
-    {
-       return MIN_HORIZ;
-    }
-
-    public Dimension getMinimumVerticalSize()
-    {
-       return MIN_VERT;
-    }
-
-    /** 
-     * Returns thumb size based on slider orientation
-     */
-    protected Dimension getThumbSize()
-    {
-       Dimension size = new Dimension();
-
-       if (slider.getOrientation() == JSlider.VERTICAL) {
-           size.width = 15;
-           size.height = 33;
-       }
-       else {
-           size.width = 33;
-           size.height = 15;
-       }
-       return size;
-    }
-
-    /**
-     * Reserved width or height for ticks, as appropriate to the slider
-     * orientation.
-     */
-    protected int getTickLength()
-    {
-       return 10;
-    }
-
-    public void paintFocus(Graphics g)
-    {
-       super.paintFocus(g);
-       System.err.println("focus " + focusRect);
-    }
-
-    /**
-     * Must account for Unicode when drawing text.
-     */
-    public void paintLabels(Graphics g)
-    {
-       super.paintLabels(g);
-       System.err.println("label " + labelRect);
-    }
-
-    /**
-     * A drawRect() generated slider has ghosting when moving left on 
-     * a horizontal slider and the bottom is not painted when moving 
-     * right.
-     */
-    public void paintThumb(Graphics g)
-    {
-       int x = thumbRect.x;
-       int y = thumbRect.y;
-       int h = thumbRect.height;
-       int w = thumbRect.width;
-
-//         "Slider.background", "#888888",
-//         "Slider.focus", "#c3c3c3",
-//         "Slider.foreground", "#d6d6d6",
-//         "Slider.highlight", "#ffffff",
-//         "Slider.shadow", "#000000"
-
-       g.setColor(fgColor);
-       g.fillRect(x,y,w,h);
-       g.setColor(bgColor);
-       
-       if (slider.getOrientation() == JSlider.HORIZONTAL) {
-           g.drawRect(x, y, w, h);
-           g.setColor(highlight);
-           g.drawLine(x+1, y+h-1, x+w, y+h-1);
-           g.setColor(focusColor);
-           g.drawLine(x+2, y+h-2, x+w, y+h-2);
-           g.setColor(Color.black);
-           g.drawLine(x+1, y+h-2, x+1, y+h-2);
-           g.drawRect(x+1, y+1, w-1, 12);          
-       }       
-       else 
-           g.drawRect(x, y, w, h);
-
-       System.err.println("thumb " + thumbRect);
-    }
-
-    // public void paintTicks(Graphics g)
-    
-    public void paintTrack(Graphics g)
-    {
-//     super.paintTrack(g);
-       int x = trackRect.x;
-       int y = trackRect.y;
-       int h = trackRect.height;
-       int w = trackRect.width;
-
-       System.err.println("track " + trackRect);
-
-       g.setColor(Color.black);
-       g.fillRect(x,y,w,h);
-
-//     if (slider.getOrientation() == JSlider.HORIZONTAL)
-//         g.drawLine(x, y+h-1, x+w-1, y+h-1);
-//     else
-//         g.drawLine(x+w-1, y, x+w-1, y+h-1);
-
-//     System.err.println("track " + trackRect);
-//     System.err.println("content " + contentRect);
-    }
-
-    // the four methods below allow you to control tick painting without 
-    // worrying about what paintTicks does, look for in other UI delegates
-    // protected void paintMajorTickForHorizSlider(Graphics g, Rectangle 
tickBounds, int x)
-    // protected void paintMajorTickForVertSlider(Graphics g, Rectangle 
tickBounds, int y)
-    // protected void paintMinorTickForHorizSlider(Graphics g, Rectangle 
tickBounds, int x)
-    // protected void paintMinorTickForVertSlider(Graphics g, Rectangle 
tickBounds, int y)
-}
Index: gnu/javax/swing/plaf/gtk/README
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/README
diff -N gnu/javax/swing/plaf/gtk/README
--- gnu/javax/swing/plaf/gtk/README     15 Mar 1999 05:08:38 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,37 +0,0 @@
-This is a start at a GTK look and feel for Java.
-It is usable already, but it mainly just defaults back to Basic Look and
-Feel for everything.
-
-Sliders are currently broken.  I haven't figured out why yet.
-
-A bunch of system colors defined in GtkLookandFeel though I have a feeling 
-I'll be defining more ColorUIResources shortly.
-
-Based on Gnome File Manager colors... or my Window Manager setup
-
-desktop                        #000000 (gtk)
-activeCaption          #163555 (window manager)        
-activeCaptionText      #FFFFFF (window manager)
-activeCaptionBorder    #000000 (unsure of this)
-inactiveCaption                #375676 (window manager)
-inactiveCaptionText    #999999 (window manager)
-inactiveCaptionBorder  #000000 (unsure of this)
-window                 #FFFFFF (gtk)
-windowBorder           #969696 (gtk)
-windowText             #000000 (gtk)
-menu                   #d6d6d6 (gtk)
-menuText               #000000 (gtk)
-text                   #FFFFFF (gtk)
-textText               #000000 (gtk)
-textHighlight          #00009c (gtk)
-textHighlightText      #FFFFFF (gtk)
-textInactiveText       #999999 (unsure of this)
-control                        #d6d6d6 (gtk)
-controlText            #000000 (gtk)
-controlHighlight       #eaeaea (gtk)
-controlLtHighlight     #eaeaea (unsure of this)
-controlShadow          #c3c3c3 (gtk)
-controlDkShadow                #888888 (unsure of this)
-scrollbar              #c3c3c3 (gtk)
-info                   #d6d6d6 (gtk)
-infoText               #000000 (gtk)
Index: gnu/javax/swing/plaf/gtk/SliderTest.java
===================================================================
RCS file: gnu/javax/swing/plaf/gtk/SliderTest.java
diff -N gnu/javax/swing/plaf/gtk/SliderTest.java
--- gnu/javax/swing/plaf/gtk/SliderTest.java    3 Aug 1999 04:15:13 -0000       
1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,82 +0,0 @@
-import javax.swing.*;
-import javax.swing.event.*;
-import java.awt.*;
-import java.awt.event.*;
-import gnu.javax.swing.plaf.gtk.*;
-
-public class SliderTest extends JFrame
-{
-    public SliderTest() 
-    { 
-       super("JSlider Test");
-       Container c = getContentPane();
-       c.setLayout(new BorderLayout());
-       this.addWindowListener(new WindowAdapter() {
-           public void windowClosing(WindowEvent e) { System.exit(0); } 
-       });
-
-       JSlider s = new JSlider();
-       s.createStandardLabels(10);
-       s.setMinorTickSpacing(10);
-       s.setMajorTickSpacing(20);
-       s.setPaintTicks(true);
-       s.setPaintTrack(true);
-       s.setPaintLabels(true);
-       s.setRequestFocusEnabled(true);
-
-       // turning off double buffering in repaint manager 
-       // in order to use debug graphics
-       RepaintManager repaintManager = RepaintManager.currentManager(s);
-       repaintManager.setDoubleBufferingEnabled(false); 
-
-       s.setDebugGraphicsOptions(DebugGraphics.BUFFERED_OPTION | 
DebugGraphics.FLASH_OPTION);
-       DebugGraphics.setFlashColor(Color.red);  // color of flash
-       DebugGraphics.setFlashTime(4);  // time delay of drawing operation 
flashing
-       DebugGraphics.setFlashCount(3); // number of time to draw
-
-       this.setSize(250, 100);
-       c.add(new JLabel("Default Slider"), "North");
-       c.add(s, "Center");
-
-       try {
-           UIManager.setLookAndFeel("gnu.javax.swing.plaf.gtk.GtkLookAndFeel");
-           SwingUtilities.updateComponentTreeUI(this);
-       } catch (Exception e) {
-           e.printStackTrace();
-           System.exit(0);
-       }
-
-       center();
-    }
-
-    public void actionPerformed(ActionEvent e) { 
-       System.exit(0);
-    }
-    
-    public void center()
-    {
-       // Centering the frame 
-       Toolkit t = this.getToolkit();
-       Dimension framesize = this.getSize();
-       Dimension screensize = t.getScreenSize();
-       
-       // Calculate point for frame (main)
-       Point pframe = new Point();
-       pframe.x = (screensize.width - framesize.width) / 2;
-       pframe.y = (screensize.height - framesize.height) / 2;
-       
-       // Set the location of each to be centered
-       this.setLocation(pframe);
-    }
-
-    public static void main(String [] argv)
-    {
-       SliderTest t = new SliderTest();
-       t.show();
-    }
-
-}
-
-
-
-

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]