home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / AbstractButton.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  15.1 KB  |  662 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Dimension;
  6. import java.awt.Graphics;
  7. import java.awt.Insets;
  8. import java.awt.ItemSelectable;
  9. import java.awt.Rectangle;
  10. import java.awt.event.ActionEvent;
  11. import java.awt.event.ActionListener;
  12. import java.awt.event.ItemEvent;
  13. import java.awt.event.ItemListener;
  14. import javax.accessibility.AccessibleState;
  15. import javax.swing.event.ChangeEvent;
  16. import javax.swing.event.ChangeListener;
  17. import javax.swing.plaf.ButtonUI;
  18. import javax.swing.plaf.UIResource;
  19.  
  20. public abstract class AbstractButton extends JComponent implements ItemSelectable, SwingConstants {
  21.    public static final String MODEL_CHANGED_PROPERTY = "model";
  22.    public static final String TEXT_CHANGED_PROPERTY = "text";
  23.    public static final String MNEMONIC_CHANGED_PROPERTY = "mnemonic";
  24.    public static final String MARGIN_CHANGED_PROPERTY = "margin";
  25.    public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY = "verticalAlignment";
  26.    public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY = "horizontalAlignment";
  27.    public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY = "verticalTextPosition";
  28.    public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY = "horizontalTextPosition";
  29.    public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted";
  30.    public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted";
  31.    public static final String ROLLOVER_ENABLED_CHANGED_PROPERTY = "rolloverEnabled";
  32.    public static final String CONTENT_AREA_FILLED_CHANGED_PROPERTY = "contentAreaFilled";
  33.    public static final String ICON_CHANGED_PROPERTY = "icon";
  34.    public static final String PRESSED_ICON_CHANGED_PROPERTY = "pressedIcon";
  35.    public static final String SELECTED_ICON_CHANGED_PROPERTY = "selectedIcon";
  36.    public static final String ROLLOVER_ICON_CHANGED_PROPERTY = "rolloverIcon";
  37.    public static final String ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY = "rolloverSelectedIcon";
  38.    public static final String DISABLED_ICON_CHANGED_PROPERTY = "disabledIcon";
  39.    public static final String DISABLED_SELECTED_ICON_CHANGED_PROPERTY = "disabledSelectedIcon";
  40.    protected ButtonModel model = null;
  41.    private String text = "";
  42.    private Insets margin = null;
  43.    private Insets defaultMargin = null;
  44.    private Icon defaultIcon = null;
  45.    private Icon pressedIcon = null;
  46.    private Icon disabledIcon = null;
  47.    private Icon selectedIcon = null;
  48.    private Icon disabledSelectedIcon = null;
  49.    private Icon rolloverIcon = null;
  50.    private Icon rolloverSelectedIcon = null;
  51.    private boolean paintBorder = true;
  52.    private boolean paintFocus = true;
  53.    private boolean rolloverEnabled = false;
  54.    private boolean contentAreaFilled = true;
  55.    private int verticalAlignment = 0;
  56.    private int horizontalAlignment = 0;
  57.    private int verticalTextPosition = 0;
  58.    private int horizontalTextPosition = 4;
  59.    protected ChangeListener changeListener = null;
  60.    protected ActionListener actionListener = null;
  61.    protected ItemListener itemListener = null;
  62.    protected transient ChangeEvent changeEvent;
  63.    // $FF: synthetic field
  64.    static Class class$javax$swing$event$ChangeListener;
  65.    // $FF: synthetic field
  66.    static Class class$java$awt$event$ActionListener;
  67.    // $FF: synthetic field
  68.    static Class class$java$awt$event$ItemListener;
  69.  
  70.    public void addActionListener(ActionListener var1) {
  71.       super.listenerList.add(class$java$awt$event$ActionListener != null ? class$java$awt$event$ActionListener : (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")), var1);
  72.    }
  73.  
  74.    public void addChangeListener(ChangeListener var1) {
  75.       super.listenerList.add(class$javax$swing$event$ChangeListener != null ? class$javax$swing$event$ChangeListener : (class$javax$swing$event$ChangeListener = class$("javax.swing.event.ChangeListener")), var1);
  76.    }
  77.  
  78.    public void addItemListener(ItemListener var1) {
  79.       super.listenerList.add(class$java$awt$event$ItemListener != null ? class$java$awt$event$ItemListener : (class$java$awt$event$ItemListener = class$("java.awt.event.ItemListener")), var1);
  80.    }
  81.  
  82.    protected int checkHorizontalKey(int var1, String var2) {
  83.       if (var1 != 2 && var1 != 0 && var1 != 4 && var1 != 10 && var1 != 11) {
  84.          throw new IllegalArgumentException(var2);
  85.       } else {
  86.          return var1;
  87.       }
  88.    }
  89.  
  90.    protected int checkVerticalKey(int var1, String var2) {
  91.       if (var1 != 1 && var1 != 0 && var1 != 3) {
  92.          throw new IllegalArgumentException(var2);
  93.       } else {
  94.          return var1;
  95.       }
  96.    }
  97.  
  98.    // $FF: synthetic method
  99.    static Class class$(String var0) {
  100.       try {
  101.          return Class.forName(var0);
  102.       } catch (ClassNotFoundException var2) {
  103.          throw new NoClassDefFoundError(((Throwable)var2).getMessage());
  104.       }
  105.    }
  106.  
  107.    protected ActionListener createActionListener() {
  108.       return new ForwardActionEvents(this);
  109.    }
  110.  
  111.    protected ChangeListener createChangeListener() {
  112.       return new ButtonChangeListener(this);
  113.    }
  114.  
  115.    protected ItemListener createItemListener() {
  116.       return new ForwardItemEvents(this);
  117.    }
  118.  
  119.    public void doClick() {
  120.       this.doClick(68);
  121.    }
  122.  
  123.    public void doClick(int var1) {
  124.       Dimension var2 = ((Component)this).getSize();
  125.       this.model.setArmed(true);
  126.       this.model.setPressed(true);
  127.       ((JComponent)this).paintImmediately(new Rectangle(0, 0, var2.width, var2.height));
  128.  
  129.       try {
  130.          Thread.currentThread();
  131.          Thread.sleep((long)var1);
  132.       } catch (InterruptedException var3) {
  133.       }
  134.  
  135.       this.model.setPressed(false);
  136.       this.model.setArmed(false);
  137.    }
  138.  
  139.    protected void fireActionPerformed(ActionEvent var1) {
  140.       Object[] var2 = super.listenerList.getListenerList();
  141.       ActionEvent var3 = null;
  142.  
  143.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  144.          if (var2[var4] == (class$java$awt$event$ActionListener != null ? class$java$awt$event$ActionListener : (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")))) {
  145.             if (var3 == null) {
  146.                String var5 = var1.getActionCommand();
  147.                if (var5 == null) {
  148.                   var5 = this.getActionCommand();
  149.                }
  150.  
  151.                var3 = new ActionEvent(this, 1001, var5, var1.getModifiers());
  152.             }
  153.  
  154.             ((ActionListener)var2[var4 + 1]).actionPerformed(var3);
  155.          }
  156.       }
  157.  
  158.    }
  159.  
  160.    protected void fireItemStateChanged(ItemEvent var1) {
  161.       Object[] var2 = super.listenerList.getListenerList();
  162.       ItemEvent var3 = null;
  163.  
  164.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  165.          if (var2[var4] == (class$java$awt$event$ItemListener != null ? class$java$awt$event$ItemListener : (class$java$awt$event$ItemListener = class$("java.awt.event.ItemListener")))) {
  166.             if (var3 == null) {
  167.                var3 = new ItemEvent(this, 701, this, var1.getStateChange());
  168.             }
  169.  
  170.             ((ItemListener)var2[var4 + 1]).itemStateChanged(var3);
  171.          }
  172.       }
  173.  
  174.    }
  175.  
  176.    protected void fireStateChanged() {
  177.       Object[] var1 = super.listenerList.getListenerList();
  178.  
  179.       for(int var2 = var1.length - 2; var2 >= 0; var2 -= 2) {
  180.          if (var1[var2] == (class$javax$swing$event$ChangeListener != null ? class$javax$swing$event$ChangeListener : (class$javax$swing$event$ChangeListener = class$("javax.swing.event.ChangeListener")))) {
  181.             if (this.changeEvent == null) {
  182.                this.changeEvent = new ChangeEvent(this);
  183.             }
  184.  
  185.             ((ChangeListener)var1[var2 + 1]).stateChanged(this.changeEvent);
  186.          }
  187.       }
  188.  
  189.    }
  190.  
  191.    public String getActionCommand() {
  192.       String var1 = this.getModel().getActionCommand();
  193.       if (var1 == null) {
  194.          var1 = this.getText();
  195.       }
  196.  
  197.       return var1;
  198.    }
  199.  
  200.    public Icon getDisabledIcon() {
  201.       if (this.disabledIcon == null && this.defaultIcon != null && this.defaultIcon instanceof ImageIcon) {
  202.          this.disabledIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon)this.defaultIcon).getImage()));
  203.       }
  204.  
  205.       return this.disabledIcon;
  206.    }
  207.  
  208.    public Icon getDisabledSelectedIcon() {
  209.       if (this.disabledSelectedIcon == null) {
  210.          if (this.selectedIcon == null || !(this.selectedIcon instanceof ImageIcon)) {
  211.             return this.disabledIcon;
  212.          }
  213.  
  214.          this.disabledSelectedIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon)this.selectedIcon).getImage()));
  215.       }
  216.  
  217.       return this.disabledSelectedIcon;
  218.    }
  219.  
  220.    public int getHorizontalAlignment() {
  221.       return this.horizontalAlignment;
  222.    }
  223.  
  224.    public int getHorizontalTextPosition() {
  225.       return this.horizontalTextPosition;
  226.    }
  227.  
  228.    public Icon getIcon() {
  229.       return this.defaultIcon;
  230.    }
  231.  
  232.    /** @deprecated */
  233.    public String getLabel() {
  234.       return this.getText();
  235.    }
  236.  
  237.    public Insets getMargin() {
  238.       return this.margin;
  239.    }
  240.  
  241.    public int getMnemonic() {
  242.       return this.model.getMnemonic();
  243.    }
  244.  
  245.    public ButtonModel getModel() {
  246.       return this.model;
  247.    }
  248.  
  249.    public Icon getPressedIcon() {
  250.       return this.pressedIcon;
  251.    }
  252.  
  253.    public Icon getRolloverIcon() {
  254.       return this.rolloverIcon;
  255.    }
  256.  
  257.    public Icon getRolloverSelectedIcon() {
  258.       return this.rolloverSelectedIcon;
  259.    }
  260.  
  261.    public Icon getSelectedIcon() {
  262.       return this.selectedIcon;
  263.    }
  264.  
  265.    public synchronized Object[] getSelectedObjects() {
  266.       if (!this.isSelected()) {
  267.          return null;
  268.       } else {
  269.          Object[] var1 = new Object[]{this.getText()};
  270.          return var1;
  271.       }
  272.    }
  273.  
  274.    public String getText() {
  275.       return this.text;
  276.    }
  277.  
  278.    public ButtonUI getUI() {
  279.       return (ButtonUI)super.ui;
  280.    }
  281.  
  282.    public int getVerticalAlignment() {
  283.       return this.verticalAlignment;
  284.    }
  285.  
  286.    public int getVerticalTextPosition() {
  287.       return this.verticalTextPosition;
  288.    }
  289.  
  290.    protected void init(String var1, Icon var2) {
  291.       ((Container)this).setLayout(new OverlayLayout(this));
  292.       if (var1 != null) {
  293.          this.setText(var1);
  294.       }
  295.  
  296.       if (var2 != null) {
  297.          this.setIcon(var2);
  298.       }
  299.  
  300.       this.updateUI();
  301.       ((Component)this).addFocusListener(new 1(this));
  302.       ((JComponent)this).setAlignmentX(0.0F);
  303.    }
  304.  
  305.    public boolean isBorderPainted() {
  306.       return this.paintBorder;
  307.    }
  308.  
  309.    public boolean isContentAreaFilled() {
  310.       return this.contentAreaFilled;
  311.    }
  312.  
  313.    public boolean isFocusPainted() {
  314.       return this.paintFocus;
  315.    }
  316.  
  317.    public boolean isRolloverEnabled() {
  318.       return this.rolloverEnabled;
  319.    }
  320.  
  321.    public boolean isSelected() {
  322.       return this.model.isSelected();
  323.    }
  324.  
  325.    protected void paintBorder(Graphics var1) {
  326.       if (this.isBorderPainted()) {
  327.          super.paintBorder(var1);
  328.       }
  329.  
  330.    }
  331.  
  332.    protected String paramString() {
  333.       String var1 = this.defaultIcon != null ? this.defaultIcon.toString() : "";
  334.       String var2 = this.pressedIcon != null ? this.pressedIcon.toString() : "";
  335.       String var3 = this.disabledIcon != null ? this.disabledIcon.toString() : "";
  336.       String var4 = this.selectedIcon != null ? this.selectedIcon.toString() : "";
  337.       String var5 = this.disabledSelectedIcon != null ? this.disabledSelectedIcon.toString() : "";
  338.       String var6 = this.rolloverIcon != null ? this.rolloverIcon.toString() : "";
  339.       String var7 = this.rolloverSelectedIcon != null ? this.rolloverSelectedIcon.toString() : "";
  340.       String var8 = this.paintBorder ? "true" : "false";
  341.       String var9 = this.paintFocus ? "true" : "false";
  342.       String var10 = this.rolloverEnabled ? "true" : "false";
  343.       return super.paramString() + ",defaultIcon=" + var1 + ",disabledIcon=" + var3 + ",disabledSelectedIcon=" + var5 + ",margin=" + this.margin + ",paintBorder=" + var8 + ",paintFocus=" + var9 + ",pressedIcon=" + var2 + ",rolloverEnabled=" + var10 + ",rolloverIcon=" + var6 + ",rolloverSelectedIcon=" + var7 + ",selectedIcon=" + var4 + ",text=" + this.text;
  344.    }
  345.  
  346.    public void removeActionListener(ActionListener var1) {
  347.       super.listenerList.remove(class$java$awt$event$ActionListener != null ? class$java$awt$event$ActionListener : (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")), var1);
  348.    }
  349.  
  350.    public void removeChangeListener(ChangeListener var1) {
  351.       super.listenerList.remove(class$javax$swing$event$ChangeListener != null ? class$javax$swing$event$ChangeListener : (class$javax$swing$event$ChangeListener = class$("javax.swing.event.ChangeListener")), var1);
  352.    }
  353.  
  354.    public void removeItemListener(ItemListener var1) {
  355.       super.listenerList.remove(class$java$awt$event$ItemListener != null ? class$java$awt$event$ItemListener : (class$java$awt$event$ItemListener = class$("java.awt.event.ItemListener")), var1);
  356.    }
  357.  
  358.    public void setActionCommand(String var1) {
  359.       this.getModel().setActionCommand(var1);
  360.    }
  361.  
  362.    public void setBorderPainted(boolean var1) {
  363.       boolean var2 = this.paintBorder;
  364.       this.paintBorder = var1;
  365.       ((JComponent)this).firePropertyChange("borderPainted", var2, this.paintBorder);
  366.       if (var1 != var2) {
  367.          ((JComponent)this).revalidate();
  368.          ((Component)this).repaint();
  369.       }
  370.  
  371.    }
  372.  
  373.    public void setContentAreaFilled(boolean var1) {
  374.       boolean var2 = this.contentAreaFilled;
  375.       this.contentAreaFilled = var1;
  376.       ((JComponent)this).firePropertyChange("contentAreaFilled", var2, this.contentAreaFilled);
  377.       if (var1 != var2) {
  378.          ((Component)this).repaint();
  379.       }
  380.  
  381.    }
  382.  
  383.    public void setDisabledIcon(Icon var1) {
  384.       Icon var2 = this.disabledIcon;
  385.       this.disabledIcon = var1;
  386.       ((JComponent)this).firePropertyChange("disabledIcon", var2, var1);
  387.       if (super.accessibleContext != null) {
  388.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, var1);
  389.       }
  390.  
  391.       if (var1 != var2 && !((Component)this).isEnabled()) {
  392.          ((Component)this).repaint();
  393.       }
  394.  
  395.    }
  396.  
  397.    public void setDisabledSelectedIcon(Icon var1) {
  398.       Icon var2 = this.disabledSelectedIcon;
  399.       this.disabledSelectedIcon = var1;
  400.       ((JComponent)this).firePropertyChange("disabledSelectedIcon", var2, var1);
  401.       if (super.accessibleContext != null) {
  402.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, var1);
  403.       }
  404.  
  405.       if (var1 != var2) {
  406.          if (var1 == null || var2 == null || var1.getIconWidth() != var2.getIconWidth() || var1.getIconHeight() != var2.getIconHeight()) {
  407.             ((JComponent)this).revalidate();
  408.          }
  409.  
  410.          if (!((Component)this).isEnabled() && this.isSelected()) {
  411.             ((Component)this).repaint();
  412.          }
  413.       }
  414.  
  415.    }
  416.  
  417.    public void setEnabled(boolean var1) {
  418.       super.setEnabled(var1);
  419.       this.model.setEnabled(var1);
  420.    }
  421.  
  422.    public void setFocusPainted(boolean var1) {
  423.       boolean var2 = this.paintFocus;
  424.       this.paintFocus = var1;
  425.       ((JComponent)this).firePropertyChange("focusPainted", var2, this.paintFocus);
  426.       if (var1 != var2 && ((JComponent)this).hasFocus()) {
  427.          ((JComponent)this).revalidate();
  428.          ((Component)this).repaint();
  429.       }
  430.  
  431.    }
  432.  
  433.    public void setHorizontalAlignment(int var1) {
  434.       if (var1 != this.horizontalAlignment) {
  435.          int var2 = this.horizontalAlignment;
  436.          this.horizontalAlignment = this.checkHorizontalKey(var1, "horizontalAlignment");
  437.          ((JComponent)this).firePropertyChange("horizontalAlignment", var2, this.horizontalAlignment);
  438.          ((Component)this).repaint();
  439.       }
  440.    }
  441.  
  442.    public void setHorizontalTextPosition(int var1) {
  443.       if (var1 != this.horizontalTextPosition) {
  444.          int var2 = this.horizontalTextPosition;
  445.          this.horizontalTextPosition = this.checkHorizontalKey(var1, "horizontalTextPosition");
  446.          ((JComponent)this).firePropertyChange("horizontalTextPosition", var2, this.horizontalTextPosition);
  447.          ((Component)this).repaint();
  448.       }
  449.    }
  450.  
  451.    public void setIcon(Icon var1) {
  452.       Icon var2 = this.defaultIcon;
  453.       this.defaultIcon = var1;
  454.       ((JComponent)this).firePropertyChange("icon", var2, var1);
  455.       if (super.accessibleContext != null) {
  456.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, var1);
  457.       }
  458.  
  459.       if (var1 != var2) {
  460.          if (var1 == null || var2 == null || var1.getIconWidth() != var2.getIconWidth() || var1.getIconHeight() != var2.getIconHeight()) {
  461.             ((JComponent)this).revalidate();
  462.          }
  463.  
  464.          ((Component)this).repaint();
  465.       }
  466.  
  467.    }
  468.  
  469.    /** @deprecated */
  470.    public void setLabel(String var1) {
  471.       this.setText(var1);
  472.    }
  473.  
  474.    public void setMargin(Insets var1) {
  475.       if (var1 instanceof UIResource) {
  476.          this.defaultMargin = var1;
  477.       } else if (this.margin instanceof UIResource) {
  478.          this.defaultMargin = this.margin;
  479.       }
  480.  
  481.       if (var1 == null && this.defaultMargin != null) {
  482.          var1 = this.defaultMargin;
  483.       }
  484.  
  485.       Insets var2 = this.margin;
  486.       this.margin = var1;
  487.       ((JComponent)this).firePropertyChange("margin", var2, var1);
  488.       if (var2 == null || !var1.equals(var2)) {
  489.          ((JComponent)this).revalidate();
  490.          ((Component)this).repaint();
  491.       }
  492.  
  493.    }
  494.  
  495.    public void setMnemonic(char var1) {
  496.       int var2 = var1;
  497.       if (var1 >= 'a' && var1 <= 'z') {
  498.          var2 = var1 - 32;
  499.       }
  500.  
  501.       this.setMnemonic(var2);
  502.    }
  503.  
  504.    public void setMnemonic(int var1) {
  505.       int var2 = this.getMnemonic();
  506.       this.model.setMnemonic(var1);
  507.       ((JComponent)this).firePropertyChange("mnemonic", var2, var1);
  508.       if (var1 != var2) {
  509.          ((JComponent)this).revalidate();
  510.          ((Component)this).repaint();
  511.       }
  512.  
  513.    }
  514.  
  515.    public void setModel(ButtonModel var1) {
  516.       ButtonModel var2 = this.getModel();
  517.       if (var2 != null) {
  518.          var2.removeChangeListener(this.changeListener);
  519.          var2.removeActionListener(this.actionListener);
  520.          this.changeListener = null;
  521.          this.actionListener = null;
  522.       }
  523.  
  524.       this.model = var1;
  525.       if (var1 != null) {
  526.          this.changeListener = this.createChangeListener();
  527.          this.actionListener = this.createActionListener();
  528.          this.itemListener = this.createItemListener();
  529.          var1.addChangeListener(this.changeListener);
  530.          var1.addActionListener(this.actionListener);
  531.          var1.addItemListener(this.itemListener);
  532.       }
  533.  
  534.       ((JComponent)this).firePropertyChange("model", var2, var1);
  535.       if (var1 != var2) {
  536.          ((JComponent)this).revalidate();
  537.          ((Component)this).repaint();
  538.       }
  539.  
  540.    }
  541.  
  542.    public void setPressedIcon(Icon var1) {
  543.       Icon var2 = this.pressedIcon;
  544.       this.pressedIcon = var1;
  545.       ((JComponent)this).firePropertyChange("pressedIcon", var2, var1);
  546.       if (super.accessibleContext != null) {
  547.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, this.defaultIcon);
  548.       }
  549.  
  550.       if (var1 != var2 && this.getModel().isPressed()) {
  551.          ((Component)this).repaint();
  552.       }
  553.  
  554.    }
  555.  
  556.    public void setRolloverEnabled(boolean var1) {
  557.       boolean var2 = this.rolloverEnabled;
  558.       this.rolloverEnabled = var1;
  559.       ((JComponent)this).firePropertyChange("rolloverEnabled", var2, this.rolloverEnabled);
  560.       if (var1 != var2) {
  561.          ((Component)this).repaint();
  562.       }
  563.  
  564.    }
  565.  
  566.    public void setRolloverIcon(Icon var1) {
  567.       Icon var2 = this.rolloverIcon;
  568.       this.rolloverIcon = var1;
  569.       ((JComponent)this).firePropertyChange("rolloverIcon", var2, var1);
  570.       if (super.accessibleContext != null) {
  571.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, var1);
  572.       }
  573.  
  574.       this.setRolloverEnabled(true);
  575.       if (var1 != var2) {
  576.          ((Component)this).repaint();
  577.       }
  578.  
  579.    }
  580.  
  581.    public void setRolloverSelectedIcon(Icon var1) {
  582.       Icon var2 = this.rolloverSelectedIcon;
  583.       this.rolloverSelectedIcon = var1;
  584.       ((JComponent)this).firePropertyChange("rolloverSelectedIcon", var2, var1);
  585.       if (super.accessibleContext != null) {
  586.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, var1);
  587.       }
  588.  
  589.       if (var1 != var2 && this.isSelected()) {
  590.          ((Component)this).repaint();
  591.       }
  592.  
  593.    }
  594.  
  595.    public void setSelected(boolean var1) {
  596.       boolean var2 = this.isSelected();
  597.       if (super.accessibleContext != null && var2 != var1) {
  598.          if (var1) {
  599.             super.accessibleContext.firePropertyChange("AccessibleState", (Object)null, AccessibleState.SELECTED);
  600.          } else {
  601.             super.accessibleContext.firePropertyChange("AccessibleState", AccessibleState.SELECTED, (Object)null);
  602.          }
  603.       }
  604.  
  605.       this.model.setSelected(var1);
  606.    }
  607.  
  608.    public void setSelectedIcon(Icon var1) {
  609.       Icon var2 = this.selectedIcon;
  610.       this.selectedIcon = var1;
  611.       ((JComponent)this).firePropertyChange("selectedIcon", var2, var1);
  612.       if (super.accessibleContext != null) {
  613.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, var1);
  614.       }
  615.  
  616.       if (var1 != var2 && this.isSelected()) {
  617.          ((Component)this).repaint();
  618.       }
  619.  
  620.    }
  621.  
  622.    public void setText(String var1) {
  623.       String var2 = this.text;
  624.       this.text = var1;
  625.       ((JComponent)this).firePropertyChange("text", var2, var1);
  626.       if (super.accessibleContext != null) {
  627.          super.accessibleContext.firePropertyChange("AccessibleVisibleData", var2, var1);
  628.       }
  629.  
  630.       if (var1 == null || var2 == null || !var1.equals(var2)) {
  631.          ((JComponent)this).revalidate();
  632.          ((Component)this).repaint();
  633.       }
  634.  
  635.    }
  636.  
  637.    public void setUI(ButtonUI var1) {
  638.       super.setUI(var1);
  639.    }
  640.  
  641.    public void setVerticalAlignment(int var1) {
  642.       if (var1 != this.verticalAlignment) {
  643.          int var2 = this.verticalAlignment;
  644.          this.verticalAlignment = this.checkVerticalKey(var1, "verticalAlignment");
  645.          ((JComponent)this).firePropertyChange("verticalAlignment", var2, this.verticalAlignment);
  646.          ((Component)this).repaint();
  647.       }
  648.    }
  649.  
  650.    public void setVerticalTextPosition(int var1) {
  651.       if (var1 != this.verticalTextPosition) {
  652.          int var2 = this.verticalTextPosition;
  653.          this.verticalTextPosition = this.checkVerticalKey(var1, "verticalTextPosition");
  654.          ((JComponent)this).firePropertyChange("verticalTextPosition", var2, this.verticalTextPosition);
  655.          ((Component)this).repaint();
  656.       }
  657.    }
  658.  
  659.    public void updateUI() {
  660.    }
  661. }
  662.