Commit 536a695f by Michael Koch Committed by Michael Koch

JComponent.java, [...]: New versions from classpath.

2003-06-19  Michael Koch  <konqueror@gmx.de>

	* javax/swing/JComponent.java,
	javax/swing/JInternalFrame.java,
	javax/swing/MenuSelectionManager.java,
	javax/swing/SwingUtilities.java,
	javax/swing/ToggleButtonModel.java:
	New versions from classpath.

From-SVN: r68207
parent 50af15ec
2003-06-19 Michael Koch <konqueror@gmx.de> 2003-06-19 Michael Koch <konqueror@gmx.de>
* javax/swing/JComponent.java,
javax/swing/JInternalFrame.java,
javax/swing/MenuSelectionManager.java,
javax/swing/SwingUtilities.java,
javax/swing/ToggleButtonModel.java:
New versions from classpath.
2003-06-19 Michael Koch <konqueror@gmx.de>
* java/text/CollationElementIterator.java * java/text/CollationElementIterator.java
(NULLORDER): Initialize with -1 as JDK documentation says. (NULLORDER): Initialize with -1 as JDK documentation says.
......
...@@ -66,7 +66,6 @@ import java.util.Hashtable; ...@@ -66,7 +66,6 @@ import java.util.Hashtable;
import javax.accessibility.Accessible; import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleExtendedComponent; import javax.accessibility.AccessibleExtendedComponent;
import javax.accessibility.AccessibleKeyBinding;
import javax.accessibility.AccessibleRole; import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleStateSet; import javax.accessibility.AccessibleStateSet;
import javax.swing.event.AncestorListener; import javax.swing.event.AncestorListener;
...@@ -116,16 +115,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -116,16 +115,6 @@ public abstract class JComponent extends Container implements Serializable
* AccessibleFocusHandler * AccessibleFocusHandler
*/ */
protected class AccessibleFocusHandler implements FocusListener { protected class AccessibleFocusHandler implements FocusListener {
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor AccessibleFocusHandler * Constructor AccessibleFocusHandler
* @param component TODO * @param component TODO
...@@ -134,11 +123,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -134,11 +123,6 @@ public abstract class JComponent extends Container implements Serializable
// TODO // TODO
} // AccessibleFocusHandler() } // AccessibleFocusHandler()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* focusGained * focusGained
* @param event TODO * @param event TODO
...@@ -154,24 +138,12 @@ public abstract class JComponent extends Container implements Serializable ...@@ -154,24 +138,12 @@ public abstract class JComponent extends Container implements Serializable
public void focusLost(FocusEvent valevent) { public void focusLost(FocusEvent valevent) {
// TODO // TODO
} // focusLost() } // focusLost()
} // AccessibleFocusHandler } // AccessibleFocusHandler
/** /**
* AccessibleContainerHandler * AccessibleContainerHandler
*/ */
protected class AccessibleContainerHandler implements ContainerListener { protected class AccessibleContainerHandler implements ContainerListener {
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor AccessibleContainerHandler * Constructor AccessibleContainerHandler
* @param component TODO * @param component TODO
...@@ -180,11 +152,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -180,11 +152,6 @@ public abstract class JComponent extends Container implements Serializable
// TODO // TODO
} // AccessibleContainerHandler() } // AccessibleContainerHandler()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* componentAdded * componentAdded
* @param event TODO * @param event TODO
...@@ -200,15 +167,8 @@ public abstract class JComponent extends Container implements Serializable ...@@ -200,15 +167,8 @@ public abstract class JComponent extends Container implements Serializable
public void componentRemoved(ContainerEvent valevent) { public void componentRemoved(ContainerEvent valevent) {
// TODO // TODO
} // componentRemoved() } // componentRemoved()
} // AccessibleContainerHandler } // AccessibleContainerHandler
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/** /**
* accessibleContainerHandler * accessibleContainerHandler
*/ */
...@@ -219,11 +179,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -219,11 +179,6 @@ public abstract class JComponent extends Container implements Serializable
*/ */
protected FocusListener accessibleFocusHandler; protected FocusListener accessibleFocusHandler;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor AccessibleJComponent * Constructor AccessibleJComponent
* @param component TODO * @param component TODO
...@@ -233,11 +188,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -233,11 +188,6 @@ public abstract class JComponent extends Container implements Serializable
// TODO // TODO
} // AccessibleJComponent() } // AccessibleJComponent()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* addPropertyChangeListener * addPropertyChangeListener
* @param listener TODO * @param listener TODO
...@@ -327,7 +277,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -327,7 +277,6 @@ public abstract class JComponent extends Container implements Serializable
//updateUI(); // get a proper ui //updateUI(); // get a proper ui
} }
// protected EventListenerList listenerList // protected EventListenerList listenerList
public boolean contains(int x, int y) public boolean contains(int x, int y)
{ {
...@@ -335,14 +284,12 @@ public abstract class JComponent extends Container implements Serializable ...@@ -335,14 +284,12 @@ public abstract class JComponent extends Container implements Serializable
return super.contains(x,y); return super.contains(x,y);
} }
public void addNotify() public void addNotify()
{ {
//Notification to this component that it now has a parent component. //Notification to this component that it now has a parent component.
super.addNotify(); super.addNotify();
} }
Hashtable get_prop_hash() Hashtable get_prop_hash()
{ {
if (prop_hash == null) if (prop_hash == null)
...@@ -374,7 +321,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -374,7 +321,6 @@ public abstract class JComponent extends Container implements Serializable
public void putClientProperty(Object key, Object value) public void putClientProperty(Object key, Object value)
{ get_prop_hash().put(key, value); } { get_prop_hash().put(key, value); }
public void removeAncestorListener(AncestorListener listener) public void removeAncestorListener(AncestorListener listener)
{ get_ancestor_list().removeElement(listener); } { get_ancestor_list().removeElement(listener); }
...@@ -405,7 +351,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -405,7 +351,6 @@ public abstract class JComponent extends Container implements Serializable
//super.computeVisibleRect(rect); //super.computeVisibleRect(rect);
} }
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
{ {
//Reports a bound property change. //Reports a bound property change.
...@@ -446,7 +391,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -446,7 +391,6 @@ public abstract class JComponent extends Container implements Serializable
// Reports a bound property change. // Reports a bound property change.
} }
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue)
{ {
// Support for reporting constrained property changes. // Support for reporting constrained property changes.
...@@ -658,16 +602,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -658,16 +602,6 @@ public abstract class JComponent extends Container implements Serializable
} }
} }
/*********************************************************************
*
*
* tooltips:
*
*
**************************************/
public JToolTip createToolTip() public JToolTip createToolTip()
{ {
if (tooltip == null) if (tooltip == null)
...@@ -687,15 +621,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -687,15 +621,6 @@ public abstract class JComponent extends Container implements Serializable
public String getToolTipText(MouseEvent event) public String getToolTipText(MouseEvent event)
{ return tool_tip_text; } { return tool_tip_text; }
/*********************************************************************
*
*
* things to do with visibility:
*
*
**************************************/
public Container getTopLevelAncestor() public Container getTopLevelAncestor()
{ {
// Returns the top-level ancestor of this component (either the containing Window or Applet), or null if this component has not been added to any container. // Returns the top-level ancestor of this component (either the containing Window or Applet), or null if this component has not been added to any container.
...@@ -953,7 +878,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -953,7 +878,6 @@ public abstract class JComponent extends Container implements Serializable
// If true this component will automatically scroll its contents when dragged, if contained in a component that supports scrolling, such as JViewport // If true this component will automatically scroll its contents when dragged, if contained in a component that supports scrolling, such as JViewport
} }
public void setDebugGraphicsOptions(int debugOptions) public void setDebugGraphicsOptions(int debugOptions)
{ {
// Enables or disables diagnostic information about every graphics operation performed within the component or one of its children. // Enables or disables diagnostic information about every graphics operation performed within the component or one of its children.
...@@ -977,6 +901,7 @@ public abstract class JComponent extends Container implements Serializable ...@@ -977,6 +901,7 @@ public abstract class JComponent extends Container implements Serializable
revalidate(); revalidate();
repaint(); repaint();
} }
public void setBackground(Color bg) public void setBackground(Color bg)
{ {
super.setBackground(bg); super.setBackground(bg);
...@@ -1043,16 +968,6 @@ public abstract class JComponent extends Container implements Serializable ...@@ -1043,16 +968,6 @@ public abstract class JComponent extends Container implements Serializable
paint(g); paint(g);
} }
/******************************************
*
*
* UI management
*
*
*********/
public String getUIClassID() public String getUIClassID()
{ {
/// Return the UIDefaults key used to look up the name of the swing. /// Return the UIDefaults key used to look up the name of the swing.
......
...@@ -35,11 +35,27 @@ this exception to your version of the library, but you are not ...@@ -35,11 +35,27 @@ 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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package javax.swing; package javax.swing;
/**
* STUBBED import java.awt.Component;
*/ import java.awt.Container;
import javax.accessibility.Accessible;
public class JInternalFrame extends JComponent public class JInternalFrame extends JComponent
/*implements Accessible, WindowConstants, RootPaneContainer*/ /*implements Accessible, WindowConstants, RootPaneContainer*/
{ {
private static final long serialVersionUID = -5425177187760785402L;
public static final String CONTENT_PANE_PROPERTY = "contentPane";
public static final String MENU_BAR_PROPERTY = "JMenuBar";
public static final String TITLE_PROPERTY = "title";
public static final String LAYERED_PANE_PROPERTY = "layeredPane";
public static final String ROOT_PANE_PROPERTY = "rootPane";
public static final String GLASS_PANE_PROPERTY = "glassPane";
public static final String FRAME_ICON_PROPERTY = "frameIcon";
public static final String IS_SELECTED_PROPERTY = "selected";
public static final String IS_CLOSED_PROPERTY = "closed";
public static final String IS_MAXIMUM_PROPERTY = "maximum";
public static final String IS_ICON_PROPERTY = "icon";
} // class JInternalFrame } // class JInternalFrame
...@@ -35,10 +35,42 @@ this exception to your version of the library, but you are not ...@@ -35,10 +35,42 @@ 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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package javax.swing; package javax.swing;
/**
* STUBBED import javax.swing.event.ChangeEvent;
*/ import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
public class MenuSelectionManager public class MenuSelectionManager
{ {
protected ChangeEvent changeEvent;
protected EventListenerList listenerList = new EventListenerList ();
protected void fireStateChanged ()
{
ChangeListener[] listeners = getChangeListeners ();
for (int i = 0; i < listeners.length; i++)
{
listeners [i].stateChanged (new ChangeEvent (this));
}
}
public void addChangeListener (ChangeListener listener)
{
listenerList.add (ChangeListener.class, listener);
}
public void removeChangeListener (ChangeListener listener)
{
listenerList.remove (ChangeListener.class, listener);
}
/** @since 1.4 */
public ChangeListener[] getChangeListeners ()
{
return (ChangeListener[]) listenerList.getListeners (ChangeListener.class);
}
} // class MenuSelectionManager } // class MenuSelectionManager
...@@ -35,20 +35,34 @@ this exception to your version of the library, but you are not ...@@ -35,20 +35,34 @@ 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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package javax.swing;
import java.awt.*;
package javax.swing;
public class SwingUtilities import java.awt.Component;
import java.awt.Container;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.lang.reflect.InvocationTargetException;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleStateSet;
public class SwingUtilities implements SwingConstants
{
public static FontMetrics getFontMetrics (Font font)
{ {
public static FontMetrics getFontMetrics ( Font font ) {
return Toolkit.getDefaultToolkit().getFontMetrics(font); return Toolkit.getDefaultToolkit().getFontMetrics(font);
} }
public static JRootPane getRootPane (Component a)
static JRootPane getRootPane(Component a)
{ {
if (a instanceof JRootPane) if (a instanceof JRootPane)
return (JRootPane) a; return (JRootPane) a;
...@@ -63,11 +77,11 @@ public class SwingUtilities ...@@ -63,11 +77,11 @@ public class SwingUtilities
return null; return null;
} }
static void updateComponentTreeUI(JFrame comp) public static void updateComponentTreeUI(JFrame comp)
{ {
} }
static public String layoutCompoundLabel(JComponent c, public static String layoutCompoundLabel(JComponent c,
FontMetrics fm, FontMetrics fm,
String text, String text,
Icon i, Icon i,
......
...@@ -35,14 +35,10 @@ this exception to your version of the library, but you are not ...@@ -35,14 +35,10 @@ 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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package javax.swing;
import java.util.*; package javax.swing;
import java.awt.event.*;
import javax.swing.event.*;
public public class ToggleButtonModel extends DefaultButtonModel
class ToggleButtonModel extends DefaultButtonModel
{ {
ToggleButtonModel(JComponent c) ToggleButtonModel(JComponent c)
{ {
......
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