Java Doc for PrimitiveShape.java in  » GIS » udig-1.1 » net » refractions » udig » tools » edit » support » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » udig 1.1 » net.refractions.udig.tools.edit.support 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.refractions.udig.tools.edit.support.PrimitiveShape

PrimitiveShape
public class PrimitiveShape implements Iterable<Point>,Shape(Code)
Represents the simplest shape. GeomShapes are made up of PrimitiveShapes.

This is not a composite pattern.


author:
   jones
since:
   1.1.0

Inner Class :class Mutator implements Iterable<Point>


Constructor Summary
public  PrimitiveShape(EditGeom owner)
    
public  PrimitiveShape(PrimitiveShape shape)
    

Method Summary
public  voidassertValid()
    
public  booleancontains(Point point, boolean treatUnknownGeomsAsPolygon)
     Returns true if the point is contained in the shape or on the edge.
public  booleancontains(Point point, boolean treatUnknownGeomsAsPolygon, boolean ignoreVertexRadius)
     Returns true if the point is contained in the shape or on the edge.
Parameters:
  point - An astrbitrary point
Parameters:
  treatUnknownGeomsAsPolygon - if EditGeom.getShapeType return UNKOWN thisparameter is used to determine if this shape should be considered a polygon.
Parameters:
  ignoreVertexRadius - if true then the point is only considered to be on the edge if itis directly on the edge.
public  booleancontains(double x, double y)
    
public  booleancontains(Point2D p)
    
public  booleancontains(double x, double y, double w, double h)
    
public  booleancontains(Rectangle2D r)
    
public  booleancontains(Coordinate startCoord, boolean treatUnknownGeomsAsPolygon)
    
public  Coordinate[]coordArray()
     Returns an array with all the coordinates in shape.
public  Iterator<Coordinate>coordIterator()
     Returns an iterator that iterates over all visible coordinates in shape.
public  intgetAssociatedPointIndex(int coordIndex)
    
public  RectanglegetBounds()
     Returns the bounding box of the Shape in pixel space.
public  Rectangle2DgetBounds2D()
    
public  ClosestEdgegetClosestEdge(Point click, boolean treatUnknownAsPolygon)
     Returns a ClosestEdge object that has information about the point that closest to the click paramter and is on an edge of the part.
public  CoordinategetCoord(int i)
    
public  List<Coordinate>getCoordsAt(int i)
     Returns all the coordinates that map to the point at location i.
public  List<Coordinate>getCoordsAt(Point point)
    
public  EditBlackboardgetEditBlackboard()
    
public  EditGeomgetEditGeom()
    
public  EnvelopegetEnvelope()
    
 MutatorgetMutator()
    
public  intgetNumCoords()
    
public  intgetNumPoints()
    
public  PathIteratorgetPathIterator(AffineTransform at)
    
public  PathIteratorgetPathIterator(AffineTransform at, double flatness)
    
public  PointgetPoint(int i)
    
public  booleanhasVertex(Point p)
     returns true if the point is contained in this shape.
 booleanhasVertex(Point p, LazyCoord coord)
    
public  booleanhasVertex(Coordinate start)
    
public  booleanintersects(double x, double y, double w, double h)
    
public  booleanintersects(Rectangle2D r)
    
public  Iterator<Point>iterator()
     Returns an iterator that iterates over all visible points in shape.
public  PointoverVertex(Point location, int radius)
     Returns the point closest to location.
public synchronized  PointoverVertex(Point location, int radius, boolean ignore)
     Returns the point closest to location.
public  booleanoverlap(PrimitiveShape shape2, boolean treatUnknownAsPolygon, boolean acceptTouches)
     Currently a simple stupid implementation for detecting if 2 polygons overlap.
public  StringtoString()
    


Constructor Detail
PrimitiveShape
public PrimitiveShape(EditGeom owner)(Code)



PrimitiveShape
public PrimitiveShape(PrimitiveShape shape)(Code)




Method Detail
assertValid
public void assertValid()(Code)



contains
public boolean contains(Point point, boolean treatUnknownGeomsAsPolygon)(Code)
Returns true if the point is contained in the shape or on the edge. It is considered on the edge if it is within PreferenceUtil.getVertexRadius of the edge.
Parameters:
  point - An astrbitrary point
Parameters:
  treatUnknownGeomsAsPolygon - if EditGeom.getShapeType return UNKOWN thisparameter is used to determine if this shape should be considered a polygon. true if the point is contained in the shape.



contains
public boolean contains(Point point, boolean treatUnknownGeomsAsPolygon, boolean ignoreVertexRadius)(Code)
Returns true if the point is contained in the shape or on the edge.
Parameters:
  point - An astrbitrary point
