summaryrefslogtreecommitdiff
path: root/libjava/java/awt/MenuComponent.java
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@albatross.co.nz>2000-07-12 03:32:07 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2000-07-12 04:32:07 +0100
commitc7a136d3ef16cf20fcd5314036508e31870b4849 (patch)
treed9865dd4f3595d22c9fd5c93cc63eb0b226278d6 /libjava/java/awt/MenuComponent.java
parent406a65d0db1eb80f45a7a3bf8c85f534e1a3960a (diff)
downloadgcc-c7a136d3ef16cf20fcd5314036508e31870b4849.tar.gz
Big AWT patch.
From-SVN: r34976
Diffstat (limited to 'libjava/java/awt/MenuComponent.java')
-rw-r--r--libjava/java/awt/MenuComponent.java111
1 files changed, 107 insertions, 4 deletions
diff --git a/libjava/java/awt/MenuComponent.java b/libjava/java/awt/MenuComponent.java
index e18314dd626..5c0ea69419a 100644
--- a/libjava/java/awt/MenuComponent.java
+++ b/libjava/java/awt/MenuComponent.java
@@ -1,15 +1,118 @@
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2000 Free Software Foundation
- This file is part of libjava.
+ This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
-Libjava License. Please consult the file "LIBJAVA_LICENSE" for
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt;
-/* A very incomplete placeholder. */
+/* Status: partially complete, untested. */
public abstract class MenuComponent
{
+ // Fields from the serialization spec. Decalare others "transient".
+ Font font;
+ String name;
+ boolean nameExplicitlySet;
+ boolean newEventsOnly;
+ //AccessibleContext accessibleContext;
+
+ transient MenuContainer parent;
+ transient java.awt.peer.MenuComponentPeer peer;
+
+ public MenuComponent()
+ {
+ }
+
+ public String getName()
+ {
+ if (name == null && !nameExplicitlySet)
+ name = generateName();
+ return name;
+ }
+
+ /** Subclasses should override this to generate unique names like
+ * "menuitem0".
+ */
+ String generateName()
+ {
+ // MenuComponent is abstract.
+ return null;
+ }
+
+ public void setName(String name)
+ {
+ nameExplicitlySet = true;
+ this.name = name;
+ }
+
+ public MenuContainer getParent()
+ {
+ return parent;
+ }
+
+ /** @deprecated Don't use this. */
+ public java.awt.peer.MenuComponentPeer getPeer()
+ {
+ return peer;
+ }
+
+ public Font getFont()
+ {
+ return font;
+ }
+
+ public void setFont(Font f)
+ {
+ this.font = f;
+ }
+
+ public void removeNotify()
+ {
+ // FIXME
+ }
+
+ /** @deprecated Replaced by dispatchEvent(AWTEvent) */
+ public boolean postEvent(Event evt)
+ {
+ return false;
+ }
+
+ public final void dispatchEvent(AWTEvent e)
+ {
+ // FIXME
+ dispatchEventImpl(e);
+ }
+
+ void dispatchEventImpl(AWTEvent e)
+ {
+ // This is overridden by subclasses that support events.
+ }
+
+ protected void processEvent(AWTEvent e)
+ {
+ // Nothing to do here? This is be overridden by subclasses that
+ // support events.
+ }
+
+ protected String paramString()
+ {
+ return name;
+ }
+
+ public String toString()
+ {
+ return this.getClass().getName() + "[" + paramString() + "]";
+ }
+
+ protected final Object getTreeLock()
+ {
+ // FIXME: figure out how the tree lock works.
+ return null;
+ }
+
+ // Accessibility API not yet implemented.
+ // public AccessibleContext getAccessibleContext()
}