|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.fenyo.gnetwatch.GUI.VisualElement
public class VisualElement
Class derivated from VisualElement can be displayed in the main tree of the GNetWatch GUI.
| Field Summary | |
|---|---|
private java.util.List<VisualElement> |
children
|
private java.lang.String |
description
|
private java.lang.Boolean |
disposed
|
private GUI |
gui
|
private java.lang.Long |
id
|
private org.eclipse.swt.graphics.Image |
image
|
private java.lang.Boolean |
initialized
|
private boolean |
is_selected
|
private java.lang.String |
item
|
private static Log |
log
|
private java.util.List<VisualElement> |
parents
|
private int |
progress
|
private java.util.List<org.eclipse.swt.widgets.TreeItem> |
treeItems
|
private java.lang.String |
type
|
| Constructor Summary | |
|---|---|
VisualElement()
Constructor. |
|
| Method Summary | |
|---|---|
private void |
addChild(VisualElement child)
Adds a sub element. |
void |
addParent(VisualElement parent)
Adds a parent. |
private void |
addTreeItem(org.eclipse.swt.widgets.TreeItem treeItem)
Adds a tree item to represent this element. |
boolean |
canManageThisChild(VisualElement visual_element)
Checks that the parameter can be attached to this element. |
boolean |
contains(VisualElement elt)
Checks that the parameter is a children. |
protected void |
disposed()
Called when disposed. |
private void |
disposeSubItems(org.eclipse.swt.widgets.TreeItem item)
Recursively detaches an item from this element and its descendants. |
private void |
duplicateTreeItem(java.util.List<org.eclipse.swt.widgets.TreeItem> destination_tree_items)
Recursively duplicates this element and its descendants under each of the destination tree items. |
void |
duplicateTreeItemOnce(java.util.List<org.eclipse.swt.widgets.TreeItem> destination_tree_items)
Duplicates this element under each of the destination tree items. |
void |
expandTreeItems(boolean doit)
Expands or merge the associated tree items. |
java.util.List<VisualElement> |
getAllParents(java.lang.Class clazz)
Returns every ascendant of this element, restricted to a given type. |
private void |
getAllParents(java.lang.Class clazz,
java.util.List<VisualElement> elts)
Returns every ascendant of this element, restricted to a given type. |
java.util.List<VisualElement> |
getChildren()
Returns children elements. |
java.lang.String |
getDescription()
|
protected GUI |
getGUI()
Returns the current GUI instance. |
java.lang.Long |
getId()
|
java.lang.String |
getItem()
Returns the item name. |
java.util.List<VisualElement> |
getParents()
Returns parents of this element. |
int |
getProgress()
Gets the progress bar position for this visual element. |
java.util.List<VisualElement> |
getSubElements(java.lang.Class clazz)
Gets sub elements of a given type. |
private void |
getSubElements(java.lang.Class clazz,
java.util.List<VisualElement> elts)
Gets sub elements of a given type. |
static java.util.List<VisualElement> |
getSubElements(org.eclipse.swt.widgets.TreeItem item,
java.lang.Class clazz)
Gets sub elements of a given type. |
private java.util.List<Pair<VisualElement,VisualElement>> |
getSubGraph(VisualElement parent)
Builds the subgraph rooted at the parent parameter. |
private void |
getSubGraph(VisualElement parent,
java.util.List<Pair<VisualElement,VisualElement>> graph)
Builds the subgraph rooted at the parent parameter. |
private java.util.List<Pair<VisualElement,VisualElement>> |
getSubGraphExceptLinks(VisualElement parent,
java.util.List<Pair<VisualElement,VisualElement>> except_links)
Builds the subgraph rooted at the parent parameter, but not containing some links of another graph. |
private void |
getSubGraphExceptLinks(VisualElement parent,
java.util.List<Pair<VisualElement,VisualElement>> graph,
java.util.List<Pair<VisualElement,VisualElement>> except_links)
Builds the subgraph rooted at the parent parameter, but not containing some links of another graph. |
java.util.List<org.eclipse.swt.widgets.TreeItem> |
getTreeItems()
Returns the list of tree items that represent this element. |
java.lang.String |
getType()
|
void |
informSelected()
Called when selected by the user. |
protected void |
initialize(GUI gui)
Initializes this element. |
boolean |
isDisposed()
Checks that this element is disposed. |
protected boolean |
isThisOurTreeItem(org.eclipse.swt.widgets.TreeItem item)
Checks that a tree item represents this element. |
void |
removeVisualElements(VisualElement visual_parent)
Detaches this element from one of its parents and removes children that have become orphan. |
private void |
removeVisualElements(VisualElement visual_parent,
boolean bypass)
Detaches this element from one of its parents and removes children that have become orphan. |
void |
selected()
Called when this element has been selected. |
void |
setChildren(java.util.List<VisualElement> children)
|
void |
setDescription(java.lang.String description)
Sets the description. |
void |
setGUI(GUI gui)
|
protected void |
setId(java.lang.Long id)
|
protected void |
setImage(org.eclipse.swt.graphics.Image image)
Sets the icon. |
void |
setImageExec()
Sets the "exec" icon to this element. |
void |
setImageFolder()
Sets the "folder" icon to this element. |
void |
setImageHost()
Sets the "IPv4 host" icon to this element. |
void |
setImageHost6()
Sets the "IPv6 host" icon to this element. |
void |
setImageHost6SNMP()
Sets the "snmp ipv6 host" icon to this element. |
void |
setImageHostSNMP()
Sets the "snmp ipv4 host" icon to this element. |
void |
setImageInterface()
Sets the "inteface" icon to this element. |
void |
setImageMultiRow()
Sets the "multirow" icon to this element. |
void |
setImageNetwork()
Sets the "network" icon to this element. |
void |
setImageOscillo()
Sets the "oscilloscope" icon to this element. |
void |
setImageQueue()
Sets the "queue" icon to this element. |
void |
setImageWatch()
Sets the "watch" icon to this element. |
protected void |
setItem(java.lang.String item)
Sets the item name (displayed text). |
protected void |
setParent(GUI gui,
org.eclipse.swt.widgets.Tree parent)
Attaches this element to the root of a tree. |
void |
setParent(GUI gui,
VisualElement parent)
Attaches this item under another element. |
void |
setProgress(int progress)
Sets the progress bar position. |
void |
setType(java.lang.String type)
Sets the displayed type. |
void |
unselected()
Called when this element has been unselected. |
private void |
unsetParent(VisualElement parent)
Detaches this element from one of its parents. |
private void |
updateImage()
Updates the displayed icon of this element. |
private void |
updateText()
Updates the displayed text (item name) of this element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static Log log
private java.lang.Long id
private java.lang.Boolean initialized
private GUI gui
private java.lang.Boolean disposed
private java.util.List<org.eclipse.swt.widgets.TreeItem> treeItems
private java.util.List<VisualElement> parents
private java.util.List<VisualElement> children
private java.lang.String item
private java.lang.String type
private java.lang.String description
private org.eclipse.swt.graphics.Image image
private boolean is_selected
private int progress
| Constructor Detail |
|---|
public VisualElement()
none. - | Method Detail |
|---|
public java.lang.Long getId()
protected void setId(java.lang.Long id)
public void setChildren(java.util.List<VisualElement> children)
protected void initialize(GUI gui)
gui - current GUI instance.public void expandTreeItems(boolean doit)
doit - true to expand.public boolean isDisposed()
none. -
protected final GUI getGUI()
none. -
public final void setGUI(GUI gui)
public void setImageExec()
none. - public void setImageFolder()
none. - public void setImageOscillo()
none. - public void setImageMultiRow()
none. - public void setImageWatch()
none. - public void setImageHost()
none. - public void setImageHost6()
none. - public void setImageInterface()
none. - public void setImageQueue()
none. - public void setImageNetwork()
none. - public void setImageHostSNMP()
none. - public void setImageHost6SNMP()
none. - public java.util.List<org.eclipse.swt.widgets.TreeItem> getTreeItems()
none. -
protected boolean isThisOurTreeItem(org.eclipse.swt.widgets.TreeItem item)
item - tree item.
private void addTreeItem(org.eclipse.swt.widgets.TreeItem treeItem)
treeItem - tree item to add.private void duplicateTreeItem(java.util.List<org.eclipse.swt.widgets.TreeItem> destination_tree_items)
destination_tree_items - destination tree items.public void duplicateTreeItemOnce(java.util.List<org.eclipse.swt.widgets.TreeItem> destination_tree_items)
destination_tree_items - destination tree items.
protected void setParent(GUI gui,
org.eclipse.swt.widgets.Tree parent)
gui - current GUI instance.parent - root of the destination tree.
public void setParent(GUI gui,
VisualElement parent)
gui - current GUI instance.parent - parent element.private void disposeSubItems(org.eclipse.swt.widgets.TreeItem item)
item - item to detach.private void unsetParent(VisualElement parent)
parent - parent.private void addChild(VisualElement child)
child - element to add.public java.util.List<VisualElement> getChildren()
none. -
public java.util.List<VisualElement> getParents()
public void addParent(VisualElement parent)
parent - new parent.public boolean contains(VisualElement elt)
elt - element to check.
private void updateText()
none. - private void updateImage()
none. - protected void setItem(java.lang.String item)
item - item name.public java.lang.String getItem()
none. -
public java.lang.String getType()
public java.lang.String getDescription()
public void setType(java.lang.String type)
type - type to display.public void setDescription(java.lang.String description)
description - description.protected void setImage(org.eclipse.swt.graphics.Image image)
image - icon.public void informSelected()
none. - protected void disposed()
none. -
private void getSubElements(java.lang.Class clazz,
java.util.List<VisualElement> elts)
clazz - type.elts - list that will be updated.public java.util.List<VisualElement> getSubElements(java.lang.Class clazz)
clazz - type.
public static java.util.List<VisualElement> getSubElements(org.eclipse.swt.widgets.TreeItem item,
java.lang.Class clazz)
clazz - type.
private void getAllParents(java.lang.Class clazz,
java.util.List<VisualElement> elts)
clazz - type.elts - elts list that will be updated.public java.util.List<VisualElement> getAllParents(java.lang.Class clazz)
clazz - type.
public boolean canManageThisChild(VisualElement visual_element)
visual_element - parameter to check.
private void getSubGraph(VisualElement parent,
java.util.List<Pair<VisualElement,VisualElement>> graph)
parent - root of the subgraph.graph - empty graph that will be updated to give the results.private java.util.List<Pair<VisualElement,VisualElement>> getSubGraph(VisualElement parent)
parent - root of the subgraph.
private void getSubGraphExceptLinks(VisualElement parent,
java.util.List<Pair<VisualElement,VisualElement>> graph,
java.util.List<Pair<VisualElement,VisualElement>> except_links)
parent - root of the subgraph.graph - empty graph that will be updated to give the results.except_links - another graph.
private java.util.List<Pair<VisualElement,VisualElement>> getSubGraphExceptLinks(VisualElement parent,
java.util.List<Pair<VisualElement,VisualElement>> except_links)
parent - root of the subgraph.graph - empty graph that will be updated to give the results.
public void removeVisualElements(VisualElement visual_parent)
visual_parent - parent.
private void removeVisualElements(VisualElement visual_parent,
boolean bypass)
visual_parent - parent.bypass - bypass some verifications.public void setProgress(int progress)
progress - position.public int getProgress()
none. -
public void selected()
none. - public void unselected()
none. -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||