## com.bbn.openmap.tools.beanbox
Class GenericPropertySheet

    java.lang.Object
      java.awt.Component
          java.awt.Container
              java.awt.Window
                  java.awt.Dialog
                      javax.swing.JDialog
                          com.bbn.openmap.tools.beanbox.GenericPropertySheet

All Implemented Interfaces:
  javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class GenericPropertySheet
extends javax.swing.JDialog
implements java.beans.PropertyChangeListener

Displays the properties associated with a bean for editing. An instance of this class is created by the `BeanBox`to display the properties of a bean that the user has clicked on the map. An instance of GenericPropertySheet can also be used as a custom editor component for a bean property that is itself a bean.

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JDialog
`javax.swing.JDialog.AccessibleJDialog`

Nested classes inherited from class java.awt.Dialog
`java.awt.Dialog.AccessibleAWTDialog`

Nested classes inherited from class java.awt.Window
`java.awt.Window.AccessibleAWTWindow`

Nested classes inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`protected BeanBox` `beanBox` A GenericPropertySheet can be optionally associated with a BeanBox.
`protected java.awt.Rectangle` `bounds` contains the rectangular bounds of this GenericPropertySheet.
`protected java.beans.PropertyEditor` `editor` If an instance of this class is used as a custom editor component of a bean's property that is itself a bean, this member contains a reference to the custom editor.
`protected int` `numEditorsToDisplay` contains the number of editors displayed in this GenericPropertySheet.
`protected com.bbn.openmap.tools.beanbox.PropertySheetPanel` `panel` contains a referrence to an internal panel that displays the bean's properties.
`protected java.lang.Object` `targetBean` the bean that this property sheet is associated with.

Fields inherited from class javax.swing.JDialog
`accessibleContext, rootPane, rootPaneCheckingEnabled`

Fields inherited from class java.awt.Component
`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

Fields inherited from interface javax.swing.WindowConstants
`DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`GenericPropertySheet(boolean isModal, java.lang.Object target, java.awt.Rectangle bounds, java.beans.PropertyEditor pe, BeanBox beanBox)` Constructs a property sheet dialog.
`GenericPropertySheet(boolean isModal, java.lang.String title)` Constructs a property sheet dialog.
`GenericPropertySheet(java.lang.Object target, int x, int y, java.beans.PropertyEditor pe, BeanBox beanBox)` Constructs a property sheet dialog.

Method Summary
`protected void` `addWindowListener()` adds a window listener to this property sheet.
`protected com.bbn.openmap.tools.beanbox.PropertySheetPanel` `getPropertySheetPanel()` Returns the JPanel object used to display all the editors in this property sheet.
`protected void` `init()` Initializes the background, bounds, title, panel and adds a window listener.
`protected void` `initPanel()` Initializes the property sheet panel.
`protected void` `initTitle()` Initializes the property sheet's title.
`void` `propertyChange(java.beans.PropertyChangeEvent evt)` Required by interface PropertyChangeListener.
`protected void` `setFrameSize()` Sets the frame size in order to accomodate all property editors.
`protected void` `setNumEditorsToDisplay(int numEditorsToDisplay)` Sets the number of editors to be displayed on this property sheet.
`void` `setTarget(java.lang.Object bean)` Sets the bean associated with this property sheet.

Methods inherited from class javax.swing.JDialog

`addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update`

Methods inherited from class java.awt.Dialog
`addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show`

Methods inherited from class java.awt.Window

`addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree`

Methods 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### panel

    protected com.bbn.openmap.tools.beanbox.PropertySheetPanel panel

  contains a referrence to an internal panel that displays the bean's properties.

### editor

    protected java.beans.PropertyEditor editor

  If an instance of this class is used as a custom editor component of a bean's property that is itself a bean, this member contains a reference to the custom editor.

### targetBean

    protected java.lang.Object targetBean

  the bean that this property sheet is associated with.

### beanBox

    protected BeanBox beanBox

  A GenericPropertySheet can be optionally associated with a BeanBox.

### bounds

    protected java.awt.Rectangle bounds

  contains the rectangular bounds of this GenericPropertySheet.

### numEditorsToDisplay

    protected int numEditorsToDisplay

  contains the number of editors displayed in this GenericPropertySheet.

Constructor Detail

### GenericPropertySheet

    public GenericPropertySheet(boolean isModal,
                                java.lang.String title)

  Constructs a property sheet dialog.

Parameters:
  `isModal` - whether the propertysheet should be displayed in a modal dialog.
  `title` - the title of this propertysheet.

### GenericPropertySheet

    public GenericPropertySheet(java.lang.Object target,
                                int x,
                                int y,
                                java.beans.PropertyEditor pe,
                                BeanBox beanBox)

  Constructs a property sheet dialog.

Parameters:
  `target` - the bean associated with this property sheet.
  `x` - the top-left x position of this property sheet.
  `y` - the top-left y position of this property sheet.
  `beanBox` - the beanBox that this propertysheet is associated with. This param is usually non-null only if this is a top-level property-sheet. When this param is non-null, this propertysheet will inform the BeanBox whenever a property on the bean changes by calling the beanChanged method on BeanBox. Additionally the propertysheet will call the editComplete method on the BeanBox when the user closes the window.

### GenericPropertySheet

    public GenericPropertySheet(boolean isModal,
                                java.lang.Object target,
                                java.awt.Rectangle bounds,
                                java.beans.PropertyEditor pe,
                                BeanBox beanBox)

  Constructs a property sheet dialog.

Parameters:
  `isModal` - whether to display the propertysheet as a modal dialog.
  `target` - the bean property that this class handles.
  `bounds` - the boundaries to use
  `pe` - the parent PropertyEditor of this sheet. An instance of GenericPropertySheet is invoked from the getCustomEditor method of pe. The parent editor can be null, in which case this class behaves exactly as a regular property sheet class.
  `beanBox` - the beanBox that this propertysheet is associated with. This param is usually non-null only if this is a top-level property-sheet. When this param is non-null, this propertysheet will inform the BeanBox whenever a property on the bean changes by calling the beanChanged method on BeanBox.

Method Detail

### init

    protected void init()

  Initializes the background, bounds, title, panel and adds a window listener.

### initPanel

    protected void initPanel()

  Initializes the property sheet panel.

### initTitle

    protected void initTitle()

  Initializes the property sheet's title.

### addWindowListener

    protected void addWindowListener()

  adds a window listener to this property sheet. The windowClosing method calls the editComplete method on the BeanBox associated with this property sheet if there is one.

### getPropertySheetPanel

    protected com.bbn.openmap.tools.beanbox.PropertySheetPanel getPropertySheetPanel()

  Returns the JPanel object used to display all the editors in this property sheet.

### setFrameSize

    protected void setFrameSize()

  Sets the frame size in order to accomodate all property editors.

### setNumEditorsToDisplay

    protected void setNumEditorsToDisplay(int numEditorsToDisplay)

  Sets the number of editors to be displayed on this property sheet.

### setTarget

    public void setTarget(java.lang.Object bean)

  Sets the bean associated with this property sheet. The property sheet will re-initialize to display the bean's properties when this method is called.

### propertyChange

    public void propertyChange(java.beans.PropertyChangeEvent evt)

  Required by interface PropertyChangeListener. This method is called whenever one of the properties of the associated bean changes. If there is a PropertyEditor associated with this property sheet, this method will generate a call to the editor's setValue method. If there is a BeanBox associated with this property sheet, this method will generate a call to beanChanged method on the BeanBox.

  Specified by:
    `propertyChange` in interface `java.beans.PropertyChangeListener`

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details