Java Doc for EditBlackboard.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.EditBlackboard

EditBlackboard
public class EditBlackboard (Code)
Maps between each pixel to a list of coordinates. Also provides convenience methods to move all coordinates at a location
author:
   jeichar


Field Summary
protected  Map<Point, List<LazyCoord>>coordMapping
    
 Map<Point, Set<EditGeom>>geomMapping
    
 PointCoordCalculatorpointCoordCalculator
    

Constructor Summary
public  EditBlackboard(int width, int height, AffineTransform toScreen, MathTransform layerToMap)
     Creates a PixelCoordMap.

Method Summary
public  PointaddCoordinate(Coordinate coord, PrimitiveShape shape)
    
public  Map<Geometry, EditGeom>addGeometry(Geometry geom, String featureID)
     Adds a Geometry to the contained geometries.
public  CoordinateaddPoint(int x, int y, PrimitiveShape shape)
     Adds a Coordinate at the x,y location on the screen to the end of the geomtry.
public  ClosestEdgeaddToNearestEdge(int x, int y, EditGeom geom, boolean treatUnknownAsPolygon)
     Adds a Coordinate the nearest edge .
public  List<ClosestEdge>addToNearestEdge(int x, int y, boolean treatUnknownAsPolygon)
     Adds a Coordinate the nearest edge .
public  voidclear()
     Removes all EditGeometries from blackboard and places an empty one on the black board.
public  booleancontains(String fid)
     Returns true if the blackboard currently holds the noted feature ID.
public  voidfireBatchedEvents()
     Fires all the batched events and resets the EditBlackboard so that it no longer batches events.
public synchronized  List<ClosestEdge>getCandidates(int x, int y, boolean treatUnknownAsPolygon)
     Returns the GeomShapes that will have the coordinate added if is called.
public synchronized  List<Coordinate>getCoords(int x, int y)
     returns the list of coordinates at location:(x,y) TREAT COORDINATES AS IMMUTABLE!!

This is a dangerous method because the coordinates are mutable but if they are modified outside of this class then the model is messed up and crazy bugs will happen.

public synchronized  List<EditGeom>getGeoms()
     The list of geometries mapped.
public synchronized  List<EditGeom>getGeoms(int x, int y)
     Returns a list of the geometries with vertices at the position (x,y).
public synchronized  intgetHeight()
    
public  Set<EditBlackboardListener>getListeners()
     Returns the list of Listeners so that listeners can be added and removed.
public  SelectiongetSelection()
    
public synchronized  intgetWidth()
    
public  CoordinateinsertCoord(int x, int y, int pointIndex, PrimitiveShape shape)
     Adds a Coordinate at the index indicated.

The index is the position in the coordinate list in the shell of the geometry.


Parameters:
  x - the x screen location to place the new coordinate
Parameters:
  y - the x screen location to place the new coordinate
Parameters:
  pointIndex - the index in terms of points in the shape to add the coordinate.
Parameters:
  geom - the geometry to append the point to.
public  PointinsertCoordinate(Coordinate coord, int index, PrimitiveShape shape)
    
public  voidinsertCoords(int pointIndex, Point p, List<Coordinate> coords, PrimitiveShape shape)
     Inserts the list of coordinates into the shape at the index indicated.
public synchronized  booleanisCollapseVertices()
    
public  List<Coordinate>moveCoords(int x, int y, int endX, int endY)
     Moves all the coordinates at location by an offset of (deltaX, deltaY).
public  voidmoveSelection(int diffX, int diffY, Selection selection)
     Moves the selection
Parameters:
  diffX - the distance to move the geometry in the x direction.
public  EditGeomnewGeom(String featureId, ShapeType type)
     Creates a new EditGeom in the map.
 voidnotify(EditBlackboardEvent event)
    
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  voidremoveCoordinate(int pointIndex, Coordinate coord, PrimitiveShape shape)
     Removes a coordinate from the shape.
public  voidremoveCoords(int x, int y, PrimitiveShape shape)
     Deletes the coordinates at the provided point in the provided shape.
public  List<Coordinate>removeCoordsAtPoint(int x, int y)
     Deletes all the coordinates at a location TREAT COORDINATES AS IMMUTABLE!! the deleted coordinates.
