@@ -28,14 +28,14 @@ |
import org.jfree.data.time.Year; |
|
/** |
-* Last Updated: 5-February-2016 |
+* Last Updated: 21-June-2016 |
* @author Tyler Wible |
* @since 3-November-2014 |
*/ |
public class guiGroundwater_Model { |
- String mainFolder = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/GW";//The output location of the graph |
+ String directory = "C:/Projects/TylerWible/CodeDirectories/NetBeans/data/GW";//The output location of the graph |
String database = "USGS"; |
- String stationID = "402955103163501";//"404915077500801";// |
+ String stationId = "402955103163501";//"404915077500801";// |
String stationName = "SB00605311CCC";//"CE 661";// |
String wqTest = "height";//"depth";//"00930 Sodium, water, filtered, milligrams per liter -- mg/L";// |
String beginDate = ""; |
@@ -114,7 +114,7 @@ |
//Gets |
public File getGWgraphOutput(){ |
//This output file is for use with JSHighCharts |
- return new File(mainFolder, "groundwater_graph.out"); |
+ return new File(directory, "groundwater_graph.out"); |
} |
public String getGraph() { |
return "groundwater_graph.jpg"; |
@@ -278,64 +278,25 @@ |
|
|
//Sets |
- public void setMainFolder(String mainFolder) { |
- this.mainFolder = mainFolder; |
- } |
- public void setDatabase(String database) { |
- this.database = database; |
- } |
- public void setStationID(String stationID) { |
- this.stationID = stationID; |
- } |
- public void setStationName(String stationName) { |
- this.stationName = stationName; |
- } |
- public void setWQtest(String wqTest) { |
- this.wqTest = wqTest; |
- } |
- public void setBeginDate(String beginDate) { |
- this.beginDate = beginDate; |
- } |
- public void setEndDate(String endDate) { |
- this.endDate = endDate; |
- } |
- public void setTimeStep(String timeStep) { |
- this.timeStep = timeStep; |
- } |
- public void setMethod(String method) { |
- this.method = method; |
- } |
- public void setPeriod1Begin(String period1Begin) { |
- this.period1Begin = period1Begin; |
- } |
- public void setPeriod1End(String period1End) { |
- this.period1End = period1End; |
- } |
- public void setPeriod2Begin(String period2Begin) { |
- this.period2Begin = period2Begin; |
- } |
- public void setPeriod2End(String period2End) { |
- this.period2End = period2End; |
- } |
- public void setPeriod3Begin(String period3Begin) { |
- this.period3Begin = period3Begin; |
- } |
- public void setPeriod3End(String period3End) { |
- this.period3End = period3End; |
- } |
- public void setMedianTF(boolean medianTF) { |
- this.medianTF = medianTF; |
- } |
- public void setUserData(String userData) { |
- this.userData = userData; |
- } |
- public void setMergeDatasets(boolean mergeDatasets) { |
- this.mergeDatasets = mergeDatasets; |
- } |
- public void setMergeMethod(String mergeMethod) { |
- this.mergeMethod = mergeMethod; |
- } |
- |
+ public void setMainFolder(String directory_str){ directory = directory_str; } |
+ public void setDatabase(String database_str){ database = database_str; } |
+ public void setStationID(String stationId_str){ stationId = stationId_str; } |
+ public void setStationName(String stationName_str){ stationName = stationName_str; } |
+ public void setWQtest(String wqTest_str){ wqTest = wqTest_str; } |
+ public void setBeginDate(String beginDate_str){ beginDate = beginDate_str; } |
+ public void setEndDate(String endDate_str){ endDate = endDate_str; } |
+ public void setTimeStep(String timeStep_str){ timeStep = timeStep_str; } |
+ public void setMethod(String method_str){ method = method_str; } |
+ public void setPeriod1Begin(String period1Begin_str){ period1Begin = period1Begin_str; } |
+ public void setPeriod1End(String period1End_str){ period1End = period1End_str; } |
+ public void setPeriod2Begin(String period2Begin_str){ period2Begin = period2Begin_str; } |
+ public void setPeriod2End(String period2End_str){ period2End = period2End_str; } |
+ public void setPeriod3Begin(String period3Begin_str){ period3Begin = period3Begin_str; } |
+ public void setPeriod3End(String period3End_str){ period3End = period3End_str; } |
+ public void setMedianTF(boolean medianTF_str){ medianTF = medianTF_str; } |
+ public void setUserData(String userData_str){ userData = userData_str; } |
+ public void setMergeDatasets(boolean mergeDatasets_TF){ mergeDatasets = mergeDatasets_TF; } |
+ public void setMergeMethod(String mergeMethod_str){ mergeMethod = mergeMethod_str; } |
/** |
* Main statistics function calls other functions to calculate each statistic value then stores the results as global variables |
* @param dataList data on which statistical values are desired |
@@ -451,8 +412,8 @@ |
Graphing graphing = new Graphing(); |
XYPlot plotTime = new XYPlot(); |
boolean showLegend = false; |
- TimeSeries series = createTimeSeriesFromData(sortedData, stationID + ": Data"); |
- TimeSeries series2 = createTimeSeriesFromData(sortedData_user, stationID + ": User Data"); |
+ TimeSeries series = createTimeSeriesFromData(sortedData, stationId + ": Data"); |
+ TimeSeries series2 = createTimeSeriesFromData(sortedData_user, stationId + ": User Data"); |
|
//Create user data points |
if(sortedData_user.length != 0){//only show user points if it is not zero |
@@ -590,7 +551,7 @@ |
plotTime = graphing.setTimeAxisPreferences(plotTime); |
|
//Create the chart with the plot and a legend |
- String graphTitle = "Time Series for " + database + " Station: " + stationID + "; " + stationName; |
+ String graphTitle = "Time Series for " + database + " Station: " + stationId + "; " + stationName; |
JFreeChart chart = new JFreeChart(graphTitle, graphing.titleFont, plotTime, showLegend); |
|
//Set legend Font |
@@ -601,7 +562,7 @@ |
|
//Save resulting graph for use later |
try{ |
- String path = mainFolder + File.separator + getGraph(); |
+ String path = directory + File.separator + getGraph(); |
ChartUtilities.saveChartAsJPEG(new File(path), chart, 1280, 800); |
System.out.println("JFreeChart created properly at: " + path); |
|
@@ -692,7 +653,7 @@ |
String[][] sortableData = new String[0][2]; |
if(wqTest.equalsIgnoreCase("height")){ |
//Check if any groundwater height data exists |
- Object[] returnArray = USGSwell_Data.getUSGSwellHeightData(stationID, beginDate, endDate); |
+ Object[] returnArray = USGSwell_Data.getUSGSwellHeightData(stationId, beginDate, endDate); |
//ArrayList<String> textData = (ArrayList<String>) returnArray[0]; |
sortableData = (String[][]) returnArray[1]; |
//String start = (String) returnArray[2]; |
@@ -710,7 +671,7 @@ |
this.units = "ft"; |
}else if(wqTest.equalsIgnoreCase("depth")){ |
//Check if any depth to watertable data exists |
- Object[] returnArray = USGSwell_Data.getUSGSwatertableDepthData(stationID, beginDate, endDate); |
+ Object[] returnArray = USGSwell_Data.getUSGSwatertableDepthData(stationId, beginDate, endDate); |
//ArrayList<String> textData = (ArrayList<String>) returnArray[0]; |
sortableData = (String[][]) returnArray[1]; |
//String start = (String) returnArray[2]; |
@@ -728,7 +689,7 @@ |
this.units = "ft"; |
}else{ |
//Check if any wq data exists |
- Object[] returnArray = USGSwell_Data.getUSGSwellWQdata(stationID, wqTest, beginDate, endDate); |
+ Object[] returnArray = USGSwell_Data.getUSGSwellWQdata(stationId, wqTest, beginDate, endDate); |
//ArrayList<String> textData = (ArrayList<String>) returnArray[0]; |
sortableData = (String[][]) returnArray[1]; |
//String start = (String) returnArray[2]; |