ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able
Class AbleObjectCustomizer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--com.ibm.able.AbleObjectCustomizer
All Implemented Interfaces:
AbleCustomizer, javax.accessibility.Accessible, java.beans.Customizer, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
Direct Known Subclasses:
AbleBackPropagationCustomizer, AbleConversationManagerCustomizer, AbleDBExportCustomizer, AbleDBImportCustomizer, AbleDecisionTreeCustomizer, AbleDecisionTreeCustomizer, AbleDefaultAgentCustomizer, AbleExportCustomizer, AbleFileWatcherCustomizer, AbleFilterCustomizer, AbleImportCustomizer, AbleKnnCustomizer, AbleNaiveBayesCustomizer, AbleNaiveBayesCustomizer, AbleRadialBasisFunctionNetCustomizer, AbleSelfOrganizingMapCustomizer, AbleTemporalDifferenceLearningCustomizer, AbleTimeSeriesFilterCustomizer, AmabBuyerLogicCustomizer, AmabSellerLogicCustomizer, AutoConversationSetupCustomizer, SampleSensorEffectorCustomizer

public class AbleObjectCustomizer
extends javax.swing.JDialog
implements AbleCustomizer

This class provides a dialog with a tabbed property panel and standard tabs for AbleObjects. Classes extending from AbleObjectCustomizer must add or insert their panels to this dialog. Panels may register property change events with their customizer to invoke a method when a property of interest changes. For now assume the panel size is 525x350.

Standard tabs are:

General tab
where the name, comment, processing options are set.
Connections tab
where data, event, and property connections are displayed and can be removed.

See Also:
AbleObject, AbleObjectPanel, AbleConnectionsPanel, addPropertyChangeMethod(java.lang.String, java.lang.Object, java.lang.String), Serialized Form

Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int TabHeight
           
static int TabWidth
           
 
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, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbleObjectCustomizer()
          Called by main.
AbleObjectCustomizer(javax.swing.JFrame theFrame, java.lang.String theTitle, boolean isModal)
          Create the property tabbed panel and add the general and connections tabs to it.
 
Method Summary
 void addPanel(AbleCustomizerPanel thePanel)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          This allows other objects to register when this customizer changes.
 void addPropertyChangeMethod(java.lang.String theProperty, java.lang.Object theObject, java.lang.String theMethodName)
          If a panel wants to be informed when a specific property is changed, it registers with its customizer.
 void addTab(java.lang.String theTabTitle, AbleCustomizerPanel thePanel)
          Append a panel to the tabbed panel.
static java.lang.String Copyright()
          Determine the copyright of this class.
 void dispose()
          Cleanup, and dispose of the customizer.
 java.lang.String getWorkingDirectory()
          Get the working directory.
 void insertTab(java.lang.String theTabTitle, AbleCustomizerPanel thePanel, int theIndex)
          Insert a panel in the tabbed list at a specific location.
 void insertTab(java.lang.String theTabTitle, javax.swing.Icon theIcon, AbleCustomizerPanel thePanel, java.lang.String theToolTip, int theIndex)
          Insert a panel in the tabbed list at a specific location.
 boolean isChanged()
          Find out if the object was changed, possibly because of a side-effect.
 boolean isIgnoringPropertyChanges()
          Find out if we're currently ignoring property change events.
static void main(java.lang.String[] args)
          Construct a new object and display the customizer.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          This allows other objects to deregister from changes to this customizer.
 void setChanged(boolean theFlag)
          Find out if the object was changed, possibly because of a side-effect.
 void setCustomizer(AbleCustomizer theCustomizer)
          Customizers that extend this customizer call setCustomizer so that the base object knows to call its updateObject method.
 void setIgnoreAnyPropertyChanges(boolean theFlag)
          Set the flag to ignore property change events.
 void setObject(java.lang.Object theObject)
          Get a reference to the object to be customized.
 void setVisible(boolean isVisible)
          When a customizer is displayed, place it relative to the parent location.
 void setWorkingDirectory(java.lang.String theDir)
          Set the working directory.
 void updateObject()
          Update the customized object by calling each panel we constructed for this customizer and telling it to get its panel data and write it to the object.
 void updateProperties()
          Call the customizer's updateObject method for each listed customizer so that all panel data is read and updated in the object.
 boolean userCancelled()
          Find out if the user pressed cancel.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, 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, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TabWidth

public static final int TabWidth

TabHeight

public static final int TabHeight
Constructor Detail

AbleObjectCustomizer

public AbleObjectCustomizer(javax.swing.JFrame theFrame,
                            java.lang.String theTitle,
                            boolean isModal)
Create the property tabbed panel and add the general and connections tabs to it.
Parameters:
theFrame - The frame to own this property dialog.
theTitle - The title of the property dialog.
isModal - This flag makes the dialog modal when true.

AbleObjectCustomizer

public AbleObjectCustomizer()
Called by main. Used for testing only.
See Also:
main(java.lang.String[])
Method Detail

main

public static void main(java.lang.String[] args)
Construct a new object and display the customizer. For testing only,

setCustomizer

