y.view
Class LineType

java.lang.Object
  |
  +--java.awt.BasicStroke
        |
        +--y.view.LineType
All Implemented Interfaces:
Stroke

public class LineType
extends 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 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 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(ObjectInputStream in)
          Returns a LineType instance whose properties have been written out before by method LineType.serializeLineType(ObjectOutputStream, LineType).
 boolean equals(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)
          Returns one of the predefined LineType objects that matches the given width and style best.
 int hashCode()
           
static void serializeLineType(ObjectOutputStream 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


LINE_STYLE

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

See Also:
LineType.getLineStyle(), Constant Field Values

DASHED_STYLE

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

See Also:
LineType.getLineStyle(), Constant Field Values

DOTTED_STYLE

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

See Also:
LineType.getLineStyle(), Constant Field Values

CUSTOM_STYLE

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

See Also:
LineType.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.


hashCode

public int hashCode()
Overrides:
hashCode in class BasicStroke

equals

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

Overrides:
equals in class BasicStroke

getLineType

public static LineType getLineType(int width,
                                   byte style)
Returns one of the predefined LineType objects that matches the given width and style best.


getLineStyle

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

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

availableLineTypes

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


serializeLineType

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

IOException

createLineType

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

IOException

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

2003