public class SwipeableContainer extends Container
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, LEFT, RIGHT, TOP
Constructor and Description |
---|
SwipeableContainer(Component bottomLeft,
Component top)
Simple Constructor
|
SwipeableContainer(Component bottomLeft,
Component bottomRight,
Component top)
Simple Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSwipeOpenListener(ActionListener l)
Adds a listener to the SwipeableContainer which will cause an event to
dispatch once the SwipeableContainer is fully opened
|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false.
|
void |
close()
Close the top component if it is currently opened.
|
protected void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
Component |
getComponentAt(int x,
int y)
Returns a Component that exists in the given x, y coordinates by traversing
component objects and invoking contains
|
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and
"ready for action" component state
|
boolean |
isOpen()
Returns true if the top Component is currently opened
|
boolean |
isOpenedToLeft()
Returns true if the top Component is opened to the left side
|
boolean |
isOpenedToRight()
Returns true if the top Component is opened to the right side
|
boolean |
isSwipeActivated()
Returns true if swipe is activated
|
void |
openToLeft()
This method will open the top Component to the left if there is a Component
to expose on the right.
|
void |
openToRight()
This method will open the top Component to the right if there is a Component
to expose on the left.
|
void |
removeSwipeOpenListener(ActionListener l)
Removes the given listener from the SwipeableContainer
|
void |
setSwipeActivated(boolean swipeActivated)
disable/enable dragging of the top Component
|
addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, contains, createAnimateMotion, dragInitiated, drop, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getClosestComponentTo, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isScrollableX, isScrollableY, isSelectableInteraction, keyPressed, keyReleased, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerHover, pointerPressed, refreshTheme, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager
addDragOverListener, addDropListener, addFocusListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, bindProperty, calcScrollSize, contains, deinitializeCustomStyle, dragEnter, dragExit, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getHeight, getLabelForComponent, getName, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTensileLength, getUIID, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFocus, initCustomStyle, installDefaultPainter, isAlwaysTensile, isCellRenderer, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isFlatten, isFocusable, isGrabsPointerEvents, isHideInPortrait, isInClippingRegion, isInitialized, isRTL, isScrollable, isScrollVisible, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintLock, paintLockRelease, paintScrollbars, paintScrollbarX, paintScrollbarY, pinch, pointerDragged, pointerDragged, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, removeDragOverListener, removeDropListener, removeFocusListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, repaint, repaint, requestFocus, resetFocusable, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setDirtyRegion, setDisabledStyle, setDraggable, setDropTarget, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHideInPortrait, setInitialized, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setPressedStyle, setPropertyValue, setRTL, setSameHeight, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTactileTouch, setTensileDragEnabled, setTensileLength, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, styleChanged, toString, unbindProperty
public SwipeableContainer(Component bottomLeft, Component top)
bottomLeft
- the Component below the top, this Component is exposed
when dragging the top to the righttop
- the component on top.public SwipeableContainer(Component bottomLeft, Component bottomRight, Component top)
bottomLeft
- the Component below the top, this Component is exposed
when dragging the top to the rightbottomRight
- the Component below the top, this Component is exposed
when dragging the top to the Lefttop
- the component on top.protected void deinitialize()
Component
deinitialize
in class Component
protected void initComponent()
Component
initComponent
in class Component
public void openToRight()
public void openToLeft()
public void close()
public Component getComponentAt(int x, int y)
Container
getComponentAt
in class Container
x
- absolute screen locationy
- absolute screen locationComponent.contains(int, int)
public boolean animate()
Animation
Display
class.public void setSwipeActivated(boolean swipeActivated)
public boolean isSwipeActivated()
public boolean isOpen()
public boolean isOpenedToRight()
public boolean isOpenedToLeft()
public void addSwipeOpenListener(ActionListener l)
l
- implementation of the action listener interfacepublic void removeSwipeOpenListener(ActionListener l)
l
- implementation of the action listener interface