com.bbn.openmap.tools.beanbox
Class GenericPropertySheet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.bbn.openmap.tools.beanbox.GenericPropertySheet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, 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 BeanBoxto 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/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, 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 reference 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.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 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 accommodate 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, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

panel

protected com.bbn.openmap.tools.beanbox.PropertySheetPanel panel
contains a reference 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 accommodate 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