nl.cloudfarming.client.area.field.shape
Class Shape
java.lang.Object
nl.cloudfarming.client.model.Bean
nl.cloudfarming.client.area.field.shape.Shape
- All Implemented Interfaces:
- Geographical<com.vividsolutions.jts.geom.Geometry>, Geometrical<com.vividsolutions.jts.geom.Geometry,Shape>
public class Shape
- extends Bean
- implements Geometrical<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 |
|
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 |
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 -
getName
public String getName()
setName
public void setName(String name)
getGeometry
public com.vividsolutions.jts.geom.Geometry getGeometry()
- Specified by:
getGeometry in interface Geometrical<com.vividsolutions.jts.geom.Geometry,Shape>
- Returns:
- The Geometry of type MultiPolygon
- See Also:
LayerObject
getObject
public Shape getObject()
- Specified by:
getObject in interface Geometrical<com.vividsolutions.jts.geom.Geometry,Shape>
- Returns:
- The Object of type Shape this LayerObject is representing
- See Also:
LayerObject
getKey
public String getKey()
- Specified by:
getKey in interface Geometrical<com.vividsolutions.jts.geom.Geometry,Shape>
- Returns:
- Key as String
- See Also:
LayerObject
getKeyAttributeValue
public Object getKeyAttributeValue()
- Specified by:
getKeyAttributeValue in interface Geometrical<com.vividsolutions.jts.geom.Geometry,Shape>
getTooltipText
public String getTooltipText()
- Specified by:
getTooltipText in interface Geographical<com.vividsolutions.jts.geom.Geometry>
- Returns:
- TooltipText as String
- See Also:
LayerObject
getId
public long getId()
- Specified by:
getId in interface Geographical<com.vividsolutions.jts.geom.Geometry>
- Returns:
- The Id of the wrapped object
- See Also:
LayerObject
getActions
public GeographicalAction[] getActions()
- Specified by:
getActions in interface Geographical<com.vividsolutions.jts.geom.Geometry>
- Returns:
- Array with actions for this LayerObject
- See Also:
LayerObject
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
getRenderObject
public com.vividsolutions.jts.geom.Geometry getRenderObject(com.vividsolutions.jts.geom.Envelope envelope)
- Specified by:
getRenderObject in interface Geographical<com.vividsolutions.jts.geom.Geometry>
getCentroid
public com.vividsolutions.jts.geom.Point getCentroid()
- Specified by:
getCentroid in interface Geographical<com.vividsolutions.jts.geom.Geometry>
Copyright © 2011. All Rights Reserved.