home *** CD-ROM | disk | FTP | other *** search
/ Australian PC Authority 1999 May / may1999.iso / May / JBUILDER / JSAMPLES.Z / DebugGraphicsPanel$DebugGraphicsListener.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-30  |  2.3 KB  |  103 lines

  1. import com.sun.java.swing.AbstractButton;
  2. import com.sun.java.swing.JButton;
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5. import java.awt.event.ItemEvent;
  6. import java.awt.event.ItemListener;
  7. import java.util.EventObject;
  8.  
  9. class DebugGraphicsPanel$DebugGraphicsListener implements ItemListener, ActionListener {
  10.    // $FF: synthetic field
  11.    private final DebugGraphicsPanel this$0;
  12.    boolean repaintButton;
  13.    boolean repaintRadio;
  14.    boolean repaintCheck;
  15.    boolean repaintSlider;
  16.    boolean repaintScrollBar;
  17.  
  18.    public void actionPerformed(ActionEvent var1) {
  19.       if (((EventObject)var1).getSource() instanceof JButton) {
  20.          if (this.repaintButton) {
  21.             this.this$0.button.repaint();
  22.          }
  23.  
  24.          if (this.repaintRadio) {
  25.             this.this$0.radio.repaint();
  26.          }
  27.  
  28.          if (this.repaintCheck) {
  29.             this.this$0.check.repaint();
  30.          }
  31.  
  32.          if (this.repaintSlider) {
  33.             this.this$0.slider.repaint();
  34.          }
  35.  
  36.          if (this.repaintScrollBar) {
  37.             this.this$0.scrollbar.repaint();
  38.          }
  39.       }
  40.  
  41.    }
  42.  
  43.    public void itemStateChanged(ItemEvent var1) {
  44.       AbstractButton var2 = (AbstractButton)((EventObject)var1).getSource();
  45.       String var3 = var2.getText();
  46.       if (var3.equals("Button")) {
  47.          if (var2.isSelected()) {
  48.             this.this$0.button.setDebugGraphicsOptions(2);
  49.             this.repaintButton = true;
  50.          } else {
  51.             this.this$0.button.setDebugGraphicsOptions(-1);
  52.             this.repaintButton = false;
  53.          }
  54.       } else if (var3.equals("RadioButton")) {
  55.          if (var2.isSelected()) {
  56.             this.this$0.radio.setDebugGraphicsOptions(2);
  57.             this.repaintRadio = true;
  58.          } else {
  59.             this.this$0.radio.setDebugGraphicsOptions(-1);
  60.             this.repaintRadio = false;
  61.          }
  62.       } else if (var3.equals("Checkbox")) {
  63.          if (var2.isSelected()) {
  64.             this.this$0.check.setDebugGraphicsOptions(2);
  65.             this.repaintCheck = true;
  66.          } else {
  67.             this.this$0.check.setDebugGraphicsOptions(-1);
  68.             this.repaintCheck = false;
  69.          }
  70.       } else if (var3.equals("Slider")) {
  71.          if (var2.isSelected()) {
  72.             this.this$0.slider.setDebugGraphicsOptions(2);
  73.             this.repaintSlider = true;
  74.          } else {
  75.             this.this$0.slider.setDebugGraphicsOptions(-1);
  76.             this.repaintSlider = false;
  77.          }
  78.       } else {
  79.          if (var3.equals("ScrollBar")) {
  80.             if (var2.isSelected()) {
  81.                this.this$0.scrollbar.setDebugGraphicsOptions(2);
  82.                this.repaintScrollBar = true;
  83.                return;
  84.             }
  85.  
  86.             this.this$0.scrollbar.setDebugGraphicsOptions(-1);
  87.             this.repaintScrollBar = false;
  88.          }
  89.  
  90.       }
  91.    }
  92.  
  93.    DebugGraphicsPanel$DebugGraphicsListener(DebugGraphicsPanel var1) {
  94.       this.this$0 = var1;
  95.       this.this$0 = var1;
  96.       this.repaintButton = false;
  97.       this.repaintRadio = false;
  98.       this.repaintCheck = false;
  99.       this.repaintSlider = false;
  100.       this.repaintScrollBar = false;
  101.    }
  102. }
  103.