uk.ac.ic.doc.automed.p2p.qproc.commands
Class ViewEdgeMappingCommand

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.gui.graph.commands.GCommand
      extended by uk.ac.ic.doc.automed.p2p.qproc.commands.ViewEdgeMappingCommand
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener
Direct Known Subclasses:
ViewQueryMappingCommand, ViewUserMappingsCommand

public class ViewEdgeMappingCommand
extends GCommand


Nested Class Summary
protected  class ViewEdgeMappingCommand.JoinResult
           
 
Field Summary
protected  QPlannerDataModel gmodel
           
private static java.awt.Color HDM_COLOR
           
private static java.lang.String HEX_COLOR_AFFIX
           
private static int HEX_COLOR_BASE
           
private static boolean KEEP_TO_MAX_SHAPES
           
private static int MAX_CXT_SHAPES
           
private  SchemaGraphBuilder sfb
           
private static java.lang.String zerox
           
 
Fields inherited from class uk.ac.ic.doc.automed.p2p.gui.graph.commands.GCommand
CMD_EDIT_LABEL, CMD_SHOW_PROPERTIES, cmdID, EVENT_ON_CLICK, EVENT_ON_DOUBLE_CLICK, EVENT_ON_MOUSE_OVER, gviz, label, mode, MODE_ADVANCED, MODE_ALL, MODE_AUTORUN, MODE_DEFAULT, MODE_NOSHOW, MODE_PUBLISHER, MODE_USER
 
Constructor Summary
ViewEdgeMappingCommand(GraphViz gviz)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
private  int displayDetailedMapping(GEdge gedge, Edge edge, QPlannerDataModel gmodel)
           
protected  void displayMapping(GEdge gedge, Edge edge, java.util.Collection mappings, GraphUI gui)
          Display a collection of mappings
protected  void displayMapping(GEdge gedge, Edge edge, ObjectMapping omap, GraphUI gui)
          Create a shape that represents an ObjectMapping and displays it.
private  GShape drawHDMGraph(ObjectMapping omap, Edge edge, GEdge gedge, GraphUI gui, boolean clear)
          To draw an HDMGraph on a user interface.
private  GShape drawMappingShape(java.util.Collection removed, ObjectMapping omap, Edge edge, GEdge gedge)
          Draw an HDM graph object as a context shape on another shape (e.g an HDMEdge)
private  java.awt.Color generateColorFromStr(java.lang.String str)
          Generate a color for each edge object
private  java.awt.Color generateMappingColor(ObjectMapping omap)
          Generate a color for each mapping
private  java.lang.String getColorStr(ObjectMapping omap, boolean isSource)
          Draw the object mapping graph on the GUI and draw mapping edges between the source and target knodes and the source and target objects of the mapping.
 
Methods inherited from class uk.ac.ic.doc.automed.p2p.gui.graph.commands.GCommand
copyProperties, eventPerformed, getID, getLabel, getMenuDef, getMode, getOutput, getPeerName, init, isAutoCommand, setOutput, updateMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gmodel

protected QPlannerDataModel gmodel

sfb

private SchemaGraphBuilder sfb

zerox

private static final java.lang.String zerox
See Also:
Constant Field Values

HEX_COLOR_BASE

private static final int HEX_COLOR_BASE

HEX_COLOR_AFFIX

private static final java.lang.String HEX_COLOR_AFFIX
See Also:
Constant Field Values

HDM_COLOR

private static final java.awt.Color HDM_COLOR

MAX_CXT_SHAPES

private static final int MAX_CXT_SHAPES
See Also:
Constant Field Values

KEEP_TO_MAX_SHAPES

private static boolean KEEP_TO_MAX_SHAPES
Constructor Detail

ViewEdgeMappingCommand

public ViewEdgeMappingCommand(GraphViz gviz)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

displayDetailedMapping

private int displayDetailedMapping(GEdge gedge,
                                   Edge edge,
                                   QPlannerDataModel gmodel)
                            throws AutoMedException
Throws:
AutoMedException

displayMapping

protected void displayMapping(GEdge gedge,
                              Edge edge,
                              ObjectMapping omap,
                              GraphUI gui)
                       throws AutoMedException
Create a shape that represents an ObjectMapping and displays it. If the shape has already been created then use it.

Parameters:
gedge -
edge -
omap -
gmodel -
gui -
Throws:
AutoMedException

displayMapping

protected void displayMapping(GEdge gedge,
                              Edge edge,
                              java.util.Collection mappings,
                              GraphUI gui)
                       throws AutoMedException
Display a collection of mappings

Parameters:
gedge -
edge -
mappings -
gui -
Throws:
AutoMedException

drawMappingShape

private GShape drawMappingShape(java.util.Collection removed,
                                ObjectMapping omap,
                                Edge edge,
                                GEdge gedge)
Draw an HDM graph object as a context shape on another shape (e.g an HDMEdge)

Returns:

drawHDMGraph

private GShape drawHDMGraph(ObjectMapping omap,
                            Edge edge,
                            GEdge gedge,
                            GraphUI gui,
                            boolean clear)
To draw an HDMGraph on a user interface.

Parameters:
omap -
edge -
gedge -
gui -
Returns:

generateColorFromStr

private java.awt.Color generateColorFromStr(java.lang.String str)
Generate a color for each edge object

Returns:

generateMappingColor

private java.awt.Color generateMappingColor(ObjectMapping omap)
Generate a color for each mapping

Parameters:
mapType -
matches -
Returns:

getColorStr

private java.lang.String getColorStr(ObjectMapping omap,
                                     boolean isSource)
Draw the object mapping graph on the GUI and draw mapping edges between the source and target knodes and the source and target objects of the mapping.