home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Premium Edition) / mycd.iso / INTERNET / NETSCAP4.06 / CP32E406.EXE / nav40.z / java40.jar / sun / awt / motif / MScrollbarPeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-13  |  2.1 KB  |  69 lines

  1. package sun.awt.motif;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Dimension;
  6. import java.awt.Graphics;
  7. import java.awt.Scrollbar;
  8. import java.awt.peer.ScrollbarPeer;
  9.  
  10. class MScrollbarPeer extends MComponentPeer implements ScrollbarPeer {
  11.    boolean ignore = false;
  12.  
  13.    native void create(MComponentPeer var1);
  14.  
  15.    MScrollbarPeer(Scrollbar var1) {
  16.       super(var1);
  17.    }
  18.  
  19.    native void pSetValues(int var1, int var2, int var3, int var4);
  20.  
  21.    public native void setLineIncrement(int var1);
  22.  
  23.    public native void setPageIncrement(int var1);
  24.  
  25.    public Dimension getMinimumSize() {
  26.       return ((Scrollbar)super.target).getOrientation() == 1 ? new Dimension(18, 50) : new Dimension(50, 18);
  27.    }
  28.  
  29.    public void lineUp(int var1) {
  30.       ((MComponentPeer)this).postEvent(new Adjustor(this, (Scrollbar)super.target, var1, this, 2));
  31.    }
  32.  
  33.    public void lineDown(int var1) {
  34.       ((MComponentPeer)this).postEvent(new Adjustor(this, (Scrollbar)super.target, var1, this, 1));
  35.    }
  36.  
  37.    public void pageUp(int var1) {
  38.       ((MComponentPeer)this).postEvent(new Adjustor(this, (Scrollbar)super.target, var1, this, 3));
  39.    }
  40.  
  41.    public void pageDown(int var1) {
  42.       ((MComponentPeer)this).postEvent(new Adjustor(this, (Scrollbar)super.target, var1, this, 4));
  43.    }
  44.  
  45.    public void dragAbsolute(int var1) {
  46.       ((MComponentPeer)this).postEvent(new Adjustor(this, (Scrollbar)super.target, var1, this, 5));
  47.    }
  48.  
  49.    public void print(Graphics var1) {
  50.       Scrollbar var2 = (Scrollbar)super.target;
  51.       Dimension var3 = ((Component)var2).size();
  52.       Color var4 = ((Component)var2).getBackground();
  53.       boolean var5 = var2.getOrientation() == 0;
  54.       ((MComponentPeer)this).drawScrollbar(var1, var4, var5 ? var3.height : var3.width, var5 ? var3.width : var3.height, var2.getMinimum(), var2.getMaximum(), var2.getValue(), var2.getVisible(), var5);
  55.       super.target.print(var1);
  56.    }
  57.  
  58.    public void setValues(int var1, int var2, int var3, int var4) {
  59.       if (!this.ignore) {
  60.          this.pSetValues(var1, var2, var3, var4);
  61.       }
  62.  
  63.    }
  64.  
  65.    public Dimension minimumSize() {
  66.       return this.getMinimumSize();
  67.    }
  68. }
  69.