From b9c71c621763df74a56aebbdc023010ae851e317 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Fri, 27 Jan 2006 10:26:34 +0000 Subject: 2006-01-27 Roman Kennke * javax/swing/plaf/basic/BasicInternalFrameUI.java (InternalFramePropertyChangeListener): Don't implement VetoableChangeListener. (InternalFramePropertyChangeListener.vetoableChange): Removed. (internalFrameVetoableChangeListener): Removed unneeded field. (installListeners): Don't install vetoableChangeListener. * javax/swing/event/DocumentEvent.java (EventType): Made class final. --- ChangeLog | 11 +++++++ javax/swing/event/DocumentEvent.java | 2 +- javax/swing/plaf/basic/BasicInternalFrameUI.java | 41 ++---------------------- 3 files changed, 14 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8392bb444..1e58c465d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-01-27 Roman Kennke + + * javax/swing/plaf/basic/BasicInternalFrameUI.java + (InternalFramePropertyChangeListener): Don't implement + VetoableChangeListener. + (InternalFramePropertyChangeListener.vetoableChange): Removed. + (internalFrameVetoableChangeListener): Removed unneeded field. + (installListeners): Don't install vetoableChangeListener. + * javax/swing/event/DocumentEvent.java + (EventType): Made class final. + 2006-01-27 Roman Kennke * javax/swing/SwingUtilities.java diff --git a/javax/swing/event/DocumentEvent.java b/javax/swing/event/DocumentEvent.java index 6cd8e61fe..c17b24254 100644 --- a/javax/swing/event/DocumentEvent.java +++ b/javax/swing/event/DocumentEvent.java @@ -81,7 +81,7 @@ public interface DocumentEvent /** * EventType */ - class EventType + final class EventType { /** * INSERT diff --git a/javax/swing/plaf/basic/BasicInternalFrameUI.java b/javax/swing/plaf/basic/BasicInternalFrameUI.java index f9653bd2e..d077a42aa 100644 --- a/javax/swing/plaf/basic/BasicInternalFrameUI.java +++ b/javax/swing/plaf/basic/BasicInternalFrameUI.java @@ -891,38 +891,10 @@ public class BasicInternalFrameUI extends InternalFrameUI * This helper class listens for PropertyChangeEvents from the * JInternalFrame. */ - public class InternalFramePropertyChangeListener implements - PropertyChangeListener, VetoableChangeListener + public class InternalFramePropertyChangeListener + implements PropertyChangeListener { - /** - * This method is called when one of the JInternalFrame's properties change. - * This method is to allow JInternalFrame to veto an attempt to close the - * internal frame. This allows JInternalFrame to honour its - * defaultCloseOperation if that is DO_NOTHING_ON_CLOSE. - */ - public void vetoableChange(PropertyChangeEvent e) - throws PropertyVetoException - { - if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) - { - if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE) - { - frame.setVisible(false); - frame.getDesktopPane().repaint(); - throw new PropertyVetoException( - "close operation is HIDE_ON_CLOSE\n", - e); - } - else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE) - closeFrame(frame); - else - throw new PropertyVetoException( - "close operation is DO_NOTHING_ON_CLOSE\n", - e); - } - } - /** * This method is called when one of the JInternalFrame's properties change. * @@ -1091,13 +1063,6 @@ public class BasicInternalFrameUI extends InternalFrameUI */ protected PropertyChangeListener propertyChangeListener; - /** - * The VetoableChangeListener. Listens to PropertyChangeEvents - * from the JInternalFrame and allows the JInternalFrame to - * veto attempts to close it. - */ - private VetoableChangeListener internalFrameVetoableChangeListener; - /** The InternalFrameListener that listens to the JInternalFrame. */ private transient BasicInternalFrameListener internalFrameListener; @@ -1238,13 +1203,11 @@ public class BasicInternalFrameUI extends InternalFrameUI borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); - internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); - frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); } -- cgit v1.2.1