Search this API

y.view
Class LineType

java.lang.Object
  extended by java.awt.BasicStroke
      extended by y.view.LineType
All Implemented Interfaces:
java.awt.Stroke

public class LineType
extends java.awt.BasicStroke

The line type of a graphical edge representation. This class is a tame variant of java.awt.BasicStroke.

 

Field Summary
static byte CUSTOM_STYLE
          Line style specifier that describes a custom line.
static LineType DASHED_1
          A dashed line with width 1.0
static LineType DASHED_2
          A dashed line with width 2.0
static LineType DASHED_3
          A dashed line with width 3.0
static LineType DASHED_4
          A dashed line with width 4.0
static LineType DASHED_5
          A dashed line with width 5.0
static LineType DASHED_DOTTED_1
          A dashed dotted line with width 1.0
static LineType DASHED_DOTTED_2
          A dashed dotted line with width 2.0
static LineType DASHED_DOTTED_3
          A dashed dotted line with width 3.0
static LineType DASHED_DOTTED_4
          A dashed dotted line with width 4.0
static LineType DASHED_DOTTED_5
          A dashed dotted line with width 5.0
static byte DASHED_DOTTED_STYLE
          Line style specifier that describes a dashed dotted line.
static byte DASHED_STYLE
          Line style specifier that describes a dashed line.
static LineType DOTTED_1
          A dotted line with width 1.0
static LineType DOTTED_2
          A dotted line with width 2.0
static LineType DOTTED_3
          A dotted line with width 3.0
static LineType DOTTED_4
          A dotted line with width 4.0
static LineType DOTTED_5
          A dotted line with width 5.0
static byte DOTTED_STYLE
          Line style specifier that describes a dotted line.
static LineType LINE_1
          A solid line with width 1.0
static LineType LINE_2
          A solid line with width 2.0
static LineType LINE_3
          A solid line with width 3.0
static LineType LINE_4
          A solid line with width 4.0
static LineType LINE_5
          A solid line with width 5.0
static LineType LINE_6
          A solid line with width 6.0
static LineType LINE_7
          A solid line with width 7.0
static byte LINE_STYLE
          Line style specifier that describes a solid line.
 
Fields inherited from class java.awt.BasicStroke
CAP_BUTT, CAP_ROUND, CAP_SQUARE, JOIN_BEVEL, JOIN_MITER, JOIN_ROUND
 
Method Summary
static java.util.Vector availableLineTypes()
          Returns a vector that contains all available LineTypes.
static LineType createLineType(float width, int cap, int join, float miterlimit, float[] dash, float dashPhase)
          Returns a custom line type adhering to the given specifications.
static LineType createLineType(int width, byte style)
          Returns a line type with the given width and style.
static LineType createLineType(java.io.ObjectInput in)
          Returns a LineType instance whose properties have been written out before by method serializeLineType(ObjectOutput, LineType).
 boolean equals(java.lang.Object o)
          Two LineTypes are considered to be equal if all of their properties are equal.
 byte getLineStyle()
          Returns the line style of this LineType.
static LineType getLineType(int width, byte style)
          Deprecated. Use method createLineType(int, byte) instead.
 int hashCode()
           
static void serializeLineType(java.io.ObjectOutput out, LineType lt)
          Writes the given LineType instance to an object stream.
 
Methods inherited from class java.awt.BasicStroke
createStrokedShape, getDashArray, getDashPhase, getEndCap, getLineJoin, getLineWidth, getMiterLimit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_1

public static final LineType LINE_1
A solid line with width 1.0


LINE_2

public static final LineType LINE_2
A solid line with width 2.0


LINE_3

public static final LineType LINE_3
A solid line with width 3.0


LINE_4

public static final LineType LINE_4
A solid line with width 4.0


LINE_5

public static final LineType LINE_5
A solid line with width 5.0


LINE_6

public static final LineType LINE_6
A solid line with width 6.0


LINE_7

public static final LineType LINE_7
A solid line with width 7.0


DASHED_1

public static final LineType DASHED_1
A dashed line with width 1.0


DASHED_2

public static final LineType DASHED_2
A dashed line with width 2.0


DASHED_3

public static final LineType DASHED_3
A dashed line with width 3.0


DASHED_4

public static final LineType DASHED_4
A dashed line with width 4.0


DASHED_5

