|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.page.JCDrawStyle
JCDrawStyle
creates styles for drawn objects, specifying line and fill
attributes (for example, color and width).
Field Summary | |
static int |
ALIGN_TO_BOTTOM
The bottom of the object is aligned to the bottom of the text descender. |
static int |
ALIGN_TO_TOP
The top of the object is aligned to the top of the text ascender. |
static com.klg.jclass.page.JCDrawStyle |
BLANK
A drawing style that does not paint drawn lines. |
static int |
CENTER_ABOVE_BASELINE
The center of the object aligns to the center of the text ascender (space used above the baseline). |
static int |
CENTER_IN_LINE
The center of the object aligns to the center of the text (between the top of the ascender and bottom of the descender). |
static int |
CENTER_ON_BASELINE
The center of the object aligns to the text baseline. |
protected JCUnit.Measure |
dashLength
The length of dashes and spaces in a broken line style. |
static String |
DEFAULT_1PT_LINE
The name of the style that draws a solid 1 point line. |
static String |
DEFAULT_2PT_LINE
The name of the style which draws a solid line 2 points in width. |
static String |
DEFAULT_LINE
The name of the style which draws a solid line of minimum width. |
static int |
FILL_RULE_EVEN_ODD
Uses the even/odd rule to determine the inside of a closed figure. |
static int |
FILL_RULE_NON_ZERO_WINDING
Uses the non-zero winding rule to determine the inside of a closed figure. |
protected Color |
fillForeground
Foreground colour for filling graphics. |
protected int |
fillRule
Method for determining which parts of a complex polygon are "inside". |
protected Color |
foreground
Foreground colour for drawing graphics. |
protected boolean |
immutable
Flag identifying if the style may be modified. |
protected Map |
immutableDrawStyles
|
protected static TreeMap |
instanceCollection
A list containing references to all named style instances. |
static com.klg.jclass.page.JCDrawStyle |
LINE
A default style for thin black lines. |
static com.klg.jclass.page.JCDrawStyle |
LINE_1POINT
A default style for thick (1 point) black lines. |
static com.klg.jclass.page.JCDrawStyle |
LINE_2POINT
A default style for very thick (2 point) black lines. |
static com.klg.jclass.page.JCDrawStyle |
LINE_DASHED
A default style for thin dashed lines. |
static com.klg.jclass.page.JCDrawStyle |
LINE_DOUBLE
A default style for thin black double lines. |
static int |
LINE_TYPE_BROKEN
Draws a dashed/dotted line. |
static int |
LINE_TYPE_DOUBLE
Draws a pair of parallel lines. |
static int |
LINE_TYPE_NONE
Don't draw the line. |
static int |
LINE_TYPE_PLAIN
Draws a single unornamented line. |
static int |
LINE_TYPE_SINGLE
Draws a single unornamented line. |
protected JCUnit.Measure |
lineSpacing
The spacing between lines in a multi-line style. |
protected int |
lineType
The type of line to draw. |
protected JCUnit.Measure |
lineWidth
Width of a drawn line. |
protected String |
name
The unique name of the style. |
static int |
POSITION_BELOW_BASELINE
The top of the object aligns to the text baseline. |
static int |
POSITION_ON_BASELINE
The bottom of the object aligns to the text baseline. |
protected static int |
styleCount
Counts of the number of instances of the class. |
protected static String |
UNAMED_STYLE_PREFIX
|
Constructor Summary | |
JCDrawStyle()
Creates a draw style with default name and values. |
|
JCDrawStyle(String name)
Creates a draw style with the given name and default values. |
|
JCDrawStyle(String name,
Color foreground,
int fill_rule,
int line_type,
JCUnit.Measure line_width,
JCUnit.Measure line_spacing,
JCUnit.Measure dash_length,
boolean immutable)
Creates a named draw style with the given attributes. |
Method Summary | |
Object |
clone()
Returns a style which is a copy of this one. |
boolean |
equals(Object o)
Compares this text style to the passed-in style. |
JCUnit.Measure |
getDashLength()
Gets the length of dashes and space between dashes in a broken line style. |
JCUnit.Measure |
getDrawnWidth()
Gets the total width of a line. |
Color |
getFillForegroundColor()
Gets the color in which figures are to be filled. |
int |
getFillRule()
Gets the method used to determine the "inside" and "outside" of a polygon. |
Color |
getForegroundColor()
Gets the color in which lines are to be drawn. |
com.klg.jclass.page.JCDrawStyle |
getImmutable()
Returns this object if it is already immutable; otherwise, sees if a style with the same properties already exists in the immutable cache and returns it. |
JCUnit.Measure |
getLineSpacing()
Gets the spacing between drawn lines in a multi-line style. |
int |
getLineType()
Gets the type used for drawing lines. |
JCUnit.Measure |
getLineWidth()
Gets the width of drawn lines. |
String |
getName()
Gets the name of the style. |
static Map |
getStyleList()
Returns the entire style Map. |
static Iterator |
getStyles()
Provides an iterator over all immutable styles. |
int |
hashCode()
Creates a hash that generates the same value depending on the property values. |
boolean |
isEqualBorder(com.klg.jclass.page.JCDrawStyle style)
Compares another draw style to this one and returns true if the two
draw styles are equivalent. |
boolean |
isMutable()
Determines if the style can be modified. |
void |
makeImmutable()
Sets the style so that it can no longer be modified. |
void |
makeImmutableAndOverride()
Sets the style so that it can no longer be modified and stores its name in the lookup map, overriding any existing style with the same name. |
void |
makeImmutableAndStore()
Sets the style so that it can no longer be modified, storing the style in the name lookup table. |
void |
setDashLength(JCUnit.Measure length)
Sets the length of dashes and space between dashes in a broken line style. |
void |
setFillForegroundColor(Color color)
Sets the color in which fills are to be drawn. |
void |
setFillRule(int fill_rule)
Sets the method used to determine the "inside" and "outside" of a polygon. |
void |
setForegroundColor(Color color)
Sets the color in which lines are to be drawn. |
void |
setLineSpacing(JCUnit.Measure spacing)
Gets the spacing between drawn lines in a multi-line style. |
void |
setLineType(int line_type)
Sets the type of line this style will draw. |
void |
setLineWidth(JCUnit.Measure width)
Sets the width of drawn lines. |
void |
setName(String name)
Sets a name for the style. |
static com.klg.jclass.page.JCDrawStyle |
stringToStyle(String name)
Returns the style which matches the given name. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String name
protected Color foreground
protected Color fillForeground
protected int fillRule
protected JCUnit.Measure lineWidth
protected int lineType
protected JCUnit.Measure lineSpacing
protected JCUnit.Measure dashLength
protected boolean immutable
protected static int styleCount
protected static TreeMap instanceCollection
public static final int FILL_RULE_EVEN_ODD
public static final int FILL_RULE_NON_ZERO_WINDING
public static final int LINE_TYPE_NONE
public static final int LINE_TYPE_PLAIN
public static final int LINE_TYPE_SINGLE
public static final int LINE_TYPE_BROKEN
public static final int LINE_TYPE_DOUBLE
public static final int POSITION_ON_BASELINE
public static final int POSITION_BELOW_BASELINE
public static final int CENTER_ON_BASELINE
public static final int CENTER_ABOVE_BASELINE
public static final int CENTER_IN_LINE
public static final int ALIGN_TO_TOP
public static final int ALIGN_TO_BOTTOM
public static final String DEFAULT_LINE
public static final String DEFAULT_1PT_LINE
public static final String DEFAULT_2PT_LINE
protected static final String UNAMED_STYLE_PREFIX
protected Map immutableDrawStyles
public static final com.klg.jclass.page.JCDrawStyle BLANK
name
property for this style is default blank
.
public static final com.klg.jclass.page.JCDrawStyle LINE
name
property for
this style is default line
.
public static final com.klg.jclass.page.JCDrawStyle LINE_DOUBLE
name
property
for this style is default double line
.
public static final com.klg.jclass.page.JCDrawStyle LINE_1POINT
name
property for this style is default 1pt line
.
public static final com.klg.jclass.page.JCDrawStyle LINE_2POINT
name
property for this style is default 2pt line
public static final com.klg.jclass.page.JCDrawStyle LINE_DASHED
name
property for
this style is dashed line
.
Constructor Detail |
public JCDrawStyle(String name, Color foreground, int fill_rule, int line_type, JCUnit.Measure line_width, JCUnit.Measure line_spacing, JCUnit.Measure dash_length, boolean immutable)
name
- the name to assign to the styleforeground
- the colour to paint drawn objectsfill_rule
- the rule used to determine the inside of figuresline_type
- the type of line to be drawnline_width
- the width of a drawn lineline_spacing
- the distance between double linesdash_length
- the length of dashes and spaces in a broken lineimmutable
- indicates if this style is to be made immutablepublic JCDrawStyle()
public JCDrawStyle(String name)
name
- the name to give the new draw styleMethod Detail |
public String getName()
public void setName(String name)
name
- the new name for the stylepublic Color getForegroundColor()
public void setForegroundColor(Color color)
color
- the foreground color to assign to the graphicspublic Color getFillForegroundColor()
public void setFillForegroundColor(Color color)
color
- the foreground color to assign to fill areaspublic int getFillRule()
public void setFillRule(int fill_rule)
fill_rule
- the rule used to determine "inside" for filling a polygonpublic JCUnit.Measure getLineWidth()
public void setLineWidth(JCUnit.Measure width)
width
- the width to draw individual linespublic int getLineType()
public void setLineType(int line_type)
line_type
- the type of line that this style will usepublic JCUnit.Measure getLineSpacing()
public void setLineSpacing(JCUnit.Measure spacing)
spacing
- the width used to separate multiple parallel linespublic JCUnit.Measure getDrawnWidth()
public JCUnit.Measure getDashLength()
public void setDashLength(JCUnit.Measure length)
length
- the length of a dash in a drawn linepublic boolean isMutable()
true
/false
, depending whether or not the style can be modifiedpublic void makeImmutable()
public void makeImmutableAndStore()
public void makeImmutableAndOverride()
public Object clone()
clone
in class Object
public boolean isEqualBorder(com.klg.jclass.page.JCDrawStyle style)
true
if the two
draw styles are equivalent.
style
- the draw style to compare to this one
true
if the draw styles result in approximately "equivalent" borderspublic static Iterator getStyles()
SortedMap
public static Map getStyleList()
public static com.klg.jclass.page.JCDrawStyle stringToStyle(String name)
name
- the name of an existing style
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
o
-
public com.klg.jclass.page.JCDrawStyle getImmutable()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |