|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.talvi.puffinplot.PuffinApp
public final class PuffinApp
This class constitutes the main PuffinPlot application.
Instantiating it starts the PuffinPlot desktop application and opens
the main window. Most of PuffinApp
's
functionality involves interfacing the user interface to the classes
which handle the actual data. Most of the actions defined in
PuffinActions
act as thin wrappers around one or a few calls
to PuffinApp
. Most of PuffinApp
's interaction with the
data is via the Suite
, Site
, and Sample
classes.
Nested Class Summary | |
---|---|
class |
PuffinApp.Version
|
Constructor Summary | |
---|---|
PuffinApp()
Instantiates a new PuffinPlot application object. |
Method Summary | |
---|---|
void |
about()
Shows the application's ‘About’ dialog box, giving brief information about PuffinPlot. |
void |
calculateGreatCirclesDirections(boolean popUpWindow)
For all selected sites, calculates the site mean direction by best-fit intersection of great circles fitted to that site's samples. |
void |
calculateMultiSuiteMeans()
|
void |
clearAmsCalcs()
Clears the results of any AMS calculations for the current suite. |
void |
clearPreferences()
Shows a confirmation dialog. |
void |
clearSiteCalculations()
Clears any previously calculated Fisherian or great-circle site directions. |
void |
closeCurrentSuite()
Closes the suite whose data is currently being displayed. |
void |
copyPointSelection()
Copies the current pattern of selected points to a clipboard. |
void |
doAmsCalc(Suite.AmsCalcType calcType,
java.lang.String scriptName)
Performs statistical calculations on AMS data using a script from Lisa Tauxe's pmagpy software suite. |
void |
doPcaOnSelection()
For all selected samples, determine a best-fit line to the selected points by principal component analysis. |
void |
errorDialog(java.lang.String title,
PuffinUserException ex)
Displays a dialog box reporting an error. |
void |
errorDialog(java.lang.String title,
java.lang.String message)
Displays a dialog box reporting an error. |
void |
exportPdfFreehep(java.io.File pdfFile)
Writes a PDF file containing data plots with the current layout for all selected samples. |
void |
exportPdfItext(java.io.File pdfFile)
Writes a PDF file containing data plots with the current layout for all selected samples. |
void |
fitGreatCirclesToSelection()
For all selected samples, fit a great circle to the selected points. |
void |
flipSelectedSamples(MeasurementAxis axis)
For all selected samples, rotates magnetization data 180° around the specified axis. |
PuffinActions |
getActions()
Returns the actions associated with this PuffinApp. |
java.util.List<Sample> |
getAllSamplesInSelectedSites()
Gets all the samples in all the sites having at least one selected sample. |
java.lang.String |
getBuildProperty(java.lang.String key)
Reads values from the build.properties file. |
CiteWindow |
getCiteWindow()
Returns this PuffinApp's citation window |
Correction |
getCorrection()
Returns the correction currently being applied to the data displayed by this PuffinApp. |
CorrectionWindow |
getCorrectionWindow()
Returns the window for user editing of correction data (sample orientation, formation orientation, geomagnetic declination) |
java.awt.print.PageFormat |
getCurrentPageFormat()
Returns the current page format. |
Site |
getCurrentSite()
Returns the site for which data is currently being displayed. |
static PuffinApp |
getInstance()
Returns the single instance of PuffinApp. |
MainWindow |
getMainWindow()
Returns this PuffinApp's main window |
int |
getOsxPointVersion()
If this PuffinApp is running on Mac OS X, this method returns the point version (minor version) of the operating system. |
PuffinPrefs |
getPrefs()
Returns the preferences for this PuffinApp. |
RecentFileList |
getRecentFiles()
Returns the list of recently used files. |
Sample |
getSample()
Gets the current Sample |
java.util.List<Sample> |
getSelectedSamples()
Gets all the currently selected samples. |
java.util.List<Site> |
getSelectedSites()
Gets all the sites containing any of the currently selected samples. |
SiteMeanWindow |
getSiteEqAreaWindow()
Returns the great-circle statistics window. |
Suite |
getSuite()
Returns the current Suite. |
SuiteEqAreaWindow |
getSuiteEqAreaWindow()
Returns the suite equal-area plot window. |
java.util.List<Suite> |
getSuites()
Returns all the Suites currently open within this PuffinApp. |
TableWindow |
getTableWindow()
Returns the data table window. |
PuffinApp.Version |
getVersion()
|
void |
importAmsWithDialog()
Shows an open filesdialog box; if the user selects any files, AMS data will be imported from them. |
void |
importPreferencesWithDialog()
Shows an open filedialog box; if the user select a file, the current preferences will be overwritten with preferences data from that file. |
void |
importTabularDataWithFormat(FileFormat format)
|
boolean |
isEmptyCorrectionActive()
Reports whether the empty-slot correction is currently active. |
boolean |
isOnOsX()
Reports whether this PuffinApp is running on Mac OS X. |
static void |
main(java.lang.String[] args)
Instantiates and starts a new PuffinApp. |
void |
openFiles(java.util.List<java.io.File> files)
|
void |
openFiles(java.util.List<java.io.File> files,
FileFormat format)
Creates a new suite and reads data into it from the specified files. |
void |
openFilesWithDialog()
Shows an ‘open files’ dialog box; if the user selects any files, they will be opened in a new suite. |
void |
openWebPage(java.lang.String uriString)
|
void |
pastePointSelection()
For each selected sample, selects the points corresponding to those last copied to the clipboard. |
void |
quit()
Terminates this instance of PuffinApp immediately. |
void |
redoCalculations()
Recalculates all sample and site calculations in all currently open suites; intended to be called when the correction (none/sample/formation) has changed. |
void |
rescaleMagSus()
Scales all magnetic susceptibility values in the current suite by a user-specified factor. |
void |
runPythonScript(java.lang.String scriptPath)
Runs a specified Python script |
void |
runPythonScriptWithDialog()
Opens a file selection dialog and runs the Python script (if any) which the user selects from that dialog. |
void |
setCorrection(Correction correction)
Sets the correction to apply to the displayed data. |
void |
setEmptyCorrectionActive(boolean b)
Activates or deactivates the empty-slot correction. |
void |
setRecentFiles(RecentFileList recentFiles)
Sets the list of recently used files (allowing it to be restored after restarting the application). |
void |
setSuite(int index)
Sets the currently displayed Suite. |
void |
showCustomFlagsWindow()
Shows the window for editing the titles of the custom flags. |
void |
showCustomNotesWindow()
Shows the window for editing the titles of the custom notes. |
void |
showPageSetupDialog()
Opens the page setup dialog box. |
void |
showPreferences()
Opens the preferences window. |
void |
showTabularImportDialog()
|
void |
updateDisplay()
Updates the main window and table window to reflect any changes in the currently displayed data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PuffinApp()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- command-line arguments for the applicationpublic boolean isOnOsX()
true
if this PuffinApp is running on Mac OS Xpublic int getOsxPointVersion()
public static PuffinApp getInstance()
public boolean isEmptyCorrectionActive()
true if the empty-slot correction is activepublic void setEmptyCorrectionActive(boolean b)
b
- true
to activate the empty-slot correction;
false
to deactivate it.public void redoCalculations()
public java.lang.String getBuildProperty(java.lang.String key)
build.properties
file. This is a
properties file written into the PuffinPlot jar at build time,
and currently contains the keys build.date
and
build.year
.
key
- the property key to read
public void calculateGreatCirclesDirections(boolean popUpWindow)
popUpWindow
- if true
, open a new window showing
great circle directionspublic void fitGreatCirclesToSelection()
public void doPcaOnSelection()
public PuffinPrefs getPrefs()
public MainWindow getMainWindow()
public CiteWindow getCiteWindow()
public Correction getCorrection()
public void setCorrection(Correction correction)
correction
- the correction to apply to the displayed datapublic void updateDisplay()
public void closeCurrentSuite()
public void openFiles(java.util.List<java.io.File> files)
public void openFiles(java.util.List<java.io.File> files, FileFormat format)
files
- the files from which to read datapublic void errorDialog(java.lang.String title, java.lang.String message)
title
- the title for the dialog boxmessage
- the message to be displayedpublic void errorDialog(java.lang.String title, PuffinUserException ex)
title
- the title for the dialog boxex
- the exception from which to take the message textpublic java.util.List<Suite> getSuites()
public Suite getSuite()
public void setSuite(int index)
index
- the index of the suite to be displayed within
PuffinApp's list of suitespublic Sample getSample()
public java.util.List<Sample> getSelectedSamples()
public Site getCurrentSite()
public java.util.List<Site> getSelectedSites()
public java.util.List<Sample> getAllSamplesInSelectedSites()
public void quit()
public void about()
public void showPreferences()
public void showPageSetupDialog()
public java.awt.print.PageFormat getCurrentPageFormat()
public TableWindow getTableWindow()
public PuffinActions getActions()
public SuiteEqAreaWindow getSuiteEqAreaWindow()
public SiteMeanWindow getSiteEqAreaWindow()
public CorrectionWindow getCorrectionWindow()
public RecentFileList getRecentFiles()
public void setRecentFiles(RecentFileList recentFiles)
recentFiles
- the list of recently used filespublic void showCustomFlagsWindow()
public void showCustomNotesWindow()
public void doAmsCalc(Suite.AmsCalcType calcType, java.lang.String scriptName)
calcType
- the type of calculation to performscriptName
- the external script which will perform the calculationspublic void openFilesWithDialog()
public void importAmsWithDialog()
Shows an open files
dialog box; if the user selects any files,
AMS data will be imported from them. The files are expected to
be in Agico ASC format.
public void importPreferencesWithDialog()
Shows an open file
dialog box; if the user select a file,
the current preferences will be overwritten with preferences data
from that file. The file is expected to contain Java Preferences
data in XML format.
public void clearPreferences()
public void copyPointSelection()
pastePointSelection()
public void pastePointSelection()
copyPointSelection()
public void flipSelectedSamples(MeasurementAxis axis)
axis
- the axis around which to flip the selected samplespublic void rescaleMagSus()
public void clearSiteCalculations()
public void clearAmsCalcs()
public void exportPdfItext(java.io.File pdfFile) throws java.io.FileNotFoundException, com.lowagie.text.DocumentException
pdfFile
- the PDF file to which to write the plots
com.lowagie.text.DocumentException
- if an error occurred while writing the PDF
java.io.FileNotFoundException
- if the file exists but is a directory
rather than a regular file, does not exist but cannot be created,
or cannot be opened for any other reasonpublic void exportPdfFreehep(java.io.File pdfFile) throws java.io.IOException
pdfFile
- the PDF file to which to write the plots
java.io.IOException
- if there was an error during file writingpublic void calculateMultiSuiteMeans()
public void runPythonScript(java.lang.String scriptPath) throws org.python.core.PyException
scriptPath
- the path to the script
org.python.core.PyException
- if an error occurred while running the scriptpublic void runPythonScriptWithDialog()
public void showTabularImportDialog()
public void importTabularDataWithFormat(FileFormat format)
public PuffinApp.Version getVersion()
public void openWebPage(java.lang.String uriString)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |