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

com.ibm.able.editor
Class AbleViewObject

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JLabel
                          |
                          +--com.ibm.able.editor.AbleViewObject
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.beans.PropertyChangeListener, java.io.Serializable, javax.swing.SwingConstants

public class AbleViewObject
extends javax.swing.JLabel
implements java.awt.event.ActionListener, java.awt.event.MouseListener, java.beans.PropertyChangeListener, java.io.Serializable

This class provides function similar to the Wrapper class in the BDK. It introspects the underlying AbleBean and provides a GUI interface for manipulation in the AbleEditorCanvas. It is meant to be a design-time only object.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
protected  int myBeanSlot
           
protected  java.lang.String myEventType
           
protected  AbleBean myUnderlyingAbleBean
           
protected  java.lang.Object myUnderlyingObject
           
protected  boolean myUnderlyingObjectIsAbleBean
           
 
Fields inherited from class javax.swing.JLabel
labelFor
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbleViewObject(java.lang.Object theObject, AbleEditorFrame theFrame)
          Construct a ViewObject over an AbleBean.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent theActionEvent)
          Process action events -- usually context menu actions
 void closeCustomizer()
          Dispose of customizer windows.
static java.lang.String Copyright()
          Determine the copyright of this class.
 java.lang.Object[] getArrayNames()
          Return an array of array (indexed property) names
 java.util.Hashtable getArrays()
          Return a hashtable of arrays (indexed properties) (name and property descriptors)
 AbleBean getBean()
          Get the able bean that this view object is wrapping Note: could be AbleBeanAdaptor if myUnderlyingObject is not an AbleBean
protected  void getBeanProperties()
          Introspect the bean to get all of the members of this object and build a list of parameters and arrays.
 java.util.Vector getBufferConnections()
          Return the vector of source buffer connections to the object used for drawing the buffer connections.
 java.util.Hashtable getCustomInspectorPanels()
          Return the list of custom inspector panels, if any.
 java.util.Hashtable getCustomInspectors()
          Return the list of custom inspectors, if any.
 java.lang.String getEventType()
           
 java.awt.Point getInputPos()
          Return the left midpoint of the object for drawing a connection
 java.lang.String getKey()
          Return a key of the form "parentname.beanname", or "beanclass.currentTimeMillis" in the event of an error.
 java.lang.String getName()
          Return the object name for display purposes
 java.lang.Object getObject()
          Get the object that this view object is wrapping
 java.lang.String getObjectName()
          Return the object name for display purposes
 java.awt.Point getOutputPos()
          Return the right midpoint of the object for drawing a connection
 java.lang.Object[] getParameterNames()
          Return an array of parameter (non-indexed property) names
 java.util.Hashtable getParameters()
          Return a hashtable of parameters (name and property descriptors)
 javax.swing.JPopupMenu getPopupMenu(java.awt.event.MouseEvent theEvent, AbleViewObject theView)
           
 java.lang.Object[] getProperties()
          Return an array of all object property names
 int getSlot()
          Get the horizontal position on the canvas
protected  void introspectBean()
          Introspect the bean, get the customizer class (if any) the icon for display on the canvas, etc.
 void mouseClicked(java.awt.event.MouseEvent theMouseEvent)
           
 void mouseEntered(java.awt.event.MouseEvent theMouseEvent)
           
 void mouseExited(java.awt.event.MouseEvent theMouseEvent)
           
 void mousePressed(java.awt.event.MouseEvent theMouseEvent)
           
 void mouseReleased(java.awt.event.MouseEvent theMouseEvent)
           
 void paintComponent(java.awt.Graphics theGraphics)
          paint the icon for this bean on the canvas
 void propertyChange(java.beans.PropertyChangeEvent theEvent)
          Handle propertyChange events from underlying AbleBean.
 void setSelected(boolean theSelectedState)
           
 java.lang.String toString()
          Retrieve a string describing (the contents of) the object.
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myUnderlyingObject

protected java.lang.Object myUnderlyingObject

myUnderlyingAbleBean

protected AbleBean myUnderlyingAbleBean

myUnderlyingObjectIsAbleBean

protected boolean myUnderlyingObjectIsAbleBean

myEventType

protected java.lang.String myEventType

myBeanSlot

protected int myBeanSlot
Constructor Detail

AbleViewObject

public AbleViewObject(java.lang.Object theObject,
                      AbleEditorFrame theFrame)
Construct a ViewObject over an AbleBean. If it is not an AbleBean, then use a generic AbleBeanAdapter as a proxy.
Parameters:
theObject - A JavaBean (usually AbleBean) object

theFrame - An AbleEditorFrame reference used to modify its list of open view object customizers.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent theActionEvent)
Process action events -- usually context menu actions
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
theActionEvent - An ActionEvent generated by user action


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent theMouseEvent)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent theMouseEvent)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent theMouseEvent)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent theMouseEvent)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent theMouseEvent)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent theEvent)
Handle propertyChange events from underlying AbleBean. If name is changed, update label text; if bean active state is changed, update icon
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

getObject

public java.lang.Object getObject()
Get the object that this view object is wrapping

getBean

public AbleBean getBean()
Get the able bean that this view object is wrapping Note: could be AbleBeanAdaptor if myUnderlyingObject is not an AbleBean

getName

public java.lang.String getName()
Return the object name for display purposes
Overrides:
getName in class java.awt.Component

getKey

public java.lang.String getKey()
Return a key of the form "parentname.beanname", or "beanclass.currentTimeMillis" in the event of an error.

getObjectName

public java.lang.String getObjectName()
Return the object name for display purposes

getEventType

public java.lang.String getEventType()

getSlot

public int getSlot()
Get the horizontal position on the canvas

getArrays

public java.util.Hashtable getArrays()
Return a hashtable of arrays (indexed properties) (name and property descriptors)

getArrayNames

public java.lang.Object[] getArrayNames()
Return an array of array (indexed property) names

getParameters

public java.util.Hashtable getParameters()
Return a hashtable of parameters (name and property descriptors)

getParameterNames

public java.lang.Object[] getParameterNames()
Return an array of parameter (non-indexed property) names

getProperties

public java.lang.Object[] getProperties()
Return an array of all object property names

getCustomInspectors

public java.util.Hashtable getCustomInspectors()
Return the list of custom inspectors, if any. Return value may be null.

getCustomInspectorPanels

public java.util.Hashtable getCustomInspectorPanels()
Return the list of custom inspector panels, if any. Return value may be null.

getBufferConnections

public java.util.Vector getBufferConnections()
Return the vector of source buffer connections to the object used for drawing the buffer connections.

setSelected

public void setSelected(boolean theSelectedState)

getOutputPos

public java.awt.Point getOutputPos()
Return the right midpoint of the object for drawing a connection

getInputPos

public java.awt.Point getInputPos()
Return the left midpoint of the object for drawing a connection

paintComponent

public void paintComponent(java.awt.Graphics theGraphics)
paint the icon for this bean on the canvas
Overrides:
paintComponent in class javax.swing.JComponent

introspectBean

protected void introspectBean()
Introspect the bean, get the customizer class (if any) the icon for display on the canvas, etc.

getBeanProperties

protected void getBeanProperties()
Introspect the bean to get all of the members of this object and build a list of parameters and arrays.

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu(java.awt.event.MouseEvent theEvent,
                                           AbleViewObject theView)
Returns:
JPopupMenu the correct popup menu for the settings object

toString

public java.lang.String toString()
Retrieve a string describing (the contents of) the object.

Note that this implementation returns the underlying bean's name.

Overrides:
toString in class java.awt.Component
Returns:
A String containing the current contents of the object.

closeCustomizer

public void closeCustomizer()
Dispose of customizer windows. Customizers that override dispose have the opportunity to remove listeners.

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