ewe.ui
Class ScrollablePanel

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
              extended byewe.ui.Canvas
                  extended byewe.ui.Panel
                      extended byewe.ui.CellPanel
                          extended byewe.ui.ScrollablePanel
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, IScroll, LayoutManager, ScrollClient, ScrollServer, TimerProc, UIConstants
Direct Known Subclasses:
ScrollBarPanel, UpDownScroller

public abstract class ScrollablePanel
extends CellPanel
implements ScrollServer

This is a CellPanel which is used as the base for ScrollServer implementations.


Field Summary
protected  boolean alwaysShow
           
static int AlwaysShowHorizontalScrollers
          This is an option for setOptions() - it keeps horizontal scrollers always displayed.
static int AlwaysShowVerticalScrollers
          This is an option for setOptions() - it keeps vertical scrollers always displayed.
protected static boolean blockUpdate
           
 ScrollClient client
          The client which the panel contains.
protected  boolean hscrollerChanges
          This is true so long as neither AlwaysShowHorizontalScrollers nor NeverShowHorizontalScrollers are selected as options.
protected  boolean neverShow
           
static int NeverShowHorizontalScrollers
          This is an option for setOptions() - it prevents horizontal scrollers from being displayed.
static int NeverShowVerticalScrollers
          This is an option for setOptions() - it prevents vertical scrollers from being displayed.
protected  int options
           
static int Permanent
          This is an option for setOptions() - it keeps both horizontal and vertical scrollers permanently displayed.
 boolean shrinkComponent
          Deprecated. - use setClientConstraints() instead. Set this true if you want the client to be shrunk if the ScrollablePanel is shrunk to be smaller than the preferred size of the component. By default this is false. If this is set true then the scrollbars will never appear.
 boolean stretchComponent
          Deprecated. - use setClientConstraints() instead. Set this true if you want the client to be stretched if the ScrollablePanel is stretched to be bigger than the preferred size of the component. By default this is true.
static int vanish
           
protected  boolean vscrollerChanges
          This is true so long as neither AlwaysShowVerticalScrollers nor NeverShowVerticalScrollers are selected as options.
 
Fields inherited from class ewe.ui.CellPanel
autoSpan, equalHeights, equalWidths, layout, mySplitter, nextSplitter, quickRecalculate
 
Fields inherited from class ewe.ui.Panel
all, backgroundImage, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
 
Fields inherited from class ewe.ui.Canvas
isFullScrollClient, origin, scrollPercent, virtualSize
 
Fields inherited from class ewe.ui.Container
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.ui.IScroll
Higher, Horizontal, Lower, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
ScrollablePanel(ScrollClient client)
           
 
Method Summary
 void changeContents(Control what)
          Only use this if the ScrollabePanel contains a ScrollableHolder.
 void checkScrolls()
           
abstract  void checkScrolls(int width, int height, boolean redraw)
           
 void dismantle(Control downTo)
           
 int getClientConstraints()
          This returns the clientConstraints, which will be any of the HEXPAND, HCONTRACT, VEXPAND, VCONTRACT values ORed together.
 void make(boolean remake)
          This is used to "make" the control before being displayed.
abstract  void modifyScrollers(int set, int clear)
           
 void redisplay()
          Do not use this to repaint a control - use repaintNow() instead.
 void reset()
          This will reset the origin of a client (if it is a ScrollableHolder) to (0,0) if it is not already so.
 void resizeTo(int w, int h)
          This will change the width and height values.
 void setClientConstraints(boolean hExpand, boolean hContract, boolean vExpand, boolean vContract)
          Set the clientConstraints value specifying the behavior horizontally and vertically.
 void setClientConstraints(int constraints)
          Set the clientConstraints value specifying the behavior horizontally and vertically.
 void setOptions(int options)
          Set options for the ScrollablePanel.
 
Methods inherited from class ewe.ui.CellPanel
calculateSizes, makeLayoutGrid, onEvent, relayout, relayoutMe, removeAll, reShow, resize
 
Methods inherited from class ewe.ui.Panel
add, addChildListener, addDirectly, addLast, addLast, addNext, addNext, addNext, doBackground, doBorder, endRow, getControlTag, getPreferredSize, getSubControls, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setText
 
Methods inherited from class ewe.ui.Canvas
canGo, canScreenScroll, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMySize, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
 
Methods inherited from class ewe.ui.Container
_paintChildren, add, containerHasFocus, dismantle, doHotKey, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getFirstFocus, getNextKeyFocus, gotFocus, lostFocus, repaintDataNow, takeFocus, takePromptControl
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doAction, doActionKey, doMenu, dontAcceptDrop, doPaint, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, refresh, removeListener, removeTimer, repaint, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 
Methods inherited from interface ewe.ui.ScrollServer
updateScroll
 
