README.md for MapGenerator
Software design based on modified Simple App Framework
This framework is provided by Richard McKenna (http://www3.cs.stonybrook.edu/~richard/). Modified from a JClassDesigner which was HW for Stony Brook CSE219 Spring 2016(?)
Core components
- DataManager: handles data structures that are used internally
- FileManager: handles input/output of files
- Workspace: UI layout of the program
How things work
How dynamic componenets are rendered.
- dObj is interface for holding basic information such as RenderInfo
- dObj.getRenderObject() returns node
How file is loaded
DataManager keeps track of all of the dObjs created. For each of the object, getRenderObject() is called. The returned Node object is added to the viewAreaPane
How file is saved
DataManager keeps track of all of the dObjs created. For each of the object, toJsonObject() is called. The returned JsonObject is added to JsonArray in FileManager. Gathered JsonArray is dumped as file.
How point -> polygon conversion occurs
- When viewAreaPane/javafx.Polygon is clicked, Point is generated by adding dObj's Point to the static MapPolygon poly
- When convert is clicked, MapPolygon is added to the list of MapPolygon and reset
- Inside the reloadCanvas(), MapPolygon is drew with array of lines
How points are deleted
- When point is pressed with secondary mouse, point removes itself from the Datamanager dObj list
- Then for every polygon, remove from the polygon.
- If remove from the polygon happened, reloadCanvas()
When points are moved
- When point is moved, point updates its location using the dObj's RenderInfo's posX and posY. They both are SimpleDoubleProperty
- This change of location of points immediately affect the shape of the polygon because the property of it is bound to the individual point's location
Known issues
- When zoomed in, moving an object does not work as expected
Features to add
- Resetting zoom
- Undo, redo
- Dashed polygon for "hole" polygon