home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / tree / DefaultTreeCellEditor$EditorContainer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.7 KB  |  69 lines

  1. package javax.swing.tree;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Dimension;
  7. import java.awt.Graphics;
  8. import java.awt.LayoutManager;
  9.  
  10. public class DefaultTreeCellEditor$EditorContainer extends Container {
  11.    // $FF: synthetic field
  12.    private final DefaultTreeCellEditor this$0;
  13.  
  14.    public DefaultTreeCellEditor$EditorContainer(DefaultTreeCellEditor var1) {
  15.       this.this$0 = var1;
  16.       ((Container)this).setLayout((LayoutManager)null);
  17.    }
  18.  
  19.    public void EditorContainer() {
  20.       ((Container)this).setLayout((LayoutManager)null);
  21.    }
  22.  
  23.    public void paint(Graphics var1) {
  24.       Dimension var2 = ((Component)this).getSize();
  25.       if (this.this$0.editingIcon != null) {
  26.          int var3 = Math.max(0, (((Component)this).getSize().height - this.this$0.editingIcon.getIconHeight()) / 2);
  27.          this.this$0.editingIcon.paintIcon(this, var1, 0, var3);
  28.       }
  29.  
  30.       Color var4 = this.this$0.getBorderSelectionColor();
  31.       if (var4 != null) {
  32.          var1.setColor(var4);
  33.          var1.drawRect(0, 0, var2.width - 1, var2.height - 1);
  34.       }
  35.  
  36.       super.paint(var1);
  37.    }
  38.  
  39.    public void doLayout() {
  40.       if (this.this$0.editingComponent != null) {
  41.          Dimension var1 = ((Component)this).getSize();
  42.          this.this$0.editingComponent.getPreferredSize();
  43.          this.this$0.editingComponent.setLocation(this.this$0.offset, 0);
  44.          this.this$0.editingComponent.setBounds(this.this$0.offset, 0, var1.width - this.this$0.offset, var1.height);
  45.       }
  46.  
  47.    }
  48.  
  49.    public Dimension getPreferredSize() {
  50.       if (this.this$0.editingComponent != null) {
  51.          Dimension var1 = this.this$0.editingComponent.getPreferredSize();
  52.          var1.width += this.this$0.offset + 5;
  53.          Dimension var2 = this.this$0.renderer != null ? this.this$0.renderer.getPreferredSize() : null;
  54.          if (var2 != null) {
  55.             var1.height = Math.max(var1.height, var2.height);
  56.          }
  57.  
  58.          if (this.this$0.editingIcon != null) {
  59.             var1.height = Math.max(var1.height, this.this$0.editingIcon.getIconHeight());
  60.          }
  61.  
  62.          var1.width = Math.max(var1.width, 100);
  63.          return var1;
  64.       } else {
  65.          return new Dimension(0, 0);
  66.       }
  67.    }
  68. }
  69.