public class SlimScrollbar extends JComponent implements ColumnScrollBar, Adjustable
JScrollBar
.JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static ColumnScrollBarFactory |
FACTORY
A factory creating new
SlimScrollbar s. |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
HORIZONTAL, NO_ORIENTATION, VERTICAL
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
SlimScrollbar()
Creates a new scrollbar
|
Modifier and Type | Method and Description |
---|---|
void |
addAdjustmentListener(AdjustmentListener listener)
Adds a listener to this scrollbar, the listener is to be called whenever the
value
changes. |
int |
getBlockIncrement() |
Component |
getComponent()
Gets a
Component which is the graphical representation of this scrollbar |
int |
getMaximum() |
int |
getMinimum() |
Dimension |
getMinimumSize() |
int |
getOrientation() |
Dimension |
getPreferredSize() |
int |
getUnitIncrement() |
int |
getValue()
Gets the offset of the scrollbar.
|
int |
getVisibleAmount() |
protected void |
paintComponent(Graphics g) |
void |
removeAdjustmentListener(AdjustmentListener listener)
Removes
listener from this scrollbar. |
void |
setBlockIncrement(int b) |
void |
setMaximum(int max) |
void |
setMinimum(int min) |
void |
setOrientation(Orientation orientation)
Sets the orientation of the scrollbar
|
void |
setUnitIncrement(int u) |
void |
setValue(int v) |
void |
setValues(int required,
int available)
Tells this scrollbar how much space is required, and how much space is available.
|
void |
setVisibleAmount(int v) |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final ColumnScrollBarFactory FACTORY
SlimScrollbar
s.public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
public void setValues(int required, int available)
ColumnScrollBar
setValues
in interface ColumnScrollBar
required
- the required pixels to show a columnavailable
- the pixels actually availablepublic int getValue()
ColumnScrollBar
0
and
available - required
.getValue
in interface ColumnScrollBar
getValue
in interface Adjustable
public Component getComponent()
ColumnScrollBar
Component
which is the graphical representation of this scrollbargetComponent
in interface ColumnScrollBar
null
public void setOrientation(Orientation orientation)
ColumnScrollBar
setOrientation
in interface ColumnScrollBar
orientation
- the orientation, not null
public void addAdjustmentListener(AdjustmentListener listener)
ColumnScrollBar
value
changes.addAdjustmentListener
in interface ColumnScrollBar
addAdjustmentListener
in interface Adjustable
listener
- the new listener, not null
public void removeAdjustmentListener(AdjustmentListener listener)
ColumnScrollBar
listener
from this scrollbar.removeAdjustmentListener
in interface ColumnScrollBar
removeAdjustmentListener
in interface Adjustable
listener
- the listener to removepublic int getOrientation()
getOrientation
in interface Adjustable
public void setMinimum(int min)
setMinimum
in interface Adjustable
public int getMinimum()
getMinimum
in interface Adjustable
public void setMaximum(int max)
setMaximum
in interface Adjustable
public int getMaximum()
getMaximum
in interface Adjustable
public void setUnitIncrement(int u)
setUnitIncrement
in interface Adjustable
public int getUnitIncrement()
getUnitIncrement
in interface Adjustable
public void setBlockIncrement(int b)
setBlockIncrement
in interface Adjustable
public int getBlockIncrement()
getBlockIncrement
in interface Adjustable
public void setVisibleAmount(int v)
setVisibleAmount
in interface Adjustable
public int getVisibleAmount()
getVisibleAmount
in interface Adjustable
public void setValue(int v)
setValue
in interface Adjustable