public ScrollBarButtonPainter(Which state){
  super();
  this.state=state;
  this.ctx=new PaintContext(CacheMode.FIXED_SIZES);
  isPressed=false;
  isDisabled=false;
switch (state) {
case FOREGROUND_DISABLED:
    isDisabled=true;
  isIncrease=false;
buttonsTogether=false;
break;
case FOREGROUND_DISABLED_TOGETHER:
isDisabled=true;
isIncrease=false;
buttonsTogether=true;
break;
case FOREGROUND_ENABLED:
isIncrease=false;
buttonsTogether=false;
break;
case FOREGROUND_ENABLED_TOGETHER:
isIncrease=false;
buttonsTogether=true;
break;
case FOREGROUND_PRESSED:
isPressed=true;
isIncrease=false;
buttonsTogether=false;
break;
case FOREGROUND_PRESSED_TOGETHER:
isPressed=true;
isIncrease=false;
buttonsTogether=true;
break;
case FOREGROUND_INCREASE_DISABLED:
isDisabled=true;
isIncrease=true;
buttonsTogether=false;
break;
case FOREGROUND_INCREASE_DISABLED_TOGETHER:
isDisabled=true;
isIncrease=true;
buttonsTogether=true;
break;
case FOREGROUND_INCREASE_ENABLED:
isIncrease=true;
buttonsTogether=false;
break;
case FOREGROUND_INCREASE_ENABLED_TOGETHER:
isIncrease=true;
buttonsTogether=true;
break;
case FOREGROUND_INCREASE_PRESSED:
isPressed=true;
isIncrease=true;
buttonsTogether=false;
break;
case FOREGROUND_INCREASE_PRESSED_TOGETHER:
isPressed=true;
isIncrease=true;
buttonsTogether=true;
break;
case FOREGROUND_CAP:
isIncrease=false;
buttonsTogether=true;
break;
}
}

public ScrollBarButtonPainter ( Which state ) { super ( ) ; this . state = state ; this . ctx = new PaintContext ( CacheMode . FIXED_SIZES ) ; isPressed = false ; isDisabled = false ; switch ( state ) { case FOREGROUND_DISABLED : isDisabled = true ; isIncrease = false ; buttonsTogether = false ; break ; case FOREGROUND_DISABLED_TOGETHER : isDisabled = true ; isIncrease = false ; buttonsTogether = true ; break ; case FOREGROUND_ENABLED : isIncrease = false ; buttonsTogether = false ; break ; case FOREGROUND_ENABLED_TOGETHER : isIncrease = false ; buttonsTogether = true ; break ; case FOREGROUND_PRESSED : isPressed = true ; isIncrease = false ; buttonsTogether = false ; break ; case FOREGROUND_PRESSED_TOGETHER : isPressed = true ; isIncrease = false ; buttonsTogether = true ; break ; case FOREGROUND_INCREASE_DISABLED : isDisabled = true ; isIncrease = true ; buttonsTogether = false ; break ; case FOREGROUND_INCREASE_DISABLED_TOGETHER : isDisabled = true ; isIncrease = true ; buttonsTogether = true ; break ; case FOREGROUND_INCREASE_ENABLED : isIncrease = true ; buttonsTogether = false ; break ; case FOREGROUND_INCREASE_ENABLED_TOGETHER : isIncrease = true ; buttonsTogether = true ; break ; case FOREGROUND_INCREASE_PRESSED : isPressed = true ; isIncrease = true ; buttonsTogether = false ; break ; case FOREGROUND_INCREASE_PRESSED_TOGETHER : isPressed = true ; isIncrease = true ; buttonsTogether = true ; break ; case FOREGROUND_CAP : isIncrease = false ; buttonsTogether = true ; break ; } }
creates a new scrollbarbuttonpainter object .
