1 19 20 21 package org.netbeans.modules.form.fakepeer; 22 23 import java.awt.*; 24 25 29 class FakeScrollbarPeer extends FakeComponentPeer 30 { 31 FakeScrollbarPeer(Scrollbar target) { 32 super(target); 33 } 34 35 Component createDelegate() { 36 return new Delegate(); 37 } 38 39 public void setValues(int value, int visible, int minimum, int maximum) {} 40 public void setLineIncrement(int l) {} 41 public void setPageIncrement(int l) {} 42 43 47 private class Delegate extends Component 48 { 49 Delegate() { 50 this.setBackground(SystemColor.scrollbar); 51 } 52 53 public void paint(Graphics g) { 54 Scrollbar target = (Scrollbar) _target; 55 Dimension sz = target.getSize(); 56 int scrollRange = target.getMaximum() - target.getMinimum(); 57 int scrollValue = target.getValue() - target.getMinimum(); 58 int thumbAmount = target.getVisibleAmount(); 59 60 g.setColor(target.getBackground()); 61 62 FakePeerUtils.drawScrollbar(g, 63 0, 0, sz.width, sz.height, 64 target.getOrientation(), 65 target.isEnabled(), 66 true, 67 scrollValue, 68 thumbAmount, 69 scrollRange); 70 } 71 72 public Dimension getMinimumSize() { 73 Scrollbar target =(Scrollbar) _target; 74 return target.getOrientation() == Scrollbar.HORIZONTAL ? 75 new Dimension(3 * FakePeerUtils.SCROLL_W, FakePeerUtils.SCROLL_H) : 76 new Dimension(FakePeerUtils.SCROLL_W, 3 * FakePeerUtils.SCROLL_H); 77 } 78 } 79 } 80 | Popular Tags |