# Class DialogManager

java.lang.Object
jspecview.dialog.DialogManager

Direct Known Subclasses:
  `AwtDialogManager, JsDialogManager`

public abstract class DialogManager extends Object
Dialogs include Integration, PeakListing, Views, OverlayLegend, and Measurements These dialogs have been generalized for platform independence.' This manager is subclassed as AwtDialogManager and JsDialogManager, which apply their own interpretation of how to create the dialog and get its event callbacks. For any one session, there will be only one DialogManager, created in JSViewer. AwtDialogManager will create instances of AwtDialog extends javax.swing.JDialog; JsDialogManager will create instances of JsDialog extends jspecview.awtj2d.swing.JDialog.

Author:
  hansonr

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ERROR_MESSAGE`
`protected Map<String, JSVDialog>`
`htDialogs`
`static final int`
`INFORMATION_MESSAGE`
`static final int`
`PLAIN_MESSAGE`
`static final int`
`QUESTION_MESSAGE`
`protected JSViewer`
`vwr`
`static final int`
`WARNING_MESSAGE`

## Constructor Summary

Constructors
Constructor
Description
`DialogManager()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`fixTitle(String title)`
`abstract PlatformDialog`
`getDialog(JSVDialog jsvDialog)`
`abstract String`
`getDialogInput(Object parentComponent, String phrase, String title, int msgType, Object icon, Object[] objects, String defaultStr)`
`abstract int[]`
`getLocationOnScreen(Object component)`
`abstract int`
`getOptionFromDialog(Object frame, String[] items, JSVPanel jsvp, String dialogName, String labelName)`
`protected String`
`getSelectorName(Object selector)`
`protected void`
`processClick(String eventId)`
processing click event from platform DialogManager
`protected void`
`processTableEvent(String eventId, int index1, int index2, boolean adjusting)`
processing table cell click event from platform DialogManager; takes two hits in AWT -- one a row, the other a column
`protected void`
`processWindowClosing(String dialogId)`
processing window closing event from platform DialogManager
`protected String`
`registerDialog(JSVDialog jsvDialog)`
register the JSV dialog with a unique key to be used as an ID in callbacks optionKeys ending with "!" are one-of-a-kind, such as "views"
`void`
`registerSelector(String selectorName, Object columnSelector)`
`DialogManager`
`set(JSViewer viewer)`
`abstract void`
`showMessage(Object frame, String text, String title)`
`abstract void`
`showMessageDialog(Object parentComponent, String msg, String title, int msgType)`
`abstract void`
`showProperties(Object frame, Spectrum spectrum)`
`void`
`showSource(Object frame, Spectrum spec)`
`void`
`showSourceErrors(Object frame, JDXSource currentSource)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### vwr

protected JSViewer vwr

### htDialogs

protected Map<String, JSVDialog> htDialogs

### PLAIN_MESSAGE

public static final int PLAIN_MESSAGE

See Also:
  - Constant Field Values

### ERROR_MESSAGE

public static final int ERROR_MESSAGE

See Also:
  - Constant Field Values

### INFORMATION_MESSAGE

public static final int INFORMATION_MESSAGE

See Also:
  - Constant Field Values

### WARNING_MESSAGE

public static final int WARNING_MESSAGE

See Also:
  - Constant Field Values

### QUESTION_MESSAGE

public static final int QUESTION_MESSAGE

See Also:
  - Constant Field Values

## Constructor Details

### DialogManager

public DialogManager()

## Method Details

### set

public DialogManager set(JSViewer viewer)

### getDialog

public abstract PlatformDialog getDialog(JSVDialog jsvDialog)

### getDialogInput

public abstract String getDialogInput(Object parentComponent, String phrase, String title, int msgType, Object icon, Object[] objects, String defaultStr)

### getLocationOnScreen

public abstract int[] getLocationOnScreen(Object component)

### getOptionFromDialog

public abstract int getOptionFromDialog(Object frame, String[] items, JSVPanel jsvp, String dialogName, String labelName)

### showMessageDialog

public abstract void showMessageDialog(Object parentComponent, String msg, String title, int msgType)

### showProperties

public abstract void showProperties(Object frame, Spectrum spectrum)

### showMessage

public abstract void showMessage(Object frame, String text, String title)

### registerDialog

protected String registerDialog(JSVDialog jsvDialog)
register the JSV dialog with a unique key to be used as an ID in callbacks optionKeys ending with "!" are one-of-a-kind, such as "views"

Parameters:
  `jsvDialog` -
Returns:
  id

### registerSelector

public void registerSelector(String selectorName, Object columnSelector)

### getSelectorName

protected String getSelectorName(Object selector)

### showSourceErrors

public void showSourceErrors(Object frame, JDXSource currentSource)

### showSource

public void showSource(Object frame, Spectrum spec)

### processClick

protected void processClick(String eventId)
processing click event from platform DialogManager

Parameters:
  `eventId` - dialogId/buttonId starting with "btn", "chk", "cmb", or "txt"

### processTableEvent

protected void processTableEvent(String eventId, int index1, int index2, boolean adjusting)
processing table cell click event from platform DialogManager; takes two hits in AWT -- one a row, the other a column

Parameters:
  `eventId` - dialogId/[ROW|COL] or just dialogId
  `index1` - row if just dialogId or (row or col if AWT)
  `index2` - column if just dialogId or -1 if AWT
  `adjusting` -

### processWindowClosing

protected void processWindowClosing(String dialogId)
processing window closing event from platform DialogManager

Parameters:
  `dialogId` -

### fixTitle

public static String fixTitle(String title)