de.saar.chorus.ubench
Class EdgeData

Object
  extended by EdgeData
All Implemented Interfaces:
IEdgeData<EdgeType>, ActionListener, EventListener

public class EdgeData
extends Object
implements IEdgeData<EdgeType>

The data that can be stored in the edge of a dominance graph -- namely, a name and an edge type. In addition, objects of this class can serve as popup targets, i.e. they provide a menu item for a popup menu.

Author:
Alexander Koller

Constructor Summary
EdgeData(EdgeType type, String name, JDomGraph parent)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addMenuItem(String id, String label)
          Adds a menu item to the popup target's menu.
 String getDesc()
           
 JMenuItem getMenu()
          Return the JMenu object that represents this popup target's submenu.
 String getMenuLabel()
          Returns the label of the menu item for this popup target in a superordinate menu.
 String getName()
           
 JDomGraph getParent()
           
 EdgeType getType()
           
 String toString()
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EdgeData

public EdgeData(EdgeType type,
                String name,
                JDomGraph parent)
Parameters:
type -
name -
Method Detail

getName

public String getName()
Returns:
Returns the name.

getType

public EdgeType getType()
Specified by:
getType in interface IEdgeData<EdgeType>
Returns:
Returns the type.

getDesc

public String getDesc()

toString

public String toString()
Overrides:
toString in class Object

getMenuLabel

public String getMenuLabel()
Returns the label of the menu item for this popup target in a superordinate menu.

Returns:
the menu item label.

getMenu

public JMenuItem getMenu()
Return the JMenu object that represents this popup target's submenu.

Returns:
the JMenu object.

addMenuItem

public void addMenuItem(String id,
                        String label)
Adds a menu item to the popup target's menu. The item has an ID and a label. The label specifies what is displayed when the menu item is drawn. The ID is sent to the popup listeners when the user clicks on the item.

Parameters:
id - an identification for this menu item
label - the label that will be displayed for this menu item.

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

getParent

public JDomGraph getParent()
Returns:
Returns the parent.