public class GTree extends GComponent implements GDisplay, TreeSelectionListener, MouseListener, ActionListener
Modifier and Type | Class and Description |
---|---|
static class |
GTree.GTreeNode |
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GTree(String rootName)
Constructor to create a tree with a string label on it.
|
GTree(String widgetId,
String rootName)
Constructor to create a tree with a string label on it.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
addNode(GTree.GTreeNode parentNode,
GComponent component)
add a children with a given parent node
|
void |
createNodes(List<GComponent> components)
create nodes of the JTree
|
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
void |
expandAll()
expand all the nodes
|
void |
expandAllNodes(int startingIndex,
int rowCount)
expand the nodes with children from starting index
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
JMenuItem |
getCopyItem()
Return the JPopupMenu Swing component associated with the GPopupMenu.
|
GTree.GTreeNode |
getGTreeNode(GTree.GTreeNode nodeParent,
GComponent component)
getter of node from a GComponent
|
JTree |
getJTree()
Get the Swing JTree encapsulated by the class.
|
GTree.GTreeNode |
getRoot()
getter for root
|
Object |
getSelectedComponent() |
boolean |
isEnabled()
Gets the enable status of the widget.
|
boolean |
isExpanded(int row)
checks by row if the jtree is expanded
|
void |
mouseClicked(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
removeChildrenNodes(DefaultMutableTreeNode parentNode)
remove children associated with a given parent node
|
void |
removeNode(GTree.GTreeNode node)
remove a Tree Node associated with a given parent node
|
void |
setEnabled(boolean flag)
enable/disable the JTree
|
void |
setVisible(boolean flag)
visibility of the component
|
void |
valueChanged(TreeSelectionEvent e)
Redirection to a GENIUS event.
|
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GTree(String rootName)
rootName
- is the name of the root nodepublic GTree.GTreeNode getRoot()
public void removeChildrenNodes(DefaultMutableTreeNode parentNode)
parentNode
- DefaultMutableTreeNodepublic void removeNode(GTree.GTreeNode node)
node
- DefaultMutableTreeNode node to removepublic void addNode(GTree.GTreeNode parentNode, GComponent component)
parentNode
- DefaultMutableTreeNodecomponent
- GComponentpublic void createNodes(List<GComponent> components)
components
- list of GComponents to display in the JTreepublic void display()
public void expandAll()
public void expandAllNodes(int startingIndex, int rowCount)
startingIndex
- first line to beginrowCount
- Number of rows to expandpublic Component getComponent()
getComponent
in class GComponent
public GTree.GTreeNode getGTreeNode(GTree.GTreeNode nodeParent, GComponent component)
nodeParent
- to search inside the tree the node associated with the GComponentcomponent
- the GComponentpublic Object getSelectedComponent()
public JMenuItem getCopyItem()
public JTree getJTree()
public boolean isEnabled()
GComponent
isEnabled
in class GComponent
public boolean isExpanded(int row)
row
- integerpublic void setEnabled(boolean flag)
setEnabled
in class GComponent
flag
- new enable status of the component.public void setVisible(boolean flag)
flag
- booleanpublic void valueChanged(TreeSelectionEvent e)
valueChanged
in interface TreeSelectionListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
Copyright © 2024. All rights reserved.