diff options
author | Tom Tromey <tromey@gcc.gnu.org> | 2005-09-23 21:31:04 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-09-23 21:31:04 +0000 |
commit | 1ea63ef8be1cc54dd0de9d82c684713a1dcf1e06 (patch) | |
tree | 3ca4b2e68dc14c3128b9c781d23f1d0b1f2bee49 /libjava/classpath/gnu/javax | |
parent | 9b044d19517541c95681d35a92dbc81e6e21d94f (diff) | |
download | gcc-1ea63ef8be1cc54dd0de9d82c684713a1dcf1e06.zip gcc-1ea63ef8be1cc54dd0de9d82c684713a1dcf1e06.tar.gz gcc-1ea63ef8be1cc54dd0de9d82c684713a1dcf1e06.tar.bz2 |
Imported Classpath 0.18.
* sources.am, Makefile.in: Updated.
* Makefile.am (nat_source_files): Removed natProxy.cc.
* java/lang/reflect/natProxy.cc: Removed.
* gnu/classpath/jdwp/VMFrame.java,
gnu/classpath/jdwp/VMIdManager.java,
gnu/classpath/jdwp/VMVirtualMachine.java,
java/lang/reflect/VMProxy.java: New files.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC
list.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/net/DefaultContentHandlerFactory.java (getContent):
Remove ClasspathToolkit references.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/awt/xlib/XCanvasPeer.java: Add new peer methods.
* gnu/awt/xlib/XFramePeer.java: Likewise.
* gnu/awt/xlib/XGraphicsConfiguration.java: Likewise.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add
classpath/native/jawt/jawt.c.
* Makefile.in: Regenerate.
* jawt.c: Remove file.
* include/Makefile.am (tool_include__HEADERS): Remove jawt.h and
jawt_md.h. Add ../classpath/include/jawt.h and
../classpath/include/jawt_md.h.
* include/Makefile.in: Regenerate.
* include/jawt.h: Regenerate.
* include/jawt_md.h: Regenerate.
From-SVN: r104586
Diffstat (limited to 'libjava/classpath/gnu/javax')
8 files changed, 0 insertions, 910 deletions
diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkBorders.java b/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkBorders.java deleted file mode 100644 index ebba6a4..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkBorders.java +++ /dev/null @@ -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); - } - } -} diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java b/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java deleted file mode 100644 index 0395af6..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkCheckBoxUI.java +++ /dev/null @@ -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(); - } -} - diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkIconFactory.java b/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkIconFactory.java deleted file mode 100644 index 28fd36e..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkIconFactory.java +++ /dev/null @@ -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"); - } - } - } -} diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java b/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java deleted file mode 100644 index ed99e6d..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkLookAndFeel.java +++ /dev/null @@ -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 (cbj@gnu.org), " + - "(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); - } -} diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java b/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java deleted file mode 100644 index 19d5338..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkRadioButtonUI.java +++ /dev/null @@ -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(); - } -} - diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkSliderUI.java b/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkSliderUI.java deleted file mode 100644 index c576b3d..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/GtkSliderUI.java +++ /dev/null @@ -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) -} diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/README b/libjava/classpath/gnu/javax/swing/plaf/gtk/README deleted file mode 100644 index 2b3f001..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/README +++ /dev/null @@ -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) diff --git a/libjava/classpath/gnu/javax/swing/plaf/gtk/SliderTest.java b/libjava/classpath/gnu/javax/swing/plaf/gtk/SliderTest.java deleted file mode 100644 index a838444..0000000 --- a/libjava/classpath/gnu/javax/swing/plaf/gtk/SliderTest.java +++ /dev/null @@ -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(); - } - -} - - - - |