public void setCustomizer(AbleCustomizer theCustomizer)
Customizers that extend this customizer call setCustomizer so that the base object knows to call its updateObject method.
Parameters:
theCustomizer - An object that implements AbleCustomizer.

addTab

public void addTab(java.lang.String theTabTitle,
                   AbleCustomizerPanel thePanel)
Append a panel to the tabbed panel.
Parameters:
theTabTitle - The string to display on the tab as the name.
thePanel - The panel to be added as a tab.

addPanel

public void addPanel(AbleCustomizerPanel thePanel)

insertTab

public void insertTab(java.lang.String theTabTitle,
                      AbleCustomizerPanel thePanel,
                      int theIndex)
Insert a panel in the tabbed list at a specific location.
Parameters:
theTabTitle - The string to display on the tab as the name.
thePanel - The panel to be added as a tab.
theIndex - The position to insert the the tab.

insertTab

public void insertTab(java.lang.String theTabTitle,
                      javax.swing.Icon theIcon,
                      AbleCustomizerPanel thePanel,
                      java.lang.String theToolTip,
                      int theIndex)
Insert a panel in the tabbed list at a specific location.
Parameters:
theTabTitle - The string to display on the tab as the name.
theIcon - The icon to display on the tab panel.
thePanel - The panel to be added as a tab.
theIndex - The position to insert the the tab.

setVisible

public void setVisible(boolean isVisible)
When a customizer is displayed, place it relative to the parent location.
Overrides:
setVisible in class java.awt.Component

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
This allows other objects to register when this customizer changes.
Specified by:
addPropertyChangeListener in interface java.beans.Customizer
Overrides:
addPropertyChangeListener in class java.awt.Component
See Also:
PropertyChangeListener, removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
This allows other objects to deregister from changes to this customizer.
Specified by:
removePropertyChangeListener in interface java.beans.Customizer
Overrides:
removePropertyChangeListener in class java.awt.Component
See Also:
PropertyChangeListener, addPropertyChangeListener(java.beans.PropertyChangeListener)

setObject

public void setObject(java.lang.Object theObject)
Get a reference to the object to be customized. Add a property change listener to this object so we can update panels appropriately when properties change. Pass the object to the panels so its properties can be written to the screen.
Specified by:
setObject in interface java.beans.Customizer
See Also:
AbleCustomizer

updateObject

public void updateObject()
                  throws java.rmi.RemoteException
Update the customized object by calling each panel we constructed for this customizer and telling it to get its panel data and write it to the object.
Specified by:
updateObject in interface AbleCustomizer
See Also:
AbleCustomizer, updateProperties()

updateProperties

public void updateProperties()
                      throws java.rmi.RemoteException
Call the customizer's updateObject method for each listed customizer so that all panel data is read and updated in the object. This temporarily turns off its own property change listener so that events are not created for these property changes themselves. This method is called when the OK button is pressed. It can also be called when panels have their own buttons that produce side-effects such as a generate or configure. Those panels must call their getDataFromBean method to force any side effects to be displayed since the property change listener is temporarily removed. If they wish to update all the panels, they should call setObject.
See Also:
AbleCustomizer, updateObject(), setObject(java.lang.Object)

dispose

public void dispose()
Cleanup, and dispose of the customizer.
Overrides:
dispose in class java.awt.Dialog

userCancelled

public boolean userCancelled()
Find out if the user pressed cancel.

setChanged

public void setChanged(boolean theFlag)
Find out if the object was changed, possibly because of a side-effect.

isChanged

public boolean isChanged()
Find out if the object was changed, possibly because of a side-effect.

isIgnoringPropertyChanges

public boolean isIgnoringPropertyChanges()
Find out if we're currently ignoring property change events.

setIgnoreAnyPropertyChanges

public void setIgnoreAnyPropertyChanges(boolean theFlag)
                                 throws java.rmi.RemoteException
Set the flag to ignore property change events. Any listeners registered with this object will only be informed if ignore is false. This flag is set to false when the updateProperties method is called.
Parameters:
theFlag - A boolean where true disables the customizer property change listener.
See Also:
updateProperties()

addPropertyChangeMethod

public void addPropertyChangeMethod(java.lang.String theProperty,
                                    java.lang.Object theObject,
                                    java.lang.String theMethodName)
If a panel wants to be informed when a specific property is changed, it registers with its customizer. This method adds the panel method to be invoked for a specific property to the hashtable myPropertyChangeMethods. If the property is already included, it makes the hashtable object a vector and adds this method to the other methods.
Parameters:
theProperty - The name of the property of interest, which could be listed in the AbleProperty class.
theObject - The panel object on which to run the property change method.
theMethodName - The name of the method to run. This method must be public, and it must take a PropertyChangeEvent as its sole parameter.
See Also:
AbleProperty

getWorkingDirectory

public java.lang.String getWorkingDirectory()
Get the working directory.
Returns:
the working directory.

setWorkingDirectory

public void setWorkingDirectory(java.lang.String theDir)
Set the working directory.
Parameters:
the - working directory.

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.


ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003