public static final LineType DASHED_5
A dashed line with width 5.0


DOTTED_1

public static final LineType DOTTED_1
A dotted line with width 1.0


DOTTED_2

public static final LineType DOTTED_2
A dotted line with width 2.0


DOTTED_3

public static final LineType DOTTED_3
A dotted line with width 3.0


DOTTED_4

public static final LineType DOTTED_4
A dotted line with width 4.0


DOTTED_5

public static final LineType DOTTED_5
A dotted line with width 5.0


DASHED_DOTTED_1

public static final LineType DASHED_DOTTED_1
A dashed dotted line with width 1.0


DASHED_DOTTED_2

public static final LineType DASHED_DOTTED_2
A dashed dotted line with width 2.0


DASHED_DOTTED_3

public static final LineType DASHED_DOTTED_3
A dashed dotted line with width 3.0


DASHED_DOTTED_4

public static final LineType DASHED_DOTTED_4
A dashed dotted line with width 4.0


DASHED_DOTTED_5

public static final LineType DASHED_DOTTED_5
A dashed dotted line with width 5.0


LINE_STYLE

public static final byte LINE_STYLE
Line style specifier that describes a solid line.

See Also:
getLineStyle(), Constant Field Values

DASHED_STYLE

public static final byte DASHED_STYLE
Line style specifier that describes a dashed line.

See Also:
getLineStyle(), Constant Field Values

DOTTED_STYLE

public static final byte DOTTED_STYLE
Line style specifier that describes a dotted line.

See Also:
getLineStyle(), Constant Field Values

DASHED_DOTTED_STYLE

public static final byte DASHED_DOTTED_STYLE
Line style specifier that describes a dashed dotted line.

See Also:
getLineStyle(), Constant Field Values

CUSTOM_STYLE

public static final byte CUSTOM_STYLE
Line style specifier that describes a custom line.

See Also:
getLineStyle(), Constant Field Values
Method Detail

createLineType

public static LineType createLineType(float width,
                                      int cap,
                                      int join,
                                      float miterlimit,
                                      float[] dash,
                                      float dashPhase)
Returns a custom line type adhering to the given specifications.

See Also:
createLineType(int, byte)

createLineType

public static LineType createLineType(int width,
                                      byte style)
Returns a line type with the given width and style. Style must be one of the style specifier constants LINE_STYLE, DASHED_STYLE, DOTTED_STYLE, and DASHED_DOTTED_STYLE defined in this class. Other style values (including CUSTOM_STYLE) are ignored and LINE_STYLE is used instead.

To create a line type with a custom dash pattern, method createLineType(float, int, int, float, float[], float) should be used.

Parameters:
width - The width of the line.
style - The style of the line. One of LINE_STYLE, DASHED_STYLE, DOTTED_STYLE, or DASHED_DOTTED_STYLE.
Returns:
a line type with the given width and style.

hashCode

public int hashCode()
Overrides:
hashCode in class java.awt.BasicStroke

equals

public boolean equals(java.lang.Object o)
Two LineTypes are considered to be equal if all of their properties are equal.

Overrides:
equals in class java.awt.BasicStroke

getLineType

public static LineType getLineType(int width,
                                   byte style)
Deprecated. Use method createLineType(int, byte) instead.

Returns one of the predefined LineType objects that matches the given width and style best.

Throws:
java.lang.IllegalArgumentException - if the specified style does not match LINE_STYLE, DASHED_STYLE, DOTTED_STYLE, or DASHED_DOTTED_STYLE.

getLineStyle

public byte getLineStyle()
Returns the line style of this LineType.

Returns:
one of LINE_STYLE, DASHED_STYLE, DOTTED_STYLE, DASHED_DOTTED_STYLE or CUSTOM_STYLE.

availableLineTypes

public static java.util.Vector availableLineTypes()
Returns a vector that contains all available LineTypes.


serializeLineType

public static void serializeLineType(java.io.ObjectOutput out,
                                     LineType lt)
                              throws java.io.IOException
Writes the given LineType instance to an object stream. The written-out instance can be read in again by using the method createLineType(ObjectInput).

Throws:
java.io.IOException

createLineType

public static LineType createLineType(java.io.ObjectInput in)
                               throws java.io.IOException
Returns a LineType instance whose properties have been written out before by method serializeLineType(ObjectOutput, LineType).

Throws:
java.io.IOException

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.