public class IlvDiagrammerPropertySheet extends JPanel
IlvDiagrammer
. The properties are displayed
in a table, each row representing one property, the left column is the property name
and the right column is the property value.
This component connects itself automatically to the "current" diagram component in a component hierarchy. All you have to do is create the property sheet and add it to a hierarchy that also contains one or more diagram components.
Styling Options
The rendering and the behavior of the property sheet can be customized
through the style sheet of the diagram component. To do this, you must call
setStyleApplicationComponents(true)
on the diagram component, and you must define special rules with the
"DiagrammerPropertySheet"
pseudo-class, like the following:
node:DiagrammerPropertySheet { background : "lightblue"; }Like in the diagram itself, you can style the property sheet according to the different kinds of nodes and links, for example:
node[state="Error"]:DiagrammerPropertySheet { background : "red"; }You can style each row of the property sheet individually. To do this, use the name of the property as an additional pseudo-class, for example:
node:DiagrammerPropertySheet:x { background : "lightgreen"; }You can also use the following additional pseudo-classes:
:selected
applies the rule only to the selected row in the property sheet.
:focus
applies the rule only to the cell that has the keyboard focus.
:property
applies the rule only to the first column, which displays the property names.
:value
applies the rule only to the second column, which displays the property values.
javax.swing.table.DefaultTableCellRenderer
class
(which is a subclass of javax.swing.JLabel
).
The most useful properties are typically foreground
, background
and font
.
editable
property: when set to false
, the
property specified as a pseudo-class in the rule selector will not be editable
in the property sheet. If no property was specified in the selector, all properties
will be non-editable.
filteredOut
property: when set to true
,
the property specified as a pseudo-class in the rule selector is not displayed
in the property sheet.
propertyEditor
property lets you specify a custom
java.beans.PropertyEditor
that will be used instead of the default
editor to edit the property value. You must use a "@#" construct to specify the
property editor, for example:
node:DiagrammerPropertySheet:status { propertyEditor : "@#myStatusEditor"; } Subobject#myStatusEditor { class : "my.package.MyStatusEditor"; }
Modifier and Type | Class and Description |
---|---|
class |
IlvDiagrammerPropertySheet.PropertySheetDelegateBeanInfo
Bean info class
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvDiagrammerPropertySheet()
Creates a new JViews Diagrammer property sheet with the default resource bundle
"ilog.views.diagrammer.application.psheet" . |
IlvDiagrammerPropertySheet(ResourceBundle bundle)
Creates a new JViews Diagrammer property sheet with the specified resource bundle.
|
Modifier and Type | Method and Description |
---|---|
void |
addNotify()
Notifies this component that it now has a parent component.
|
void |
addTargetPropertyChangeListener(PropertyChangeListener listener)
Add a listener that will be notified of the target modifications
|
static void |
allowUserDefinedType(boolean allowed)
Lets you install or not the action that lets the user to set
the user-defined type for the selected object.
|
IlvDiagrammer |
getDiagrammer()
Returns the diagram component to which this component is currently attached.
|
Icon |
getIcon()
Returns the icon to be used when this component is displayed in a frame.
|
JTable |
getTable()
Returns the JTable used by the property sheet.
|
protected Object |
getTargetObject()
Returns the target object.
|
String |
getTitle()
Returns the title to be used when this component is displayed in a frame.
|
IlvDiagrammerToolBar |
getToolbar()
Returns the toolbar of the property sheet.
|
void |
removeNotify()
Notifies this component that it no longer has a parent component.
|
void |
removeTargetPropertyChangeListener(PropertyChangeListener listener)
Removes a target property change listener.
|
void |
setDiagrammer(IlvDiagrammer diagrammer)
Sets the diagram component to which this component is attached.
|
void |
setTarget(Object target)
Sets the object that is currently edited by the property sheet.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, 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, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, 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, validateTree
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, getPeer, 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, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvDiagrammerPropertySheet()
"ilog.views.diagrammer.application.psheet"
.public IlvDiagrammerPropertySheet(ResourceBundle bundle)
public static void allowUserDefinedType(boolean allowed)
public void addNotify()
addNotify
in class JComponent
public void removeNotify()
removeNotify
in class JComponent
public IlvDiagrammerToolBar getToolbar()
public void setTarget(Object target)
Normally, the target object is set automatically when you select an object in the diagram component to which the property sheet is attached. You may call this method if you want to edit the properties of an object that is not select in the diagram.
target
- An object contained in the data model of the diagram
component to which the property sheet is attached.
May be null
.public JTable getTable()
public IlvDiagrammer getDiagrammer()
public void setDiagrammer(IlvDiagrammer diagrammer)
You do not usually need to call this method, because this component is attached automatically to the current diagram component of the Swing hierarchy.
diagrammer
- The new diagram component to which this component is attached.protected Object getTargetObject()
public String getTitle()
public Icon getIcon()
public void addTargetPropertyChangeListener(PropertyChangeListener listener)
public final void removeTargetPropertyChangeListener(PropertyChangeListener listener)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.