public  List<EditGeom>removeGeometries(Collection<EditGeom> geomsToRemove)
    
public  booleanselectionAdd(Point point)
    
public  booleanselectionAddAll(Collection<Point> points)
    
public  voidselectionClear()
    
public  booleanselectionRemove(Point point)
    
public  booleanselectionRemoveAll(Collection<Point> points)
    
public  booleanselectionRetainAll(Collection<Point> points)
    
public synchronized  voidsetCollapseVertices(boolean collapseVertices)
    
public  voidsetCoords(Point point, Coordinate newValue)
     Sets all the coordinates at the point to provided coordinate.
public  Map<Geometry, EditGeom>setGeometries(Geometry geom, String featureId)
     Adds a Geometry to the contained geometries.
public synchronized  voidsetHeight(int height)
    
public  voidsetMapLayerTransform(MathTransform mapToLayer)
    
public  voidsetToScreenTransform(AffineTransform newToScreen)
     Modifies the mapping of points to coordinates so that the transform passed in as a parameter is the new toScreen transform.
public synchronized  voidsetWidth(int width)
    
public synchronized  voidstartBatchingEvents()
     Changes the behaviour of the EditBlackboard so that events are not fired but batched together until is called.
public synchronized  CoordinatetoCoord(Point point)
    
public synchronized  PointtoPoint(Coordinate coord)
     Transforms a Coordinate into the point location it would occupy on the screen.

Field Detail
coordMapping
protected Map<Point, List<LazyCoord>> coordMapping(Code)



geomMapping
Map<Point, Set<EditGeom>> geomMapping(Code)



pointCoordCalculator
PointCoordCalculator pointCoordCalculator(Code)




Constructor Detail
EditBlackboard
public EditBlackboard(int width, int height, AffineTransform toScreen, MathTransform layerToMap)(Code)
Creates a PixelCoordMap. A default GeomShape will be created and can be obtained by EditBlackboard.getGeoms() .get(0)
Parameters:
  width - width of the current ViewportPane
Parameters:
  height - height of the current ViewportPane
Parameters:
  toScreen - transform to take the coordinates to a screen location.
Parameters:
  layerToMap - transform to transform coordinates from a layer's CRS to the map's CRS
Parameters:
  coords - coordinates that need to be mapped.




Method Detail
addCoordinate
public Point addCoordinate(Coordinate coord, PrimitiveShape shape)(Code)



addGeometry
public Map<Geometry, EditGeom> addGeometry(Geometry geom, String featureID)(Code)
Adds a Geometry to the contained geometries. If the Geometry is a MultiGeometry it will not be in the mapping only the sub geometries will be in the geometry.
Parameters:
  geom - the geometry that will be added.
Parameters:
  featureID - The id of the feature the geometry was part of. Maybe null.



addPoint
public Coordinate addPoint(int x, int y, PrimitiveShape shape) throws IllegalArgumentException(Code)
Adds a Coordinate at the x,y location on the screen to the end of the geomtry. Closure of the hole is not enforced.
Parameters:
  x - the x screen location to place the new coordinate
Parameters:
  y - the x screen location to place the new coordinate
Parameters:
  holeIndex - the hole to append to. added coordinate. Do not modify coordinate otherwise the state of this class willbe wrong and bugs will occur in the code.



addToNearestEdge
public ClosestEdge addToNearestEdge(int x, int y, EditGeom geom, boolean treatUnknownAsPolygon) throws IllegalArgumentException(Code)
Adds a Coordinate the nearest edge .

If two edges are equidistant the first edge in the geometry will be targeted edge


Parameters:
  x - the x screen location to place the new coordinate
Parameters:
  y - the x screen location to place the new coordinate
Parameters:
  geom - the geometry to append the point to.
Parameters:
  treatUnknownAsPolygon - declares whether to treat geometries of type UNKNOWN as a polygon



addToNearestEdge
public List<ClosestEdge> addToNearestEdge(int x, int y, boolean treatUnknownAsPolygon) throws IllegalArgumentException(Code)
Adds a Coordinate the nearest edge .

If two edges of the same geometry are equidistant the first edge in the geometry will be targeted edge

If two edges of different geometries are equidistant both will have a vertex added.