Methods inherited from interface ewe.ui.ScrollClient
getServer, setServer
 

Field Detail

client

public ScrollClient client
The client which the panel contains.


Permanent

public static int Permanent
This is an option for setOptions() - it keeps both horizontal and vertical scrollers permanently displayed.


AlwaysShowHorizontalScrollers

public static int AlwaysShowHorizontalScrollers
This is an option for setOptions() - it keeps horizontal scrollers always displayed.


AlwaysShowVerticalScrollers

public static int AlwaysShowVerticalScrollers
This is an option for setOptions() - it keeps vertical scrollers always displayed.


NeverShowHorizontalScrollers

public static int NeverShowHorizontalScrollers
This is an option for setOptions() - it prevents horizontal scrollers from being displayed.


NeverShowVerticalScrollers

public static int NeverShowVerticalScrollers
This is an option for setOptions() - it prevents vertical scrollers from being displayed.


options

protected int options

hscrollerChanges

protected boolean hscrollerChanges
This is true so long as neither AlwaysShowHorizontalScrollers nor NeverShowHorizontalScrollers are selected as options.


vscrollerChanges

protected boolean vscrollerChanges
This is true so long as neither AlwaysShowVerticalScrollers nor NeverShowVerticalScrollers are selected as options.


stretchComponent

public boolean stretchComponent
Deprecated. - use setClientConstraints() instead. Set this true if you want the client to be stretched if the ScrollablePanel is stretched to be bigger than the preferred size of the component. By default this is true.


shrinkComponent

public boolean shrinkComponent
Deprecated. - use setClientConstraints() instead. Set this true if you want the client to be shrunk if the ScrollablePanel is shrunk to be smaller than the preferred size of the component. By default this is false. If this is set true then the scrollbars will never appear.


alwaysShow

protected boolean alwaysShow

neverShow

protected boolean neverShow

vanish

public static int vanish

blockUpdate

protected static boolean blockUpdate
Constructor Detail

ScrollablePanel

public ScrollablePanel(ScrollClient client)
Method Detail

getClientConstraints

public int getClientConstraints()
This returns the clientConstraints, which will be any of the HEXPAND, HCONTRACT, VEXPAND, VCONTRACT values ORed together. By default it is HEXPAND|VEXPAND meaning the client will be expanded bigger than its preferred size, but will not be contracted smaller than its preferred size.


setClientConstraints

public void setClientConstraints(boolean hExpand,
                                 boolean hContract,
                                 boolean vExpand,
                                 boolean vContract)
Set the clientConstraints value specifying the behavior horizontally and vertically.

Parameters:
hExpand - if this is true then the client control will be expanded horizontally.
hContract - if this is true then the client control will be contracted horizontally.
vExpand - if this is true then the client control will be expanded vertically.
vContract - if this is true then the client control will be contracted vertically.

setClientConstraints

public void setClientConstraints(int constraints)
Set the clientConstraints value specifying the behavior horizontally and vertically.

Parameters:
constraints - any of the HEXPAND, HCONTRACT, VEXPAND, VCONTRACT values ORed together.

changeContents

public void changeContents(Control what)
Only use this if the ScrollabePanel contains a ScrollableHolder. This will change the contents of the ScrollableHolder.


setOptions

public void setOptions(int options)
Set options for the ScrollablePanel. Call this after creating the ScrollBar, but only call it once.


resizeTo

public void resizeTo(int w,
                     int h)
Description copied from class: Control
This will change the width and height values.

Overrides:
resizeTo in class CellPanel

checkScrolls

public abstract void checkScrolls(int width,
                                  int height,
                                  boolean redraw)

checkScrolls

public void checkScrolls()
Specified by:
checkScrolls in interface ScrollServer
Overrides:
checkScrolls in class Canvas

make

public void make(boolean remake)
Description copied from class: Control
This is used to "make" the control before being displayed. This is usually only overridden by containers.

Overrides:
make in class CellPanel

redisplay

public void redisplay()
Description copied from class: Control
Do not use this to repaint a control - use repaintNow() instead. This is used to cause a control to re-layout its components and re-calculate its preferred size.

Overrides:
redisplay in class Control

reset

public void reset()
This will reset the origin of a client (if it is a ScrollableHolder) to (0,0) if it is not already so. If it is already so, it has no effect.


modifyScrollers

public abstract void modifyScrollers(int set,
                                     int clear)

dismantle

public void dismantle(Control downTo)
Overrides:
dismantle in class Container