Class PamDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
AboutPluginDisplay, AcceptMeasurementDialog, AcquisitionDialog, ActionDialog, AirgunParametersDialog, AISDisplayDialog, AISSettingsDialog, AlarmDialog, AlarmSerialDialog, AlarmUDPDialog, AmpDialog, AnalogSensorDialog, AngleCalibrationDialog, AngleVetoDialog, AngleVetoesDialog, AnnotationDialog, AnnotationSettingsDialog, AnnotationsPopup, ArrayAccelDialog, ArrayDialog, ArrayDisplayParamsDialog, AzigramDisplayDialog, BatchRainbowFileConversion, BatchTrainingDialog, BeamformParamsDialog, BespokeNameDialog, BinaryMapMakingDialog, BinaryStorageDialog, CalibrationDialog, CepstrumDialog, CheckWavFileHeaders, CircularMovementDialog, ClassifierTrainingDialog, ClassifierTrainingDialog, ClickAlarmDialog, ClickAlarmDialog, ClickClassifyDialog, ClickDelayDialog, ClickDisplayDialog, ClickLocalisationDialog, ClickMapDialog, ClickParamsDialog, ClickSpectrumDialog, ClickSpectrumTemplateDialog, ClickSpectrumTemplateEditDialog, ClickStorageOptionsDialog, ClickTrainIdDialog, ClickTypeDialog, ClickTypesDialog, ClipDialog, ClipDisplayDialog, ClipGenSettingDialog, ConcatenatedSpectrogramdialog, CopyDialog, CouplerDialog, CPODDialog, DatabaseCheckDialog, DatabaseSpeedDialog, DataBlockSpeciesDialog, DataExportDialog, DatagramDialog, DatagramProgressDialog, DataKeepDialog, DataSelectDialog, DBDialog, DbHtAlarmParamsDialog, DbHtDialog, DbHtDisplayDialog, DbHtSummaryDialog, DBMapMakingDialog, DecimatorParamsDialog, DelayOptionsDialog, DeprecatedModuleDialog, DepthDialog, DetectionGroupDialog, DifarDisplayParamsDialog, DifarParamsDialog, DisplayScalingDialog, EchoDialog, EditOfflineEventDialog, EffortDialog, EffortProblemDialog, EmulateDialog, EnvelopeDialog, EventListDialog, FFTFilterDialog, FFTParametersDialog, FFTPluginParamsDialog, FileBackupDialog, FileDateDialog, FileMapMakingdialog, FilterDataSourceDialog, FilterDialog, FluxgateWorldDialog, FormEditDialog, FormsDataUnitEditDialog, FormsPlotOptionsDialog, GeneralMarkDialog, GenericBackupDialog, GenericSwingDialog, GlobalTimeDialog, GPLDialog, GPSParametersDialog, GridbaseDialog, GridMovementDialog, HeightDialog, HidingDialog, HydrophoneElementDialog, IDI_DisplayDialog, ImportBCLDialog, ImportDataDialog, ImportGGADialog, ImportGPSDialog, ImportLoadBar, IMUCalibrationDialog, IMUImportDialog, IMUSettingsDialog, IshDetParamsDialog, IshDisplayDialog, IshLocParamsDialog, KernelSmoothingDialog, LabelClicksDialog, LandMarkAddDialog, LandmarkDialog, LandMarkGroupDialog, LandmarksDialog, LatLongDialog, LevelMeterDialog, LikelihoodDetectionParametersDialog, ListeningDialog, LoadingDataDialog, LoadOptionsDialog, LookupEditDialog, LtsaDialog, ManagedParameterDialog, ManualLocationDialog, MapCommentDialog, MapDetectionsDialog, MapGrouperDialog, MapParametersDialog, MarkAnnotationDialog, MatrixDialog, MccDialog, MCMCParamsDialog, MetaDataDialog, ModuleOrderDialog, NetworkReceiveDialog, NetworkSendDialog, NewModuleDialog, NewProjectDialog, NMEAOutdialog, NMEAParametersDialog, NMEASimDialog, NMEAStringsTable, NMEATimeDialog, NodeSelectDialog, NoiseAlarmDialog, NoiseBandDialog, NoiseDialog, NoiseDisplayDialog, NTPDialog, OfflienEventViewer, OfflineEventDialog, OfflineEventViewer, OfflineFileProgressDialog, OfflineFilesDialog, OLProcessDialog, OneBandAlarmParamsDialog, OneBandDialog, OneBandDisplayDialog, OneBandSummaryDialog, OpsEditDialog, OverlayOptionsDialog, PamDialogFX2AWT, PAMGuardXMLPreview, PamObjectList, PamSymbolDialog, PamTipViewer, PamWizard, PamWorkDialog, PatchPanelDialog, PerformanceDialog, PlaybackDialog, PlaySoundDialog, PreviewDialog, PrintScreenDialog, ProjectDeploymentsDialog, QAReportDialog, QuickAnnotationDialog, QuickAnnotationParamsDialog, RadarParametersDialog, RainbowDatabaseConversion, RavenImportDialog, RecorderSettingsDialog, RecordingGapDialog, ReprocessChoiceDialog, RoccaParametersDialog, RockBlockParamsDialog, RWEDialog, ScrollJumpDialog, SelectProjectDialog, SelectServerdDialog, SendEmailSettingsDialog, SettingsFileDialog, SettingsImportDialog, SimObjectDialog, SpeciesMapIODialog, SpeciesSearchDialog, SpectrogramMarkDialog, SpectrogramNoiseDialog, SpectrogramParamsDialog, StorageOptionsDialog, StreamerDialog, StreamerOriginDialog, SUDParamsDialog, SweepClassifierDialog, SwingRelationshipsDialog, TargetMotionDialog, TethysDocumentsFrame, ThreadingDialog, TimesDialog, TimeZoneDisplayDialog, TowedArray3DParametersDialog, TriggerOptionsDialog, UIDRepairDialog, UserBandDialog, ValueFilterDialog, VetoParametersDialog, ViewTimesDialog, VRCalibrationDialog, VRParametersDialog, WarnOnceDialog, WaveCorrector, WaveDisplayDialog, WekaOptionsDialog, WhistleClassificationDialog, WhistleParametersDialog, WhistleToneDialog, WignerPlotdialog, WMAlarmDialog, WMDisplayDialog, WMRecordTriggerdialog, XMLStringView, XMLWriterDialog

