org.opensha.commons.gui.plot
Enum PlotLineType

java.lang.Object
  extended by java.lang.Enum<PlotLineType>
      extended by org.opensha.commons.gui.plot.PlotLineType
All Implemented Interfaces:
Serializable, Comparable<PlotLineType>

public enum PlotLineType
extends Enum<PlotLineType>

These are the supported line syles used in OpenSHA JFreeChart plots.

Author:
kevin

Enum Constant Summary
DASHED
           
DOTTED
           
DOTTED_AND_DASHED
           
HISTOGRAM
           
SHADED_UNCERTAIN
          Shaded uncertainty bounds, can only be used with UncertainArbDiscDataset
SHADED_UNCERTAIN_TRANS
          Shaded uncertainty bounds with default 50% transparency, can only be used with UncertainArbDiscDataset
SOLID
           
SOLID_BAR
           
STACKED_BAR
           
 
Method Summary
static org.jfree.chart.renderer.xy.XYItemRenderer buildRenderer(PlotLineType plt, PlotSymbol sym, float width)
          Builds a render for the given PlotLineType and/or PlotSymbol.
static org.jfree.chart.renderer.xy.XYItemRenderer buildRenderer(PlotLineType plt, PlotSymbol sym, float lineWidth, float symWidth)
          Builds a render for the given PlotLineType and/or PlotSymbol.
 Stroke buildStroke(float lineWidth)
           
static void checkValidConfiguration(PlotLineType plt, PlotSymbol sym)
           
static PlotLineType forString(String desc)
           
 boolean isSymbolCompatible()
           
 String toString()
           
static PlotLineType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PlotLineType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SOLID

public static final PlotLineType SOLID

DOTTED

public static final PlotLineType DOTTED

DASHED

public static final PlotLineType DASHED

DOTTED_AND_DASHED

public static final PlotLineType DOTTED_AND_DASHED

HISTOGRAM

public static final PlotLineType HISTOGRAM

STACKED_BAR

public static final PlotLineType STACKED_BAR

SOLID_BAR

public static final PlotLineType SOLID_BAR

SHADED_UNCERTAIN

public static final PlotLineType SHADED_UNCERTAIN
Shaded uncertainty bounds, can only be used with UncertainArbDiscDataset


SHADED_UNCERTAIN_TRANS

public static final PlotLineType SHADED_UNCERTAIN_TRANS
Shaded uncertainty bounds with default 50% transparency, can only be used with UncertainArbDiscDataset

Method Detail

values

public static PlotLineType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PlotLineType c : PlotLineType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PlotLineType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<PlotLineType>

buildStroke

public Stroke buildStroke(float lineWidth)

forString

public static PlotLineType forString(String desc)

buildRenderer

public static org.jfree.chart.renderer.xy.XYItemRenderer buildRenderer(PlotLineType plt,
                                                                       PlotSymbol sym,
                                                                       float width)
                                                                throws IllegalStateException
Builds a render for the given PlotLineType and/or PlotSymbol.

Parameters:
plt - plot line type, or null for none
sym - plot symbol type, or null for none
width - width of the line or symbol. if line and symbol, symbol width will equal 4*width
Returns:
Throws:
IllegalStateException - when both plt and sym are null

isSymbolCompatible

public boolean isSymbolCompatible()
Returns:
true if the line type is compatible with symbols, false otherwise

checkValidConfiguration

public static void checkValidConfiguration(PlotLineType plt,
                                           PlotSymbol sym)

buildRenderer

public static org.jfree.chart.renderer.xy.XYItemRenderer buildRenderer(PlotLineType plt,
                                                                       PlotSymbol sym,
                                                                       float lineWidth,
                                                                       float symWidth)
                                                                throws IllegalStateException
Builds a render for the given PlotLineType and/or PlotSymbol.

Parameters:
plt - plot line type, or null for none
sym - plot symbol type, or null for none
lineWidth - width of the line, if not null
symWidth - width of the symbols, if not null
Returns:
Throws:
IllegalStateException - when both plt and sym are null