yunjoon-soh / MapGenerator

Map Generator for Project Fill

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. DataManager: handles data structures that are used internally
  2. FileManager: handles input/output of files
  3. Workspace: UI layout of the program

How things work

How dynamic componenets are rendered.

  1. dObj is interface for holding basic information such as RenderInfo
  2. 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

  1. When viewAreaPane/javafx.Polygon is clicked, Point is generated by adding dObj's Point to the static MapPolygon poly
  2. When convert is clicked, MapPolygon is added to the list of MapPolygon and reset
  3. Inside the reloadCanvas(), MapPolygon is drew with array of lines

How points are deleted

  1. When point is pressed with secondary mouse, point removes itself from the Datamanager dObj list
  2. Then for every polygon, remove from the polygon.
  3. If remove from the polygon happened, reloadCanvas()

When points are moved

  1. When point is moved, point updates its location using the dObj's RenderInfo's posX and posY. They both are SimpleDoubleProperty
  2. 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

About

Map Generator for Project Fill


Languages

Language:Java 98.2%Language:CSS 1.8%