com.jmex.bui
Class BScrollPane.BViewport

java.lang.Object
  extended by com.jmex.bui.BComponent
      extended by com.jmex.bui.BContainer
          extended by com.jmex.bui.BScrollPane.BViewport
Enclosing class:
BScrollPane

protected static class BScrollPane.BViewport
extends BContainer

Does all the heavy lifting for the BScrollPane.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jmex.bui.BContainer
BContainer.ChildOp
 
Field Summary
protected  BoundedRangeModel _hmodel
           
protected  Rectangle _srect
           
protected  BComponent _target
           
protected  BoundedRangeModel _vmodel
           
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
 
Constructor Summary
BScrollPane.BViewport(BComponent target, boolean vert, boolean horiz, int snap)
           
 
Method Summary
protected  Dimension computePreferredSize(int whint, int hhint)
          Computes and returns a preferred size for this component.
 int getAbsoluteX()
          Returns the x position of this component in absolute screen coordinates.
 int getAbsoluteY()
          Returns the y position of this component in absolute screen coordinates.
 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 getHModel()
          Returns the range model defined by this viewport's size and the preferred size of its target component.
 BComponent getTarget()
          Returns a reference to the target of this viewport.
 BoundedRangeModel getVModel()
          Returns the range model defined by this viewport's size and the preferred size of its target component.
protected  int getXOffset()
           
protected  int getYOffset()
           
 void invalidate()
          Marks this component as invalid and needing a relayout.
 void layout()
          Instructs this component to lay itself out.
protected  void renderComponent(Renderer renderer)
          Renders any custom bits for this component.
protected  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).
protected  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, getComponent, getComponentCount, getComponentIndex, getDefaultStyleClass, getLayoutManager, getNextFocus, getPreviousFocus, remove, remove, removeAll, replace, setAlpha, setEnabled, setLayoutManager, setVisible, validate
 
Methods inherited from class com.jmex.bui.BComponent
acceptsFocus, addListener, applyDefaultStates, boundsToString, changeCursor, configureStyle, createTooltipComponent, dispatchEvent, emitEvent, getAlpha, getBackground, getBorder, getBounds, getColor, getCursor, getFocusTarget, getHeight, getInsets, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleClass, getTooltipText, getWidth, getWindow, getX, getY, hasFocus, intersectScissorBox, isAdded, isEnabled, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeListener, render, renderBackground, renderBorder, requestFocus, restoreScissorState, setBackground, setBounds, setCursor, setLocation, 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

_vmodel

protected BoundedRangeModel _vmodel

_hmodel

protected BoundedRangeModel _hmodel

_target

protected BComponent _target

_wheelListener

protected MouseWheelListener _wheelListener

_srect

protected Rectangle _srect
Constructor Detail

BScrollPane.BViewport

public BScrollPane.BViewport(BComponent target,
                             boolean vert,
                             boolean horiz,
                             int snap)
Method Detail

getTarget

public BComponent getTarget()
Returns a reference to the target of this viewport.


getVModel

public BoundedRangeModel getVModel()
Returns the range model defined by this viewport's size and the preferred size of its target component.


getHModel

public BoundedRangeModel getHModel()
Returns the range model defined by this viewport's size and the preferred size of its target component.


invalidate

public void invalidate()
Description copied from class: BComponent
Marks this component as invalid and needing a relayout. If the component is valid, its parent will also be marked as invalid.

Overrides:
invalidate in class BComponent

layout

public 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

getAbsoluteX

public int getAbsoluteX()
Description copied from class: BComponent
Returns the x position of this component in absolute screen coordinates.

Overrides:
getAbsoluteX in class BComponent

getAbsoluteY

public int getAbsoluteY()
Description copied from class: BComponent
Returns the y position of this component in absolute screen coordinates.

Overrides:
getAbsoluteY in class BComponent

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

wasAdded

protected 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

protected 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

computePreferredSize

protected Dimension computePreferredSize(int whint,
                                         int hhint)
Description copied from class: BComponent
Computes and returns a preferred size for this component. This method is called if no overriding preferred size has been supplied.

Overrides:
computePreferredSize in class BContainer
Returns:
the computed preferred size of this component in a newly created Dimension instance which will be adopted (and modified) by the caller.

renderComponent

protected void renderComponent(Renderer renderer)
Description copied from class: BComponent
Renders any custom bits for this component. This is called with the graphics context translated to (0, 0) relative to this component.

Overrides:
renderComponent in class BContainer

getYOffset

protected final int getYOffset()

getXOffset

protected final int getXOffset()


Copyright © 2008 Michael Bayne. All Rights Reserved.