Package PamView.dialog
Class PamDialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
PamView.dialog.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
General functionality for PamGuard dialogs.
Should be subclassed.
- Author:
- Doug Gillespie
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Only activated in the smruDev version to provide a quick way of copying dialog displays for help file authoring.Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.ModalExclusionType, Dialog.ModalityType
Nested classes/interfaces inherited from class java.awt.Window
Window.Type
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
Field Summary
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addComponent
(JPanel panel, Component p, GridBagConstraints constraints) add to a panel which must use GridBagLayoutabstract void
called when the cancel button is pressed before the dialog closes.void
Reschedule closing of the window to happen on the AWT thread using SwingUtilities.invokeLater(...)void
enableHelpButton
(boolean helpOn) boolean
exportSettings
(PamSettings pamControlledUnit, Serializable settings, String fileName) Export settings for a controlled unit.static String
formatDouble
(double val) Use the standard internal Double formatting to print Double numbers with a minimum, but sensible number of decimal places.getter for cancel button so that you can change it's name from the default valuegetter for ok button so that you can change it's name from the default valueabstract boolean
called when the Ok button is pressed.importSettings
(Class objectClass) Find a file and import settings that have the same class as that given.boolean
boolean
boolean
void
moveToLocation
(Point point) void
put the dialog near the mouse location.abstract void
standard function which should us used to copy default parameters into the dialog controls.void
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.void
setCancelObserver
(CancelObserver cancelObserver) void
setDialogComponent
(JComponent component) Used to set the main panel containing dialog controls -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 nullvoid
setHelpPoint
(String helpPoint) Sets the starting point for Java help.void
setMoveToMouse
(boolean moveToMouse) 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.void
setVisible
(boolean visible) void
setWarnDefaultSetting
(boolean warnDefaultSetting) void
setWarningTitle
(String warningTitle) boolean
showQuestion
(Window owner, String warningTitle, String warningText) Ask a yes no question and return true if yes was selectedboolean
showQuestion
(String warningText) Ask a yes no question and return true if yes was selectedboolean
showQuestion
(String warningTitle, String warningText) Ask a yes no question and return true if yes was selectedstatic boolean
showWarning
(Window owner, String warningTitle, String warningText) boolean
showWarning
(String warningText) Display a warning message with a default titleboolean
showWarning
(String warningTitle, String warningText) Display a warning message with given title and textMethods inherited from class javax.swing.JDialog
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
PamDialog
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 dialogtitle
- dialog titlehasDefault
- display a default button
-
-
Method Details
-
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
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
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 classDialog
-
moveToMouseLocation
public void moveToMouseLocation()put the dialog near the mouse location. -
moveToLocation
-
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
-
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
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
getter for cancel button so that you can change it's name from the default value- Returns:
- reference to the cancel button
-
getOkButton
getter for ok button so that you can change it's name from the default value- Returns:
- reference to the ok button
-
addComponent
add to a panel which must use GridBagLayout- Parameters:
panel
- - a panel which must use GridBagLayoutp
-constraints
-
-
getDefaultButton
-
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
-
setWarningTitle
-
showWarning
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
-
showWarning
Display a warning message with given title and text- Parameters:
warningTitle
- title of warning dialogwarningText
- message of warning dialog- Returns:
- false so these can be a single return line in dialog getParams funcs.
-
showQuestion
Ask a yes no question and return true if yes was selected- Parameters:
warningText
- text for optionpane- Returns:
- true if yes selected.
-
showQuestion
Ask a yes no question and return true if yes was selected- Parameters:
warningTitle
- title for dialogwarningText
- text for optionpane- Returns:
- true if yes selected.
-
showQuestion
Ask a yes no question and return true if yes was selected- Parameters:
owner
- parent windowwarningTitle
- title for dialogwarningText
- text for optionpane- Returns:
- true if yes selected.
-
formatDouble
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
- Returns:
- the cancelObserver
-
setCancelObserver
- Parameters:
cancelObserver
- the cancelObserver to set
-
setDoubleValue
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
-