com.jmex.bui
Class BScrollBar

java.lang.Object
  extended by com.jmex.bui.BComponent
      extended by com.jmex.bui.BContainer
          extended by com.jmex.bui.BScrollBar
All Implemented Interfaces:
BConstants

public class BScrollBar
extends BContainer
implements BConstants

Displays a scroll bar for all your horizontal and vertical scrolling needs.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jmex.bui.BContainer
BContainer.ChildOp
 
Field Summary
protected  ActionListener _buttoner
           
protected  BButton _less
           
protected  BoundedRangeModel _model
           
protected  BButton _more
           
protected  Orientation _orient
           
protected  BComponent _thumb
           
protected  MouseAdapter _thumbListener
           
protected  ChangeListener _updater
           
protected  BComponent _well
           
protected  MouseListener _wellListener
           
protected  MouseWheelListener _wheelListener
           
 
Fields inherited from class com.jmex.bui.BContainer
_children, _layout
 
Fields inherited from class com.jmex.bui.BComponent
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES
 
Fields inherited from interface com.jmex.bui.BConstants
DEFAULT_SIZE, DEFAULT_SPACING
 
Constructor Summary
BScrollBar()
          Creates a vertical scroll bar with the default range, value and extent.
BScrollBar(Orientation orientation)
          Creates a scroll bar with the default range, value and extent.
BScrollBar(Orientation orientation, BoundedRangeModel model)
          Creates a scroll bar with the specified orientation which will interact with the supplied model.
BScrollBar(Orientation orientation, int min, int value, int extent, int max)
          Creates a scroll bar with the specified orientation, range, value and extent.
 
Method Summary
protected  java.lang.String getDefaultStyleClass()
          Returns the default stylesheet class to be used for all instances of this component.
 BComponent getHitComponent(int mx, int my)
          Returns the component "hit" by the specified mouse coordinates which might be this component or any of its children.
 BoundedRangeModel getModel()
          Returns a reference to the scrollbar's range model.
protected  void layout()
          Instructs this component to lay itself out.
protected  void update()
          Recomputes and repositions the scroll bar thumb to reflect the current configuration of the model.
 void wasAdded()
          This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up).
 void wasRemoved()
          This method is called when we are removed from a hierarchy that is connected to a top-level window.
 
Methods inherited from class com.jmex.bui.BContainer
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getLayoutManager, getNextFocus, getPreviousFocus, remove, remove, removeAll, renderComponent, replace, setAlpha, setEnabled, setLayoutManager, setVisible, validate
 
Methods inherited from class com.jmex.bui.BComponent
acceptsFocus, addListener, addListeners, applyDefaultStates, boundsToString, changeCursor, configureStyle, createTooltipComponent, dispatchEvent, emitEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getCursor, getFocusTarget, getHeight, getInsets, getLocation, getName, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleClass, getTooltipText, getWidth, getWindow, getX, getY, hasFocus, intersectScissorBox, invalidate, isAdded, isConsumeMouseEvents, isEnabled, isHoverEnabled, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeListener, render, renderBackground, renderBorder, requestFocus, restoreScissorState, setBackground, setBounds, setConsumeMouseEvents, setCursor, setHoverEnabled, setLocation, setName, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleClass, setTooltipRelativeToMouse, setTooltipText, stateDidChange, updateCursor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_updater

protected ChangeListener _updater

_wellListener

protected MouseListener _wellListener

_thumbListener

protected MouseAdapter _thumbListener

_buttoner

protected ActionListener _buttoner

_model

protected BoundedRangeModel _model

_orient

protected Orientation _orient

_less

protected BButton _less

_more

protected BButton _more

_well

protected BComponent _well

_thumb

protected BComponent _thumb

_wheelListener

protected MouseWheelListener _wheelListener
Constructor Detail

BScrollBar

public BScrollBar()
Creates a vertical scroll bar with the default range, value and extent.


BScrollBar

public BScrollBar(Orientation orientation)
Creates a scroll bar with the default range, value and extent.

Parameters:
orientation - Orientation

BScrollBar

public BScrollBar(Orientation orientation,
                  int min,
                  int value,
                  int extent,
                  int max)
Creates a scroll bar with the specified orientation, range, value and extent.

Parameters:
orientation - Orientation
min - int
value - int
extent - int
max - int

BScrollBar

public BScrollBar(Orientation orientation,
                  BoundedRangeModel model)
Creates a scroll bar with the specified orientation which will interact with the supplied model.

Parameters:
orientation - Orientation
model - BoundedRangeModel
Method Detail

getModel

public BoundedRangeModel getModel()
Returns a reference to the scrollbar's range model.

Returns:
BoundingRangeModel brm

wasAdded

public void wasAdded()
Description copied from class: BComponent
This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up).

Overrides:
wasAdded in class BContainer

wasRemoved

public void wasRemoved()
Description copied from class: BComponent
This method is called when we are removed from a hierarchy that is connected to a top-level window. If we wish to clean up after things done in BComponent.wasAdded(), this is a fine place to do so.

Overrides:
wasRemoved in class BContainer

getHitComponent

public BComponent getHitComponent(int mx,
                                  int my)
Description copied from class: BComponent
Returns the component "hit" by the specified mouse coordinates which might be this component or any of its children. This method should return null if the supplied mouse coordinates are outside the bounds of this component.

Overrides:
getHitComponent in class BContainer

update

protected void update()
Recomputes and repositions the scroll bar thumb to reflect the current configuration of the model.


getDefaultStyleClass

protected java.lang.String getDefaultStyleClass()
Description copied from class: BComponent
Returns the default stylesheet class to be used for all instances of this component. Derived classes will likely want to override this method and set up a default class for their type of component.

Overrides:
getDefaultStyleClass in class BContainer

layout

protected void layout()
Description copied from class: BComponent
Instructs this component to lay itself out. This is called as a result of the component changing size.

Overrides:
layout in class BContainer


Copyright © 2011 Michael Bayne. All Rights Reserved.