Class JToolBarLocation

java.lang.Object
org.fest.swing.driver.JToolBarLocation

public final class JToolBarLocation extends Object
Understands a visible location on a JToolBar.
  • Field Details

    • VALID_CONSTRAINTS

      private static String[] VALID_CONSTRAINTS
  • Constructor Details

    • JToolBarLocation

      public JToolBarLocation()
  • Method Details

    • pointToGrab

      @RunsInCurrentThread public Point pointToGrab(JToolBar toolBar)
      Returns the point where to grab the given JToolBar.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      toolBar - the target JToolBar.
      Returns:
      the point where to grab the given JToolBar.
    • dockLocation

      @RunsInCurrentThread public Point dockLocation(JToolBar toolBar, Container dock, String constraint)
      Returns the location where to dock the given JToolBar, at the given constraint position. The constraint position must be one of the constants NORTH, EAST, SOUTH, or WEST.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      toolBar - the target JToolBar.
      dock - the container where to dock the JToolBar to.
      constraint - the constraint position.
      Returns:
      the location where to dock the given JToolBar.
      Throws:
      IllegalArgumentException - if the constraint has an invalid value.
    • isHorizontal

      @RunsInCurrentThread private boolean isHorizontal(JToolBar toolBar)
    • validate

      private void validate(String constraint)
    • invalidConstraint

      private IllegalArgumentException invalidConstraint(String constraint)
    • verticalDockingYCoordinate

      private int verticalDockingYCoordinate(int dockHeight, Insets insets, int offset)