public abstract static class ObjectdrawFilter.Operator extends Object
DrawableInterface
objects,
each of which can be combined using any operator.Constructor and Description |
---|
Operator() |
Modifier and Type | Method and Description |
---|---|
protected abstract ObjectdrawFilter |
applySelfTo(ObjectdrawFilter otherFilter)
Concrete subclasses must override this to implement an
operation on the filter being passed in to transform it into
another filter.
|
ObjectdrawFilter |
colorIs(Color color)
Create a filter that checks a shape's color.
|
ObjectdrawFilter |
heightIs(int value)
Create a filter that checks a shape's height.
|
ObjectdrawFilter |
hiddenIs(boolean hidden)
Create a filter that checks whether a shape is hidden.
|
ObjectdrawFilter |
isContainedWithin(Rectangle region)
Create a filter that checks whether a shape's bounding box
lies within a specific rectangle--that is, whether the entire
shape's area rather than just its top left corner, lies within
the specified region.
|
ObjectdrawFilter |
isLocatedWithin(Rectangle region)
Create a filter that checks whether a shape's location (its
top left corner) lies within a specific rectangle.
|
ObjectdrawFilter |
lineEndLocationIs(int x,
int y)
Create a filter that checks whether a line ends at a given
coordinate.
|
ObjectdrawFilter |
lineEndLocationIs(objectdraw.Location location)
Create a filter that checks whether a line starts at a given
location.
|
ObjectdrawFilter |
lineStartLocationIs(int x,
int y)
Create a filter that checks whether a line starts at a given
coordinate.
|
ObjectdrawFilter |
lineStartLocationIs(objectdraw.Location location)
Create a filter that checks whether a line starts at a given
location.
|
ObjectdrawFilter |
locationIs(int x,
int y)
Create a filter that checks a shape's location.
|
ObjectdrawFilter |
sizeIs(int width,
int height)
Create a filter that checks a shape's size.
|
ObjectdrawFilter |
sizeIsWithin(int maxWidth,
int maxHeight)
Create a filter that checks a shape's size.
|
ObjectdrawFilter |
textIs(String text)
Create a filter that checks the text of a shape by calling the
shape's
getText() method, if it has one. |
ObjectdrawFilter |
typeIs(Class<? extends objectdraw.DrawableInterface> aClass)
Create a filter that checks the class of a shape.
|
ObjectdrawFilter |
widthIs(int value)
Create a filter that checks a shape's width.
|
ObjectdrawFilter |
xLocationIs(int x)
Create a filter that checks a shape's x-coordinate.
|
ObjectdrawFilter |
yLocationIs(int y)
Create a filter that checks a shape's y-coordinate.
|
public ObjectdrawFilter textIs(String text)
getText()
method, if it has one.text
- The text to look forgetText()
is a valid method and
returns the specified text.public ObjectdrawFilter typeIs(Class<? extends objectdraw.DrawableInterface> aClass)
aClass
- The required class to check for (any subclass will
also match).public ObjectdrawFilter widthIs(int value)
value
- The width to look for.public ObjectdrawFilter heightIs(int value)
value
- The height to look for.public ObjectdrawFilter sizeIs(int width, int height)
width
- The required width.height
- The required height.public ObjectdrawFilter sizeIsWithin(int maxWidth, int maxHeight)
maxWidth
- The required width.maxHeight
- The required height.public ObjectdrawFilter xLocationIs(int x)
x
- The required x-coordinatepublic ObjectdrawFilter yLocationIs(int y)
y
- The required y-coordinatepublic ObjectdrawFilter locationIs(int x, int y)
x
- The required x-coordinate.y
- The required y-coordinate.public ObjectdrawFilter isLocatedWithin(Rectangle region)
region
- A rectangle defining a region.public ObjectdrawFilter isContainedWithin(Rectangle region)
region
- A rectangle defining a region.Rectangle.contains(Rectangle)
.public ObjectdrawFilter colorIs(Color color)
color
- the color to check for.public ObjectdrawFilter hiddenIs(boolean hidden)
hidden
- a boolean indicating the hidden state to check for.public ObjectdrawFilter lineStartLocationIs(int x, int y)
x
- the required x-coordinate.y
- the required y-coordinate.public ObjectdrawFilter lineStartLocationIs(objectdraw.Location location)
location
- the required Location.public ObjectdrawFilter lineEndLocationIs(int x, int y)
x
- the required x-coordinate.y
- the required y-coordinate.public ObjectdrawFilter lineEndLocationIs(objectdraw.Location location)
location
- the required Locationprotected abstract ObjectdrawFilter applySelfTo(ObjectdrawFilter otherFilter)
otherFilter
- The argument to transform (second argument,
for binary operators)