/**************************************************************************************************
 **
 ** $Id: ArrowStyle.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/ArrowStyle.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;


/**
 * Indicates the various enumerations of drawing a line with an arrow head.
 * This class defines static constants for all of the standard choices.
 *
 * 

An implementation is not required to implement the entire list of available * arrow styles. At runtime, the list of implemented arrow 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 arrow styles not listed here.

* *

NOTE: Two different implementations may have arrow styles with * the same name, but use different ArrowStyle * instances. If clients need to use the arrow style name to find a * arrow style they should search the array returned by * getSupportedArrowStyles from the * DisplayCapabilities instance associated with the * correct provider.

* * @author OpenGIS® consortium * @version $Revision: 658 $, $Date: 2006-02-23 12:09:34 +1100 (jeu., 23 févr. 2006) $ */ public class ArrowStyle extends SimpleEnumerationType { /** * Serial number for compatibility with different versions. */ private static final long serialVersionUID = -1295348723850401634L; //************************************************************************* // Static Fields //************************************************************************* /** * The list of enumeration available in this virtual machine. * Must be declared first!. */ private static final List VALUES = new ArrayList(4); /** * Solid line with an no arrowhead. */ public static final ArrowStyle NONE = new ArrowStyle("NONE", "No arrow head will be drawn"); /** * Solid line with an open arrowhead on one end in the foreground color. */ public static final ArrowStyle OPEN_ARROW = new ArrowStyle("OPEN_ARROW", "Single line with an open arrowhead."); /** * Solid line with a filled arrowhead on one end. */ public static final ArrowStyle SOLID_ARROW = new ArrowStyle("SOLID_ARROW", "Single line with a filled arrowhead."); /** * Double line with large arrowhead. */ public static final ArrowStyle BROAD_ARROW = new ArrowStyle("BROAD_ARROW", "Double line with large arrowhead."); //************************************************************************* // Constructor //************************************************************************* /** * Construct a new ArrowStyle with the given 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.getSupportedArrowStyles(). * * @param name a String defining the name of the Arrow pattern. * @param description a String describing the pattern. */ protected ArrowStyle(String name, String description) { super(VALUES, name, description, loadIconResource(ArrowStyle.class, name + ".gif")); } //************************************************************************* // Methods //************************************************************************* /** * Returns the list of ArrowStyles. */ public ArrowStyle[] values() { synchronized (VALUES) { return (ArrowStyle[]) VALUES.toArray(new ArrowStyle[VALUES.size()]); } } /** * Returns the list of enumerations of the same kind than this enum. */ public /*{ArrowStyle}*/ CodeList[] family() { return values(); } }

Ads help maintain this website.