Commit 31e632d3 by Graydon Hoare

[multiple changes]

2004-04-09  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* gnu/java/awt/peer/gtk/GtkPanelPeer.java (connectSignals):
	Remove method.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c: Remove
	unused code.

2004-04-02  Olga Rodimina  <rodimina@redhat.com>

	* Makefile.am: Added new file.
	* Makefile.in: Regenerate.
	* javax/swing/ImageIcon.java:
	(ImageIcon(file)): set description of the icon
	to the file name
	* javax/swing/JCheckBoxMenuItem.java:
	Mostly Implemented. Work in progress.
	* javax/swing/JRadioButtonMenuItem.java:
 	Reimplement constructors to use JToggleButtonModel.
	* javax/swing/plaf/basic/BasicIconFactory.java:
	(getCheckBoxMenuItemIcon): return check box
	icon.
	* javax/swing/plaf/basic/BasicMenuItemUI.java:
	paint menu item selected only when it is armed and
	pressed.

2004-04-02  David Jee  <djee@redhat.com>

	* gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
	(GtkMenuItemPeer): Only connect signals if this isn't a Menu peer.
	* java/awt/Component.java
	(add): Set the parent of the popup as this component.
	* java/awt/PopupMenu.java
	(addNotify): Create popup menu when peer is null.
	(show): Call addNotify() if peer is null.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
	(Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_show): Set the button
	argument for gtk_menu_popup() as zero. This causes the popup menu to
	respond to any mouse button.

2004-03-31  Olga Rodimina  <rodimina@redhat.com>

	* Makefile.am: Added new file.
	* Makefile.in: Regenerate.
	* javax/swing/JRadioButtonMenuItem.java:
	Implemented.
	* javax/swing/plaf/basic/BasicIconFactory.java:
	(getRadioButtonMenuItemIcon): Return
	radio button icon.
	* javax/swing/plaf/basic/BasicMenuItemUI.java:
	(getPreferredSize): Add size of checkIcon if it
	exists.
	(installDefaults): Don't initialize checkIcon.
	It's value will be set in subclasses.
	(uninstallDefaults): remove uninstallation of
	checkIcon.
	(paint): Moved code to paintMenuItem().
	(paintMenuItem): Implemented.
	* javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java:
	UI delegate for JRadioButtonMenuItem.

2004-03-29  Olga Rodimina  <rodimina@redhat.com>

	* javax/swing/plaf/basic/BasicMenuItemUI.java:
	Corrected position of the accelerator.

2004-03-29  Olga Rodimina  <rodimina@redhat.com>

	* Makefile.am: Added new file.
	* Makefile.in: Regenerate.
	* javax/swing/JMenuItem.java: Partly
	implemented. Work in progress
	* javax/swing/plaf/basic/BasicLookAndFeel.java:
	Changed default value of acceleratorDelimiter.
	* javax/swing/plaf/basic/BasicMenuItemUI.java:
	New class. Partly implemented.

2004-03-26  Mark Wielaard  <mark@klomp.org>

	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
	(item_activate): Declare label before use.
	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
	(gtkSetFont): Removed unused variable label.
	(addExposeFilter): Declare variables before use.
	(removeExposeFilter): Likewise.
	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
	(ok_clicked): Declare str_fileName before use.

2004-03-26  David Jee  <djee@redhat.com>

	* gnu/java/awt/peer/gtk/GtkMenuPeer.java
	(addSeparator): Remove.
	* java/awt/Menu.java
	(separator): Remove static final MenuItem field.
	(separatorLabel): New static final String field.
	(addSeparator): Do not use peer method; use add(MenuItem) instead.
	Use separatorLabel to denote that it is a separator.
	(insertSeparator): Create a new MenuItem with separatorLabel, instead
	of reusing the static separator instance, because a MenuItem instance
	can't be added more than once without being cloned.
	* java/awt/peer/MenuPeer.java
	(addSeparator): Remove from interface.

