Package com.jidesoft.swing
Interface Overlayable
-
- All Superinterfaces:
javax.swing.SwingConstants
- All Known Implementing Classes:
DefaultOverlayable
public interface Overlayable extends javax.swing.SwingConstantsOverlayableprovides a way to add a number of components on top of another component as the overlay components. Usually we make a component implementing Overlayable interface although it is not required. This interface will allow user to add/remove other components as overlay components and set their location independently.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLIENT_PROPERTY_OVERLAYABLEClient property.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddOverlayComponent(javax.swing.JComponent component)Adds an overlay component to the center.voidaddOverlayComponent(javax.swing.JComponent component, int location)Adds an overlay component at the specified location.voidaddOverlayComponent(javax.swing.JComponent component, int location, int index)Adds an overlay component at the specified location.javax.swing.JComponent[]getOverlayComponents()Gets the overlay component.intgetOverlayLocation(javax.swing.JComponent component)Gets the overlay component location.java.awt.InsetsgetOverlayLocationInsets()Gets the insets of the overlay component relative to the border of the component.voidremoveOverlayComponent(javax.swing.JComponent component)Removes an overlay component that was added before.voidsetOverlayLocation(javax.swing.JComponent component, int location)Sets the overlay component location.voidsetOverlayLocationInsets(java.awt.Insets insets)Sets the insets of the overlay component relative to the border of the component.voidsetOverlayVisible(boolean visible)Sets all the overlay components visible or invisible.
-
-
-
Field Detail
-
CLIENT_PROPERTY_OVERLAYABLE
static final java.lang.String CLIENT_PROPERTY_OVERLAYABLE
Client property. If a component has this property, the property will be an Overlayable. The component is the actual component of the Overlayable.- See Also:
- Constant Field Values
-
-
Method Detail
-
addOverlayComponent
void addOverlayComponent(javax.swing.JComponent component)
Adds an overlay component to the center.- Parameters:
component- the overlay component.
-
addOverlayComponent
void addOverlayComponent(javax.swing.JComponent component, int location)Adds an overlay component at the specified location. The location could be one of the following values.SwingConstants.CENTERSwingConstants.SOUTHSwingConstants.NORTHSwingConstants.WESTSwingConstants.EASTSwingConstants.NORTH_EASTSwingConstants.NORTH_WESTSwingConstants.SOUTH_EASTSwingConstants.SOUTH_WEST
- Parameters:
component- the overlay component.location- the overlay location.
-
addOverlayComponent
void addOverlayComponent(javax.swing.JComponent component, int location, int index)Adds an overlay component at the specified location. The location could be one of the following values.SwingConstants.CENTERSwingConstants.SOUTHSwingConstants.NORTHSwingConstants.WESTSwingConstants.EASTSwingConstants.NORTH_EASTSwingConstants.NORTH_WESTSwingConstants.SOUTH_EASTSwingConstants.SOUTH_WEST
- Parameters:
component- the overlay component.location- the overlay location.index- the overlay index. 0 means the first overlay component. -1 means the last overlay component.
-
removeOverlayComponent
void removeOverlayComponent(javax.swing.JComponent component)
Removes an overlay component that was added before.- Parameters:
component-
-
getOverlayComponents
javax.swing.JComponent[] getOverlayComponents()
Gets the overlay component.- Returns:
- the overlay component.
-
setOverlayLocation
void setOverlayLocation(javax.swing.JComponent component, int location)Sets the overlay component location. The valid values are defined in SwingConstants. They areSwingConstants.CENTERSwingConstants.SOUTHSwingConstants.NORTHSwingConstants.WESTSwingConstants.EASTSwingConstants.NORTH_EASTSwingConstants.NORTH_WESTSwingConstants.SOUTH_EASTSwingConstants.SOUTH_WEST
- Parameters:
location- the overlay component location.
-
getOverlayLocation
int getOverlayLocation(javax.swing.JComponent component)
Gets the overlay component location. If -1, it means the component doesn't exit.- Returns:
- the overlay component location.
-
getOverlayLocationInsets
java.awt.Insets getOverlayLocationInsets()
Gets the insets of the overlay component relative to the border of the component. This will affect the actual location of the overlay component except CENTER. If an edge of the insets is greater than 0, it will move the overlay component outwards on that edge. On the opposite, if the value is negative, it will move inward.- Returns:
- the insets of the overlay component relative to the border of the component.
-
setOverlayLocationInsets
void setOverlayLocationInsets(java.awt.Insets insets)
Sets the insets of the overlay component relative to the border of the component.- Parameters:
insets- the insets of the overlay component relative to the border of the component.
-
setOverlayVisible
void setOverlayVisible(boolean visible)
Sets all the overlay components visible or invisible. If you want to set one overlay component visible/invisible, you just need to call setVisible of that component.- Parameters:
visible- true to set it visible. False to invisible.
-
-