|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.Pattern
The Pattern class represents a certain style that can be used
for area filling. It consists of the following attributes:
The type attribute defines the type of the pattern to fill an area with.
The different types of patterns that can be used to fill an area are as
follows:
SOLIDGREY75GREY50GREY25GREY16GREY8HORIZONTALVERTICALDOWNUPCHECKERSEMIGREY75LIGHTHORIZONTALLIGHTVERTICALLIGHTDOWNLIGHTUPGRIDCRISSCROSS
The foreground color attribute defines the color that is used to draw the
pattern with. It is represented by an int that defines the
values for the red, green and blue components as illustrated by the following
hexadecimal pattern:
0x00rrggbb
where rr stands for the red component, gg stands for the green component and
bb stands for the blue component of the color.
The background color attribute defines the color that is used to draw the
background of the pattern. It is represented by an int that
defines the values for the red, green and blue components as illustrated by
the following hexadecimal pattern:
0x00rrggbb
where rr stands for the red component, gg stands for the green component and
bb stands for the blue component of the color.
The raster attribute defines the pattern itself. The raster is expected as a monocrome bitmap where a pixel that is set to zero is interpreted as background pixel and a pixel that is set to one is interpreded as a pixel of the pattern.
It is not possible to create an instance of this class. In fact this class
provides some predefined patterns that can be used. This predefined patterns
can be gained typewise through a call to getPattern(int, int, int).
| Field Summary | |
static int |
CHECKER
constant that tells about a type of pattern the Pattern
class supports |
static int |
CRISSCROSS
constant that tells about a type of pattern the Pattern
class supports |
static int |
DOWN
constant that tells about a type of pattern the Pattern
class supports |
static int |
GREY16
constant that tells about a type of pattern the Pattern
class supports |
static int |
GREY25
constant that tells about a type of pattern the Pattern
class supports |
static int |
GREY50
constant that tells about a type of pattern the Pattern
class supports |
static int |
GREY75
constant that tells about a type of pattern the Pattern
class supports |
static int |
GREY8
constant that tells about a type of pattern the Pattern
class supports |
static int |
GRID
constant that tells about a type of pattern the Pattern
class supports |
static int |
HORIZONTAL
constant that tells about a type of pattern the Pattern
class supports |
static int |
LIGHTDOWN
constant that tells about a type of pattern the Pattern
class supports |
static int |
LIGHTHORIZONTAL
constant that tells about a type of pattern the Pattern
class supports |
static int |
LIGHTUP
constant that tells about a type of pattern the Pattern
class supports |
static int |
LIGHTVERTICAL
constant that tells about a type of pattern the Pattern
class supports |
static Pattern |
PATTERN_CHECKER
enumeration of the predefined patterns |
static Pattern |
PATTERN_CRISSCROSS
enumeration of the predefined patterns |
static Pattern |
PATTERN_DOWN
enumeration of the predefined patterns |
static Pattern |
PATTERN_GREY16
enumeration of the predefined patterns |
static Pattern |
PATTERN_GREY25
enumeration of the predefined patterns |
static Pattern |
PATTERN_GREY50
enumeration of the predefined patterns |
static Pattern |
PATTERN_GREY75
enumeration of the predefined patterns |
static Pattern |
PATTERN_GREY8
enumeration of the predefined patterns |
static Pattern |
PATTERN_GRID
enumeration of the predefined patterns |
static Pattern |
PATTERN_HORIZONTAL
enumeration of the predefined patterns |
static Pattern |
PATTERN_LIGHTDOWN
enumeration of the predefined patterns |
static Pattern |
PATTERN_LIGHTHORIZONTAL
enumeration of the predefined patterns |
static Pattern |
PATTERN_LIGHTUP
enumeration of the predefined patterns |
static Pattern |
PATTERN_LIGHTVERTICAL
enumeration of the predefined patterns |
static int |
PATTERN_MAX
constant that indicates the maximum number of predefined patterns |
static Pattern |
PATTERN_SEMIGREY75
enumeration of the predefined patterns |
static Pattern |
PATTERN_SOLID
enumeration of the predefined patterns |
static Pattern |
PATTERN_UP
enumeration of the predefined patterns |
static Pattern |
PATTERN_VERTICAL
enumeration of the predefined patterns |
static int |
SEMIGREY75
constant that tells about a type of pattern the Pattern
class supports |
static int |
SOLID
constant that tells about a type of pattern the Pattern
class supports |
static int |
UP
constant that tells about a type of pattern the Pattern
class supports |
static int |
VERTICAL
constant that tells about a type of pattern the Pattern
class supports |
| Method Summary | |
boolean |
equals(java.lang.Object o)
|
int |
get(int x,
int y)
Returns the value of the patterns raster at the position given by x and y. |
int |
getBackground()
Returns the patterns background color value. |
int |
getBackgroundRaster()
Returns an int representation of the set background color of
the used Raster. |
int |
getForeground()
Returns the patterns foreground color value. |
int |
getForegroundRaster()
Returns an int representation of the set foreground color of
the used Raster. |
int |
getHeight()
Returns the height of the patterns raster. |
static Pattern |
getPattern(int type,
int colorback,
int colorfore)
Returns an instance of a Pattern object that belongs to the
type given by type. |
int |
getType()
Returns the type of the pattern. |
int |
getWidth()
Returns the width of the patterns raster. |
boolean |
hasAlpha()
Returns a boolean that indicates weather this pattern uses alpha values or not. |
int |
hashCode()
Overridden hashcode, please see java.lang.Object why it is
overridden here. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SOLID
Pattern
class supports
public static final int GREY75
Pattern
class supports
public static final int GREY50
Pattern
class supports
public static final int GREY25
Pattern
class supports
public static final int GREY16
Pattern
class supports
public static final int GREY8
Pattern
class supports
public static final int HORIZONTAL
Pattern
class supports
public static final int VERTICAL
Pattern
class supports
public static final int DOWN
Pattern
class supports
public static final int UP
Pattern
class supports
public static final int CHECKER
Pattern
class supports
public static final int SEMIGREY75
Pattern
class supports
public static final int LIGHTHORIZONTAL
Pattern
class supports
public static final int LIGHTVERTICAL
Pattern
class supports
public static final int LIGHTDOWN
Pattern
class supports
public static final int LIGHTUP
Pattern
class supports
public static final int GRID
Pattern
class supports
public static final int CRISSCROSS
Pattern
class supports
public static final int PATTERN_MAX
public static final Pattern PATTERN_SOLID
public static final Pattern PATTERN_GREY75
public static final Pattern PATTERN_GREY50
public static final Pattern PATTERN_GREY25
public static final Pattern PATTERN_GREY16
public static final Pattern PATTERN_GREY8
public static final Pattern PATTERN_HORIZONTAL
public static final Pattern PATTERN_VERTICAL
public static final Pattern PATTERN_DOWN
public static final Pattern PATTERN_UP
public static final Pattern PATTERN_CHECKER
public static final Pattern PATTERN_SEMIGREY75
public static final Pattern PATTERN_LIGHTHORIZONTAL
public static final Pattern PATTERN_LIGHTVERTICAL
public static final Pattern PATTERN_LIGHTDOWN
public static final Pattern PATTERN_LIGHTUP
public static final Pattern PATTERN_GRID
public static final Pattern PATTERN_CRISSCROSS
| Method Detail |
public int getType()
SOLID,
GREY75,
GREY50,
GREY25,
GREY16,
GREY8,
HORIZONTAL,
VERTICAL,
DOWN,
UP,
CHECKER,
SEMIGREY75,
LIGHTHORIZONTAL,
LIGHTVERTICAL,
LIGHTDOWN,
LIGHTUP,
GRID,
CRISSCROSSpublic int getBackground()
public int getForeground()
public int getBackgroundRaster()
int representation of the set background color of
the used Raster.
int representation of the set background color of
the used Raster.public int getForegroundRaster()
int representation of the set foreground color of
the used Raster.
int representation of the set foreground color of
the used Raster.public int getWidth()
public int getHeight()
public int get(int x,
int y)
x and y.
x - component of the position to return the value fory - component of the position to return the value for
public boolean hasAlpha()
public int hashCode()
java.lang.Object why it is
overridden here. The contract of java.util.HashSet and
java.util.HashMap requires it as well.
public boolean equals(java.lang.Object o)
public static Pattern getPattern(int type,
int colorback,
int colorfore)
Pattern object that belongs to the
type given by type.
type - the type of the Pattern to returncolorback - a background color for the Pattern.colorfore - a foreground color for the Pattern.
Pattern instance of the requested type.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||