public class SwipableSingleContainer extends SingleContainer implements Swipable
Swipable.Page
Modifier and Type | Field and Description |
---|---|
protected int |
selectedPage
This is the page currently selected.
|
client, made, parentToRelayout
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocus
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
PAGE_ABOVE, PAGE_BACKGROUND, PAGE_BELOW, PAGE_CURRENT, PAGE_LEFT, PAGE_RIGHT, SHOULD_END_DEFAULT, SHOULD_END_PAGE_CHANGE, SHOULD_END_STAY_IN_PLACE, SHOULD_END_STAY_ON_PAGE, SWIPE_ACCEPTED_DRAG_PAGES, SWIPE_ACCEPTED_GIVE_EVENTS, SWIPE_REJECTED
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, 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
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
SwipableSingleContainer(Control[] pages,
Control background) |
Modifier and Type | Method and Description |
---|---|
void |
getPage(int need,
Swipable.Page page)
This is called to retrieve a page to display while swiping.
|
protected int |
getPageCount()
Return the number of pages in the Container.
|
Dimension |
getPreferredSize(Dimension ps) |
protected Control |
makePage(int whichPage) |
protected void |
newPageSelected() |
void |
resizeTo(int width,
int height)
This is called to change the width and height values.
|
void |
selectPage(int page) |
void |
setControl(Control who)
This changes the control.
|
int |
shouldEnd(int swipeDistanceX,
int swipeDistanceY,
int startPointX,
int startPointY)
This is called when the swipe has ended and it should return one of the SHOULD_END_XXX values.
|
void |
shown()
This is called when a Control is shown in a Window.
|
void |
swipeEnded(int pageChange,
int pixelChangeX,
int pixelChangeY)
This is called when the swipe has ended after shouldEnd() is called.
|
int |
swipeStarting(Swiper swiper,
boolean horizontally,
boolean vertically,
int type)
This is called when a swipe is beginning and before getPage() is called.
|
boolean |
swiping(int swipeDistanceX,
int swipeDistanceY,
int startPointX,
int startPointY)
This is only called if swipeStarting() returned SWIPE_ACCEPTED_GIVE_EVENTS.
|
dismantle, formClosing, getSubControls, make, setControl, setControl
add, addDirectly, completeAddPopupControl, containerHasFocus, dismantle, doHotKey, doPaint, findChild, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getFirstFocus, getNextKeyFocus, gotFocus, grayOut, hide, lostFocus, relayout, remove, removeAll, removePopupControl, repaintDataNow, reShow, scrollToVisible, setHidden, startAddPopupControl, takeFocus, takePromptControl, unhide
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doBorder, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onControlEvent, onEvent, onKeyEvent, onLabelPenEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setText, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGraphics, getSize
public Dimension getPreferredSize(Dimension ps)
getPreferredSize
in class SingleContainer
protected int getPageCount()
protected Control makePage(int whichPage)
public void resizeTo(int width, int height)
Control
resizeTo
in class SingleContainer
public void setControl(Control who)
SingleContainer
setControl
in class SingleContainer
who
- The new control to display.public void selectPage(int page)
protected void newPageSelected()
public void shown()
Control
public void getPage(int need, Swipable.Page page)
Swipable
public int shouldEnd(int swipeDistanceX, int swipeDistanceY, int startPointX, int startPointY)
Swipable
shouldEnd
in interface Swipable
swipeDistanceX
- the horizontal distance, positive (to the right) or negative (to the left)
that the swipe ended from the starting point. If it is a vertical only swipe, this is set to zero.swipeDistanceY
- the vertical distance, positive (downwards) or negative (upwards) that the
swipe ended from the starting point. If it is a horizontal only swipe, this is set to zero.startPointX
- the start x-point on the Control of the swipe.startPointY
- the start Y-point on the Control of the swipe.public void swipeEnded(int pageChange, int pixelChangeX, int pixelChangeY)
Swipable
swipeEnded
in interface Swipable
pageChange
- this will be one or more of the PAGE_XXX values OR'ed together or zero if there
was no page change.pixelChangeX
- if shouldEnd() returned SHOULD_END_STAY_IN_PLACE then this is the change in horizontal pixels
(positive indicates a shift right, negative a shift left), otherwise it is zero.pixelChangeY
- if shouldEnd() returned SHOULD_END_STAY_IN_PLACE then this is the change in vertical pixels
(positive indicates a shift down, negative a shift up), otherwise it is zero.public int swipeStarting(Swiper swiper, boolean horizontally, boolean vertically, int type)
Swipable
swipeStarting
in interface Swipable
swiper
- the Swiper (swipe handler) handling the swipe. This is the only time this parameter is given
during a swipe.horizontally
- true if horizontal swiping is being done. This may be in conjunction with vertical swiping.vertically
- true if vertical swiping is being done. This may be in conjunction with horizontal swiping.type
- either SWIPER_SINGLE_SWIPE or SWIPER_DRAGGING_SWIPE.public boolean swiping(int swipeDistanceX, int swipeDistanceY, int startPointX, int startPointY)
Swipable
swiping
in interface Swipable
swipeDistanceX
- the horizontal distance, positive (to the right) or negative (to the left)
that the swipe has traveled from the starting point. If it is a vertical only swipe, this is set to zero.swipeDistanceY
- the vertical distance, positive (downwards) or negative (upwards) that the
swipe has traveled from the starting point. If it is a horizontal only swipe, this is set to zero.startPointX
- the start x-point on the Control of the swipe.startPointY
- the start Y-point on the Control of the swipe.