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,PamRunModeDialog,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
Nested ClassesModifier and TypeClassDescriptionclassOnly activated in the smruDev version to provide a quick way of copying dialog displays for help file authoring.Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy - 
Field Summary
FieldsFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddComponent(JPanel panel, Component p, GridBagConstraints constraints) add to a panel which must use GridBagLayoutabstract voidcalled when the cancel button is pressed before the dialog closes.voidReschedule closing of the window to happen on the AWT thread using SwingUtilities.invokeLater(...)voidenableHelpButton(boolean helpOn) booleanexportSettings(PamSettings pamControlledUnit, Serializable settings, String fileName) Export settings for a controlled unit.static StringformatDouble(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 valuestatic FrameCopied from JPopup menu.getter for ok button so that you can change it's name from the default valueabstract booleancalled when the Ok button is pressed.importSettings(Class objectClass) Find a file and import settings that have the same class as that given.booleanbooleanbooleanvoidmoveToLocation(Point point) voidput the dialog near the mouse location.protected voidprotected voidpositionInFrame(Window parentFrame) abstract voidstandard function which should us used to copy default parameters into the dialog controls.voidrestore 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.voidsetCancelObserver(CancelObserver cancelObserver) protected voidsetCentreLocation(Point point) Try to set the central location of the dialog at point but also check entire dialog is on screen.protected voidsetCloseLocation(Point point) Set a location as close as possible to the given point, but ensure that the dialog stays in it's parent frame.voidsetDialogComponent(JComponent component) Used to set the main panel containing dialog controls -static voidsetDoubleValue(JTextField textField, Double value, String format) Set a Double value in a text field, setting appropriately to null if the Double value is nullvoidsetHelpPoint(String helpPoint) Sets the starting point for Java help.voidsetMoveToMouse(boolean moveToMouse) voidsetSendGeneralSettingsNotification(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.voidsetVisible(boolean visible) voidsetWarnDefaultSetting(boolean warnDefaultSetting) voidsetWarningTitle(String warningTitle) booleanshowQuestion(Window owner, String warningTitle, String warningText) Ask a yes no question and return true if yes was selectedbooleanshowQuestion(String warningText) Ask a yes no question and return true if yes was selectedbooleanshowQuestion(String warningTitle, String warningText) Ask a yes no question and return true if yes was selectedstatic booleanshowWarning(Window owner, String warningTitle, String warningText) Display a warning text.booleanshowWarning(String warningText) Display a warning message with a default titlebooleanshowWarning(String warningTitle, String warningText) Display a warning message with given title and textMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods 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, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, 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
 - 
getFrame
Copied from JPopup menu. Finds the frame of any component.- Parameters:
 c- Swing component.- Returns:
 - parent frame or null
 
 - 
setCentreLocation
Try to set the central location of the dialog at point but also check entire dialog is on screen.- Parameters:
 point-
 - 
setCloseLocation
Set a location as close as possible to the given point, but ensure that the dialog stays in it's parent frame. If there isn't a parent frame, make sure it's at least on the screen.- Parameters:
 point-
 - 
positionInFrame
 - 
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:
 setVisiblein 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. - 
okButtonPressed
protected void okButtonPressed() - 
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
Display a warning text.- Parameters:
 owner-warningTitle-warningText-- Returns:
 
 - 
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
 
 -