public abstract static class GUIFilter.Operator extends Object
Component
objects,
each of which can be combined using any operator.Constructor and Description |
---|
Operator() |
Modifier and Type | Method and Description |
---|---|
GUIFilter |
ancestorIs(Component ancestor)
Create a filter that checks a component's ancestor
|
protected abstract GUIFilter |
applySelfTo(GUIFilter otherFilter)
Concrete subclasses must override this to implement an
operation on the filter being passed in to transform it into
another filter.
|
GUIFilter |
enabledIs(boolean value)
Create a filter that succeeds if a component is enabled.
|
GUIFilter |
hasFocusIs(boolean value)
Create a filter that succeeds if a component has focus.
|
GUIFilter |
heightIs(int value)
Create a filter that checks a component's height.
|
GUIFilter |
isContainedWithin(Rectangle region)
Create a filter that checks whether a component's bounding box
(as returned by
Component.getBounds() ) lies within a
specific rectangle--that is, whether the entire component's area,
rather than just its top left corner, lies within the specified
region. |
GUIFilter |
isLocatedWithin(Rectangle region)
Create a filter that checks whether a component's location (its
top left corner) lies within a specific rectangle.
|
GUIFilter |
locationIs(int x,
int y)
Create a filter that checks a component's location relative to
its parent.
|
GUIFilter |
nameIs(String name)
Create a filter that compares the name of a component against a
given value.
|
GUIFilter |
parentIs(Component parent)
Create a filter that checks a component's parent
|
GUIFilter |
sizeIs(int width,
int height)
Create a filter that checks a component's size.
|
GUIFilter |
sizeIsWithin(int maxWidth,
int maxHeight)
Create a filter that checks a component's size.
|
GUIFilter |
textIs(String text)
Create a filter that checks the text of a component by calling the
component's
getText() method. |
GUIFilter |
typeIs(Class<? extends Component> aClass)
Create a filter that checks the class of a component.
|
GUIFilter |
widthIs(int value)
Create a filter that checks a component's width.
|
GUIFilter |
xLocationIs(int x)
Create a filter that checks a component's x-coordinate.
|
GUIFilter |
yLocationIs(int y)
Create a filter that checks a component's y-coordinate.
|
public GUIFilter nameIs(String name)
name
- The name to look forpublic GUIFilter textIs(String text)
getText()
method.text
- The text to look forgetText()
returns the specified text.public GUIFilter hasFocusIs(boolean value)
value
- True when searching for a component with focus, or
false when searching for one without.public GUIFilter enabledIs(boolean value)
value
- True when searching for an enabled component, or false
when searching for a disabled component.public GUIFilter typeIs(Class<? extends Component> aClass)
aClass
- The required class to check for (any subclass will
also match).public GUIFilter widthIs(int value)
value
- The width to look for.public GUIFilter heightIs(int value)
value
- The height to look for.public GUIFilter sizeIs(int width, int height)
width
- The required width.height
- The required height.public GUIFilter sizeIsWithin(int maxWidth, int maxHeight)
maxWidth
- The required width.maxHeight
- The required height.public GUIFilter xLocationIs(int x)
x
- The required x-coordinate, relative to the
component's parent.public GUIFilter yLocationIs(int y)
y
- The required y-coordinate, relative to the
component's parent.public GUIFilter locationIs(int x, int y)
x
- The required x-coordinate, relative to the
component's parent.y
- The required y-coordinate, relative to the
component's parent.public GUIFilter isLocatedWithin(Rectangle region)
region
- A rectangle defining a region in the component's
parent.public GUIFilter isContainedWithin(Rectangle region)
Component.getBounds()
) lies within a
specific rectangle--that is, whether the entire component's area,
rather than just its top left corner, lies within the specified
region.region
- A rectangle defining a region in the component's
parent.Rectangle.contains(Rectangle)
.public GUIFilter parentIs(Component parent)
parent
- the parent component of the component being checkedpublic GUIFilter ancestorIs(Component ancestor)
ancestor
- one of the ancestors of the component being checkedprotected abstract GUIFilter applySelfTo(GUIFilter otherFilter)
otherFilter
- The argument to transform (second argument,
for binary operators)