|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.MarkerFormat
A MarkerFormat is a somewhat special format: It defines the
appearance of line endpoints. This format consists of the following
attributes:
MarkerFormat.
The appearance of these types is shown in the following image:
The different types provided are as follows:
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
The size attribute defines the size of the marker. It can be freely chosen and is given in coordinate system units.
The stroke attribute is represented by a StrokeFormat and
defines the stroke the marker is surrounded by.
The paint attribute is represented by a PaintFormat and
defines the filling of the marker.
Since the MarkerFormat is an object that is frequently used
within the graphics api and all apis that use the
graphics api MarkerFormats are subject of
pooling. The pooling of the MarkerFormat instances is being done
by the FormatPool. To get more informations about this class
take a look at the documentation about the FormatPool.
In order to pool a MarkerFormat it has to be immutable because
maybe many objects have a reference on the same MarkerFormat and
modifying the MarkerFormat will affect all these objects.
For the pooling also an unique expression is needed so that a
MarkerFormat can be surely identified. The unique expression is
called the canonical description. This canonical description is made up of
the attributes a MarkerFormat consists of and it can be gained
by Format.getCanonicalDescription().
A MarkerFormat can only be created by using the
FormatPool.parseMarkerFormat(String) method to
ensure a correct pooling behaviour. You can obtain the canonical description
by calling the on of the static methods called getCanonicalDescription().
A MarkerFormat is usually applied to a Primitive
(e.g. Line2D, Polyline2D)
by calling methods like Line2D.setMarkerBegin(MarkerFormat)
or Line2D.setMarkerEnd(MarkerFormat).
The MarkerFormat contains other formats like PaintFormat
and StrokeFormat.
| Field Summary | |
static int |
ARROW_LARGEFILLED
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_LARGEFILLED_HALF
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_LARGEFILLED_HALFLONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_LARGEFILLED_LONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_LARGENOTFILLED
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_LARGENOTFILLED_LONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_MEDIUMFILLED
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_MEDIUMFILLED_HALF
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_MEDIUMFILLED_HALFLONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_MEDIUMFILLED_LONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_MEDIUMNOTFILLED
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_MEDIUMNOTFILLED_LONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_SMALLFILLED
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_SMALLFILLED_HALF
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_SMALLFILLED_HALFLONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_SMALLFILLED_LONG
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_SMALLNOTFILLED
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
ARROW_SMALLNOTFILLED_LONG
Constant that tells about a type marker supported by the MarkerFormat class |
protected static java.lang.String |
CANONIC_DESCRIPTION_DELIMITER
constant needed as delimitier for the canonical description |
static MarkerFormat |
DEFAULT_INVISIBLE_MARKER
global constant that defines an invisible marker |
static int |
DIAMOND
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
INVISIBLE
Constant that tells about a type marker supported by the MarkerFormat class |
static int |
MARKER_TYPE_MAX
global constant that tells about the count of different marker types |
static int |
SQUARE
Constant that tells about a type marker supported by the MarkerFormat class |
protected static java.lang.String |
TOKEN_PAINT
enumeration that tells about the canonical description tokens |
protected static java.lang.String |
TOKEN_SIZE
enumeration that tells about the canonical description tokens |
protected static java.lang.String |
TOKEN_STROKE
enumeration that tells about the canonical description tokens |
protected static java.lang.String |
TOKEN_TYPE
enumeration that tells about the canonical description tokens |
static int |
VERTLINE
Constant that tells about a type marker supported by the MarkerFormat class |
| Constructor Summary | |
MarkerFormat(int type,
int size,
StrokeFormat stroke,
PaintFormat paint)
Constructor for MarkerFormat. |
|
| Method Summary | |
java.lang.String |
getCanonicalDescription()
Returns the canonical description of a MarkerFormat. |
static java.lang.String |
getCanonicalDescription(int type,
int size,
StrokeFormat stroke,
PaintFormat paint)
Returns the canonical description of a MarkerFormat. |
static java.lang.String |
getCanonicalDescription(java.lang.String type,
java.lang.String size,
java.lang.String stroke,
java.lang.String paint)
Returns the canonical description of a MarkerFormat. |
java.lang.Object[][] |
getFormatData()
Returns an array filled with the attributes of the MarkerFormat. |
PaintFormat |
getPaint()
Returns the PaintFormat the MarkerFormat uses
to fill the background. |
int |
getSize()
Returns the size. |
StrokeFormat |
getStroke()
Returns the StrokeFormat the MarkerFormat uses
to draw borders or lines. |
int |
getType()
Returns the type. |
boolean |
isVisible()
Returns a boolean that indicates whether the
MarkerFormat is visible or not. |
java.lang.String |
toString()
Returns a String that represent the
MarkerFormat and all of the attributes of it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int INVISIBLE
MarkerFormat class
public static final int ARROW_SMALLFILLED
MarkerFormat class
public static final int ARROW_MEDIUMFILLED
MarkerFormat class
public static final int ARROW_LARGEFILLED
MarkerFormat class
public static final int ARROW_SMALLFILLED_LONG
MarkerFormat class
public static final int ARROW_MEDIUMFILLED_LONG
MarkerFormat class
public static final int ARROW_LARGEFILLED_LONG
MarkerFormat class
public static final int ARROW_SMALLFILLED_HALF
MarkerFormat class
public static final int ARROW_MEDIUMFILLED_HALF
MarkerFormat class
public static final int ARROW_LARGEFILLED_HALF
MarkerFormat class
public static final int ARROW_SMALLFILLED_HALFLONG
MarkerFormat class
public static final int ARROW_MEDIUMFILLED_HALFLONG
MarkerFormat class
public static final int ARROW_LARGEFILLED_HALFLONG
MarkerFormat class
public static final int ARROW_SMALLNOTFILLED
MarkerFormat class
public static final int ARROW_MEDIUMNOTFILLED
MarkerFormat class
public static final int ARROW_LARGENOTFILLED
MarkerFormat class
public static final int ARROW_SMALLNOTFILLED_LONG
MarkerFormat class
public static final int ARROW_MEDIUMNOTFILLED_LONG
MarkerFormat class
public static final int ARROW_LARGENOTFILLED_LONG
MarkerFormat class
public static final int SQUARE
MarkerFormat class
public static final int DIAMOND
MarkerFormat class
public static final int VERTLINE
MarkerFormat class
public static final int MARKER_TYPE_MAX
protected static final java.lang.String CANONIC_DESCRIPTION_DELIMITER
protected static final java.lang.String TOKEN_TYPE
protected static final java.lang.String TOKEN_SIZE
protected static final java.lang.String TOKEN_STROKE
protected static final java.lang.String TOKEN_PAINT
public static final MarkerFormat DEFAULT_INVISIBLE_MARKER
| Constructor Detail |
public MarkerFormat(int type,
int size,
StrokeFormat stroke,
PaintFormat paint)
| Method Detail |
public int getSize()
public int getType()
public StrokeFormat getStroke()
StrokeFormat the MarkerFormat uses
to draw borders or lines.
StrokeFormat for the markerpublic PaintFormat getPaint()
PaintFormat the MarkerFormat uses
to fill the background.
PaintFormat for the markerpublic boolean isVisible()
boolean that indicates whether the
MarkerFormat is visible or not.
MarkerFormatpublic java.lang.Object[][] getFormatData()
MarkerFormat. The indices of the attributes are given by
constants defined in this class. This array is used by
Renderers and Devices. To get more informations
about this objects take a look at the documentation of
Renderer and
Device
MarkerFormatpublic java.lang.String getCanonicalDescription()
MarkerFormat. For
instance this description is used for the pooling of
MarkerFormats. It can also be used to compare two instances
of a MarkerFormat.
getCanonicalDescription in interface FormatMarkerFormatpublic java.lang.String toString()
String that represent the
MarkerFormat and all of the attributes of it. For instance
this representation can be used for tracing purposes and such.
toString in interface FormatMarkerFormat
public static final java.lang.String getCanonicalDescription(int type,
int size,
StrokeFormat stroke,
PaintFormat paint)
MarkerFormat. For
instance this description is used for the pooling of
MarkerFormats. It can also be used to compare two instances
of a MarkerFormat.
type - the type of a MarkerFormatsize - the size of a MarkerFormatstroke - the StrokeFormat of a
MarkerFormatpaint - the PaintFormat of a MarkerFormat
MarkerFormat
public static final java.lang.String getCanonicalDescription(java.lang.String type,
java.lang.String size,
java.lang.String stroke,
java.lang.String paint)
MarkerFormat. For
instance this description is used for the pooling of
MarkerFormats. It can also be used to compare two instances
of a MarkerFormat.
type - the type of a MarkerFormatsize - the size of a MarkerFormatstroke - the StrokeFormat of a
MarkerFormatpaint - the PaintFormat of a MarkerFormat
MarkerFormat
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||