public class FileController
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CURRENT_YEAR |
private static CustomOptions |
customOptions |
static int |
EARLIEST_ALLOWED_YEAR |
static int |
FHX2_MAX_FILE_NAME_LENGTH |
static int |
FHX2_MAX_NUMBER_OF_SAMPLES |
static int |
FHX2_MAX_SAMPLE_NAME_LENGTH |
static int |
FHX2_YEAR_LOWER_BOUNDARY |
static int |
FHX2_YEAR_UPPER_BOUNDARY |
static java.lang.String |
fileName |
static java.lang.String |
filePath |
private static java.lang.Boolean |
isChangedSinceLastSave |
private static java.lang.Boolean |
isChangedSinceOpened |
private static java.lang.Boolean |
isCorrupted |
private static java.lang.Boolean |
isNewFile |
private static java.lang.Boolean |
lastYearDefinedInFile |
private static org.slf4j.Logger |
log |
static int |
MAX_VISIBLE_GRAPH_COLUMNS |
private static boolean |
overrideCompositeWarnings |
static java.lang.String |
progName |
static FireHistoryRecorder |
thePrimaryWindow |
Constructor and Description |
---|
FileController() |
Modifier and Type | Method and Description |
---|---|
static void |
checkIfNumSamplesExceedsFHX2Reqs()
Issues a warning if the number of samples exceeds the original capabilities of FHX2
|
static void |
checkIfYearLowerBoundaryIsWithinFHX2Reqs()
Issues a warning if the data-set first year is below the minimum supported year of FHX2
|
static void |
checkIfYearUpperBoundaryIsWithinFHX2Reqs()
Issues a warning if the data-set last year is above the minimum supported year of FHX2
|
static void |
disableCloseMenu()
Calls the "disableCloseMenu" method in GUI_FireHistoryRecorder.
|
static void |
displayUpdatedFile()
Redraws the necessary components to reflect updates that have been performed on the file since the last redraw.
|
private static void |
doSaveFileFunctionality()
Saves the data stored in theFHX2File as a FHX file at filePath.
|
static void |
enableCloseMenu()
Calls the "enableCloseMenu" method in GUI_FireHistoryRecorder.
|
static CustomOptions |
getCustomOptions()
TODO
|
static java.io.File |
getSavedFile()
Gets the path of the file currently loaded into FireHistoryRecorder.
|
static java.util.List<YearSummary> |
getYearSummaryList()
TODO
|
static void |
importFile(java.io.File theImportedFile)
Loads an FHX file from the disk and stores the data in theFHX2File.
|
static java.lang.Boolean |
isChangedSinceLastSave()
Gets the value of isChangedSinceLastSave.
|
static java.lang.Boolean |
isChangedSinceOpened()
Gets the value of isChangedSinceOpened.
|
static java.lang.Boolean |
isEnforcingOldReqs()
Returns a value indicating whether or not the old FHX2 file requirements are to be enforced.
|
static java.lang.Boolean |
isFileCorrupted()
Returns the value indicating whether or not an error has been found while parsing the file from the disk.
|
static java.lang.Boolean |
isFileNew()
TODO
|
static boolean |
isOverrideCompositeWarnings()
Returns the status of the OverrideCompositeWarnings flag.
|
static void |
loadDialog()
Determines the actions of the loading dialog when importing new files.
|
static void |
newFile()
Handles the GUI-side setup of a new FHX2 file.
|
static void |
redrawEventPanel()
Calls the "redrawEventPanel" method in GUI_FireHistoryRecorder.
|
static void |
redrawSampleInputPanel()
Calls the "redrawSampleInputPanel" method in GUI_FireHistoryRecorder.
|
static void |
save()
Checks if a path for the current theFHX2File exists and calls doSaveFileFunctionality().
|
static void |
saveAs()
Opens a JFileChooser for the user to set the filepath to save theFHX2File.
|
static void |
setCorruptedState(java.lang.Boolean b)
Updates the value indicating whether or not an error has been found while parsing the file from the disk.
|
static void |
setCustomOptions(CustomOptions inCustomOptions)
Overwrites the existing option set with the input option set.
|
static void |
setIsChangedSinceLastSave(java.lang.Boolean b)
Sets the value of isChangedSinceLastSave based on the input parameter.
|
static void |
setIsChangedSinceOpened(java.lang.Boolean b)
Sets the value of isChangedSinceOpened based on the input parameter.
|
protected static void |
setIsNewFile(java.lang.Boolean b)
TODO
|
protected static void |
setLastYearDefinedInFile(java.lang.Boolean inValue)
Sets lastYearDefinedInFile according to the input parameter.
|
static void |
setOverrideCompositeWarnings(boolean overrideCompositeWarnings)
Updates the status of the OverrideCompositeWarnings flag.
|
static void |
setTitleName(java.lang.String name)
Sets the title of the form based on the input parameter.
|
static void |
showComments()
Calls the "showComments" method in GUI_FireHistoryRecorder.
|
static void |
showInfo()
Calls the "showInfo" method in GUI_FireHistoryRecorder.
|
static void |
showInput()
Calls the "showInput" method in GUI_FireHistoryRecorder.
|
static java.lang.Boolean |
wasLastYearDefinedInFile()
Returns a value indicating the special case in which the last year of the data set was not originally defined in the FHX2 file.
|
public static final int CURRENT_YEAR
public static final int EARLIEST_ALLOWED_YEAR
public static final int MAX_VISIBLE_GRAPH_COLUMNS
public static final int FHX2_MAX_FILE_NAME_LENGTH
public static final int FHX2_MAX_SAMPLE_NAME_LENGTH
public static final int FHX2_MAX_NUMBER_OF_SAMPLES
public static final int FHX2_YEAR_LOWER_BOUNDARY
public static final int FHX2_YEAR_UPPER_BOUNDARY
private static final org.slf4j.Logger log
private static CustomOptions customOptions
public static FireHistoryRecorder thePrimaryWindow
public static java.lang.String progName
public static java.lang.String filePath
public static java.lang.String fileName
private static java.lang.Boolean isChangedSinceLastSave
private static java.lang.Boolean isChangedSinceOpened
private static java.lang.Boolean isCorrupted
private static java.lang.Boolean isNewFile
private static java.lang.Boolean lastYearDefinedInFile
private static boolean overrideCompositeWarnings
public static java.lang.Boolean isEnforcingOldReqs()
public static java.lang.Boolean isChangedSinceOpened()
public static void setIsChangedSinceOpened(java.lang.Boolean b)
b
- public static java.lang.Boolean isChangedSinceLastSave()
public static void setIsChangedSinceLastSave(java.lang.Boolean b)
b
- public static java.lang.Boolean isFileCorrupted()
public static java.lang.Boolean isFileNew()
public static void setCorruptedState(java.lang.Boolean b)
b
- public static java.io.File getSavedFile()
public static void setTitleName(java.lang.String name)
name
- public static java.lang.Boolean wasLastYearDefinedInFile()
protected static void setLastYearDefinedInFile(java.lang.Boolean inValue)
inValue
- protected static void setIsNewFile(java.lang.Boolean b)
b
- public static void showInput()
public static void showInfo()
public static void showComments()
public static void redrawSampleInputPanel()
public static void redrawEventPanel()
public static void enableCloseMenu()
public static void disableCloseMenu()
public static void displayUpdatedFile()
public static void checkIfNumSamplesExceedsFHX2Reqs()
public static void checkIfYearLowerBoundaryIsWithinFHX2Reqs()
public static void checkIfYearUpperBoundaryIsWithinFHX2Reqs()
public static void newFile()
public static void importFile(java.io.File theImportedFile) throws CompositeFileException
theImportedFile
- CompositeFileException
public static void loadDialog() throws CompositeFileException
CompositeFileException
public static void save()
private static void doSaveFileFunctionality()
public static void saveAs()
public static CustomOptions getCustomOptions()
public static void setCustomOptions(CustomOptions inCustomOptions)
inCustomOptions
- public static java.util.List<YearSummary> getYearSummaryList()
public static boolean isOverrideCompositeWarnings()
public static void setOverrideCompositeWarnings(boolean overrideCompositeWarnings)
overrideCompositeWarnings
-