public abstract class PamDialog extends JDialog
General functionality for PamGuard dialogs. Should be subclassed.
Author:
Doug Gillespie
See Also:
  • Field Details

  • Constructor Details

    • PamDialog

      public PamDialog(Window parentFrame, String title, boolean hasDefault)
      Dialogs are always constructed with OK and Cancel buttons. Help and Set Defaults buttons are optional.
      Parameters:
      parentFrame - owner frame - can be null, but preferably the owner frame of the menu that calls this dialog
      title - dialog title
      hasDefault - display a default button
  • Method Details

    • getButtonPanel

      public JPanel getButtonPanel()
    • exportSettings

      public boolean exportSettings(PamSettings pamControlledUnit, Serializable settings, String fileName)
      Export settings for a controlled unit. Some process info is also written from the PAMControlled unit,
      Parameters:
      pamControlledUnit -
      settings -
      fileName -
      Returns:
    • importSettings

      public XMLImportData importSettings(Class objectClass)
      Find a file and import settings that have the same class as that given.
      Parameters:
      objectClass - class to search for in the settings file.
      Returns:
      Object.
    • setDialogComponent

      public void setDialogComponent(JComponent component)
      Used to set the main panel containing dialog controls -
      Parameters:
      component - - usually a jPanel
      See Also:
    • setVisible

      public void setVisible(boolean visible)
      Overrides:
      setVisible in class Dialog
    • moveToMouseLocation

      public void moveToMouseLocation()
      put the dialog near the mouse location.
    • moveToLocation

      public void moveToLocation(Point point)
    • closeLater

      public void closeLater()
      Reschedule closing of the window to happen on the AWT thread using SwingUtilities.invokeLater(...)
    • getParams

      public abstract boolean getParams()
      called when the Ok button is pressed. This must return true in order that the dialog may close. It should also copy all parameters into an object that will be returned by showDialog.
    • cancelButtonPressed

      public abstract void cancelButtonPressed()
      called when the cancel button is pressed before the dialog closes. Generally you should set the parameters returned by the dialog to null or some default value, or in some other way indicate that Cancel was pressed.
    • getHelpPoint

      public String getHelpPoint()
    • restoreDefaultSettingsQ

      public void restoreDefaultSettingsQ()
      restore default setting ? Check with user before calling restoreDefaultSettings(); Thsi may be overridden if you want to ask a more complex question or offer options at this point.
    • restoreDefaultSettings

      public abstract void restoreDefaultSettings()
      standard function which should us used to copy default parameters into the dialog controls.
    • setHelpPoint

      public void setHelpPoint(String helpPoint)
      Sets the starting point for Java help. If this is null, then the help button is hidden, if it is not null, then the help button is displayed.
      Parameters:
      helpPoint -
    • enableHelpButton

      public void enableHelpButton(boolean helpOn)
    • getCancelButton

      public JButton getCancelButton()
      getter for cancel button so that you can change it's name from the default value
      Returns:
      reference to the cancel button
    • getOkButton

      public JButton getOkButton()
      getter for ok button so that you can change it's name from the default value
      Returns:
      reference to the ok button
    • addComponent

      public static void addComponent(JPanel panel, Component p, GridBagConstraints constraints)
      add to a panel which must use GridBagLayout
      Parameters:
      panel - - a panel which must use GridBagLayout
      p -
      constraints -
    • getDefaultButton

      public JButton getDefaultButton()
    • getHelpButton

      public JButton getHelpButton()
    • setSendGeneralSettingsNotification

      public void setSendGeneralSettingsNotification(boolean sendGeneralSettingsNotification)
      Tell the Pamguard Controller to send a notification message around ALL program modules, processes and data blocks indicating that some settings have changed.
      Parameters:
      sendGeneralSettingsNotification - the sendGeneralSettingsNotification to set
    • isSendGeneralSettingsNotification

      public boolean isSendGeneralSettingsNotification()
      Returns:
      the sendGeneralSettingsNotification
    • getWarningTitle

      public String getWarningTitle()
    • setWarningTitle

      public void setWarningTitle(String warningTitle)
    • showWarning

      public boolean showWarning(String warningText)
      Display a warning message with a default title
      Parameters:
      warningText - text
      Returns:
      false so these can be a single return line in dialog getParams funcs.
    • showWarning

      public static boolean showWarning(Window owner, String warningTitle, String warningText)
    • showWarning

      public boolean showWarning(String warningTitle, String warningText)
      Display a warning message with given title and text
      Parameters:
      warningTitle - title of warning dialog
      warningText - message of warning dialog
      Returns:
      false so these can be a single return line in dialog getParams funcs.
    • showQuestion

      public boolean showQuestion(String warningText)
      Ask a yes no question and return true if yes was selected
      Parameters:
      warningText - text for optionpane
      Returns:
      true if yes selected.
    • showQuestion

      public boolean showQuestion(String warningTitle, String warningText)
      Ask a yes no question and return true if yes was selected
      Parameters:
      warningTitle - title for dialog
      warningText - text for optionpane
      Returns:
      true if yes selected.
    • showQuestion

      public boolean showQuestion(Window owner, String warningTitle, String warningText)
      Ask a yes no question and return true if yes was selected
      Parameters:
      owner - parent window
      warningTitle - title for dialog
      warningText - text for optionpane
      Returns:
      true if yes selected.
    • formatDouble

      public static String formatDouble(double val)
      Use the standard internal Double formatting to print Double numbers with a minimum, but sensible number of decimal places.
      Parameters:
      val - value to format
      Returns:
      formatted string.
    • setWarnDefaultSetting

      public void setWarnDefaultSetting(boolean warnDefaultSetting)
      Parameters:
      warnDefaultSetting - the warnDefaultSetting to set
    • isWarnDefaultSetting

      public boolean isWarnDefaultSetting()
      Returns:
      the warnDefaultSetting
    • getCancelObserver

      public CancelObserver getCancelObserver()
      Returns:
      the cancelObserver
    • setCancelObserver

      public void setCancelObserver(CancelObserver cancelObserver)
      Parameters:
      cancelObserver - the cancelObserver to set
    • setDoubleValue

      public static void setDoubleValue(JTextField textField, Double value, String format)
      Set a Double value in a text field, setting appropriately to null if the Double value is null
      Parameters:
      heading -
      heading2 -
      string -
    • isMoveToMouse

      public boolean isMoveToMouse()
      Returns:
      the moveToMouse
    • setMoveToMouse

      public void setMoveToMouse(boolean moveToMouse)
      Parameters:
      moveToMouse - the moveToMouse to set