com.sun.jimi.core.component
Class JimiScrollPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--com.sun.jimi.core.component.JimiScrollPane

public class JimiScrollPane
extends java.awt.Container

See Also:
Serialized Form

Field Summary
static int SCROLL_ALWAYS
          always show scrollbars
static int SCROLL_AS_NEEDED
          scrollbars as needed
static int SCROLL_HORIZONTAL
          always show horizontal scrollbar
static int SCROLL_VERTICAL
          always show vertical scrollbar
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JimiScrollPane()
          create a new BufferedScollPane with the default scroll policy which is SCROLL_AS_NEEDED.
JimiScrollPane(java.awt.Component comp)
          create a new scrollpane with default scrollpolicy and the specified component.
JimiScrollPane(java.awt.Component comp, int policy)
          create a new scrollpane based on policy and the component specified.
JimiScrollPane(int policy)
          create a new scrollpane based on policy
 
Method Summary
 java.awt.Component add(java.awt.Component comp)
          adds a component to the viewport of the scrollpane
 int getHBarOffset()
           
 java.awt.Scrollbar getHorizontalBar()
           
 int getHorizontalPosition()
           
 int getScrollPolicy()
           
 int getVBarOffset()
           
 java.awt.Scrollbar getVerticalBar()
           
 int getVerticalPosition()
           
protected  java.awt.Dimension getViewPort()
           
 boolean handleEvent(java.awt.Event e)
           
 void layout()
          determines which scrollbars to enable/disable.
 java.awt.Dimension preferredSize()
           
 void setScrollPolicy(int policy)
           
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, list, list, locate, minimumSize, paint, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCROLL_HORIZONTAL

public static final int SCROLL_HORIZONTAL
always show horizontal scrollbar

SCROLL_VERTICAL

public static final int SCROLL_VERTICAL
always show vertical scrollbar

SCROLL_AS_NEEDED

public static final int SCROLL_AS_NEEDED
scrollbars as needed

SCROLL_ALWAYS

public static final int SCROLL_ALWAYS
always show scrollbars
Constructor Detail

JimiScrollPane

public JimiScrollPane()
create a new BufferedScollPane with the default scroll policy which is SCROLL_AS_NEEDED.

JimiScrollPane

public JimiScrollPane(int policy)
create a new scrollpane based on policy
Parameters:
policy - the policy you want to use
See Also:
SCROLL_VERTICAL, SCROLL_HORIZONTAL, SCROLL_AS_NEEDED, SCROLL_AWAYS

JimiScrollPane

public JimiScrollPane(java.awt.Component comp,
                      int policy)
create a new scrollpane based on policy and the component specified.
Parameters:
comp - the component you wish to scroll (instead of calling add(Component))
policy - the policy you want to use
See Also:
SCROLL_VERTICAL, SCROLL_HORIZONTAL, SCROLL_AS_NEEDED, SCROLL_AWAYS

JimiScrollPane

public JimiScrollPane(java.awt.Component comp)
create a new scrollpane with default scrollpolicy and the specified component.
Parameters:
comp - the component you wish to scroll (instead of calling add(Component))
See Also:
SCROLL_VERTICAL, SCROLL_HORIZONTAL, SCROLL_AS_NEEDED, SCROLL_AWAYS
Method Detail

add

public java.awt.Component add(java.awt.Component comp)
adds a component to the viewport of the scrollpane
Parameters:
comp - the component you wish to scroll
Overrides:
add in class java.awt.Container

preferredSize

public java.awt.Dimension preferredSize()
Overrides:
preferredSize in class java.awt.Container

getVerticalPosition

public int getVerticalPosition()
Returns:
Vertical position of the scrollable object.

getHorizontalPosition

public int getHorizontalPosition()
Returns:
Horizontal position of the scrollable object.

getVBarOffset

public int getVBarOffset()
Returns:
Vertical scrollbar width

getHBarOffset

public int getHBarOffset()
Returns:
Horizontal scrollbar height

getVerticalBar

public java.awt.Scrollbar getVerticalBar()
Returns:
vertical scrollbar

getHorizontalBar

public java.awt.Scrollbar getHorizontalBar()
Returns:
horizontal scrollbar

setScrollPolicy

public void setScrollPolicy(int policy)
Parameters:
policy - the policy you want to use
See Also:
SCROLL_VERTICAL, SCROLL_HORIZONTAL, SCROLL_AS_NEEDED, SCROLL_AWAYS

getScrollPolicy

public int getScrollPolicy()
Returns:
current policy

layout

public void layout()
determines which scrollbars to enable/disable. this method should no be called directly.
Overrides:
layout in class java.awt.Container

getViewPort

protected java.awt.Dimension getViewPort()
Returns:
the viewport dimensions based on scrollbar policy and whatnot

handleEvent

public boolean handleEvent(java.awt.Event e)
Overrides:
handleEvent in class java.awt.Component