public class InteractionDialog extends Container
Unlike a regular dialog the interaction dialog only looks like a dialog,
it resides in the layered pane and can be used to implement features where
interaction with the background form is still required.
Since this code is designed for interaction all "dialogs" created thru here are
modless and never block.
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, 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, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR
Constructor and Description |
---|
InteractionDialog()
Default constructor with no title
|
InteractionDialog(Layout l)
Default constructor with layout
|
InteractionDialog(String title)
Constructor with dialog title
|
InteractionDialog(String title,
Layout l)
Constructor with dialog title
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component cmp)
Adds a Component to the Container
|
void |
addComponent(int index,
Component cmp)
This method adds the Component at a specific index location in the Container
Components array.
|
void |
addComponent(int index,
Object constraints,
Component cmp)
Adds a Component to the Container
|
void |
addComponent(Object constraints,
Component cmp)
Adds a Component to the Container
|
protected void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
void |
dispose()
Removes the interaction dialog from view
|
void |
disposeToTheBottom()
Removes the interaction dialog from view with an animation to the bottom
|
void |
disposeToTheBottom(Runnable onFinish)
Removes the interaction dialog from view with an animation to the bottom
|
void |
disposeToTheLeft()
Removes the interaction dialog from view with an animation to the left
|
void |
disposeToTheRight()
Removes the interaction dialog from view with an animation to the right
|
void |
disposeToTheTop()
Removes the interaction dialog from view with an animation to the top
|
Container |
getContentPane()
Returns the body of the interaction dialog
|
Style |
getDialogStyle()
Simple getter to get the Dialog Style
|
String |
getDialogUIID()
Returns the uiid of the dialog
|
Layout |
getLayout()
Returns the layout manager responsible for arranging this container.
|
String |
getTitle() |
Label |
getTitleComponent() |
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and
"ready for action" component state
|
boolean |
isAnimateShow()
Indicates whether show/dispose should be animated or not
|
boolean |
isDisposeWhenPointerOutOfBounds()
This flag indicates if the dialog should be disposed if a pointer
released event occurred out of the dialog content.
|
boolean |
isFormMode()
Whether the interaction dialog uses the form layered pane of the regular layered pane
|
boolean |
isRepositionAnimation()
Repositions the component so the animation will "grow/shrink" when showing/disposing
|
boolean |
isShowing()
Will return true if the dialog is currently showing
|
void |
removeAll()
remove all Components from container, notice that removed component might still have
a pending repaint in the queue that won't be removed.
|
void |
removeComponent(Component cmp)
removes a Component from the Container, notice that removed component might still have
a pending repaint in the queue that won't be removed.
|
void |
resize(int top,
int bottom,
int left,
int right) |
void |
setAnimateShow(boolean animateShow)
Indicates whether show/dispose should be animated or not
|
void |
setDialogUIID(String uiid)
Simple setter to set the Dialog uiid
|
void |
setDisposeWhenPointerOutOfBounds(boolean disposeWhenPointerOutOfBounds)
This flag indicates if the dialog should be disposed if a pointer
released event occurred out of the dialog content.
|
void |
setFormMode(boolean formMode)
Whether the interaction dialog uses the form layered pane of the regular layered pane
|
void |
setLayout(Layout layout)
Sets the layout manager responsible for arranging this container
|
void |
setRepositionAnimation(boolean repositionAnimation)
Repositions the component so the animation will "grow/shrink" when showing/disposing
|
void |
setScrollable(boolean scrollable)
The equivalent of calling both setScrollableY and setScrollableX
|
void |
setTitle(String title) |
void |
show(int top,
int bottom,
int left,
int right)
This method shows the form as a modal alert allowing us to produce a behavior
of an alert/dialog box.
|
void |
showPopupDialog(Component c)
A popup dialog is shown with the context of a component and its selection.
|
void |
showPopupDialog(Component c,
boolean bias)
A popup dialog is shown with the context of a component and its selection.
|
void |
showPopupDialog(Rectangle rect)
A popup dialog is shown with the context of a component and its selection.
|
void |
showPopupDialog(Rectangle rect,
boolean bias)
A popup dialog is shown with the context of a component and its selection.
|
add, add, add, add, add, add, addAll, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, constrainHeightWhenScrollable, constrainWidthWhenScrollable, contains, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayout, createAnimateLayoutFade, createAnimateLayoutFadeAndWait, createAnimateMotion, createAnimateUnlayout, createReplaceTransition, dragInitiated, drop, encloseIn, encloseIn, findDropTargetAt, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getChildrenAsList, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getResponderAt, getSafeAreaRoot, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isSafeArea, isSafeAreaRoot, isScrollableX, isScrollableY, isSelectableInteraction, isSurface, iterator, iterator, keyPressed, keyReleased, layoutContainer, morph, morphAndWait, paint, paintBackground, paintBorderBackground, paintComponentBackground, paintGlass, paramString, pointerPressed, refreshTheme, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndices
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, animate, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains
public InteractionDialog()
public InteractionDialog(Layout l)
l
- layoutpublic InteractionDialog(String title)
title
- the title of the dialogprotected void initComponent()
Component
initComponent
in class Component
public void setDisposeWhenPointerOutOfBounds(boolean disposeWhenPointerOutOfBounds)
disposeWhenPointerOutOfBounds
- public boolean isDisposeWhenPointerOutOfBounds()
public Container getContentPane()
public void setScrollable(boolean scrollable)
setScrollable
in class Container
scrollable
- whether the component should/could scroll on the
X and Y axispublic Layout getLayout()
public String getTitle()
public void addComponent(Component cmp)
addComponent
in class Container
cmp
- the component to be addedpublic void addComponent(Object constraints, Component cmp)
addComponent
in class Container
constraints
- this method is useful when the Layout requires a constraint
such as the BorderLayout.
In this case you need to specify an additional data when you add a Component,
such as "CENTER", "NORTH"...cmp
- component to addpublic void addComponent(int index, Object constraints, Component cmp)
addComponent
in class Container
index
- location to insert the Componentconstraints
- this method is useful when the Layout requires a constraint
such as the BorderLayout.
In this case you need to specify an additional data when you add a Component,
such as "CENTER", "NORTH"...cmp
- component to addpublic void addComponent(int index, Component cmp)
addComponent
in class Container
index
- location to insert the Componentcmp
- the Component to addpublic void removeAll()
public void removeComponent(Component cmp)
removeComponent
in class Container
cmp
- the removed componentpublic Label getTitleComponent()
public void setLayout(Layout layout)
public void setTitle(String title)
protected void deinitialize()
deinitialize
in class Component
public void resize(int top, int bottom, int left, int right)
public void show(int top, int bottom, int left, int right)
Modal dialogs Allow the forms "content" to "hang in mid air" this is especially useful for dialogs where you would want the underlying form to "peek" from behind the form.
top
- space in pixels between the top of the screen and the formbottom
- space in pixels between the bottom of the screen and the formleft
- space in pixels between the left of the screen and the formright
- space in pixels between the right of the screen and the formpublic void dispose()
public void disposeToTheLeft()
public void disposeToTheBottom()
public void disposeToTheBottom(Runnable onFinish)
onFinish
- Callback called when dispose animation is complete.public void disposeToTheTop()
public void disposeToTheRight()
public boolean isShowing()
public boolean isAnimateShow()
public void setAnimateShow(boolean animateShow)
animateShow
- the animateShow to setpublic void showPopupDialog(Component c)
setDisposeWhenPointerOutOfBounds(boolean)
to make it dispose
when the user clicks outside the bounds of the popup. It can optionally provide an arrow in the theme to point at the context component. The popup
dialog has the PopupDialog style by default.c
- the context component which is used to position the dialog and can also be pointed atpublic void showPopupDialog(Component c, boolean bias)
setDisposeWhenPointerOutOfBounds(boolean)
to make it dispose
when the user clicks outside the bounds of the popup. It can optionally provide an arrow in the theme to point at the context component. The popup
dialog has the PopupDialog style by default.c
- the context component which is used to position the dialog and can also be pointed atbias
- biases the dialog to appear above/below or to the sides.
This is ignored if there isn't enough spacepublic void showPopupDialog(Rectangle rect)
setDisposeWhenPointerOutOfBounds(boolean)
to make it dispose
when the user clicks outside the bounds of the popup. It can optionally provide an arrow in the theme to point at the context component. The popup
dialog has the PopupDialog style by default.rect
- the screen rectangle to which the popup should pointpublic void showPopupDialog(Rectangle rect, boolean bias)
setDisposeWhenPointerOutOfBounds(boolean)
to make it dispose
when the user clicks outside the bounds of the popup. It can optionally provide an arrow in the theme to point at the context component. The popup
dialog has the PopupDialog style by default.rect
- the screen rectangle to which the popup should pointbias
- biases the dialog to appear above/below or to the sides.
This is ignored if there isn't enough spacepublic void setDialogUIID(String uiid)
uiid
- the id for the dialogpublic String getDialogUIID()
public Style getDialogStyle()
public boolean isRepositionAnimation()
public void setRepositionAnimation(boolean repositionAnimation)
repositionAnimation
- the repositionAnimation to setpublic boolean isFormMode()
public void setFormMode(boolean formMode)
formMode
- the formMode to set