If the vertex would end up being added to the same location as an existing vertex then no vertext is added


Parameters:
  x - the x screen location to place the new coordinate
Parameters:
  y - the x screen location to place the new coordinate
Parameters:
  treatUnknownAsPolygon - declares whether to treat geometries of type UNKNOWN as a polygon the list of GeomShapes that had the coordinate added to.



clear
public void clear()(Code)
Removes all EditGeometries from blackboard and places an empty one on the black board.



contains
public boolean contains(String fid)(Code)
Returns true if the blackboard currently holds the noted feature ID.
Parameters:
  fid - Feature ID boolean



fireBatchedEvents
public void fireBatchedEvents()(Code)
Fires all the batched events and resets the EditBlackboard so that it no longer batches events.



getCandidates
public synchronized List<ClosestEdge> getCandidates(int x, int y, boolean treatUnknownAsPolygon)(Code)
Returns the GeomShapes that will have the coordinate added if is called.
Parameters:
  x - the x screen location to place the new coordinate
Parameters:
  y - the x screen location to place the new coordinate
Parameters:
  treatUnknownAsPolygon - declares whether to treat geometries of type UNKNOWN as a polygon the GeomShapes that will have the coordinate added if is called.



getCoords
public synchronized List<Coordinate> getCoords(int x, int y)(Code)
returns the list of coordinates at location:(x,y) TREAT COORDINATES AS IMMUTABLE!!

This is a dangerous method because the coordinates are mutable but if they are modified outside of this class then the model is messed up and crazy bugs will happen. The weakness is permitted for performance reasons. I'm trusting people to not be stupid.

the list of coordinates at location:(x,y). TREAT COORDINATES AS IMMUTABLE!!



getGeoms
public synchronized List<EditGeom> getGeoms()(Code)
The list of geometries mapped. list of geometries mapped.



getGeoms
public synchronized List<EditGeom> getGeoms(int x, int y)(Code)
Returns a list of the geometries with vertices at the position (x,y). Edges are not calculated.
Parameters:
  x - x coordinate of point
Parameters:
  y - x coordinate of point a list of the geometries at the position (x,y)



getHeight
public synchronized int getHeight()(Code)
Returns the height.



getListeners
public Set<EditBlackboardListener> getListeners()(Code)
Returns the list of Listeners so that listeners can be added and removed. This is thread safe. Each Listener can only be added once. Returns the listeners.



getSelection
public Selection getSelection()(Code)



getWidth
public synchronized int getWidth()(Code)
Returns the width.



insertCoord
public Coordinate insertCoord(int x, int y, int pointIndex, PrimitiveShape shape) throws IllegalArgumentException(Code)
Adds a Coordinate at the index indicated.

The index is the position in the coordinate list in the shell of the geometry.


Parameters:
  x - the x screen location to place the new coordinate
Parameters:
  y - the x screen location to place the new coordinate
Parameters:
  pointIndex - the index in terms of points in the shape to add the coordinate.
Parameters:
  geom - the geometry to append the point to. added coordinate. Do not modify coordinate otherwise the state of this class willbe wrong and bugs will occur in the code.



insertCoordinate
public Point insertCoordinate(Coordinate coord, int index, PrimitiveShape shape)(Code)



insertCoords
public void insertCoords(int pointIndex, Point p, List<Coordinate> coords, PrimitiveShape shape)(Code)
Inserts the list of coordinates into the shape at the index indicated.
Parameters:
  pointIndex - the location that the coordinates will be inserted.
Parameters:
  coords - coords that will inserted.insertCoords
Parameters:
  shape - the shape that will have the coords inserted.



isCollapseVertices
public synchronized boolean isCollapseVertices()(Code)
Returns the collapseVertices.



moveCoords
public List<Coordinate> moveCoords(int x, int y, int endX, int endY)(Code)
Moves all the coordinates at location by an offset of (deltaX, deltaY).
Parameters:
  x - x coordinate of coords to move
Parameters:
  y - y coordinate of coords to move
Parameters:
  deltaX - the number of pixels to move coords in the positive x direction(Screen space)
Parameters:
  deltaY - the number of pixels to move coords in the positive y direction(Screen space)



