© 2006-2007 ETH Zurich

org.ximtec.igesture.tool.explorer
Class NodeInfoImpl

java.lang.Object
  extended by org.ximtec.igesture.tool.explorer.NodeInfoImpl
All Implemented Interfaces:
NodeInfo

public class NodeInfoImpl
extends Object
implements NodeInfo

Implementation of the NodeInfo interface. Reflection and dynamic class loading is used to get children, views, etc.

Since:
igesture
Version:
1.0
Author:
UeliKurmann

Field Summary
static String CHILD_DELIMITER
           
 
Constructor Summary
NodeInfoImpl(Controller controller, Class<? extends Object> type, String propertyName, String childList, Class<? extends ExplorerTreeView> view, List<Class<? extends org.sigtec.graphix.widget.BasicAction>> popupActions, String key)
          Constructor
 
Method Summary
 List<Object> getChildren(Object node)
          Returns a list of children
 Icon getExpandedIcon()
          Returns the expanded icon
 Icon getIcon()
          Returns the icon of the node
 String getName(Object node)
          Returns the name of the node
 JPopupMenu getPopupMenu(TreePath treePath)
          Returns the context menu of a node.
 String getTooltip()
          Returns the tool tip of the node
 Class<?> getType()
          Rerturns the type of the node
 ExplorerTreeView getView(Controller controller, Object node)
          Returns the view of the node
 boolean isLeaf(Object object)
          Returns true if the current node is a leaf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHILD_DELIMITER

public static final String CHILD_DELIMITER
See Also:
Constant Field Values
Constructor Detail

NodeInfoImpl

public NodeInfoImpl(Controller controller,
                    Class<? extends Object> type,
                    String propertyName,
                    String childList,
                    Class<? extends ExplorerTreeView> view,
                    List<Class<? extends org.sigtec.graphix.widget.BasicAction>> popupActions,
                    String key)
Constructor

Parameters:
type - the type (class) of the node
propertyName - the name of the property containing the name of the node.
childList - a list of properties (as ";" separated strings) which should be used as children.
view - the view belonging the node. The view MUST HAVE a constructor with the node instance as the only parameter.
popupActions - a list of actions.
icon - the icon of the node
Method Detail

getChildren

public List<Object> getChildren(Object node)
Description copied from interface: NodeInfo
Returns a list of children

Specified by:
getChildren in interface NodeInfo
Returns:

getIcon

public Icon getIcon()
Description copied from interface: NodeInfo
Returns the icon of the node

Specified by:
getIcon in interface NodeInfo
Returns:

getExpandedIcon

public Icon getExpandedIcon()
Description copied from interface: NodeInfo
Returns the expanded icon

Specified by:
getExpandedIcon in interface NodeInfo
Returns:
the expanded icon

getName

public String getName(Object node)
Description copied from interface: NodeInfo
Returns the name of the node

Specified by:
getName in interface NodeInfo
Returns:

getTooltip

public String getTooltip()
Description copied from interface: NodeInfo
Returns the tool tip of the node

Specified by:
getTooltip in interface NodeInfo
Returns:

getType

public Class<?> getType()
Description copied from interface: NodeInfo
Rerturns the type of the node

Specified by:
getType in interface NodeInfo
Returns:

isLeaf

public boolean isLeaf(Object object)
Description copied from interface: NodeInfo
Returns true if the current node is a leaf

Specified by:
isLeaf in interface NodeInfo
Parameters:
object - the node
Returns:
true if the current node is a leaf.

getView

public ExplorerTreeView getView(Controller controller,
                                Object node)
Description copied from interface: NodeInfo
Returns the view of the node

Specified by:
getView in interface NodeInfo
Returns:

getPopupMenu

public JPopupMenu getPopupMenu(TreePath treePath)
Description copied from interface: NodeInfo
Returns the context menu of a node.

Specified by:
getPopupMenu in interface NodeInfo
Returns:

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.