diva.sketch.toolbox
Class DashedPathData

java.lang.Object
  extended by diva.util.xml.AbstractXmlBuilder
      extended by diva.sketch.toolbox.DashedPathData
All Implemented Interfaces:
XmlBuilder

public class DashedPathData
extends AbstractXmlBuilder

A typed data that holds a recognized dashed path which consists of a Polyline2D path, an average dash length, and an average gap length.

Version:
$Revision: 1.3 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Field Summary
static String DASHED_PATH_DATA
           
static String GAP_LENGTH
           
static String PATH
           
static String SEGMENT_LENGTH
           
static Type type
          The static type associated with this typed data.
 
Constructor Summary
DashedPathData()
           
DashedPathData(Polyline2D path, double segLen, double gapLen)
          Construct a text data that contains an empty string.
 
Method Summary
 Object build(XmlElement elt, String type)
          Given an XmlElement, create and return an internal representtion of it.
 boolean equals(Object o)
          Equality test: are the paths, segment lengths, and gap lengths identical?
 XmlElement generate(Object in)
          Unable to generate XML by default.
 double getGapLength()
          Return the average gap length of the path.
 Polyline2D getPath()
          Return the polyline path that the dashed path follows.
 double getSegmentLength()
          Return the average segment length of the path.
 Type getType()
          Return the type of this data, implementing the TypedData interface.
 void setGapLength(double gapLen)
          Set the average gap length of the path.
 void setPath(Polyline2D path)
          Set the polyline path that the dashed path follows.
 void setSegmentLength(double segLen)
          Set the average segment length of the path.
 String toString()
          Return a string representation of this data for debugging.
 
Methods inherited from class diva.util.xml.AbstractXmlBuilder
getDelegate, setDelegate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DASHED_PATH_DATA

public static final String DASHED_PATH_DATA
See Also:
Constant Field Values

SEGMENT_LENGTH

public static final String SEGMENT_LENGTH
See Also:
Constant Field Values

GAP_LENGTH

public static final String GAP_LENGTH
See Also:
Constant Field Values

PATH

public static final String PATH
See Also:
Constant Field Values

type

public static final Type type
The static type associated with this typed data.

Constructor Detail

DashedPathData

public DashedPathData()

DashedPathData

public DashedPathData(Polyline2D path,
                      double segLen,
                      double gapLen)
Construct a text data that contains an empty string.

Method Detail

getType

public Type getType()
Return the type of this data, implementing the TypedData interface. Returns the static type DashedPathData.type.


getPath

public Polyline2D getPath()
Return the polyline path that the dashed path follows.


setPath

public void setPath(Polyline2D path)
Set the polyline path that the dashed path follows.


getSegmentLength

public double getSegmentLength()
Return the average segment length of the path.


setSegmentLength

public void setSegmentLength(double segLen)
Set the average segment length of the path.


getGapLength

public double getGapLength()
Return the average gap length of the path.


setGapLength

public void setGapLength(double gapLen)
Set the average gap length of the path.


equals

public boolean equals(Object o)
Equality test: are the paths, segment lengths, and gap lengths identical?

Overrides:
equals in class Object

build

public Object build(XmlElement elt,
                    String type)
Description copied from class: AbstractXmlBuilder
Given an XmlElement, create and return an internal representtion of it. Implementors should also provide a more type-specific version of this method:
   public Graph build (XmlELement elt, String type);
 

Specified by:
build in interface XmlBuilder
Specified by:
build in class AbstractXmlBuilder

generate

public XmlElement generate(Object in)
Description copied from class: AbstractXmlBuilder
Unable to generate XML by default.

Specified by:
generate in interface XmlBuilder
Overrides:
generate in class AbstractXmlBuilder

toString

public String toString()
Return a string representation of this data for debugging.

Overrides:
toString in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.