moveSelection
public void moveSelection(int diffX, int diffY, Selection selection)(Code)
Moves the selection
Parameters:
  diffX - the distance to move the geometry in the x direction. The delta is in pixels.
Parameters:
  diffY - the distance to move the geometry in the y direction. The delta is in pixels.
Parameters:
  selection - the selection to move.



newGeom
public EditGeom newGeom(String featureId, ShapeType type)(Code)
Creates a new EditGeom in the map. If there is only one geometry on the bb and it has no points and has not been editted it will be removed.
Parameters:
  featureId - The id of the feature the geometry was part of. Maybe null.
Parameters:
  type - the type of geometry to create if null then the type will be unknown the created geometry



notify
void notify(EditBlackboardEvent event)(Code)



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.



removeCoordinate
public void removeCoordinate(int pointIndex, Coordinate coord, PrimitiveShape shape)(Code)
Removes a coordinate from the shape. The index indicates which point to remove, the Point parameter is a check to ensure that the correct point is indicated, and the coord is the coordinate that will be removed
Parameters:
  pointIndex - index of point in shape
Parameters:
  coord - coordinate to remove
Parameters:
  shape - shape to remove from



removeCoords
public void removeCoords(int x, int y, PrimitiveShape shape)(Code)
Deletes the coordinates at the provided point in the provided shape.
Parameters:
  x - x coordinate in screen coords
Parameters:
  y - y coordinate in screen coords
Parameters:
  shape - shape to delete from.



removeCoordsAtPoint
public List<Coordinate> removeCoordsAtPoint(int x, int y)(Code)
Deletes all the coordinates at a location TREAT COORDINATES AS IMMUTABLE!! the deleted coordinates. TREAT COORDINATES AS IMMUTABLE!!



removeGeometries
public List<EditGeom> removeGeometries(Collection<EditGeom> geomsToRemove)(Code)
Removes all the geometries in the list from the blackboard and all the coordinates in the geometries
Parameters:
  geomsToRemove - the list of geometries to remove.



selectionAdd
public boolean selectionAdd(Point point)(Code)



selectionAddAll
public boolean selectionAddAll(Collection<Point> points)(Code)



selectionClear
public void selectionClear()(Code)



selectionRemove
public boolean selectionRemove(Point point)(Code)



selectionRemoveAll
public boolean selectionRemoveAll(Collection<Point> points)(Code)



selectionRetainAll
public boolean selectionRetainAll(Collection<Point> points)(Code)



setCollapseVertices
public synchronized void setCollapseVertices(boolean collapseVertices)(Code)

Parameters:
  collapseVertices - The collapseVertices to set.



setCoords
public void setCoords(Point point, Coordinate newValue)(Code)
Sets all the coordinates at the point to provided coordinate. The coodinate must still map to the point
Parameters:
  point - the point at which all the coordinates will be changed
Parameters:
  newValue - the new coordinate value of coordinates at the point



setGeometries
public Map<Geometry, EditGeom> setGeometries(Geometry geom, String featureId)(Code)
Adds a Geometry to the contained geometries. If the Geometry is a MultiGeometry it will not be in the mapping only the sub geometries will be in the geometry.
Parameters:
  geom - the geometry that will be added.
Parameters:
  featureId - The id of the feature the geometry was part of. Maybe null.



setHeight
public synchronized void setHeight(int height)(Code)

Parameters:
  height - The height to set.



setMapLayerTransform
public void setMapLayerTransform(MathTransform mapToLayer)(Code)



setToScreenTransform
public void setToScreenTransform(AffineTransform newToScreen)(Code)
Modifies the mapping of points to coordinates so that the transform passed in as a parameter is the new toScreen transform.
Parameters:
  transform - new transform



setWidth
public synchronized void setWidth(int width)(Code)

Parameters:
  width - The width to set.



startBatchingEvents
public synchronized void startBatchingEvents()(Code)
Changes the behaviour of the EditBlackboard so that events are not fired but batched together until is called.



toCoord
public synchronized Coordinate toCoord(Point point)(Code)



toPoint
public synchronized Point toPoint(Coordinate coord)(Code)
Transforms a Coordinate into the point location it would occupy on the screen.
Parameters:
  coord - coordinate object point coordinate would occupy on the screen.



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.