Package ca.cgjennings.apps.arkham
Interface ContextBar.Locator
-
- Enclosing class:
- ContextBar
public static interface ContextBar.Locator
This interface is implemented by objects that customize where a context bar appears over a component.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.awt.Rectangle
getContextBarRectangle(ContextBar bar, int barWidth, int barHeight, javax.swing.JComponent target)
Returns the rectangle that will be used to determine where the context bar appears for a component.
-
-
-
Method Detail
-
getContextBarRectangle
java.awt.Rectangle getContextBarRectangle(ContextBar bar, int barWidth, int barHeight, javax.swing.JComponent target)
Returns the rectangle that will be used to determine where the context bar appears for a component. The rectangle's x and y values must be in screen coordinates. The context bar will be located relative to the returned rectangle as if that rectangle were the bounding rectangle of the target component. For example, if theContextBar.BAR_BELOW_PROPERTY
is set totrue
, then the bar will be placed below the bottom of the returned rectangle. If this method returnsnull
, then the context bar will be shown at its normal location.- Parameters:
bar
- the context bar that is being positionedbarWidth
- the width of the context bar window, in pixelsbarHeight
- the height of the context bar window, in pixelstarget
- the component that the context bar is attached to- Returns:
- the rectangle, in screen coordinates, that the bar will be
positioned relative to, or
null
to use the target component's bounding rectangle - See Also:
ContextBar.BAR_CUSTOM_LOCATION_PROPERTY
-
-