public abstract static class GObjectFilter.Operator extends Object
GObject
objects,
each of which can be combined using any operator.Constructor and Description |
---|
Operator() |
Modifier and Type | Method and Description |
---|---|
protected abstract GObjectFilter |
applySelfTo(GObjectFilter otherFilter)
Concrete subclasses must override this to implement an
operation on the filter being passed in to transform it into
another filter.
|
GObjectFilter |
cointainsPoint(double x,
double y)
Create a filter that checks that a GObject contains
the given point.
|
GObjectFilter |
cointainsPoint(acm.graphics.GPoint point)
Create a filter that checks that a GObject contains
the given point.
|
GObjectFilter |
colorIs(Color color)
Create a filter that checks a GObject's color.
|
GObjectFilter |
fillColorIs(Color color)
Create a filter that checks a GObject's fill color.
|
GObjectFilter |
filledIs(boolean filled)
Create a filter that checks whether a GObject is filled.
|
GObjectFilter |
heightIs(double value)
Create a filter that checks a GObject's height.
|
GObjectFilter |
isContainedWithin(Rectangle region)
Create a filter that checks whether a GObject's bounding box
(as returned by
GObject.getBounds() ) lies within a
specific rectangle--that is, whether the entire GObject's area,
rather than just its top left corner, lies within the specified
region. |
GObjectFilter |
isLocatedWithin(Rectangle region)
Create a filter that checks whether a GObject's location (its
top left corner) lies within a specific rectangle.
|
GObjectFilter |
isNear(double x,
double y)
Create a filter that checks that a GObject is within 50
pixels of the given point.
|
GObjectFilter |
isNear(double x,
double y,
double distance)
Create a filter that checks that a GObject is within
distance pixels of the given point.
|
GObjectFilter |
isNear(acm.graphics.GPoint point)
Create a filter that checks that a GObject is within 50
pixels of the given point.
|
GObjectFilter |
isNear(acm.graphics.GPoint point,
double distance)
Create a filter that checks that a GObject is within
distance pixels of the given point.
|
GObjectFilter |
lineEndPointIs(double x,
double y)
Create a filter that checks that a GPoint is a line
that ends at the point (x, y).
|
GObjectFilter |
lineEndPointIs(acm.graphics.GPoint point)
Create a filter that checks that a GOBject is a line
that ends at point.
|
GObjectFilter |
lineStartPointIs(double x,
double y)
Create a filter that checks that a GPoint is a line
that starts at the point (x, y).
|
GObjectFilter |
lineStartPointIs(acm.graphics.GPoint point)
Create a filter that checks that a GOBject is a line
that starts at point.
|
GObjectFilter |
locationIs(double x,
double y)
Create a filter that checks a GObject's location relative to
its parent.
|
GObjectFilter |
locationIs(acm.graphics.GPoint point)
Create a filter that checks a GObject's location relative to
its parent.
|
GObjectFilter |
sizeIs(double width,
double height)
Create a filter that checks a GObject's size.
|
GObjectFilter |
sizeIsWithin(double maxWidth,
double maxHeight)
Create a filter that checks a GObject's size.
|
GObjectFilter |
textIs(String text)
Create a filter that checks the text of a GObject by calling the
GObject's
getText() method. |
GObjectFilter |
typeIs(Class<? extends acm.graphics.GObject> aClass)
Create a filter that checks the class of a GObject.
|
GObjectFilter |
visibilityIs(boolean visibility)
Create a filter that checks a GObject's visibilty.
|
GObjectFilter |
widthIs(double value)
Create a filter that checks a GObject's width.
|
GObjectFilter |
xLocationIs(double x)
Create a filter that checks a GObject's x-coordinate.
|
GObjectFilter |
yLocationIs(double y)
Create a filter that checks a GObject's y-coordinate.
|
public GObjectFilter cointainsPoint(acm.graphics.GPoint point)
point
- the required pointpublic GObjectFilter cointainsPoint(double x, double y)
x
- The required x coordinate, relative to the
GObject's parent.y
- The required y coordinate, relative to the
GObject's parent.public GObjectFilter isNear(acm.graphics.GPoint point)
point
- The required point.public GObjectFilter isNear(double x, double y)
x
- The required x coordinate, relative to the
GObject's parent.y
- The required y coordinate, relative to the
GObject's parent.public GObjectFilter isNear(acm.graphics.GPoint point, double distance)
point
- The required point.distance
- The distance used to judge whether the
GObject is near the given pointpublic GObjectFilter isNear(double x, double y, double distance)
x
- The required x coordinate, relative to the
GObject's parent.y
- The required y coordinate, relative to the
GObject's parentdistance
- The distance used to judge whether the
GObject is near the given pointpublic GObjectFilter lineStartPointIs(acm.graphics.GPoint point)
point
- The required point.public GObjectFilter lineStartPointIs(double x, double y)
x
- The required x coordinate, relative to the
GObject's parent.y
- The required y coordinate, relative to the
GObject's parentpublic GObjectFilter lineEndPointIs(acm.graphics.GPoint point)
point
- The required point.public GObjectFilter lineEndPointIs(double x, double y)
x
- The required x coordinate, relative to the
GObject's parent.y
- The required y coordinate, relative to the
GObject's parentpublic GObjectFilter sizeIs(double width, double height)
width
- The required width.height
- The required height.public GObjectFilter sizeIsWithin(double maxWidth, double maxHeight)
maxWidth
- The required width.maxHeight
- The required height.public GObjectFilter locationIs(double x, double y)
x
- The required x-coordinate, relative to the
GObject's parent.y
- The required y-coordinate, relative to the
GObject's parent.public GObjectFilter locationIs(acm.graphics.GPoint point)
point
- The required point, relative to the
GObject's parent.public GObjectFilter isLocatedWithin(Rectangle region)
region
- A rectangle defining a region in the GObject's
parent.public GObjectFilter isContainedWithin(Rectangle region)
GObject.getBounds()
) lies within a
specific rectangle--that is, whether the entire GObject's area,
rather than just its top left corner, lies within the specified
region.region
- A rectangle defining a region in the GObject's
parent.Rectangle.contains(Rectangle)
.public GObjectFilter xLocationIs(double x)
x
- The required x-coordinate, relative to the
GObject's parent.public GObjectFilter yLocationIs(double y)
y
- The required y-coordinate, relative to the
GObject's parent.public GObjectFilter textIs(String text)
getText()
method.text
- The text to look forgetText()
returns the specified text.public GObjectFilter typeIs(Class<? extends acm.graphics.GObject> aClass)
aClass
- The required class to check for (any subclass will
also match).public GObjectFilter widthIs(double value)
value
- The width to look for.public GObjectFilter heightIs(double value)
value
- The height to look for.public GObjectFilter colorIs(Color color)
color
- The required Color.public GObjectFilter fillColorIs(Color color)
color
- The required Color.public GObjectFilter filledIs(boolean filled)
filled
- The required boolean value.public GObjectFilter visibilityIs(boolean visibility)
visibility
- The required boolean value.protected abstract GObjectFilter applySelfTo(GObjectFilter otherFilter)
otherFilter
- The argument to transform (second argument,
for binary operators)