Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Introduce FxRobot::bounds() and BoundsQuery. #258

Merged
merged 3 commits into from Mar 27, 2016

Conversation

hastebrot
Copy link
Member

First very simple iteration of BoundsQuery. BoundsQuery::query() only returns bounds on desktop screen, for now. In the future it should also support bounds for Nodes (layout, in local, in parent, in scene, in window) and bounds relative to other kinds of screen objects.

public interface BoundsQuery {
    public Bounds query();
}

This includes the new FxRobot::bounds() methods.

public interface FxRobotInterface {
    public BoundsQuery bounds(double minX,
                              double minY,
                              double width,
                              double height);
    public BoundsQuery bounds(Point2D point);
    public BoundsQuery bounds(Bounds bounds);
    public BoundsQuery bounds(Node node);
    public BoundsQuery bounds(Scene scene);
    public BoundsQuery bounds(Window window);

    // Convenience methods:
    public BoundsQuery bounds(String query);
    public <T extends Node> BoundsQuery bounds(Matcher<T> matcher);
    public <T extends Node> BoundsQuery bounds(Predicate<T> predicate);
}

@hastebrot
Copy link
Member Author

BoundsQueryUtils basic methods:

  • Bounds bounds(double minX, double minY, double width, double height)
  • Bounds bounds(Point2D point)
  • Bounds bounds(Dimension2D dimension)
  • Bounds bounds(Rectangle2D region)
  • Bounds bounds(Scene scene)
  • Bounds bounds(Window window)

BoundsQueryUtils node methods:

  • Bounds nodeBounds(Node node)
  • Bounds nodeBoundsInLocal(Node node)
  • Bounds nodeBoundsInParent(Node node)
  • Bounds nodeBoundsInScene(Node node)

BoundsQueryUtils screen methods:

  • Bounds boundsOnScreen(Bounds boundsInScene, Scene scene)
  • Bounds boundsOnScreen(Bounds boundsInWindow, Window window)
  • Bounds boundsOnScreen(Bounds boundsOnScreen, Rectangle2D screenRegion)

@hastebrot hastebrot merged commit 61514e2 into TestFX:master Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant