MetalScrollBarUI
MetalScrollBarUI
Metal Look and Feel를 위한 ScrollBarUI 구현이에요.
본문
MetalScrollBarUI는 스크롤 바(JScrollBar)에 메탈 Look and Feel를 적용하는 UI 클래스예요. 감소/증가 버튼과 자유 서 있는(free standing) 속성을 다룹니다.
대표적인 시그니처는 다음과 같아요.
protected MetalScrollButton increaseButton
protected MetalScrollButton decreaseButton
protected int scrollBarWidth
public static final String FREE_STANDING_PROP
protected boolean isFreeStanding
public MetalScrollBarUI()
public static ComponentUI createUI(JComponent c)
protected JButton createDecreaseButton(int orientation)
protected JButton createIncreaseButton(int orientation)
protected void setThumbBounds(int x, int y, int width, int height)
주요 필드와 메서드의 동작을 살펴볼게요.
increaseButton— 증가 버튼이에요.decreaseButton— 감소 버튼이에요.scrollBarWidth— 스크롤 바의 너비예요.FREE_STANDING_PROP—JScrollBar.isFreeStanding속성의 키예요.isFreeStanding—JScrollBar.isFreeStanding속성의 값이에요.createDecreaseButton(int orientation)— 감소 뷰를 나타내는 뷰를 반환해요.createIncreaseButton(int orientation)— 증가 뷰를 나타내는 뷰를 반환해요.setThumbBounds(...)— 무효 영역(invalid area)을 늘리기 위해서만 재정의되며, 엄지(thumb) 아래의 "그림자(Shadow)"가 무효화되도록 해요.