Parameters:
  treatUnknownGeomsAsPolygon - if EditGeom.getShapeType return UNKOWN thisparameter is used to determine if this shape should be considered a polygon.
Parameters:
  ignoreVertexRadius - if true then the point is only considered to be on the edge if itis directly on the edge. (within 1 pixel of the line). true if the point is contained in the shape.



contains
public boolean contains(double x, double y)(Code)



contains
public boolean contains(Point2D p)(Code)



contains
public boolean contains(double x, double y, double w, double h)(Code)



contains
public boolean contains(Rectangle2D r)(Code)



contains
public boolean contains(Coordinate startCoord, boolean treatUnknownGeomsAsPolygon)(Code)



coordArray
public Coordinate[] coordArray()(Code)
Returns an array with all the coordinates in shape. an array with all the coordinates in shape.



coordIterator
public Iterator<Coordinate> coordIterator()(Code)
Returns an iterator that iterates over all visible coordinates in shape. Notmodifyible



getAssociatedPointIndex
public int getAssociatedPointIndex(int coordIndex)(Code)



getBounds
public Rectangle getBounds()(Code)
Returns the bounding box of the Shape in pixel space. the bounding box of the Shape in pixel space.



getBounds2D
public Rectangle2D getBounds2D()(Code)



getClosestEdge
public ClosestEdge getClosestEdge(Point click, boolean treatUnknownAsPolygon)(Code)
Returns a ClosestEdge object that has information about the point that closest to the click paramter and is on an edge of the part.
Parameters:
  click - the point to use as the reference point



getCoord
public Coordinate getCoord(int i)(Code)



getCoordsAt
public List<Coordinate> getCoordsAt(int i)(Code)
Returns all the coordinates that map to the point at location i.
Parameters:
  i - index of a point in the shape Returns all the coordinates that map to the point at location i.



getCoordsAt
public List<Coordinate> getCoordsAt(Point point)(Code)



getEditBlackboard
public EditBlackboard getEditBlackboard()(Code)



getEditGeom
public EditGeom getEditGeom()(Code)
Returns the owner.



getEnvelope
public Envelope getEnvelope()(Code)



getMutator
Mutator getMutator()(Code)



getNumCoords
public int getNumCoords()(Code)



getNumPoints
public int getNumPoints()(Code)



getPathIterator
public PathIterator getPathIterator(AffineTransform at)(Code)



getPathIterator
public PathIterator getPathIterator(AffineTransform at, double flatness)(Code)



getPoint
public Point getPoint(int i)(Code)



hasVertex
public boolean hasVertex(Point p)(Code)
returns true if the point is contained in this shape.
Parameters:
  p - an arbitrary point Returns true if the point is contained in this shape.



hasVertex
boolean hasVertex(Point p, LazyCoord coord)(Code)



hasVertex
public boolean hasVertex(Coordinate start)(Code)



intersects
public boolean intersects(double x, double y, double w, double h)(Code)



intersects
public boolean intersects(Rectangle2D r)(Code)



iterator
public Iterator<Point> iterator()(Code)
Returns an iterator that iterates over all visible points in shape. Not modifyable



overVertex
public Point overVertex(Point location, int radius)(Code)
Returns the point closest to location. The search is a square of height and width radius + 1.
Parameters:
  location - the locations to start searching from.
Parameters:
  radius - the distance away from location to search. the point closest to location or null if no point exists.



overVertex
public synchronized Point overVertex(Point location, int radius, boolean ignore)(Code)
Returns the point closest to location. If ignore is true the point at locations will not be returned. The search is a square of height and width radius + 1.
Parameters:
  location - the locations to start searching from.
Parameters:
  radius - radius the distance away from location to search.
Parameters:
  ignore - true if the vertex at location is ignored the point closest to location or null if no point exists.



overlap
public boolean overlap(PrimitiveShape shape2, boolean treatUnknownAsPolygon, boolean acceptTouches)(Code)
Currently a simple stupid implementation for detecting if 2 polygons overlap. Currently it only check the points not the real coordinates so this method must be used with care. Just iterates through all the edges in one shape and checks if it overlap with an edge in the other shape.
 ------------------
 |   ---------    |
 |   |       |    |
 ----|-------|-----
 |       |
 ---------
 
Above is considered overlapping but below is only if acceptTouches is true:
 ------------------
 |                |
 |                |
 ------------------
 |       |
 ---------
 

Note: If one of the shapes is a point and the other is a line or a point then acceptTouches must be true other or this method will always return false.


Parameters:
  shape2 - other shape to test against
Parameters:
  acceptTouches - if true then this method will return true if the two shapes simply touch(but don't fully overlap). See above for more details true if the two shapes overlap



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.