C
- component typeU
- component UI typepublic class PopOverPainter<C extends JRootPane,U extends WRootPaneUI> extends AbstractPopupPainter<C,U> implements IPopOverPainter<C,U>
WebPopOver
component.Modifier and Type | Field and Description |
---|---|
protected boolean |
attached
Whether or not popover is attached to invoker component.
|
protected PopOverDirection |
currentDirection
Current display direction.
|
protected WindowFocusListener |
focusListener |
protected ComponentMoveBehavior |
moveAdapter
Listeners.
|
protected boolean |
popOverFocused
Whether or not popover is focused.
|
protected PopOverSourcePoint |
popOverSourcePoint
WebPopOver display source point.
|
protected PopOverAlignment |
preferredAlignment
Preferred WebPopOver alignment relative to display source point.
|
protected PopOverDirection |
preferredDirection
Preferred direction in which WebPopOver should be displayed.
|
protected ComponentAdapter |
resizeAdapter |
protected VisibilityBehavior<C> |
windowVisibilityBehavior |
background, borderColor, cornerAlignment, cornerSide, cornerWidth, DROPDOWN_BORDER_SHAPE, DROPDOWN_FILL_SHAPE, opacity, popupStyle, relativeCorner, round, shade, shadeOpacity, shadeWidth, shaped, SIMPLE_BORDER_SHAPE, SIMPLE_FILL_SHAPE
component, installed, ltr, propertyChangeListener, sectionPainters, ui
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
PopOverPainter() |
Modifier and Type | Method and Description |
---|---|
protected Point |
checkBottomCollision(Point location,
Dimension ps,
Rectangle screenBounds)
Checks whether WebPopOver will collide with bottom screen border and modifies location accordingly.
|
protected Point |
checkLeftCollision(Point location,
Rectangle screenBounds)
Checks whether WebPopOver will collide with left screen border and modifies location accordingly.
|
protected Point |
checkRightCollision(Point location,
Dimension ps,
Rectangle screenBounds)
Checks whether WebPopOver will collide with right screen border and modifies location accordingly.
|
protected Point |
checkTopCollision(Point location,
Rectangle screenBounds)
Checks whether WebPopOver will collide with top screen border and modifies location accordingly.
|
void |
configure(WebPopOver popOver,
Component invoker,
Supplier<Rectangle> boundsSupplier,
PopOverDirection direction,
PopOverAlignment alignment)
Configures popover to be displayed as attached to the invoker component and faced to specified direction.
|
void |
configure(WebPopOver popOver,
int x,
int y)
Configures popover to be displayed as unattached at the specified location.
|
void |
configure(WebPopOver popOver,
PopOverLocation location)
Configures popover to be displayed as unattached at the specified screen location.
|
protected PopOverDirection |
getActualDirection(Rectangle ib,
boolean ltr,
int cw,
Dimension ps,
Rectangle screenBounds)
Returns actual direction depending on preferred WebPopOver direction, its sizes and source point.
|
protected Point |
getActualLocation(Rectangle ib,
boolean ltr,
int round,
int cw,
Dimension ps,
Rectangle screenBounds,
PopOverDirection actualDirection)
Returns actual WebPopOver location.
|
protected Point |
getActualSourcePoint(Rectangle ib,
boolean ltr,
PopOverDirection direction)
Returns actual source point depending on WebPopOver direction and invoker component location on screen.
|
PopOverDirection |
getCurrentDirection()
Returns current display direction.
|
protected float |
getCurrentShadeOpacity()
Returns current shade opacity.
|
protected WebPopOver |
getPopOver(C c)
Returns popover instance for the specified root pane.
|
PopOverSourcePoint |
getPopOverSourcePoint()
Returns popup display source point.
|
PopOverDirection |
getPreferredDirection()
Returns preferred direction in which WebPopOver should be displayed.
|
protected int |
getRelativeCorner(Rectangle ib,
PopOverDirection actualDirection,
Point actualLocation)
Returns relative corner position.
|
protected void |
installPopOverLocationUpdater(WebPopOver popOver,
Component invoker,
Supplier<Rectangle> boundsProvider)
Installs listeners to update WebPopOver location.
|
protected void |
installPropertiesAndListeners()
Installs properties and listeners used by this
Painter implementation. |
boolean |
isDecorated()
Returns whether or not this
IRootPanePainter implementation will provide window decoration. |
boolean |
isPopOverFocused()
Returns whether this WebPopOver is focus owner or not.
|
void |
setCurrentDirection(PopOverDirection direction)
Sets current display direction.
|
void |
setPopOverFocused(boolean focused)
Sets whether this WebPopOver is focus owner or not.
|
void |
setPopOverSourcePoint(PopOverSourcePoint popOverSourcePoint)
Sets popup display source point.
|
void |
setPreferredDirection(PopOverDirection direction)
Sets preferred direction in which WebPopOver should be displayed.
|
protected void |
uninstallPropertiesAndListeners()
Uninstalls properties and listeners used by this
Painter implementation. |
protected void |
updatePopOverLocation(WebPopOver popOver,
Component invoker)
Updates WebPopOver location on screen.
|
protected void |
updatePopOverLocation(WebPopOver popOver,
Component invoker,
Rectangle invokerBounds)
Updates WebPopOver location on screen.
|
protected void |
updatePopOverLocation(WebPopOver popOver,
Component invoker,
Supplier<Rectangle> boundsProvider)
Updates WebPopOver location on screen.
|
createDropdownCornerShape, createDropdownShape, createSimpleShape, getBackgroundColor, getBorder, getBorderColor, getBorderShape, getCachedShapeSettings, getComponentBackground, getCornerAlignment, getCornerSide, getCornerWidth, getDropdownCornerShape, getOpacity, getPopupStyle, getRelativeCorner, getRound, getShadeBounds, getShadeOpacity, getShadeWidth, getSideWidth, isOpaque, paint, paintBackground, paintBorder, paintShade, paintSimplePopup, paintTransparentPopup, provideShape, setBorderColor, setCornerAlignment, setCornerSide, setCornerWidth, setOpacity, setPopupStyle, setRelativeCorner, setRound, setShadeOpacity, setShadeWidth
afterInstall, afterUninstall, asList, beforeInstall, beforeUninstall, borderChange, contains, getBaseline, getBaselineResizeBehavior, getCompleteBorder, getInstalledSectionPainters, getPreferredSize, getSectionPainters, install, installPropertyChangeListener, installSectionPainter, installSectionPainters, isInstalled, isSectionPainter, isSettingsUpdateAllowed, orientationChange, paintSection, propertyChanged, repaint, repaint, repaint, revalidate, saveOrientation, uninstall, uninstallPropertyChangeListener, uninstallSectionPainter, uninstallSectionPainters, updateAll, updateBorder, updateOpacity, updateOrientation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, getBaseline, getBaselineResizeBehavior, getPreferredSize, install, isInstalled, isOpaque, paint, uninstall
protected transient ComponentMoveBehavior moveAdapter
protected transient WindowFocusListener focusListener
protected transient ComponentAdapter resizeAdapter
protected transient VisibilityBehavior<C extends JRootPane> windowVisibilityBehavior
protected boolean popOverFocused
protected boolean attached
protected PopOverSourcePoint popOverSourcePoint
protected PopOverDirection preferredDirection
protected PopOverDirection currentDirection
protected PopOverAlignment preferredAlignment
protected void installPropertiesAndListeners()
AbstractPainter
Painter
implementation.
Override this method instead of AbstractPainter.install(JComponent, ComponentUI)
to install additional properties and listeners.installPropertiesAndListeners
in class AbstractPopupPainter<C extends JRootPane,U extends WRootPaneUI>
protected void uninstallPropertiesAndListeners()
AbstractPainter
Painter
implementation.
Override this method instead of AbstractPainter.uninstall(JComponent, ComponentUI)
to uninstall additional properties and listeners.uninstallPropertiesAndListeners
in class AbstractPopupPainter<C extends JRootPane,U extends WRootPaneUI>
public boolean isDecorated()
IRootPanePainter
IRootPanePainter
implementation will provide window decoration.
todo This method might not be necessary outside of implementation anymoreisDecorated
in interface IRootPanePainter<C extends JRootPane,U extends WRootPaneUI>
true
if this IRootPanePainter
implementation will provide window decoration, false
otherwisepublic boolean isPopOverFocused()
public void setPopOverFocused(boolean focused)
focused
- whether this WebPopOver is focus owner or notprotected float getCurrentShadeOpacity()
AbstractPopupPainter
getCurrentShadeOpacity
in class AbstractPopupPainter<C extends JRootPane,U extends WRootPaneUI>
public PopOverSourcePoint getPopOverSourcePoint()
public void setPopOverSourcePoint(PopOverSourcePoint popOverSourcePoint)
popOverSourcePoint
- popup display source pointpublic PopOverDirection getPreferredDirection()
public void setPreferredDirection(PopOverDirection direction)
direction
- preferred direction in which WebPopOver should be displayedpublic PopOverDirection getCurrentDirection()
public void setCurrentDirection(PopOverDirection direction)
direction
- current display directionpublic void configure(WebPopOver popOver, PopOverLocation location)
IPopOverPainter
configure
in interface IPopOverPainter<C extends JRootPane,U extends WRootPaneUI>
popOver
- popover to configurelocation
- location on screenpublic void configure(WebPopOver popOver, int x, int y)
IPopOverPainter
configure
in interface IPopOverPainter<C extends JRootPane,U extends WRootPaneUI>
popOver
- popover to configurex
- X locationy
- Y locationpublic void configure(WebPopOver popOver, Component invoker, Supplier<Rectangle> boundsSupplier, PopOverDirection direction, PopOverAlignment alignment)
IPopOverPainter
configure
in interface IPopOverPainter<C extends JRootPane,U extends WRootPaneUI>
popOver
- popover to configureinvoker
- invoker componentboundsSupplier
- source area providerdirection
- preferred display directionalignment
- preferred display alignmentprotected void updatePopOverLocation(WebPopOver popOver, Component invoker, Supplier<Rectangle> boundsProvider)
popOver
- WebPopOver to configureinvoker
- invoker componentboundsProvider
- source area bounds providerprotected void updatePopOverLocation(WebPopOver popOver, Component invoker)
popOver
- WebPopOver to configureinvoker
- invoker componentprotected void updatePopOverLocation(WebPopOver popOver, Component invoker, Rectangle invokerBounds)
popOver
- WebPopOver to configureinvoker
- invoker componentinvokerBounds
- invoker component bounds on screenprotected void installPopOverLocationUpdater(WebPopOver popOver, Component invoker, Supplier<Rectangle> boundsProvider)
popOver
- WebPopOver to configureinvoker
- invoker componentboundsProvider
- source area bounds providerprotected int getRelativeCorner(Rectangle ib, PopOverDirection actualDirection, Point actualLocation)
ib
- invoker component bounds on screenactualDirection
- actual WebPopOver directionactualLocation
- actual WebPopOver locationprotected Point getActualLocation(Rectangle ib, boolean ltr, int round, int cw, Dimension ps, Rectangle screenBounds, PopOverDirection actualDirection)
ib
- invoker component bounds on screenltr
- whether LTR orientation is active or notround
- corners roundcw
- corner widthps
- WebPopOver size without shadow widthsscreenBounds
- screen boundsactualDirection
- actual WebPopOver directionprotected Point checkTopCollision(Point location, Rectangle screenBounds)
location
- approximate WebPopOver locationscreenBounds
- screen boundsprotected Point checkBottomCollision(Point location, Dimension ps, Rectangle screenBounds)
location
- approximate WebPopOver locationps
- WebPopOver size without shadow widthsscreenBounds
- screen boundsprotected Point checkLeftCollision(Point location, Rectangle screenBounds)
location
- approximate WebPopOver locationscreenBounds
- screen boundsprotected Point checkRightCollision(Point location, Dimension ps, Rectangle screenBounds)
location
- approximate WebPopOver locationps
- WebPopOver size without shadow widthsscreenBounds
- screen boundsprotected PopOverDirection getActualDirection(Rectangle ib, boolean ltr, int cw, Dimension ps, Rectangle screenBounds)
ib
- invoker component bounds on screenltr
- whether LTR orientation is active or notcw
- corner withps
- WebPopOver size without shadow widthsscreenBounds
- screen boundsprotected Point getActualSourcePoint(Rectangle ib, boolean ltr, PopOverDirection direction)
ib
- invoker component bounds on screenltr
- whether LTR orientation is active or notdirection
- WebPopOver direction @return actual source pointprotected final WebPopOver getPopOver(C c)
c
- root paneCopyright © 2020. All rights reserved.