2004-03-26  David Jee  <djee@redhat.com>

	* gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
	(connectSignals): New native method declaration.
	(GtkMenuItemPeer): Connect signals if the parent is a Menu.
	* java/awt/MenuItem.java
	(getActionCommand): Return the label if the action command is not set.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
	(Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_addMenu): Use
	gtk_menu_shell_append().
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
	(item_activate): Fix argument type.
	(Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Do not connect
	signal here.
	(Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_connectSignals): New
	method.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
	(Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Check if a label is
	given. Add the menu widget's top-level GtkWindow to the global window
	group, so it can grab the pointer.
	(Java_gnu_java_awt_peer_gtk_GtkMenuPeer_addItem): Use
	gtk_menu_shell_append().

2004-03-23  Graydon Hoare  <graydon@redhat.com>

	* java/text/AttributedString.java
	(addAttribute): Fix off-by-one.
	(getIterator): Likewise.
	* java/text/AttributedStringIterator.java
	(getRunLimit): Correct logic.
	(getRunStart): Likewise.
	(getAttribute): Fix inequality.
	(getAttributes): Likewise.
	* testsuite/libjava.mauve/xfails: Remove AttributedString xfail.

2004-03-23  Kim Ho  <kho@redhat.com>

	* javax/swing/plaf/basic/BasicTabbedPaneUI.java:
	(calculateSizes): Return real width and height.

2004-03-23  Kim Ho  <kho@redhat.com>

	* javax/swing/plaf/basic/BasicTabbedPaneUI.java
	(calculateTabRects): Set the selectedRun before
	trying to rotate tabs.

2004-03-23  Kim Ho  <kho@redhat.com>

	* Makefile.am: New file
	* Makefile.in: Regenerate
	* java/awt/Graphics.java: (drawRect):
	Draw to the correct point.
	* javax/swing/DefaultSingleSelectionModel.java
	(isSelected): Return true if the selected index
	is not -1.
	* javax/swing/JLabel.java: Do not change mnemonic
	index if text is null.
	* javax/swing/JProgressBar.java: Use JComponent's
	EventListenerList.
	* javax/swing/JScrollBar.java: Ditto.
	* javax/swing/JSlider.java: Ditto.
	* javax/swing/JTabbedPane.java: Reimplement.
	* javax/swing/plaf/basic/BasicLookAndFeel.java:
	Add defaults for TabbedPane.
	* javax/swing/plaf/basic/BasicArrowButton.java:
	Implement
	* javax/swing/plaf/basic/BasicProgressBarUI.java:
	(paintDeterminate): Don't paint String if it's
	empty.
	(paintIndeterminate): ditto.
	* javax/swing/plaf/basic/BasicTabbedPaneUI.java:
	Reimplement.

2004-03-19  Michael Koch  <konqueror@gmx.de>

	* java/awt/image/AffineTransformOp.java
	(AffineTransformOp): Made public.
	* javax/swing/JComponent.java
	(listenerList): Made protected.
	(accessibleContext): Likewise.
	* javax/swing/JList.java
	(valueChanged): Dont use internal fields of ListSelectionEvent.
	* javax/swing/JViewport.java
	(getView): Dont use internal fields of Component.
	(addImpl): Likewise.
	* javax/swing/Timer.java
	(isRunning): Made public.
	(start): Likewise.
	(stop): Likewise.
	* javax/swing/UIDefaults.java
	(getInt): Made public.
	* javax/swing/plaf/basic/BasicListUI.java
	(mousePressed): Dont use internal fields of MouseEvent.
	(propertyChanged): Dont use internal fields of PropertyChangeEvent.
	* javax/swing/plaf/basic/BasicScrollBarUI.java
	(arrowIcon): Made static.
	* javax/swing/plaf/basic/BasicViewportUI.java
	(stateChanged): Dont use internal field on ChangeEvent.
	* javax/swing/text/JTextComponent.java
	(getUI): Call UIManager.getUI().
	(updateUI): Use getUI().

2004-03-19  Graydon Hoare  <graydon@redhat.com>

	* javax/swing/JComponent.java: Turn off double buffer by default.
	* javax/swing/plaf/basic/BasicViewportUI.java: Clear rects before painting.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
	(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable):
	Use cairo to copy areas.
	(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClip):
	Initialize and set clip region.

2004-03-15  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* java/applet/Applet.java (preferredSize): Override deprecated
	variant of getPreferredSize.
	(minimumSize): Override deprecated variant of getMinimumSize.

2004-03-15  Olga Rodimina  <rodimina@redhat.com>

	* gnu/java/awt/peer/gtk/GdkGraphics2D.java
	(drawImage(img,xform,bgcolor,obs)): New Method.
	Helper function that every drawImage method will
	use.
	(drawRaster): Added new parameter, bgcolor. All
	transparent pixels are changed to bgcolor before
	image is drawn.
	(drawRenderedImage): Fixed to use changed drawRaster().
	(drawImage(image,xform,obs): Fixed to use new helper function
	(drawImage(image,op,x,y)): Ditto.
	(drawImage (img,x,y,observer)): Ditto.
	((PainterThread) bgcolor): New Field.
	((PainterThread) (setPixels)): Changed all transparent pixels
	to bgcolor.
	(drawImage(img,x,y,width,height,bgcolor,observer)):
	Fixed FIXME - all the transparent pixels are
	changed to the specified bgcolor.
	(drawImage(img, x, y, width, height, observer): Changed to
	use function above.
	(drawImage (img,dx1,dy1,dx2,dy2,sx1,sy1,sx2,sy2,bgcolor,observer)):
	Fixed FIXME- changed all transparent pixels to bgcolor.
	(drawImage (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer)):
	Changed to use function above.

2004-03-14  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* java/applet/Applet.java (dimensions): New field.
	(getDimensions): New method.
	(getPreferredSize): Call getDimensions.
	(getMinimumSize): Likewise.

2004-03-13  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* jni/classpath/jcl.c: Include stdlib.h, not malloc.h.
	* jni/classpath/jnilink.c: Likewise.

	* java/applet/Applet.java (getPreferredSize): New method.
	(getMinimumSize): New method.

From-SVN: r80762
parent 2d49ce67
2004-04-09 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkPanelPeer.java (connectSignals):
Remove method.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c: Remove
unused code.
2004-04-02 Olga Rodimina <rodimina@redhat.com>
* Makefile.am: Added new file.
* Makefile.in: Regenerate.
* javax/swing/ImageIcon.java:
(ImageIcon(file)): set description of the icon
to the file name
* javax/swing/JCheckBoxMenuItem.java:
Mostly Implemented. Work in progress.
* javax/swing/JRadioButtonMenuItem.java:
Reimplement constructors to use JToggleButtonModel.
* javax/swing/plaf/basic/BasicIconFactory.java:
(getCheckBoxMenuItemIcon): return check box
icon.
* javax/swing/plaf/basic/BasicMenuItemUI.java:
paint menu item selected only when it is armed and
pressed.
2004-04-02 David Jee <djee@redhat.com>
* gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
(GtkMenuItemPeer): Only connect signals if this isn't a Menu peer.
* java/awt/Component.java
(add): Set the parent of the popup as this component.
* java/awt/PopupMenu.java
(addNotify): Create popup menu when peer is null.
(show): Call addNotify() if peer is null.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
(Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_show): Set the button
argument for gtk_menu_popup() as zero. This causes the popup menu to
respond to any mouse button.
2004-03-31 Olga Rodimina <rodimina@redhat.com>
* Makefile.am: Added new file.
* Makefile.in: Regenerate.
* javax/swing/JRadioButtonMenuItem.java:
Implemented.
* javax/swing/plaf/basic/BasicIconFactory.java:
(getRadioButtonMenuItemIcon): Return
radio button icon.
* javax/swing/plaf/basic/BasicMenuItemUI.java:
(getPreferredSize): Add size of checkIcon if it
exists.
(installDefaults): Don't initialize checkIcon.
It's value will be set in subclasses.
(uninstallDefaults): remove uninstallation of
checkIcon.
(paint): Moved code to paintMenuItem().
(paintMenuItem): Implemented.
* javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java:
UI delegate for JRadioButtonMenuItem.
2004-03-29 Olga Rodimina <rodimina@redhat.com>
* javax/swing/plaf/basic/BasicMenuItemUI.java:
Corrected position of the accelerator.
2004-03-29 Olga Rodimina <rodimina@redhat.com>
* Makefile.am: Added new file.
* Makefile.in: Regenerate.
* javax/swing/JMenuItem.java: Partly
implemented. Work in progress
* javax/swing/plaf/basic/BasicLookAndFeel.java:
Changed default value of acceleratorDelimiter.
* javax/swing/plaf/basic/BasicMenuItemUI.java:
New class. Partly implemented.
2004-03-26 Mark Wielaard <mark@klomp.org>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
(item_activate): Declare label before use.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
(gtkSetFont): Removed unused variable label.
(addExposeFilter): Declare variables before use.
(removeExposeFilter): Likewise.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
(ok_clicked): Declare str_fileName before use.
2004-03-26 David Jee <djee@redhat.com>
* gnu/java/awt/peer/gtk/GtkMenuPeer.java
(addSeparator): Remove.
* java/awt/Menu.java
(separator): Remove static final MenuItem field.
(separatorLabel): New static final String field.
(addSeparator): Do not use peer method; use add(MenuItem) instead.
Use separatorLabel to denote that it is a separator.
(insertSeparator): Create a new MenuItem with separatorLabel, instead
of reusing the static separator instance, because a MenuItem instance
can't be added more than once without being cloned.
* java/awt/peer/MenuPeer.java
(addSeparator): Remove from interface.
2004-03-26 David Jee <djee@redhat.com>
* gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
(connectSignals): New native method declaration.
(GtkMenuItemPeer): Connect signals if the parent is a Menu.
* java/awt/MenuItem.java
(getActionCommand): Return the label if the action command is not set.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
(Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_addMenu): Use
gtk_menu_shell_append().
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
(item_activate): Fix argument type.
(Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Do not connect
signal here.
(Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_connectSignals): New
method.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
(Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Check if a label is
given. Add the menu widget's top-level GtkWindow to the global window
group, so it can grab the pointer.
(Java_gnu_java_awt_peer_gtk_GtkMenuPeer_addItem): Use
gtk_menu_shell_append().
2004-03-23 Graydon Hoare <graydon@redhat.com>
* java/text/AttributedString.java
(addAttribute): Fix off-by-one.
(getIterator): Likewise.
* java/text/AttributedStringIterator.java
(getRunLimit): Correct logic.
(getRunStart): Likewise.
(getAttribute): Fix inequality.
(getAttributes): Likewise.
* testsuite/libjava.mauve/xfails: Remove AttributedString xfail.
2004-03-23 Kim Ho <kho@redhat.com>
* javax/swing/plaf/basic/BasicTabbedPaneUI.java:
(calculateSizes): Return real width and height.
2004-03-23 Kim Ho <kho@redhat.com>
* javax/swing/plaf/basic/BasicTabbedPaneUI.java
(calculateTabRects): Set the selectedRun before
trying to rotate tabs.
2004-03-23 Kim Ho <kho@redhat.com>
* Makefile.am: New file
* Makefile.in: Regenerate
* java/awt/Graphics.java: (drawRect):
Draw to the correct point.
* javax/swing/DefaultSingleSelectionModel.java
(isSelected): Return true if the selected index
is not -1.
* javax/swing/JLabel.java: Do not change mnemonic
index if text is null.
* javax/swing/JProgressBar.java: Use JComponent's
EventListenerList.
* javax/swing/JScrollBar.java: Ditto.
* javax/swing/JSlider.java: Ditto.
* javax/swing/JTabbedPane.java: Reimplement.
* javax/swing/plaf/basic/BasicLookAndFeel.java:
Add defaults for TabbedPane.
* javax/swing/plaf/basic/BasicArrowButton.java:
Implement
* javax/swing/plaf/basic/BasicProgressBarUI.java:
(paintDeterminate): Don't paint String if it's
empty.
(paintIndeterminate): ditto.
* javax/swing/plaf/basic/BasicTabbedPaneUI.java:
Reimplement.
2004-03-19 Michael Koch <konqueror@gmx.de>
* java/awt/image/AffineTransformOp.java
(AffineTransformOp): Made public.
* javax/swing/JComponent.java
(listenerList): Made protected.
(accessibleContext): Likewise.
* javax/swing/JList.java
(valueChanged): Dont use internal fields of ListSelectionEvent.
* javax/swing/JViewport.java
(getView): Dont use internal fields of Component.
(addImpl): Likewise.
* javax/swing/Timer.java
(isRunning): Made public.
(start): Likewise.
(stop): Likewise.
* javax/swing/UIDefaults.java
(getInt): Made public.
* javax/swing/plaf/basic/BasicListUI.java
(mousePressed): Dont use internal fields of MouseEvent.
(propertyChanged): Dont use internal fields of PropertyChangeEvent.
* javax/swing/plaf/basic/BasicScrollBarUI.java
(arrowIcon): Made static.
* javax/swing/plaf/basic/BasicViewportUI.java
(stateChanged): Dont use internal field on ChangeEvent.
* javax/swing/text/JTextComponent.java
(getUI): Call UIManager.getUI().
(updateUI): Use getUI().
2004-03-19 Graydon Hoare <graydon@redhat.com>
* javax/swing/JComponent.java: Turn off double buffer by default.
* javax/swing/plaf/basic/BasicViewportUI.java: Clear rects before painting.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable):
Use cairo to copy areas.
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClip):
Initialize and set clip region.
2004-03-15 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/applet/Applet.java (preferredSize): Override deprecated
variant of getPreferredSize.
(minimumSize): Override deprecated variant of getMinimumSize.
2004-03-15 Olga Rodimina <rodimina@redhat.com>
* gnu/java/awt/peer/gtk/GdkGraphics2D.java
(drawImage(img,xform,bgcolor,obs)): New Method.
Helper function that every drawImage method will
use.
(drawRaster): Added new parameter, bgcolor. All
transparent pixels are changed to bgcolor before
image is drawn.
(drawRenderedImage): Fixed to use changed drawRaster().
(drawImage(image,xform,obs): Fixed to use new helper function
(drawImage(image,op,x,y)): Ditto.
(drawImage (img,x,y,observer)): Ditto.
((PainterThread) bgcolor): New Field.
((PainterThread) (setPixels)): Changed all transparent pixels
to bgcolor.
(drawImage(img,x,y,width,height,bgcolor,observer)):
Fixed FIXME - all the transparent pixels are
changed to the specified bgcolor.
(drawImage(img, x, y, width, height, observer): Changed to
use function above.
(drawImage (img,dx1,dy1,dx2,dy2,sx1,sy1,sx2,sy2,bgcolor,observer)):
Fixed FIXME- changed all transparent pixels to bgcolor.
(drawImage (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer)):
Changed to use function above.
2004-03-14 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/applet/Applet.java (dimensions): New field.
(getDimensions): New method.
(getPreferredSize): Call getDimensions.
(getMinimumSize): Likewise.
2004-03-13 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/classpath/jcl.c: Include stdlib.h, not malloc.h.
* jni/classpath/jnilink.c: Likewise.
* java/applet/Applet.java (getPreferredSize): New method.
(getMinimumSize): New method.
2004-04-15 Bryce McKinlay <mckinlay@redhat.com>
* prims.cc (_Jv_AllocObject): Remove `size' argument.
......
......@@ -1326,17 +1326,21 @@ javax/swing/border/TitledBorder.java \
javax/swing/GrayFilter.java \
javax/swing/AbstractAction.java \
javax/swing/AbstractButton.java \
javax/swing/plaf/basic/BasicArrowButton.java \
javax/swing/plaf/basic/BasicButtonListener.java \
javax/swing/plaf/basic/BasicButtonUI.java \
javax/swing/plaf/basic/BasicCheckBoxUI.java \
javax/swing/plaf/basic/BasicGraphicsUtils.java \
javax/swing/plaf/basic/BasicLabelUI.java \
javax/swing/plaf/basic/BasicListUI.java \
javax/swing/plaf/basic/BasicMenuItemUI.java \
javax/swing/plaf/basic/BasicOptionPaneUI.java \
javax/swing/plaf/basic/BasicPanelUI.java \
javax/swing/plaf/basic/BasicProgressBarUI.java \
javax/swing/plaf/basic/BasicRootPaneUI.java \
javax/swing/plaf/basic/BasicRadioButtonUI.java \
javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java \
javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java \
javax/swing/plaf/basic/BasicScrollBarUI.java \
javax/swing/plaf/basic/BasicScrollPaneUI.java \
javax/swing/plaf/basic/BasicSeparatorUI.java \
......
......@@ -1008,17 +1008,21 @@ javax/swing/border/TitledBorder.java \
javax/swing/GrayFilter.java \
javax/swing/AbstractAction.java \
javax/swing/AbstractButton.java \
javax/swing/plaf/basic/BasicArrowButton.java \
javax/swing/plaf/basic/BasicButtonListener.java \
javax/swing/plaf/basic/BasicButtonUI.java \
javax/swing/plaf/basic/BasicCheckBoxUI.java \
javax/swing/plaf/basic/BasicGraphicsUtils.java \
javax/swing/plaf/basic/BasicLabelUI.java \
javax/swing/plaf/basic/BasicListUI.java \
javax/swing/plaf/basic/BasicMenuItemUI.java \
javax/swing/plaf/basic/BasicOptionPaneUI.java \
javax/swing/plaf/basic/BasicPanelUI.java \
javax/swing/plaf/basic/BasicProgressBarUI.java \
javax/swing/plaf/basic/BasicRootPaneUI.java \
javax/swing/plaf/basic/BasicRadioButtonUI.java \
javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java \
javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java \
javax/swing/plaf/basic/BasicScrollBarUI.java \
javax/swing/plaf/basic/BasicScrollPaneUI.java \
javax/swing/plaf/basic/BasicSeparatorUI.java \
......@@ -4533,18 +4537,22 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/javax/swing/plaf/TextUI.P .deps/javax/swing/plaf/ToolBarUI.P \
.deps/javax/swing/plaf/ToolTipUI.P .deps/javax/swing/plaf/TreeUI.P \
.deps/javax/swing/plaf/UIResource.P .deps/javax/swing/plaf/ViewportUI.P \
.deps/javax/swing/plaf/basic/BasicArrowButton.P \
.deps/javax/swing/plaf/basic/BasicBorders.P \
.deps/javax/swing/plaf/basic/BasicButtonListener.P \
.deps/javax/swing/plaf/basic/BasicButtonUI.P \
.deps/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.P \
.deps/javax/swing/plaf/basic/BasicCheckBoxUI.P \
.deps/javax/swing/plaf/basic/BasicGraphicsUtils.P \
.deps/javax/swing/plaf/basic/BasicIconFactory.P \
.deps/javax/swing/plaf/basic/BasicLabelUI.P \
.deps/javax/swing/plaf/basic/BasicListUI.P \
.deps/javax/swing/plaf/basic/BasicLookAndFeel.P \
.deps/javax/swing/plaf/basic/BasicMenuItemUI.P \
.deps/javax/swing/plaf/basic/BasicOptionPaneUI.P \
.deps/javax/swing/plaf/basic/BasicPanelUI.P \
.deps/javax/swing/plaf/basic/BasicProgressBarUI.P \
.deps/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.P \
.deps/javax/swing/plaf/basic/BasicRadioButtonUI.P \
.deps/javax/swing/plaf/basic/BasicRootPaneUI.P \
.deps/javax/swing/plaf/basic/BasicScrollBarUI.P \
......
......@@ -50,6 +50,7 @@ public class GtkMenuItemPeer extends GtkMenuComponentPeer
implements MenuItemPeer
{
native void create (String label);
public native void connectSignals ();
public GtkMenuItemPeer (MenuItem item)
{
......@@ -57,6 +58,9 @@ public class GtkMenuItemPeer extends GtkMenuComponentPeer
create (item.getLabel ());
setEnabled (item.isEnabled ());
setParent (item);
if (item.getParent() instanceof Menu && ! (item instanceof Menu))
connectSignals();
}
void setParent (MenuItem item)
......
......@@ -95,10 +95,5 @@ public class GtkMenuPeer extends GtkMenuItemPeer
addItem (item, key, shiftModifier);
}
public void addSeparator ()
{
addItem (new MenuItem ("-"));
}
native public void delItem (int index);
}
......@@ -46,7 +46,6 @@ public class GtkPanelPeer extends GtkContainerPeer
{
native void create ();
native void connectJObject ();
native void connectSignals ();
public GtkPanelPeer (Panel p)
{
......
......@@ -78,6 +78,11 @@ public class Applet extends Panel
private transient AppletStub stub;
/**
* The dimensions passed to this applet through its HTML tag.
*/
private transient Dimension dimensions;
/**
* The accessibility context for this applet.
*
* @serial the accessibleContext for this
......@@ -457,6 +462,41 @@ public class Applet extends Panel
s.defaultReadObject();
}
private Dimension getDimensions ()
{
if (dimensions == null)
{
int width = Integer.parseInt(stub.getParameter("width"));
int height = Integer.parseInt(stub.getParameter("height"));
dimensions = new Dimension(width, height);
}
return dimensions;
}
/**
* Returns an instance of {@link Dimension} representing the
* applet's width and height parameters.
*
* @return the applet's preferred size
*/
public Dimension preferredSize()
{
return getDimensions ();
}
/**
* Returns an instance of {@link Dimension} representing the
* applet's width and height parameters.
*
* @return the applet's minimum size
*/
public Dimension minimumSize()
{
return getDimensions ();
}
/**
* This class provides accessibility support for Applets, and is the
* runtime type returned by {@link #getAccessibleContext()}.
......
......@@ -3816,6 +3816,12 @@ public abstract class Component
if (popups == null)
popups = new Vector();
popups.add(popup);
if (popup.parent != null)
popup.parent.remove(popup);
popup.parent = this;
if (peer != null)
popup.addNotify();
}
/**
......
......@@ -417,7 +417,7 @@ draw3DRect(int x, int y, int width, int height, boolean raised)
drawLine(x1, y2, x1, y1);
setColor(br);
drawLine(x2, y1, x2, y2);
drawLine(x2, y1, x1, y2);
drawLine(x2, y2, x1, y2);
setColor(color);
}
......
......@@ -82,7 +82,7 @@ private boolean isHelpMenu;
// From the serialization spec. FIXME: what should it be?
private int menuSerializedDataVersion;
static final MenuItem separator = new MenuItem("-");
static final String separatorLabel = "-";
/*************************************************************************/
......@@ -295,8 +295,7 @@ insert(String label, int index)
public void
addSeparator()
{
if (peer != null)
((MenuPeer) peer).addSeparator();
add(new MenuItem(separatorLabel));
}
/*************************************************************************/
......@@ -314,7 +313,7 @@ addSeparator()
public void
insertSeparator(int index)
{
insert(separator, index);
insert(new MenuItem(separatorLabel), index);
}
/*************************************************************************/
......
......@@ -310,7 +310,10 @@ deleteShortcut()
public String
getActionCommand()
{
return(actionCommand);
if (actionCommand == null)
return label;
else
return actionCommand;
}
/*************************************************************************/
......
......@@ -105,7 +105,7 @@ PopupMenu(String label)
public void
addNotify()
{
if (peer != null)
if (peer == null)
peer = getToolkit ().createPopupMenu (this);
super.addNotify ();
}
......@@ -123,6 +123,8 @@ addNotify()
public void
show(Component component, int x, int y)
{
if (getPeer() == null)
this.addNotify();
PopupMenuPeer pmp = (PopupMenuPeer)getPeer();
if (pmp != null)
{
......
......@@ -43,7 +43,6 @@ import java.awt.MenuItem;
public interface MenuPeer extends MenuItemPeer
{
void addItem (MenuItem item);
void addSeparator ();
void delItem (int index);
}
......@@ -38,6 +38,7 @@ exception statement from your version. */
package java.text;
import java.util.Arrays;
import java.util.Iterator;
import java.util.HashMap;
import java.util.Hashtable;
......@@ -219,26 +220,7 @@ AttributedString(AttributedCharacterIterator aci, int begin_index,
// Get the valid attribute list
Set all_attribs = aci.getAllAttributeKeys();
if (attributes != null)
{
Set valid_attribs = new HashSet();
Iterator iter = all_attribs.iterator();
while (iter.hasNext())
{
Object obj = iter.next();
int i;
for (i = 0; i < attributes.length; i++)
if (obj.equals(attributes[0]))
break;
if (i == attributes.length)
continue;
valid_attribs.add(obj);
}
all_attribs = valid_attribs;
}
all_attribs.retainAll(Arrays.asList(attributes));
// Loop through and extract the attributes
char c = aci.setIndex(begin_index);
......@@ -320,7 +302,7 @@ AttributedString(AttributedCharacterIterator aci, int begin_index,
public void
addAttribute(AttributedCharacterIterator.Attribute attrib, Object value)
{
addAttribute(attrib, value, 0, sci.getEndIndex() - 1);
addAttribute(attrib, value, 0, sci.getEndIndex());
}
/*************************************************************************/
......@@ -389,8 +371,7 @@ addAttributes(Map attributes, int begin_index, int end_index)
public AttributedCharacterIterator
getIterator()
{
return(new AttributedStringIterator(sci, attribs, 0, sci.getEndIndex() - 1,
null));
return(new AttributedStringIterator(sci, attribs, 0, sci.getEndIndex(), null));
}
/*************************************************************************/
......@@ -409,7 +390,7 @@ getIterator()
public AttributedCharacterIterator
getIterator(AttributedCharacterIterator.Attribute[] attributes)
{
return(getIterator(attributes, 0, sci.getEndIndex() - 1));
return(getIterator(attributes, 0, sci.getEndIndex()));
}
/*************************************************************************/
......
......@@ -221,39 +221,28 @@ getRunLimit(AttributedCharacterIterator.Attribute attrib)
public synchronized int
getRunLimit(Set attribute_set)
{
int orig_index = ci.getIndex();
int run_limit;
boolean hit = false;
int runLimit = ci.getEndIndex ();
int pos = ci.getIndex ();
do
for (int i = 0; i < attribs.length; ++i)
{
run_limit = ci.getIndex();
Map attribute_map = getAttributes();
boolean found = false;
Iterator iter = attribute_set.iterator();
while(iter.hasNext())
if (!attribute_map.containsKey(iter.next()))
{
found = true;
break;
}
if (found)
break;
if (pos >= attribs[i].begin_index &&
pos <= attribs[i].end_index)
{
Iterator iter = attribute_set.iterator();
while(iter.hasNext())
if (attribs[i].attribs.containsKey(iter.next()))
{
hit = true;
runLimit = Math.min(runLimit, attribs[i].end_index);
}
}
}
while (ci.next() != CharacterIterator.DONE);
boolean hit_end = (ci.previous() == CharacterIterator.DONE);
ci.setIndex(orig_index);
if (run_limit == orig_index)
return(-1); // No characters match the given attributes
// else if (!hit_end)
// --run_limit;
return(run_limit);
if (hit)
return runLimit;
else
return -1;
}
/*************************************************************************/
......@@ -281,35 +270,28 @@ getRunStart(AttributedCharacterIterator.Attribute attrib)
public int
getRunStart(Set attribute_set)
{
int orig_index = ci.getIndex();
int run_start;
boolean hit = false;
int runBegin = 0;
int pos = ci.getIndex ();
do
for (int i = 0; i < attribs.length; ++i)
{
run_start = ci.getIndex();
Map attribute_map = getAttributes();
Iterator iter = attribute_set.iterator();
while(iter.hasNext())
if (!attribute_map.containsKey(iter.next()))
break;
if (iter.hasNext())
break;
if (pos >= attribs[i].begin_index &&
pos <= attribs[i].end_index)
{
Iterator iter = attribute_set.iterator();
while(iter.hasNext())
if (attribs[i].attribs.containsKey(iter.next()))
{
hit = true;
runBegin = Math.max(runBegin, attribs[i].begin_index);
}
}
}
while (ci.previous() != CharacterIterator.DONE);
boolean hit_beginning = (ci.previous() == CharacterIterator.DONE);
ci.setIndex(orig_index);
if (run_start == orig_index)
return(-1); // No characters match the given attributes
else if (!hit_beginning)
++run_start;
return(run_start);
if (hit)
return runBegin;
else
return -1;
}
/*************************************************************************/
......
......@@ -115,7 +115,7 @@ public class DefaultSingleSelectionModel
*/
public boolean isSelected ()
{
return (index == -1);
return (index != -1);
}
/**
......
......@@ -56,7 +56,10 @@ public class ImageIcon implements Icon
public ImageIcon(String s)
{
this(s, "");
// if description is not specified, then file name becomes
// desciption for this icon
this(s, s);
}
public ImageIcon(String file,
......
......@@ -39,206 +39,135 @@ package javax.swing;
import java.io.IOException;
import java.io.ObjectOutputStream;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
/**
* JCheckBoxMenuItem
* @author Andrew Selkirk
* @version 1.0
*/
public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants, Accessible
{
//-------------------------------------------------------------
// Classes ----------------------------------------------------
//-------------------------------------------------------------
/**
* AccessibleJCheckBoxMenuItem
*/
protected class AccessibleJCheckBoxMenuItem extends AccessibleJMenuItem {
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor AccessibleJCheckBoxMenuItem
* @param component TODO
*/
protected AccessibleJCheckBoxMenuItem(JCheckBoxMenuItem component) {
super(component);
// TODO
} // AccessibleJCheckBoxMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/**
* getAccessibleRole
* @returns AccessibleRole
*/
public AccessibleRole getAccessibleRole() {
return AccessibleRole.CHECK_BOX;
} // getAccessibleRole()
} // AccessibleJCheckBoxMenuItem
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* uiClassID
*/
private static final String uiClassID = "CheckBoxMenuItemUI";
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor JCheckBoxMenuItem
*/
public JCheckBoxMenuItem() {
// TODO
} // JCheckBoxMenuItem()
/**
* Constructor JCheckBoxMenuItem
* @param icon TODO
*/
public JCheckBoxMenuItem(Icon icon) {
// TODO
} // JCheckBoxMenuItem()
/**
* Constructor JCheckBoxMenuItem
* @param text TODO
*/
public JCheckBoxMenuItem(String text) {
// TODO
} // JCheckBoxMenuItem()
/**
* Constructor JCheckBoxMenuItem
* @param action TODO
*/
public JCheckBoxMenuItem(Action action) {
// TODO
} // JCheckBoxMenuItem()
/**
* Constructor JCheckBoxMenuItem
* @param text TODO
* @param icon TODO
*/
public JCheckBoxMenuItem(String text, Icon icon) {
// TODO
} // JCheckBoxMenuItem()
/**
* Constructor JCheckBoxMenuItem
* @param text TODO
* @param state TODO
*/
public JCheckBoxMenuItem(String text, boolean state) {
// TODO
} // JCheckBoxMenuItem()
/**
* Constructor JCheckBoxMenuItem
* @param text TODO
* @param icon TODO
* @param state TODO
*/
public JCheckBoxMenuItem(String text, Icon icon, boolean state) {
// TODO
} // JCheckBoxMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/**
* writeObject
* @param stream TODO
* @exception IOException TODO
*/
private void writeObject(ObjectOutputStream stream) throws IOException {
// TODO
} // writeObject()
/**
* getUIClassID
* @returns String
*/
public String getUIClassID() {
return uiClassID;
} // getUIClassID()
/**
* getState
* @returns boolean
*/
public boolean getState() {
return false; // TODO
} // getState()
/**
* setState
* @param state TODO
*/
public synchronized void setState(boolean state) {
// TODO
} // setState()
/**
* getSelectedObjects
* @returns Object[]
*/
public Object[] getSelectedObjects() {
return null; // TODO
} // getSelectedObjects()
/**
* requestFocus
*/
public void requestFocus() {
// TODO
} // requestFocus()
/**
* paramString
* @returns String
*/
protected String paramString() {
return null; // TODO
} // paramString()
/**
* getAccessibleContext
* @returns AccessibleContext
*/
public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) {
accessibleContext = new AccessibleJCheckBoxMenuItem(this);
} // if
return accessibleContext;
} // getAccessibleContext()
public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants,
Accessible
{
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
private static final String uiClassID = "CheckBoxMenuItemUI";
private boolean state;
private Object[] selectedObjects;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
public JCheckBoxMenuItem()
{
this(null, null);
} // JCheckBoxMenuItem()
public JCheckBoxMenuItem(Icon icon)
{
this(null, icon);
} // JCheckBoxMenuItem()
public JCheckBoxMenuItem(String text)
{
this(text, null);
} // JCheckBoxMenuItem()
public JCheckBoxMenuItem(Action action)
{
this();
setAction(action);
} // JCheckBoxMenuItem()
public JCheckBoxMenuItem(String text, Icon icon)
{
this(text, icon, false);
} // JCheckBoxMenuItem()
public JCheckBoxMenuItem(String text, boolean state)
{
this(text, null, state);
} // JCheckBoxMenuItem()
public JCheckBoxMenuItem(String text, Icon icon, boolean state)
{
super(text, icon);
setModel(new JToggleButton.ToggleButtonModel());
this.state = state;
} // JCheckBoxMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
private void writeObject(ObjectOutputStream stream) throws IOException
{
// TODO
} // writeObject()
public String getUIClassID()
{
return uiClassID;
} // getUIClassID()
public boolean getState()
{
return state;
} // getState()
public synchronized void setState(boolean state)
{
this.state = state;
} // setState()
public Object[] getSelectedObjects()
{
return selectedObjects;
} // getSelectedObjects()
public void requestFocus()
{
// TODO
} // requestFocus()
protected String paramString()
{
return "JCheckBoxMenuItem";
} // paramString()
public AccessibleContext getAccessibleContext()
{
if (accessibleContext == null)
{
accessibleContext = new AccessibleJCheckBoxMenuItem(this);
}
return accessibleContext;
} // getAccessibleContext()
//-------------------------------------------------------------
// Classes ----------------------------------------------------
//-------------------------------------------------------------
protected class AccessibleJCheckBoxMenuItem extends AccessibleJMenuItem
{
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
protected AccessibleJCheckBoxMenuItem(JCheckBoxMenuItem component)
{
super(component);
// TODO
} // AccessibleJCheckBoxMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.CHECK_BOX;
} // getAccessibleRole()
} // AccessibleJCheckBoxMenuItem
} // JCheckBoxMenuItem
......@@ -100,7 +100,7 @@ public abstract class JComponent extends Container implements Serializable
Border border;
JToolTip tooltip;
String tool_tip_text;
boolean use_double_buffer, opaque;
boolean use_double_buffer = false, opaque;
Image doubleBuffer;
int doubleBufferWidth = -1;
int doubleBufferHeight = -1;
......
......@@ -289,7 +289,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
String oldText = labelText;
labelText = text;
firePropertyChange(TEXT_CHANGED_PROPERTY, oldText, labelText);
if (labelText.length() <= underlinedChar)
if (labelText != null && labelText.length() <= underlinedChar)
setDisplayedMnemonicIndex(labelText.length() - 1);
}
}
......
......@@ -185,9 +185,6 @@ public class JProgressBar extends JComponent implements SwingConstants,
/** Fired in a PropertyChangeEvent when the "indeterminate" property changes. */
public static final String INDETERMINATE_CHANGED_PROPERTY = "indeterminate";
/** A list of ChangeListeners registered with this ProgressBar. */
private transient EventListenerList changeListenerList;
/** Whether the ProgressBar is determinate. */
private transient boolean indeterminate = false;
......@@ -260,7 +257,6 @@ public class JProgressBar extends JComponent implements SwingConstants,
this.orientation = orientation;
changeListener = createChangeListener();
model.addChangeListener(changeListener);
changeListenerList = new EventListenerList();
updateUI();
}
......@@ -275,7 +271,6 @@ public class JProgressBar extends JComponent implements SwingConstants,
this.model = model;
changeListener = createChangeListener();
model.addChangeListener(changeListener);
changeListenerList = new EventListenerList();
updateUI();
}
......@@ -511,7 +506,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
*/
public void addChangeListener(ChangeListener listener)
{
changeListenerList.add(ChangeListener.class, listener);
listenerList.add(ChangeListener.class, listener);
}
/**
......@@ -521,7 +516,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
*/
public void removeChangeListener(ChangeListener listener)
{
changeListenerList.remove(ChangeListener.class, listener);
listenerList.remove(ChangeListener.class, listener);
}
/**
......@@ -532,7 +527,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
*/
public ChangeListener[] getChangeListeners()
{
return (ChangeListener[]) changeListenerList.getListenerList();
return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
}
/**
......@@ -542,7 +537,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
*/
protected void fireStateChanged()
{
Object[] changeListeners = changeListenerList.getListenerList();
Object[] changeListeners = listenerList.getListenerList();
if (changeEvent == null)
changeEvent = new ChangeEvent(this);
for (int i = changeListeners.length - 2; i >= 0; i -= 2)
......
......@@ -39,186 +39,118 @@ package javax.swing;
import java.io.IOException;
import java.io.ObjectOutputStream;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
/**
* JRadioButtonMenuItem
* @author Andrew Selkirk
* @version 1.0
*/
public class JRadioButtonMenuItem extends JMenuItem implements Accessible
{
//-------------------------------------------------------------
// Classes ----------------------------------------------------
//-------------------------------------------------------------
/**
* AccessibleJRadioButtonMenuItem
*/
protected class AccessibleJRadioButtonMenuItem extends AccessibleJMenuItem {
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor AccessibleJRadioButtonMenuItem
* @param component TODO
*/
protected AccessibleJRadioButtonMenuItem(JRadioButtonMenuItem component) {
super(component);
// TODO
} // AccessibleJRadioButtonMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/**
* getAccessibleRole
* @returns AccessibleRole
*/
public AccessibleRole getAccessibleRole() {
return AccessibleRole.RADIO_BUTTON;
} // getAccessibleRole()
} // AccessibleJRadioButtonMenuItem
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* uiClassID
*/
private static final String uiClassID = "RadioButtonMenuItemUI";
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor JRadioButtonMenuItem
*/
public JRadioButtonMenuItem() {
// TODO
} // JRadioButtonMenuItem()
/**
* Constructor JRadioButtonMenuItem
* @param icon TODO
*/
public JRadioButtonMenuItem(Icon icon) {
// TODO
} // JRadioButtonMenuItem()
/**
* Constructor JRadioButtonMenuItem
* @param text TODO
*/
public JRadioButtonMenuItem(String text) {
// TODO
} // JRadioButtonMenuItem()
/**
* Constructor JRadioButtonMenuItem
* @param action TODO
*/
public JRadioButtonMenuItem(Action action) {
// TODO
} // JRadioButtonMenuItem()
/**
* Constructor JRadioButtonMenuItem
* @param text TODO
* @param icon TODO
*/
public JRadioButtonMenuItem(String text, Icon icon) {
// TODO
} // JRadioButtonMenuItem()
/**
* Constructor JRadioButtonMenuItem
* @param text TODO
* @param selected TODO
*/
public JRadioButtonMenuItem(String text, boolean selected) {
// TODO
} // JRadioButtonMenuItem()
/**
* Constructor JRadioButtonMenuItem
* @param icon TODO
* @param selected TODO
*/
public JRadioButtonMenuItem(Icon icon, boolean selected) {
// TODO
} // JRadioButtonMenuItem()
/**
* Constructor JRadioButtonMenuItem
* @param text TODO
* @param icon TODO
* @param selected TODO
*/
public JRadioButtonMenuItem(String text, Icon icon, boolean selected) {
// TODO
} // JRadioButtonMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/**
* writeObject
* @param stream TODO
* @exception IOException TODO
*/
private void writeObject(ObjectOutputStream stream) throws IOException {
// TODO
} // writeObject()
/**
* getUIClassID
* @returns String
*/
public String getUIClassID() {
return uiClassID;
} // getUIClassID()
/**
* requestFocus
*/
public void requestFocus() {
// TODO
} // requestFocus()
/**
* paramString
* @returns String
*/
protected String paramString() {
return null; // TODO
} // paramString()
/**
* getAccessibleContext
* @returns AccessibleContext
*/
public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) {
accessibleContext = new AccessibleJRadioButtonMenuItem(this);
} // if
return accessibleContext;
} // getAccessibleContext()
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
private static final String uiClassID = "RadioButtonMenuItemUI";
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
public JRadioButtonMenuItem()
{
this(null, null);
} // JRadioButtonMenuItem()
public JRadioButtonMenuItem(Icon icon)
{
this(null, icon);
} // JRadioButtonMenuItem()
public JRadioButtonMenuItem(String text)
{
this(text, null);
} // JRadioButtonMenuItem()
public JRadioButtonMenuItem(Action action)
{
this();
setAction(action);
} // JRadioButtonMenuItem()
public JRadioButtonMenuItem(String text, Icon icon)
{
this(text, icon, false);
} // JRadioButtonMenuItem()
public JRadioButtonMenuItem(String text, boolean selected)
{
this(text, null, selected);
} // JRadioButtonMenuItem()
public JRadioButtonMenuItem(Icon icon, boolean selected)
{
this(null, icon, selected);
} // JRadioButtonMenuItem()
public JRadioButtonMenuItem(String text, Icon icon, boolean selected)
{
super(text, icon);
setModel(new JToggleButton.ToggleButtonModel());
model.setSelected(selected);
} // JRadioButtonMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
private void writeObject(ObjectOutputStream stream) throws IOException
{
// TODO
} // writeObject()
public String getUIClassID()
{
return uiClassID;
} // getUIClassID()
public void requestFocus()
{
// TODO
} // requestFocus()
protected String paramString()
{
return "JRadioButtonMenuItem";
} // paramString()
public AccessibleContext getAccessibleContext()
{
if (accessibleContext == null)
{
accessibleContext = new AccessibleJRadioButtonMenuItem(this);
}
return accessibleContext;
} // getAccessibleContext()
//-------------------------------------------------------------
// Classes ----------------------------------------------------
//-------------------------------------------------------------
protected class AccessibleJRadioButtonMenuItem extends AccessibleJMenuItem
{
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
protected AccessibleJRadioButtonMenuItem(JRadioButtonMenuItem component)
{
super(component);
// TODO
} // AccessibleJRadioButtonMenuItem()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.RADIO_BUTTON;
} // getAccessibleRole()
} // AccessibleJRadioButtonMenuItem
} // JRadioButtonMenuItem
......@@ -176,12 +176,6 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
/** How much the thumb moves when moving in a unit. */
protected int unitIncrement = 1;
/** A list of all ChangeListeners attached to the scroll bar. */
private transient EventListenerList changeListenerList;
/** A list of all AdjustmentListeners attached to the scroll bar. */
private transient EventListenerList adjustmentListenerList;
/** The ChangeListener that listens to the model. */
private transient ChangeListener changeListener;
......@@ -228,8 +222,6 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
+ " is not a legal orientation");
this.orientation = orientation;
changeListener = createChangeListener();
changeListenerList = new EventListenerList();
adjustmentListenerList = new EventListenerList();
model.addChangeListener(changeListener);
updateUI();
}
......@@ -586,7 +578,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
private void fireStateChanged()
{
Object[] changeListeners = changeListenerList.getListenerList();
Object[] changeListeners = listenerList.getListenerList();
if (changeEvent == null)
changeEvent = new ChangeEvent(this);
for (int i = changeListeners.length - 2; i >= 0; i -= 2)
......@@ -603,7 +595,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void addChangeListener(ChangeListener listener)
{
changeListenerList.add(ChangeListener.class, listener);
listenerList.add(ChangeListener.class, listener);
}
/**
......@@ -613,7 +605,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void removeChangeListener(ChangeListener listener)
{
changeListenerList.remove(ChangeListener.class, listener);
listenerList.remove(ChangeListener.class, listener);
}
/**
......@@ -624,7 +616,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public ChangeListener[] getChangeListeners()
{
return (ChangeListener[]) changeListenerList.getListenerList();
return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
}
/**
......@@ -634,7 +626,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void addAdjustmentListener(AdjustmentListener listener)
{
adjustmentListenerList.add(AdjustmentListener.class, listener);
listenerList.add(AdjustmentListener.class, listener);
}
/**
......@@ -644,7 +636,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void removeAdjustmentListener(AdjustmentListener listener)
{
adjustmentListenerList.remove(AdjustmentListener.class, listener);
listenerList.remove(AdjustmentListener.class, listener);
}
/**
......@@ -655,7 +647,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public AdjustmentListener[] getAdjustmentListeners()
{
return (AdjustmentListener[]) adjustmentListenerList.getListenerList();
return (AdjustmentListener[]) listenerList.getListeners(AdjustmentListener.class);
}
/**
......@@ -670,7 +662,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
protected void fireAdjustmentValueChanged(int id, int type, int value)
{
Object[] adjustmentListeners = adjustmentListenerList.getListenerList();
Object[] adjustmentListeners = listenerList.getListenerList();
AdjustmentEvent adjustmentEvent = new AdjustmentEvent(this,
AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
AdjustmentEvent.TRACK,
......
......@@ -253,9 +253,6 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
*/
private transient Dictionary labelTable;
/** A list of all ChangeListeners listening to this slider. */
private transient EventListenerList changeListenerList;
/** The model used to describe the slider. */
protected BoundedRangeModel sliderModel;
......@@ -342,7 +339,6 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
throw new IllegalArgumentException(orientation + " is not a legal orientation");
this.orientation = orientation;
changeListener = createChangeListener();
changeListenerList = new EventListenerList();
sliderModel.addChangeListener(changeListener);
updateUI();
}
......@@ -359,7 +355,6 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
else
sliderModel = model;
changeListener = createChangeListener();
changeListenerList = new EventListenerList();
sliderModel.addChangeListener(changeListener);
updateUI();
}
......@@ -453,7 +448,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
*/
public void addChangeListener(ChangeListener listener)
{
changeListenerList.add(ChangeListener.class, listener);
listenerList.add(ChangeListener.class, listener);
}
/**
......@@ -463,7 +458,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
*/
public void removeChangeListener(ChangeListener listener)
{
changeListenerList.remove(ChangeListener.class, listener);
listenerList.remove(ChangeListener.class, listener);
}
/**
......@@ -473,7 +468,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
*/
protected void fireStateChanged()
{
Object[] changeListeners = changeListenerList.getListenerList();
Object[] changeListeners = listenerList.getListenerList();
if (changeEvent == null)
changeEvent = new ChangeEvent(this);
for (int i = changeListeners.length - 2; i >= 0; i -= 2)
......@@ -491,7 +486,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
*/
public ChangeListener[] getChangeListeners()
{
return (ChangeListener[]) changeListenerList.getListenerList();
return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
}
/**
......
/* BasicCheckBoxMenuItemUI.java
Copyright (C) 2002, 2004 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 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.basic;
import java.awt.event.MouseEvent;
import javax.swing.AbstractButton;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.MenuElement;
import javax.swing.MenuSelectionManager;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI
{
public static ComponentUI createUI(final JComponent c)
{
return new BasicCheckBoxMenuItemUI();
}
protected String getPropertyPrefix()
{
return null; // TODO
}
protected void installDefaults()
{
super.installDefaults();
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
checkIcon = defaults.getIcon("CheckBoxMenuItem.checkIcon");
}
void processMouseEvent(JMenuItem item, MouseEvent e, MenuElement[] path,
MenuSelectionManager manager)
{
}
}
......@@ -196,11 +196,11 @@ public class BasicIconFactory implements Serializable
}
public static Icon getCheckBoxMenuItemIcon()
{
return new DummyIcon();
return getCheckBoxIcon();
}
public static Icon getRadioButtonMenuItemIcon()
{
return new DummyIcon();
return getRadioButtonIcon();
}
public static Icon createEmptyFrameIcon()
{
......
......@@ -501,7 +501,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"MenuBar.windowBindings", new Object[] {
"F10", "takeFocus"
},
"MenuItem.acceleratorDelimiter", "+",
"MenuItem.acceleratorDelimiter", "-",
"MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12),
"MenuItem.acceleratorForeground", new ColorUIResource(Color.black),
"MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white),
......@@ -703,9 +703,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"ctrl UP", "requestFocus",
"ctrl KP_UP", "requestFocus"
}),
"TabbedPane.background", new ColorUIResource(Color.lightGray),
"TabbedPane.background", new ColorUIResource(Color.GRAY),
"TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3),
"TabbedPane.darkShadow", new ColorUIResource(Color.black),
"TabbedPane.darkShadow", new ColorUIResource(Color.darkGray),
"TabbedPane.focus", new ColorUIResource(Color.black),
"TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
"LEFT", "navigateLeft",
......@@ -725,8 +725,10 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"TabbedPane.lightHighlight", new ColorUIResource(Color.white),
"TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1),
"TabbedPane.shadow", new ColorUIResource(Color.gray),
"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 2, 0, 2),
"TabbedPane.tabInsets", new InsetsUIResource(0, 4, 1, 4),
"TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2),
"TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4),
"TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2),
"TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1),
"TabbedPane.tabRunOverlay", new Integer(2),
"TabbedPane.textIconGap", new Integer(4),
"Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
......
......@@ -573,7 +573,7 @@ public class BasicProgressBarUI extends ProgressBarUI
}
}
if (progressBar.isStringPainted())
if (progressBar.isStringPainted() && !progressBar.getString().equals(""))
paintString(g, 0, 0, or.width, or.height, amountFull, insets);
g.setColor(saved);
}
......@@ -605,7 +605,7 @@ public class BasicProgressBarUI extends ProgressBarUI
g.setColor(c.getForeground());
g.fill3DRect(box.x, box.y, box.width, box.height, true);
if (progressBar.isStringPainted())
if (progressBar.isStringPainted() && !progressBar.getString().equals(""))
paintString(g, 0, 0, or.width, or.height,
getAmountFull(insets, or.width, or.height), insets);
......
/* BasicRadioButtonMenuItemUI.java
Copyright (C) 2002, 2004 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 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.basic;
import java.awt.event.MouseEvent;
import javax.swing.AbstractButton;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.MenuElement;
import javax.swing.MenuSelectionManager;
import javax.swing.plaf.ComponentUI;
public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI
{
public BasicRadioButtonMenuItemUI()
{
super();
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
checkIcon = defaults.getIcon("RadioButtonMenuItem.checkIcon");
}
public static ComponentUI createUI(JComponent b)
{
return new BasicRadioButtonMenuItemUI();
}
protected String getPropertyPrefix()
{
return null;
// TODO
}
void processMouseEvent(JMenuItem item, MouseEvent e, MenuElement[] path,
MenuSelectionManager manager)
{
}
}
......@@ -127,6 +127,7 @@ public class BasicViewportUI extends ViewportUI
Point pos = v.getViewPosition();
Rectangle viewBounds = view.getBounds();
Rectangle portBounds = v.getBounds();
if (backingStoreImage == null
|| backingStoreWidth != viewBounds.width
......@@ -138,6 +139,32 @@ public class BasicViewportUI extends ViewportUI
}
Graphics g2 = backingStoreImage.getGraphics();
if (c.getBackground() != null)
{
// fill the backing store background
java.awt.Color save = g2.getColor();
g2.setColor(c.getBackground());
g2.fillRect (0, 0, backingStoreWidth, backingStoreHeight);
g2.setColor(save);
// fill the viewport background
save = g.getColor();
g.setColor(c.getBackground());
g.fillRect (0, 0, portBounds.width, portBounds.height);
g.setColor(save);
}
else
{
// clear the backing store background
g2.clearRect(0, 0, backingStoreWidth, backingStoreHeight);
// clear the viewport background
g.clearRect(0, 0, portBounds.width, portBounds.height);
}
view.paint(g2);
g2 = null;
g.drawImage(backingStoreImage,
......
/* jcl.c
Copyright (C) 1998 Free Software Foundation, Inc.
Copyright (C) 1998, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -37,7 +37,7 @@ exception statement from your version. */
#include <stdio.h>
#include <jcl.h>
#include <malloc.h>
#include <stdlib.h>
#ifndef __GNUC__
#define __attribute__(x) /* nothing */
......
/* JNILINK 1.1: JNI version.
Copyright (C) 1998 Free Software Foundation, Inc.
Copyright (C) 1998, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -40,7 +40,7 @@ exception statement from your version. */
#include <string.h>
#include <jcl.h>
#include <malloc.h>
#include <stdlib.h>
#define GETCLASS(c) *(jclass*)(c)
......
......@@ -145,7 +145,7 @@ grab_current_drawable (GtkWidget *widget, GdkDrawable **draw, GdkWindow **win)
}
*draw = *win;
gdk_window_get_internal_paint_info (*win, draw, 0, 0);
gdk_window_get_internal_paint_info (*win, draw, 0, 0);
g_object_ref (*draw);
}
......@@ -349,7 +349,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__II
if (gr->debug) printf ("constructing offscreen drawable of size (%d,%d)\n",
width, height);
gr->drawable = (GdkDrawable *) gdk_pixmap_new (NULL, width, height,
gdk_rgb_get_visual ()->depth);
g_assert (gr->drawable != NULL);
......@@ -371,9 +371,12 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__II
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable
(JNIEnv *env, jobject self, jobject other, jint x, jint y)
{
GdkRectangle clipRect;
struct graphics2d *src = NULL, *dst = NULL;
gint s_height, s_width, d_height, d_width, height, width;
cairo_matrix_t *matrix;
GdkGC *gc;
cairo_operator_t tmp_op;
src = (struct graphics2d *)NSA_GET_G2D_PTR (env, other);
dst = (struct graphics2d *)NSA_GET_G2D_PTR (env, self);
......@@ -386,19 +389,33 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable
gdk_drawable_get_size (src->drawable, &s_width, &s_height);
gdk_drawable_get_size (dst->drawable, &d_width, &d_height);
width = min (s_width, d_width);
height = min (s_width, d_height);
height = min (s_height, d_height);
gdk_threads_leave ();
gc = gdk_gc_new (dst->drawable);
g_assert (gc != NULL);
begin_drawing_operation(dst);
gdk_draw_drawable(dst->drawable, gc, src->drawable,
0, 0, x, y, width, height);
gdk_flush ();
matrix = cairo_matrix_create ();
cairo_surface_get_matrix (src->surface, matrix);
cairo_matrix_translate (matrix, (double)-x, (double)-y);
cairo_surface_set_matrix (src->surface, matrix);
g_object_unref (gc);
tmp_op = cairo_current_operator (dst->cr);
cairo_set_operator(dst->cr, CAIRO_OPERATOR_SRC);
cairo_show_surface (dst->cr, src->surface, width, height);
cairo_set_operator(dst->cr, tmp_op);
if (src->debug) printf ("copied %d x %d pixels from offscreen drawable\n", width, height);
cairo_matrix_translate (matrix, (double)x, (double)y);
cairo_surface_set_matrix (src->surface, matrix);
cairo_matrix_destroy (matrix);
end_drawing_operation(dst);
gdk_threads_enter ();
gdk_flush ();
gdk_threads_leave ();
if (src->debug) printf ("copied %d x %d pixels from offscreen drawable\n", width, height);
}
static jintArray
......@@ -1215,7 +1232,8 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClip
gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
g_assert (gr != NULL);
if (gr->debug) printf ("cairo_clip\n");
cairo_clip (gr->cr);
cairo_init_clip (gr->cr);
cairo_clip (gr->cr);
}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSurfaceSetFilter
......
......@@ -249,9 +249,10 @@ static void
item_activate (GtkItem *item __attribute__((unused)),
struct item_event_hook_info *ie)
{
jstring label;
gdk_threads_leave ();
jstring label = (*gdk_env)->NewStringUTF (gdk_env, ie->label);
label = (*gdk_env)->NewStringUTF (gdk_env, ie->label);
(*gdk_env)->CallVoidMethod (gdk_env, ie->peer_obj,
choicePostItemEventID,
label,
......
......@@ -136,7 +136,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_requestFocus
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
gtk_widget_grab_focus (GTK_WIDGET (ptr));
// gtk_widget_grab_focus (GTK_WIDGET (ptr));
gdk_threads_leave ();
}
......@@ -386,7 +386,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkSetFont
{
const char *font_name;
void *ptr;
GtkWidget *label;
PangoFontDescription *font_desc;
ptr = NSA_GET_PTR (env, obj);
......@@ -632,12 +631,13 @@ filter_expose_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_addExposeFilter
(JNIEnv *env, jobject obj)
{
void *ptr = NSA_GET_PTR (env, obj);
jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
g_assert (gref);
GtkObject *filterobj;
GtkWidget *vbox, *layout;
GList *children;
void *ptr = NSA_GET_PTR (env, obj);
jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
g_assert (gref);
gdk_threads_enter ();
......@@ -675,12 +675,13 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_addExposeFilt
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_removeExposeFilter
(JNIEnv *env, jobject obj)
{
void *ptr = NSA_GET_PTR (env, obj);
jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
g_assert (gref);
GtkObject *filterobj;
GtkWidget *vbox, *layout;
GList *children;
void *ptr = NSA_GET_PTR (env, obj);
jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
g_assert (gref);
gdk_threads_enter ();
......
......@@ -186,6 +186,7 @@ ok_clicked (GtkButton *button __attribute__((unused)),
static jmethodID hideID;
void *ptr;
G_CONST_RETURN gchar *fileName;
jstring str_fileName;
ptr = NSA_GET_PTR (gdk_env, peer_obj);
......@@ -204,7 +205,7 @@ ok_clicked (GtkButton *button __attribute__((unused)),
gdk_threads_leave ();
/* Set the Java object field 'file' with this value. */
jstring str_fileName = (*gdk_env)->NewStringUTF (gdk_env, fileName);
str_fileName = (*gdk_env)->NewStringUTF (gdk_env, fileName);
(*gdk_env)->CallVoidMethod (gdk_env, peer_obj, gtkSetFilenameID, str_fileName);
/* We can hide the dialog now (and unblock show) */
......
......@@ -66,7 +66,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_addMenu
menu = NSA_GET_PTR (env, menupeer);
gdk_threads_enter ();
gtk_menu_bar_append (GTK_MENU_BAR (mbar), GTK_WIDGET (menu));
gtk_menu_shell_append (GTK_MENU_SHELL (mbar), GTK_WIDGET (menu));
gdk_threads_leave ();
}
......
......@@ -41,18 +41,16 @@ exception statement from your version. */
#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
static void item_activate (GtkMenuItem *item __attribute__((unused)),
jobject *peer_obj);
jobject peer_obj);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create
(JNIEnv *env, jobject obj, jstring label)
{
GtkWidget *widget;
const char *str;
jobject *gref;
/* Create global reference and save it for future use */
NSA_SET_GLOBAL_REF (env, obj);
gref = NSA_GET_GLOBAL_REF (env, obj);
str = (*env)->GetStringUTFChars (env, label, NULL);
......@@ -63,10 +61,6 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create
else
widget = gtk_menu_item_new_with_label (str);
/* Connect activate hook */
g_signal_connect (G_OBJECT (widget), "activate",
GTK_SIGNAL_FUNC (item_activate), *gref);
gtk_widget_show (widget);
gdk_threads_leave ();
......@@ -76,6 +70,22 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create
NSA_SET_PTR (env, obj, widget);
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_connectSignals
(JNIEnv *env, jobject obj)
{
void *ptr = NSA_GET_PTR (env, obj);
jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
g_assert (gref);
gdk_threads_enter ();
g_signal_connect (G_OBJECT (ptr), "activate",
G_CALLBACK (item_activate), *gref);
gdk_threads_leave ();
}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_setLabel
(JNIEnv *env, jobject obj, jstring label)
{
......@@ -104,9 +114,9 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_setLabel
}
static void
item_activate (GtkMenuItem *item __attribute__((unused)), jobject *peer_obj)
item_activate (GtkMenuItem *item __attribute__((unused)), jobject peer_obj)
{
(*gdk_env)->CallVoidMethod (gdk_env, *peer_obj,
(*gdk_env)->CallVoidMethod (gdk_env, peer_obj,
postMenuActionEventID);
}
......@@ -101,10 +101,21 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create
menu = gtk_menu_new ();
menu_title = gtk_menu_item_new_with_label (str);
if (str != NULL)
menu_title = gtk_menu_item_new_with_label (str);
else
menu_title = gtk_menu_item_new();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_title), menu);
gtk_widget_show (menu);
// Allow this menu to grab the pointer.
GtkWidget *toplevel = gtk_widget_get_toplevel (menu);
if (GTK_IS_WINDOW (toplevel))
{
gtk_window_group_add_window (global_gtk_window_group,
GTK_WINDOW(toplevel));
}
gtk_widget_show (menu_title);
NSA_SET_PTR (env, obj, menu_title);
......@@ -125,8 +136,8 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_addItem
gdk_threads_enter ();
menu = GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu);
gtk_menu_append (menu, GTK_WIDGET (ptr2));
menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(ptr1));
gtk_menu_shell_append (GTK_MENU_SHELL(menu), GTK_WIDGET (ptr2));
if (key)
{
......
......@@ -58,14 +58,6 @@ Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create
NSA_SET_PTR (env, obj, widget);
}
typedef struct _GtkLayoutChild GtkLayoutChild;
struct _GtkLayoutChild {
GtkWidget *widget;
gint x;
gint y;
};
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectJObject
(JNIEnv *env, jobject obj)
......@@ -80,59 +72,3 @@ Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectJObject
gdk_threads_leave ();
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals
(JNIEnv *env, jobject obj)
{
void *ptr = NSA_GET_PTR (env, obj);
jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
g_assert (gref);
gdk_threads_enter ();
gtk_widget_realize (GTK_WIDGET (ptr));
/* FIXME: If we don't need this then remove this method. */
/* g_signal_connect (G_OBJECT (ptr), "size_request", GTK_SIGNAL_FUNC (sr), */
/* NULL); */
gdk_threads_leave ();
/* Connect the superclass signals. */
Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
}
/* FIXME: The following doesn't seem to be used.
Is not declared as a native function in GtkPanelPeer.java */
/*
* Make a new panel.
*/
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew
(JNIEnv *env, jobject obj, jobject parent_obj)
{
GtkWidget *layout;
void *parent;
/* Create global reference and save it for future use */
NSA_SET_GLOBAL_REF (env, obj);
parent = NSA_GET_PTR (env, parent_obj);
gdk_threads_enter ();
layout = gtk_layout_new (NULL, NULL);
set_parent (layout, GTK_CONTAINER (parent));
gtk_widget_realize (layout);
connect_awt_hook (env, obj, 1, GTK_LAYOUT (layout)->bin_window);
set_visible (layout, 1);
gdk_threads_leave ();
NSA_SET_PTR (env, obj, layout);
}
......@@ -72,7 +72,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_show
gdk_threads_enter ();
gtk_menu_popup (GTK_MENU (GTK_MENU_ITEM (ptr)->submenu),
NULL, NULL, menu_pos, p, 3, time);
NULL, NULL, menu_pos, p, 0, time);
gdk_threads_leave ();
g_free (p);
......
......@@ -32,7 +32,6 @@ FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeLittleUnm
FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("ISO8859_15") (number 1)
FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16BE") (number 1)
FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16LE") (number 1)
FAIL: gnu.testlet.java.text.AttributedString.Test: Attribute key count (number 1)
FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: patterns (number 2)
FAIL: gnu.testlet.java.text.SimpleDateFormat.getAndSet2DigitYearStart: get2DigitYearStart() initial (number 1)
FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: invalid locale (number 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment