Class ALcdBeanCustomizerSW
- All Implemented Interfaces:
ILcdBeanEditor,ILcdPropertySheet,ImageObserver,MenuContainer,Customizer,Serializable,Accessible
Customizer for editing the properties of a bean. It provides
a complete custom GUI. Therefore you need to create your own subclass of this class,
and implement the abstract method createCustomizer.
The setObject method takes a bean as a parameter and analyzes it. From that point on, all utility methods like getPropertyDisplayName, getPropertyComponent, ... can be used.
It makes use of a TLcdBeanGUIFactory instance to perform the bean analysis and
find, for each property, a PropertyEditor as well as an AWT or Swing
Component to display and edit the property value.
This ALcdBeanCustomizer can have a button Panel with Apply,
OK and Cancel buttons. This can be specified by setting the ButtonPanelVisible
property.
This class can be set to edit the bean itself or to edit a clone of the bean with the
method setEditClone.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Default constructor.ALcdBeanCustomizerSW(boolean aButtonPanelVisible) Deprecated.Constructor with a flag to indicate if the Apply, OK, Cancel button Panel has to be visible or not. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener aListener) Deprecated.Registers a listener for the PropertyChange event.protected abstract ComponentDeprecated.This method creates aComponentto edit the bean set bysetObject.Deprecated.This method generates some useful info when you are in development stage.voidfirePropertyChange(PropertyChangeEvent aPropertyChangeEvent) Deprecated.Fires aPropertyChangeEventto all registered PropertyChangeListeners.String[]Deprecated.Deprecated.Deprecated.getPropertyComponent(String aPropertyName) Deprecated.getPropertyComponent(String aPropertyName, boolean aExpandIfPossible) Deprecated.Returns a property component.getPropertyDisplayName(String aPropertyName) Deprecated.getPropertyLabel(String aPropertyName) Deprecated.booleanDeprecated.Tests if the AutoUpdateFromPropertyEditors property istrueor not.booleanDeprecated.Tests if the Apply, OK, Cancel buttonPanelis currently visible or not.booleanDeprecated.Returns true if this object edits a clone of the bean set bysetObject, false otherwise.booleanisPropertyExpandable(String aPropertyName) Deprecated.booleanisPropertyNameValid(String aPropertyName) Deprecated.booleanDeprecated.This method has been deprecated.voidDeprecated.Removes a listener for the PropertyChange event.voidsetAutoUpdateFromPropertyEditors(boolean aBoolean) Deprecated.When this property istrue, the property values will be automatically set to the bean set using the setObject method, each time one of its property value has been changed by the correspondingPropertyEditor(thePropertyEditorfires then a PropertyChangeEvent).voidsetButtonPanelVisible(boolean aButtonPanelVisible) Deprecated.Sets the visibility of the Apply, OK, Cancel button Panel.static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetEditClone(boolean aEditClone) Deprecated.Set true if you want this object to edit a clone of the bean when usingsetObject, false otherwise.voidDeprecated.ImplementsCustomizer.setObject()voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.voidDeprecated.Updates the properties of the bean set, from the values stored in the corresponding PropertyEditors.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.beans.ILcdPropertySheet
getHelpIDString, setHelpIDString
-
Constructor Details
-
ALcdBeanCustomizerSW
public ALcdBeanCustomizerSW()Deprecated.Default constructor. -
ALcdBeanCustomizerSW
public ALcdBeanCustomizerSW(boolean aButtonPanelVisible) Deprecated.Constructor with a flag to indicate if the Apply, OK, Cancel button Panel has to be visible or not. Default istrue.- Parameters:
aButtonPanelVisible- true if the panel containing the Apply, OK and Cancel buttons should be displayed.
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istruethen all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrueif tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
isEditClone
public boolean isEditClone()Deprecated.Returns true if this object edits a clone of the bean set bysetObject, false otherwise.- Returns:
- true if this object edits a clone of the bean set by
setObject, false otherwise.
-
setEditClone
public void setEditClone(boolean aEditClone) Deprecated.Set true if you want this object to edit a clone of the bean when usingsetObject, false otherwise.- Parameters:
aEditClone- true if you want this object to edit a clone of the bean when usingsetObject, false otherwise.
-
getObject
Deprecated.- Specified by:
getObjectin interfaceILcdBeanEditor
-
setObject
Deprecated.ImplementsCustomizer.setObject()- Specified by:
setObjectin interfaceCustomizer- Specified by:
setObjectin interfaceILcdBeanEditor- Parameters:
aObject- the object to be customized. If isEditClone() the object must have a publicclone()method, or anIllegalArgumentExceptionwill be thrown.
-
getComponent
Deprecated.- Specified by:
getComponentin interfaceILcdPropertySheet
-
isButtonPanelVisible
public boolean isButtonPanelVisible()Deprecated.Tests if the Apply, OK, Cancel buttonPanelis currently visible or not.- Specified by:
isButtonPanelVisiblein interfaceILcdPropertySheet
-
setButtonPanelVisible
public void setButtonPanelVisible(boolean aButtonPanelVisible) Deprecated.Sets the visibility of the Apply, OK, Cancel button Panel.- Specified by:
setButtonPanelVisiblein interfaceILcdPropertySheet
-
isAutoUpdateFromPropertyEditors
public boolean isAutoUpdateFromPropertyEditors()Deprecated.Tests if the AutoUpdateFromPropertyEditors property istrueor not.- Specified by:
isAutoUpdateFromPropertyEditorsin interfaceILcdBeanEditor- See Also:
-
setAutoUpdateFromPropertyEditors
public void setAutoUpdateFromPropertyEditors(boolean aBoolean) Deprecated.When this property istrue, the property values will be automatically set to the bean set using the setObject method, each time one of its property value has been changed by the correspondingPropertyEditor(thePropertyEditorfires then a PropertyChangeEvent).If this property is
false, one can make this update manually by calling updateObjectFromPropertyEditors.- Specified by:
setAutoUpdateFromPropertyEditorsin interfaceILcdBeanEditor- See Also:
-
updateObjectFromPropertyEditors
public void updateObjectFromPropertyEditors()Deprecated.Updates the properties of the bean set, from the values stored in the corresponding PropertyEditors. If the bean has been set using aPropertyEditor(the bean object is then the value returned byPropertyEditor.getValue()), thePropertyEditor.setValue()is called with the updated bean.- Specified by:
updateObjectFromPropertyEditorsin interfaceILcdBeanEditor- See Also:
-
addPropertyChangeListener
Deprecated.Registers a listener for the PropertyChange event.- Specified by:
addPropertyChangeListenerin interfaceCustomizer- Specified by:
addPropertyChangeListenerin interfaceILcdPropertySheet- Overrides:
addPropertyChangeListenerin classContainer- Parameters:
aListener- an object to be invoked when a PropertyChange event is fired.
-
removePropertyChangeListener
Deprecated.Removes a listener for the PropertyChange event.- Specified by:
removePropertyChangeListenerin interfaceCustomizer- Specified by:
removePropertyChangeListenerin interfaceILcdPropertySheet- Overrides:
removePropertyChangeListenerin classComponent- Parameters:
aListener- the PropertyChange listener to be removed.
-
firePropertyChange
Deprecated.Fires aPropertyChangeEventto all registered PropertyChangeListeners.- Parameters:
aPropertyChangeEvent- contains the information of which the listeners should be notified.
-
createCustomizer
Deprecated.This method creates aComponentto edit the bean set bysetObject. To facilitate the creation of this gui, a bunch of utility methods are provided (e.g. getPropertyComponent, getPropertyDisplayName, ...). They can only be used aftersetObjectis invoked.There is also a helper class
TLcdBeanPanelto which these components can be easily added by name. Note that you don't have to use this helper class, but it makes life easier. The most simple implementation of this method is like this:TLcdBeanPanel panel = createNewPanel();
panel.addProperties( this.getAllPropertyNames() );
return panel;- Returns:
- a Component to edit the bean set in setObject.
-
isPropertyNameValid
Deprecated. -
isPropertyExpandable
Deprecated. -
getPropertyComponent
Deprecated. -
getPropertyComponent
Deprecated.Returns a property component. These components are the actual gui modifiers for a certain property (e.g. a text field for a text property, a checkbox for a boolean, a fancy panel with all bells and whistles for your own class, ...). The actual components are retrieved from the with this object associatedfBeanGUIFactory. A component has two 'modes': expanded or not. Expand if possible is the default. Expanding is only possible for those components that have a button to show up an extra dialog with the actual editor. Expanding means that instead of popping up an extra dialog, the content of that dialog is put in this gui directly. So no popup button is needed.- Parameters:
aPropertyName- the name of the propertyaExpandIfPossible- whether or not dialogs behind a button should be included directly.- Returns:
- a component to edit a property.
-
getPropertyLabel
Deprecated. -
getPropertyDisplayName
Deprecated. -
getAllPropertyNames
Deprecated. -
feedBackOnPropertyUsages
Deprecated.This method generates some useful info when you are in development stage. For every component that was never referenced, a line is generated. For every component that was referenced more than once, a line is generated. Call this method after you created your gui, otherwise the reference count will be zero for every property.- Returns:
- information on the specified property descriptors.
-