home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / plaf / basic / BasicSplitPaneDivider$OneTouchActionHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.5 KB  |  53 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Insets;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6.  
  7. class BasicSplitPaneDivider$OneTouchActionHandler implements ActionListener {
  8.    private boolean toMinimum;
  9.    // $FF: synthetic field
  10.    private final BasicSplitPaneDivider this$0;
  11.  
  12.    BasicSplitPaneDivider$OneTouchActionHandler(BasicSplitPaneDivider var1, boolean var2) {
  13.       this.this$0 = var1;
  14.       this.toMinimum = var2;
  15.    }
  16.  
  17.    public void actionPerformed(ActionEvent var1) {
  18.       Insets var2 = this.this$0.splitPane.getInsets();
  19.       int var3 = this.this$0.splitPane.getLastDividerLocation();
  20.       int var4 = this.this$0.splitPaneUI.getDividerLocation(this.this$0.splitPane);
  21.       int var5;
  22.       if (this.toMinimum) {
  23.          if (this.this$0.orientation == 0) {
  24.             if (var4 >= this.this$0.splitPane.getHeight() - var2.bottom - this.this$0.getDividerSize()) {
  25.                var5 = var3;
  26.             } else {
  27.                var5 = var2.top;
  28.             }
  29.          } else if (var4 >= this.this$0.splitPane.getWidth() - var2.right - this.this$0.getDividerSize()) {
  30.             var5 = var3;
  31.          } else {
  32.             var5 = var2.left;
  33.          }
  34.       } else if (this.this$0.orientation == 0) {
  35.          if (var4 == var2.top) {
  36.             var5 = var3;
  37.          } else {
  38.             var5 = this.this$0.splitPane.getHeight() - this.this$0.getHeight() - var2.top;
  39.          }
  40.       } else if (var4 == var2.left) {
  41.          var5 = var3;
  42.       } else {
  43.          var5 = this.this$0.splitPane.getWidth() - this.this$0.getWidth() - var2.left;
  44.       }
  45.  
  46.       if (var4 != var5) {
  47.          this.this$0.splitPane.setDividerLocation(var5);
  48.          this.this$0.splitPane.setLastDividerLocation(var4);
  49.       }
  50.  
  51.    }
  52. }
  53.