public class TreeWidget extends SysexWidget
See synthdrivers.RolandTD6.TD6SingleEditor as an example.
Created: Sun Jun 22 13:53:35 2003
TreeWidget.Nodes
,
Serialized FormModifier and Type | Class and Description |
---|---|
static interface |
TreeWidget.Nodes
Structured data for Tree Widget.
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected JTree |
tree
JTree object.
|
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 |
---|
TreeWidget(String label,
Patch patch,
TreeWidget.Nodes treeNodes,
IParamModel paramModel,
ISender sysexString)
Creates a new
TreeWidget instance. |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(TreeSelectionListener l)
Adds a
TreeSelectionListener to the slider. |
protected void |
createWidgets()
create Widgets.
|
protected void |
eventListener(TreeSelectionEvent e)
invoked when a node is selected.
|
protected int[] |
getIndices(TreePath path)
Convert
TreePath data to int[] data. |
Object |
getNode(int n)
Return a tree node object specified by
n . |
protected Object |
getNode(int[] indices)
Return a tree node object specified by
indices[] . |
protected TreePath |
getTreePath(int[] indices)
Convert
int[] data to TreePath data. |
protected void |
layoutWidgets()
layout Widgets.
|
protected DefaultMutableTreeNode |
populate(Object[] root)
Small routine that will make node out of the first entry in the array,
then make nodes out of subsequent entries and make them child nodes of
the first one.
|
void |
setEnabled(boolean e)
Enable/disable the widget.
|
protected void |
setSelection(int n)
Select a tree node specified by
n . |
void |
setValue(int value)
Set a value and Select the corresponding tree node.
|
_setLabel, _setSliderNum, getDriver, getInsets, getJLabel, getLabel, getNumFaders, getPatch, getSliderNum, getValue, getValueMax, getValueMin, sendSysex, sendSysex, setFaderValue, setJLabel, setLabel, setMax, setMin, setNumFaders, setSliderNum, setValue
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, 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, 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
protected JTree tree
public TreeWidget(String label, Patch patch, TreeWidget.Nodes treeNodes, IParamModel paramModel, ISender sysexString)
TreeWidget
instance.label
- not used in the current implementation.patch
- a Patch
, which is edited.treeNodes
- a TreeWidget.Nodes
object specifying the tree
data structure.paramModel
- a ParamModel
valuesysexString
- SysexSender for transmitting the value at editing the
parameter.protected void createWidgets()
SysexWidget
createWidgets
in class SysexWidget
protected void eventListener(TreeSelectionEvent e)
public void addEventListener(TreeSelectionListener l)
TreeSelectionListener
to the slider.protected void layoutWidgets()
SysexWidget
layoutWidgets
in class SysexWidget
protected DefaultMutableTreeNode populate(Object[] root)
root
- a tree structure given via treeNode
constructor
parameter.DefaultMutableTreeNode
valueprotected int[] getIndices(TreePath path)
TreePath
data to int[]
data.path
- a TreePath
valueint[]
value. Each entry is the index of TreeNode
in path
.protected TreePath getTreePath(int[] indices)
int[]
data to TreePath
data.indices
- an int[]
valueTreePath
valueprotected void setSelection(int n)
n
.n
- an int
value specifing a tree node.TreeWidget.Nodes.getIndices(int)
public Object getNode(int n)
n
.n
- an int
value specifing a tree node.Object
valueTreeWidget.Nodes.getIndices(int)
protected Object getNode(int[] indices)
indices[]
.public void setValue(int value)
setValue
in class SysexWidget
value
- an int
value to be set.public void setEnabled(boolean e)
SysexWidget
setEnabled
in class SysexWidget
Copyright © 2014. All Rights Reserved.