/**************************************************************************************************
**
** $Id: LineStyle.java 831 2006-05-01 00:27:23Z Desruisseaux $
**
** $URL: http://svn.code.sf.net/p/geoapi/code/branches/2.0.x/geoapi/src/main/java/org/opengis/go/display/style/LineStyle.java $
**
** Copyright (C) 2003-2005 Open GIS Consortium, Inc.
** All Rights Reserved. http://www.opengis.org/legal/
**
*************************************************************************************************/
package org.opengis.go.display.style;
// J2SE direct dependencies
import java.util.ArrayList;
import java.util.List;
import org.opengis.util.CodeList;
import org.opengis.util.SimpleEnumerationType;
/**
* Indicate the various enumerations of drawing a line. This class defines static
* constants for all of the standard choices. Depending on the choice of line style,
* the current foreground color, and background color may affect the appearance of an
* object.
*
* An implementation is not required to implement the entire list of available line
* styles. At runtime, the list of implemented line styles can be retrieved from a
* {@link org.opengis.go.display.DisplayCapabilities} object (that was itself retrieved
* from a Canvas). An implementation may also implement
* other line styles not listed here.
*
* NOTE: Two different implementations may have line styles with
* the same name, but use different LineStyle
* instances. If clients need to use the line style name to find a
* line style they should search the array returned by
* getSupportedLineStyles() from the
* DisplayCapabilities instance associated with the
* correct provider.
*
* This list was compiled by examining the behavior of various
* software packages. Where possible, a reference document is given.
* For others, a description of the style or an indication of the
* software where the style can be seen is given.
*
* @author OpenGIS® consortium
* @version $Revision: 658 $, $Date: 2006-02-23 12:09:34 +1100 (jeu., 23 févr. 2006) $
*/
public class LineStyle extends SimpleEnumerationType {
/**
* Serial number for compatibility with different versions.
*/
private static final long serialVersionUID = -3641627651863436629L;
//*************************************************************************
// Static Fields
//*************************************************************************
/**
* The list of enumeration available in this virtual machine.
* Must be declared first!.
*/
private static final List VALUES = new ArrayList(2);
/**
* The line should be drawn as a single line.
*/
public static final LineStyle SINGLE = new LineStyle("SINGLE", "Single Line");
/**
* The line should be drawn as double parallel lines.
*/
public static final LineStyle DOUBLE
= new LineStyle("DOUBLE", "Double Line");
//*************************************************************************
// Constructor
//*************************************************************************
/**
* Construct a new LineStyle with the give name and description.
* This constructor should only be used to make the static
* constants in this class or by a provider subclasses to create
* implementation specific styles that can be accessed by
* DisplayCapabilities.getSupportedLineStyles().
*
* @param name a String defining the name of the fill pattern.
* @param description a String describing the pattern.
*/
protected LineStyle(String name, String description) {
super(VALUES, name, description, loadIconResource(LineStyle.class, name + ".gif"));
}
//*************************************************************************
// Methods
//*************************************************************************
/**
* Returns the list of LineStyles.
*/
public static LineStyle[] values() {
synchronized (VALUES) {
return (LineStyle[]) VALUES.toArray(new LineStyle[VALUES.size()]);
}
}
/**
* Returns the list of enumerations of the same kind than this enum.
*/
public /*{LineStyle}*/ CodeList[] family() {
return values();
}
}
Ads help maintain this website.