public class IlvDiagrammerTable extends JPanel implements ActionListener
IlvDiagrammer
as a table.
This component connects itself automatically to the "current" diagram component in a component hierarchy. All you have to do is create the table and add it to a hierarchy that also contains one or more diagram components.
The table displays all the objects of a given type in the data model. A combo box lets you choose which objects are displayed. Each row in the table represents an object; each column represents a property.
This component differs from the IlvDiagrammerPropertySheet
in that
it displays a set of objects in a single view, while the property sheet
displays the properties of a single object.
Styling Options
The rendering and the behavior of the table 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
"DiagrammerTable"
pseudo-class, like the following:
node:DiagrammerTable { background : "lightblue"; }Like in the diagram itself, you can style each row in the table according to the different kinds of nodes and links, for example:
node[state="Error"]:DiagrammerTable { background : "red"; }You can style each column of the table individually. To do this, use the name of the property displayed in the column as an additional pseudo-class, for example:
node:DiagrammerTable:x { background : "lightgreen"; }You can also use the following additional pseudo-classes:
:selected
applies the rule only to the selected cells in the table.
:focus
applies the rule only to the cell that has the keyboard focus.
javax.swing.table.DefaultTableCellRenderer
class
(which is a subclass of javax.swing.JLabel
).
The most useful properties are typically foreground
, background
font
and icon
.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 |
---|
IlvDiagrammerTable()
Creates a new JViews Diagrammer table with the default resource bundle
"ilog.views.diagrammer.application.table" . |
IlvDiagrammerTable(ResourceBundle bundle)
Creates a new JViews Diagrammer table with the specified resource bundle.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Implementation of the ActionListener interface.
|
void |
addNotify()
Notifies this component that it now has a parent component.
|
JComboBox |
getCombo()
Returns the combo box displayed above the table.
|
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.
|
IlvSDMTableMediator |
getMediator()
Returns the object that is used internally to connect the table to the
data model.
|
JTable |
getTable()
Returns the JTable that displays the data model.
|
String |
getTitle()
Returns the title to be used when this component is displayed in a frame.
|
IlvDiagrammerToolBar |
getToolbar()
Returns the toolbar displayed above the table.
|
void |
removeNotify()
Notifies this component that it no longer has a parent component.
|
void |
setDiagrammer(IlvDiagrammer diagrammer)
Sets the diagram component to which this component is attached.
|
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 IlvDiagrammerTable(ResourceBundle bundle)
public IlvDiagrammerTable()
"ilog.views.diagrammer.application.table"
.public void addNotify()
addNotify
in class JComponent
public void removeNotify()
removeNotify
in class JComponent
public JComboBox getCombo()
public IlvSDMTableMediator getMediator()
public JTable getTable()
public IlvDiagrammerToolBar getToolbar()
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.public void actionPerformed(ActionEvent e)
The default implementation filters the contents of the table according to the selected tag.
actionPerformed
in interface ActionListener
e
- The action event.public String getTitle()
public Icon getIcon()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.