Package jadex.base.gui.componenttree
Class ComponentTreeNode
- java.lang.Object
-
- jadex.base.gui.asynctree.AbstractTreeNode
-
- jadex.base.gui.asynctree.AbstractSwingTreeNode
-
- jadex.base.gui.componenttree.ComponentTreeNode
-
- All Implemented Interfaces:
ISwingTreeNode
,ITreeNode
,IActiveComponentTreeNode
- Direct Known Subclasses:
PlatformTreeNode
,PseudoProxyComponentTreeNode
public class ComponentTreeNode extends AbstractSwingTreeNode implements IActiveComponentTreeNode
Node object representing a service container.
-
-
Field Summary
Fields Modifier and Type Field Description protected IExternalAccess
access
The platform access.protected boolean
broken
Flag indicating a broken node (e.g.protected boolean
busy
Flag indicating a busy node (e.g.protected ISubscriptionIntermediateFuture<CMSStatusEvent>
cmslistener
The cms listener (if any).protected IComponentDescription
desc
The component description.protected ComponentIconCache
iconcache
The icon cache.static javax.swing.UIDefaults
icons
The image icons.protected ComponentProperties
propcomp
The properties component (if any).-
Fields inherited from class jadex.base.gui.asynctree.AbstractSwingTreeNode
tree
-
Fields inherited from class jadex.base.gui.asynctree.AbstractTreeNode
childrenfuture, dirty, model, parent, recurse, searching
-
-
Constructor Summary
Constructors Constructor Description ComponentTreeNode(ISwingTreeNode parent, AsyncSwingTreeModel model, javax.swing.JTree tree, IComponentDescription desc, ComponentIconCache iconcache, IExternalAccess access)
Create a new service container node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCMSListener(IComponentIdentifier cid)
Add a CMS listener for tree updates of components from the given (platform) id.ISwingTreeNode
createComponentNode(IComponentDescription desc)
Create a new component node.protected IFuture<java.lang.Void>
createNFPropertyNodes(java.util.Iterator<java.lang.String> names, java.util.List<ISwingTreeNode> results, IExternalAccess provider, IExternalAccess rootea, NFPropertyContainerNode cn)
void
dispose()
Remove listener, if any.IComponentIdentifier
getComponentIdentifier()
Get the component id.IComponentDescription
getDescription()
Get the component description.byte[]
getIcon()
Get the icon as byte[] for a node.java.lang.Object
getId()
Get the id used for lookup.javax.swing.JComponent
getPropertiesComponent()
Get or create a component displaying the node properties.javax.swing.Icon
getSwingIcon()
Get the icon for a node.java.lang.String
getTooltipText()
Get tooltip text.boolean
hasProperties()
True, if the node has properties that can be displayed.void
refresh(boolean recurse)
Refresh the node.protected void
searchChildren()
Asynchronously search for children.protected IFuture<java.util.List<ITreeNode>>
searchChildren(IExternalAccess access, IComponentIdentifier cid)
Asynchronously search for children.void
setDescription(IComponentDescription desc)
Set the component description.java.lang.String
toString()
Create a string representation.-
Methods inherited from class jadex.base.gui.asynctree.AbstractSwingTreeNode
addChild, addChild, equals, expandChildren, getCachedChildren, getChild, getChildCount, getChildren, getIndexOfChild, getModel, getParent, getTree, isLeaf, removeChild, setChildren
-
Methods inherited from class jadex.base.gui.asynctree.AbstractTreeNode
checkChildren, hashCode, removeAllChildren, setParent
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jadex.base.gui.asynctree.ISwingTreeNode
getChild, getChildren, getParent
-
Methods inherited from interface jadex.base.gui.asynctree.ITreeNode
getCachedChildren, getChildCount, getIndexOfChild, isLeaf
-
-
-
-
Field Detail
-
icons
public static final javax.swing.UIDefaults icons
The image icons.
-
desc
protected IComponentDescription desc
The component description.
-
access
protected IExternalAccess access
The platform access.
-
iconcache
protected final ComponentIconCache iconcache
The icon cache.
-
propcomp
protected ComponentProperties propcomp
The properties component (if any).
-
cmslistener
protected ISubscriptionIntermediateFuture<CMSStatusEvent> cmslistener
The cms listener (if any).
-
broken
protected boolean broken
Flag indicating a broken node (e.g. children could not be searched due to network problems).
-
busy
protected boolean busy
Flag indicating a busy node (e.g. update in progress).
-
-
Constructor Detail
-
ComponentTreeNode
public ComponentTreeNode(ISwingTreeNode parent, AsyncSwingTreeModel model, javax.swing.JTree tree, IComponentDescription desc, ComponentIconCache iconcache, IExternalAccess access)
Create a new service container node.
-
-
Method Detail
-
getId
public java.lang.Object getId()
Get the id used for lookup.
-
getIcon
public byte[] getIcon()
Get the icon as byte[] for a node.- Specified by:
getIcon
in interfaceITreeNode
- Specified by:
getIcon
in classAbstractTreeNode
-
getSwingIcon
public javax.swing.Icon getSwingIcon()
Get the icon for a node.- Specified by:
getSwingIcon
in interfaceISwingTreeNode
- Specified by:
getSwingIcon
in classAbstractSwingTreeNode
-
getTooltipText
public java.lang.String getTooltipText()
Get tooltip text.- Specified by:
getTooltipText
in interfaceITreeNode
- Specified by:
getTooltipText
in classAbstractTreeNode
-
refresh
public void refresh(boolean recurse)
Refresh the node.- Specified by:
refresh
in interfaceITreeNode
- Overrides:
refresh
in classAbstractSwingTreeNode
- Parameters:
recurse
- Recursively refresh subnodes, if true.
-
searchChildren
protected void searchChildren()
Asynchronously search for children. Should call setChildren() once children are found.- Specified by:
searchChildren
in classAbstractTreeNode
-
createComponentNode
public ISwingTreeNode createComponentNode(IComponentDescription desc)
Create a new component node.
-
toString
public java.lang.String toString()
Create a string representation.- Overrides:
toString
in classjava.lang.Object
-
getDescription
public IComponentDescription getDescription()
Get the component description.- Specified by:
getDescription
in interfaceIActiveComponentTreeNode
-
getComponentIdentifier
public IComponentIdentifier getComponentIdentifier()
Get the component id.- Specified by:
getComponentIdentifier
in interfaceIActiveComponentTreeNode
-
setDescription
public void setDescription(IComponentDescription desc)
Set the component description.
-
hasProperties
public boolean hasProperties()
True, if the node has properties that can be displayed.- Specified by:
hasProperties
in interfaceITreeNode
- Overrides:
hasProperties
in classAbstractTreeNode
-
getPropertiesComponent
public javax.swing.JComponent getPropertiesComponent()
Get or create a component displaying the node properties. Only to be called if hasProperties() is true;- Specified by:
getPropertiesComponent
in interfaceISwingTreeNode
- Overrides:
getPropertiesComponent
in classAbstractSwingTreeNode
-
searchChildren
protected IFuture<java.util.List<ITreeNode>> searchChildren(IExternalAccess access, IComponentIdentifier cid)
Asynchronously search for children.
-
createNFPropertyNodes
protected IFuture<java.lang.Void> createNFPropertyNodes(java.util.Iterator<java.lang.String> names, java.util.List<ISwingTreeNode> results, IExternalAccess provider, IExternalAccess rootea, NFPropertyContainerNode cn)
-
addCMSListener
protected void addCMSListener(IComponentIdentifier cid)
Add a CMS listener for tree updates of components from the given (platform) id.
-
dispose
public void dispose()
Remove listener, if any.- Specified by:
dispose
in interfaceITreeNode
- Overrides:
dispose
in classAbstractTreeNode
-
-