Open happyjack27 opened 8 years ago
finsished:
merge Feature and VTD classes into one.
move vertex and edge into geography package
remove JSonobject extension from edges and vertexes - just a memory waste
now just need to move things out of mainframe and into applet.
PROPOSED NEW ARCHITECTURE
Applet |-static MainFrame mainframe; |-static InstructionProcessor ip; |-static FeatureCollection featureCollection; |-static Ecology ecology; |-static LoadShapefile; <-- load shapefile threads |-static ThreadFactory; <-- other threads -static Core; <-- everything else from mainframe that's not ui-related
merge Feature and VTD classes into one.
move vertex and edge into geography package
remove JSonobject extension from edges and vertexes - just a memory waste
loading
load to hash hash to vector
getMinMaxXY featureCollection.initWards:
resetZoom() featureCollection.initEcology <--- merge into initWards ecology.wards = vtds; locked_wards = new boolean[vtds.size()]; for( int i = 0; i < locked_wards.length; i++) { locked_wards[i] = false; } addEcologyListeners(); <-- this should be on a constructor, probably mainframe's.
fillComboBoxes(); mapPanel.invalidate(); mapPanel.repaint();
setDistrictColumn(project.district_column); setEnableds(); project.demographic_columns.clear(); setDemographicColumns(); project.election_columns.clear(); setElectionColumns(); project.election_columns_2.clear(); setElectionColumns2(); project.election_columns_3.clear(); setElectionColumns3(); project.substitute_columns.clear(); setSubstituteColumns();
OBSOLETE (REMOVE)
initFeatures (and calling function)
CLASS HEIRARCHY
ui
-DialogManageLocks manageLocks = new DialogManageLocks();
Threads in ui.MainFrame
FileThread
OpenShapeFileThread; OpenProjectFileThread (deprecated?) OpenGeoJsonFileThread
MergeInDemoAndElection(); (deprecated?) ImportCensus2Thread; ImportTranslations ImportCountyLevel ImportDemographics ImportVTDLevel ThreadFinishImport
ImportAggregateCustom
ExportCustomThread ExportToBlockLevelThread
LoadCensusFileThread (deprecated?) ImportGazzeterThread (deprecated)
OpenWKTFileThread WKTFileToCoordsThread (deprecated?)
CycleThread (deprecated)
FeatureCollection - Simple
FeatureCollection |-Features | |-Properties | |-Geometry | -VTD | |-Edge | -VTD (neighbors) -Ecology -DistrictMap -District -VTD
FeatureCollection - Detailed
FeatureCollection extends ReflectionJSONObject
|-Vector features
|-Vector vtds
|-Ecology ecology
|-HashMap<String,Quadruplet<String,Integer,Integer,Byte>> header_data
-Vector locked_counties
Feature extends ReflectionJSONObject implements Comparable
|-Properties properties
|-Geometry geometry
|-VTD vtd
-Vector<double[]> points
Properties extends ReflectionJSONObject
Geometry extends ReflectionJSONObject
|-String type;
|-double[][][] coordinates;
|-int[] xpolys;
|-int[] ypolys;
|-Polygon[] polygons;
|-Polygon[] polygons_full;
|-Color outlineColor = Color.BLACK;
|-Color fillColor = FeatureCollection.DEFAULT_COLOR;
|-boolean isDistrict = true;
-double[] full_centroid;
VTD extends ReflectionJSONObject
|-Feature feature
|-Vector edges
|-Vector neighbors
|-Vector<Vector>
-double[] demographics
Edge extends ReflectionJSONObject
|-VTD ward1 = null;
|-VTD ward2 = null;
|-Vertex vertex1;
|-Vertex vertex2;
|-int id = -1;
|-int ward1_id = -1;
|-int ward2_id = -1;
|-int vertex1_id = -1;
|-int vertex2_id = -1;
-double length;
Vertex extends ReflectionJSONObject
|-int id;
|-double x;
-double y;
Ecology extends ReflectionJSONObject
|-Vector population
|-Vector swap_population
|-HashMap<Integer,VTD> wards_by_id;
|-Vector wards = new Vector();
|-Vector edges = new Vector();
-Vector vertexes = new Vector();
DistrictMap implements iEvolvable, Comparable
|-Vector vtds = new Vector();
-Vector districts = new Vector();
District extends JSONObject -Vector vtds = new Vector();
jdbf
DBFReader / DBFWRiter |-JDBField -JDBFException
serialization
ReflectionJSONObject -JSONObject -iJSONObject