nl.cloudfarming.client.area.field.shape
Class Shape

java.lang.Object
  extended by nl.cloudfarming.client.model.Bean
      extended by nl.cloudfarming.client.area.field.shape.Shape
All Implemented Interfaces:
LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>

public class Shape
extends Bean
implements LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>

non persistent object for storing geometries and additional information

Author:
Timon Veenstra

Nested Class Summary
static class Shape.Builder
          Shape builder class usage: Shape shape = new Shape.Builder().setName("someName").build();
static class Shape.ShapeType
          Type of a shape object Gives an indication about what kind of shape it is, what the purpose is and where it needs to be stored eventually.
 
Nested classes/interfaces inherited from class nl.cloudfarming.client.model.Bean
Bean.BeanState
 
Nested classes/interfaces inherited from interface nl.cloudfarming.client.geoviewer.LayerObject
LayerObject.Actions
 
Field Summary
 
Fields inherited from class nl.cloudfarming.client.model.Bean
BEAN_FLAVOR, currentState, PROP_NAME
 
Constructor Summary
Shape()
           
Shape(com.vividsolutions.jts.geom.Geometry geometry)
          Create a shape object based on a Geometry
Shape(String wkt)
          Construct a shape object based on a WKT string
 
Method Summary
 boolean equals(Object obj)
           
 LayerObjectAction[] getActions()
           
 com.vividsolutions.jts.geom.Geometry getGeometry()
           
 long getId()
           
 String getKey()
           
 Object getKeyAttributeValue()
           
 String getName()
           
 Shape getObject()
           
 String getTooltipText()
           
 Shape.ShapeType getType()
          Returns the shape type as ShapeType (enum-value) A shape can for example be a Field, or a Line, etc.
 int hashCode()
           
 void save()
           
 void setName(String name)
           
 void setType(Shape.ShapeType type)
          Set the shape type as ShapeType (enum-value) A shape can for example be a Field, or a Line, etc.
 
Methods inherited from class nl.cloudfarming.client.model.Bean
addPropertyChangeListener, addPropertyChangeListener, addUndoableEditListener, fireUndoableEvent, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener, removeUndoableEditListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shape

public Shape()

Shape

public Shape(String wkt)
      throws com.vividsolutions.jts.io.ParseException
Construct a shape object based on a WKT string

Parameters:
wkt - will be transformed into a Geometry
Throws:
com.vividsolutions.jts.io.ParseException

Shape

public Shape(com.vividsolutions.jts.geom.Geometry geometry)
Create a shape object based on a Geometry

Parameters:
geometry -
Method Detail

getName

public String getName()

setName

public void setName(String name)

getGeometry

public com.vividsolutions.jts.geom.Geometry getGeometry()
Specified by:
getGeometry in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>
Returns:
The Geometry of type MultiPolygon
See Also:
LayerObject.getGeometry()

getObject

public Shape getObject()
Specified by:
getObject in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>
Returns:
The Object of type Shape this LayerObject is representing
See Also:
LayerObject.getObject()

getKey

public String getKey()
Specified by:
getKey in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>
Returns:
Key as String
See Also:
LayerObject.getKey()

getKeyAttributeValue

public Object getKeyAttributeValue()
Specified by:
getKeyAttributeValue in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>

getTooltipText

public String getTooltipText()
Specified by:
getTooltipText in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>
Returns:
TooltipText as String
See Also:
LayerObject.getTooltipText()

getId

public long getId()
Specified by:
getId in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>
Returns:
The Id of the wrapped object
See Also:
LayerObject.getId()

save

public void save()
Specified by:
save in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>
See Also:
LayerObject.save()

getActions

public LayerObjectAction[] getActions()
Specified by:
getActions in interface LayerObject<com.vividsolutions.jts.geom.Geometry,Shape>
Returns:
Array with actions for this LayerObject
See Also:
LayerObject.getActions()

getType

public Shape.ShapeType getType()
Returns the shape type as ShapeType (enum-value) A shape can for example be a Field, or a Line, etc.

Returns:
Shape type as ShapeType

setType

public void setType(Shape.ShapeType type)
Set the shape type as ShapeType (enum-value) A shape can for example be a Field, or a Line, etc.

Parameters:
type - Set the type of this Shape

equals

public boolean equals(Object obj)
Overrides:
equals in class Bean

hashCode

public int hashCode()
Overrides:
hashCode in class Bean


Copyright © 2011. All Rights Reserved.