Package com.jidesoft.swing
Class OverlayableUtils
java.lang.Object
com.jidesoft.swing.OverlayableUtils
This util class has several methods related to
Overlayable
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Overlayable[]
getAllOverlayables
(JComponent component) Gets all overlayables associated with this component and its parents.static Overlayable
getOverlayable
(JComponent component) Gets the overlayable associated with this component and its parents.static Icon
Gets the predefined icon that can be used as the overlay icon for the Swing component.static void
repaintAllOverlayables
(JComponent component) Repaints all the overlayables associated with the component or its parents.static void
repaintOverlayable
(JComponent component) Repaints the overlayable component associated with component.
-
Constructor Details
-
OverlayableUtils
public OverlayableUtils()
-
-
Method Details
-
getOverlayable
Gets the overlayable associated with this component and its parents. This method will find the first overlayable that contains the component or its parents.- Parameters:
component
- the component.- Returns:
- the overlayable.
-
getAllOverlayables
Gets all overlayables associated with this component and its parents. Different fromgetOverlayable(javax.swing.JComponent)
, this method will find the all overlayables that contain the component or its parents.- Parameters:
component
- the component- Returns:
- all the overlayables.
-
repaintOverlayable
Repaints the overlayable component associated with component. Because the overlay component is shown above the component and its child components, if any of the components repaint, the overlay component will be covered if the overlay component doesn't know to repaint immediately. Due to way Swing repaintManager works, there isn't any other better way to solve the issue other than the component has code to trigger the repaint of the overlay component. That's one reason we provide this way to repaint the overlay component easily. See below for an example of how to prepare the component to be ready for the overlayable.public OverlayTextField() { ... public void repaint(long tm, int x, int y, int width, int height) { super.repaint(tm, x, y, width, height); OverlayableUtils.repaintOverlayable(this); }
- Parameters:
component
- the component that has an overlayable.
-
repaintAllOverlayables
Repaints all the overlayables associated with the component or its parents.- Parameters:
component
- the component.
-
getPredefinedOverlayIcon
Gets the predefined icon that can be used as the overlay icon for the Swing component. Available icon names are- Parameters:
name
- name defined inOverlayableIconsFactory
.- Returns:
- the icon
-