home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.peer.ButtonPeer;
- import java.io.IOException;
- import java.io.ObjectInputStream;
- import java.io.ObjectOutputStream;
- import java.util.EventListener;
- import javax.accessibility.Accessible;
- import javax.accessibility.AccessibleContext;
-
- public class Button extends Component implements Accessible {
- String label;
- String actionCommand;
- transient ActionListener actionListener;
- private static final String base = "button";
- private static int nameCounter = 0;
- private static final long serialVersionUID = -8774683716313001058L;
- private int buttonSerializedDataVersion;
- // $FF: synthetic field
- static Class class$java$awt$event$ActionListener;
-
- private static native void initIDs();
-
- public Button() {
- this("");
- }
-
- public Button(String var1) {
- this.buttonSerializedDataVersion = 1;
- this.label = var1;
- }
-
- String constructComponentName() {
- Class var1 = this.getClass();
- synchronized(var1) {
- String var2 = "button" + nameCounter++;
- return var2;
- }
- }
-
- public void addNotify() {
- Object var1 = ((Component)this).getTreeLock();
- synchronized(var1) {
- if (super.peer == null) {
- super.peer = ((Component)this).getToolkit().createButton(this);
- }
-
- super.addNotify();
- }
- }
-
- public String getLabel() {
- return this.label;
- }
-
- public void setLabel(String var1) {
- boolean var2 = false;
- synchronized(this) {
- if (var1 != this.label && (this.label == null || !this.label.equals(var1))) {
- this.label = var1;
- ButtonPeer var4 = (ButtonPeer)super.peer;
- if (var4 != null) {
- var4.setLabel(var1);
- }
-
- var2 = true;
- }
- }
-
- if (var2 && super.valid) {
- ((Component)this).invalidate();
- }
-
- }
-
- public void setActionCommand(String var1) {
- this.actionCommand = var1;
- }
-
- public String getActionCommand() {
- return this.actionCommand == null ? this.label : this.actionCommand;
- }
-
- public synchronized void addActionListener(ActionListener var1) {
- if (var1 != null) {
- this.actionListener = AWTEventMulticaster.add(this.actionListener, var1);
- super.newEventsOnly = true;
- }
- }
-
- public synchronized void removeActionListener(ActionListener var1) {
- if (var1 != null) {
- this.actionListener = AWTEventMulticaster.remove(this.actionListener, var1);
- }
- }
-
- public EventListener[] getListeners(Class var1) {
- Object var2 = null;
- if (var1 == (class$java$awt$event$ActionListener == null ? (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")) : class$java$awt$event$ActionListener)) {
- ActionListener var3 = this.actionListener;
- return AWTEventMulticaster.getListeners(var3, var1);
- } else {
- return super.getListeners(var1);
- }
- }
-
- boolean eventEnabled(AWTEvent var1) {
- if (var1.id == 1001) {
- return (super.eventMask & 128L) != 0L || this.actionListener != null;
- } else {
- return super.eventEnabled(var1);
- }
- }
-
- protected void processEvent(AWTEvent var1) {
- if (var1 instanceof ActionEvent) {
- this.processActionEvent((ActionEvent)var1);
- } else {
- super.processEvent(var1);
- }
- }
-
- protected void processActionEvent(ActionEvent var1) {
- if (this.actionListener != null) {
- this.actionListener.actionPerformed(var1);
- }
-
- }
-
- protected String paramString() {
- return super.paramString() + ",label=" + this.label;
- }
-
- private void writeObject(ObjectOutputStream var1) throws IOException {
- var1.defaultWriteObject();
- AWTEventMulticaster.save(var1, "actionL", this.actionListener);
- var1.writeObject((Object)null);
- }
-
- private void readObject(ObjectInputStream var1) throws ClassNotFoundException, IOException {
- var1.defaultReadObject();
-
- Object var2;
- while(null != (var2 = var1.readObject())) {
- String var3 = ((String)var2).intern();
- if ("actionL" == var3) {
- this.addActionListener((ActionListener)var1.readObject());
- } else {
- var1.readObject();
- }
- }
-
- }
-
- public AccessibleContext getAccessibleContext() {
- if (super.accessibleContext == null) {
- super.accessibleContext = new AccessibleAWTButton(this);
- }
-
- return super.accessibleContext;
- }
-
- // $FF: synthetic method
- static Class class$(String var0) {
- try {
- return Class.forName(var0);
- } catch (ClassNotFoundException var2) {
- throw new NoClassDefFoundError(((Throwable)var2).getMessage());
- }
- }
-
- static {
- Toolkit.loadLibraries();
- initIDs();
- }
- }
-