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 the ContextBar.BAR_BELOW_PROPERTY is set to true, then the bar will be placed below the bottom of the returned rectangle. If this method returns null, then the context bar will be shown at its normal location.
        Parameters:
        bar - the context bar that is being positioned
        barWidth - the width of the context bar window, in pixels
        barHeight - the height of the context bar window, in pixels
        target - 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