# Class JsDialog

java.lang.Object
org.jmol.awtjs.swing.Component
org.jmol.awtjs.swing.Container
org.jmol.awtjs.swing.JDialog
jspecview.js2d.JsDialog

All Implemented Interfaces:
  `PlatformDialog`

public class JsDialog extends JDialog implements PlatformDialog
just a class I made to separate the construction of the AnnotationDialogs from their use

Author:
  Bob Hanson hansonr@stolaf.edu

## Field Summary

Fields
Modifier and Type
Field
Description
`protected JPanel`
`leftPanel`
`protected DialogManager`
`manager`
`protected String`
`optionKey`
`protected Map<String,Object>`
`options`
`protected String`
`registryKey`
`protected int`
`selectedRow`
`protected boolean`
`tableCellAlignLeft`

### Fields inherited from class JDialog

`defaultHeight`

### Fields inherited from class Container

`list`

### Fields inherited from class Component

`enabled, height, id, minHeight, minWidth, mouseListener, name, parent, renderHeight, renderWidth, text, width`

## Constructor Summary

Constructors
Constructor
Description
`JsDialog(DialogManager manager, JSVDialog jsvDialog, String registryKey)`

## Method Summary

Modifier and Type
Method
Description
`Object`
`addButton(String name, String text)`
`Object`
`addCheckBox(String name, String title, int level, boolean isSelected)`
`Object`
`addSelectOption(String name, String label, String[] info, int iPt, boolean visible)`
`Object`
`addTextField(String name, String label, String value, String units, String defaultValue, boolean visible)`
/ get/set methods ////
`void`
`createTable(Object[][] data, String[] header, int[] widths)`
`void`
`dispose()`
`void`
`endLayout()`
`protected int`
`getColumnCentering(int column)`
`int`
`getSelectedIndex(Object c)`
`Object`
`getSelectedItem(Object combo)`
`String`
`getText(Object o)`
`boolean`
`isSelected(Object chkbox)`
`void`
`onFocus()`
`void`
`selectTableRow(int i)`
`void`
`setCellSelectionEnabled(boolean enabled)`
`void`
`setEnabled(Object btn, boolean b)`
/ Table-related methods ////
`void`
`setFocus(boolean tf)`
`void`
`setIntLocation(int[] loc)`
`void`
`setPreferredSize(int width, int height)`
`void`
`setSelected(Object chkbox, boolean b)`
`void`
`setSelectedIndex(Object combo, int i)`
`void`
`setText(Object o, String text)`
`void`
`startLayout()`

### Methods inherited from class JDialog

`getContentPane, pack, repaint, setLocation, setTitle, setVisible, setZIndex, toFront, toHTML, validate`

### Methods inherited from class Container

`add, addComponent, getComponent, getComponentCount, getComponents, getSubcomponentHeight, getSubcomponentWidth, insertComponent, remove, removeAll`

### Methods inherited from class Component

`addMouseListener, getCSSstyle, getHeight, getName, getParent, getText, getWidth, isEnabled, isVisible, newID, setBackground, setEnabled, setMinimumSize, setName, setParent, setPreferredSize, setText`

### Methods inherited from class Object

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

### Methods inherited from interface PlatformDialog

`isVisible, pack, repaint, setTitle, setVisible`

## Field Details

### optionKey

protected String optionKey

### registryKey

protected String registryKey

### options

protected Map<String,Object> options

### manager

protected DialogManager manager

### leftPanel

protected JPanel leftPanel

### tableCellAlignLeft

protected boolean tableCellAlignLeft

### selectedRow

protected int selectedRow

## Constructor Details

### JsDialog

public JsDialog(DialogManager manager, JSVDialog jsvDialog, String registryKey)

## Method Details

### onFocus

public void onFocus()

### setFocus

public void setFocus(boolean tf)

Specified by:
  `setFocus` in interface `PlatformDialog`

### addButton

public Object addButton(String name, String text)

Specified by:
  `addButton` in interface `PlatformDialog`

### dispose

public void dispose()

Specified by:
  `dispose` in interface `PlatformDialog`
Overrides:
  `dispose` in class `JDialog`

### addCheckBox

public Object addCheckBox(String name, String title, int level, boolean isSelected)

Specified by:
  `addCheckBox` in interface `PlatformDialog`

### addSelectOption

public Object addSelectOption(String name, String label, String[] info, int iPt, boolean visible)

Specified by:
  `addSelectOption` in interface `PlatformDialog`

### addTextField

public Object addTextField(String name, String label, String value, String units, String defaultValue, boolean visible)
/ get/set methods ////

Specified by:
  `addTextField` in interface `PlatformDialog`

### createTable

public void createTable(Object[][] data, String[] header, int[] widths)

Specified by:
  `createTable` in interface `PlatformDialog`

### endLayout

public void endLayout()

Specified by:
  `endLayout` in interface `PlatformDialog`

### getSelectedIndex

public int getSelectedIndex(Object c)

Specified by:
  `getSelectedIndex` in interface `PlatformDialog`

### getSelectedItem

public Object getSelectedItem(Object combo)

Specified by:
  `getSelectedItem` in interface `PlatformDialog`

### getText

public String getText(Object o)

Specified by:
  `getText` in interface `PlatformDialog`

### isSelected

public boolean isSelected(Object chkbox)

Specified by:
  `isSelected` in interface `PlatformDialog`

### selectTableRow

public void selectTableRow(int i)

Specified by:
  `selectTableRow` in interface `PlatformDialog`

### setCellSelectionEnabled

public void setCellSelectionEnabled(boolean enabled)

Specified by:
  `setCellSelectionEnabled` in interface `PlatformDialog`

### setEnabled

public void setEnabled(Object btn, boolean b)
/ Table-related methods ////

Specified by:
  `setEnabled` in interface `PlatformDialog`

### setIntLocation

public void setIntLocation(int[] loc)

Specified by:
  `setIntLocation` in interface `PlatformDialog`

### setPreferredSize

public void setPreferredSize(int width, int height)

Specified by:
  `setPreferredSize` in interface `PlatformDialog`

### setSelected

public void setSelected(Object chkbox, boolean b)

Specified by:
  `setSelected` in interface `PlatformDialog`

### setSelectedIndex

public void setSelectedIndex(Object combo, int i)

Specified by:
  `setSelectedIndex` in interface `PlatformDialog`

### setText

public void setText(Object o, String text)

Specified by:
  `setText` in interface `PlatformDialog`

### startLayout

public void startLayout()

Specified by:
  `startLayout` in interface `PlatformDialog`

### getColumnCentering

protected int getColumnCentering(int column)