Commit 23f87aec authored by Guillaume Chomat's avatar Guillaume Chomat
Browse files

minor modification

parent 3c8ce10a
/**
* $Id: FCMarqueeHandler.java,v 1.25 2002-06-10 11:36:52 gchomat Exp $
* $Id: FCMarqueeHandler.java,v 1.26 2002-06-10 11:48:44 gchomat Exp $
*
* Transmorpher
*
......@@ -100,6 +100,10 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
return currentProcess;
}
public Point getCurrentPoint(){
return current;
}
/* Return true if this handler should be preferred over other handlers. */
public boolean isForceMarqueeEvent(MouseEvent e) {
......
/**
* $Id: ProcessGraph.java,v 1.22 2002-06-10 11:36:52 gchomat Exp $
* $Id: ProcessGraph.java,v 1.23 2002-06-10 11:48:44 gchomat Exp $
*
* Transmorpher
*
......@@ -57,10 +57,10 @@ import fr.fluxmedia.transmorpher.Files.*;
public class ProcessGraph extends JGraph implements Comparator, Observer{
Object userObject;
// Undo Manager
protected GraphUndoManager undo;
protected DefaultGraphCell pCell = null;
/** boundsCube define the dimension of a squared form composant such as ApplyQuery, Merge and Dispatch.
* ie: this composant are included in square boxe
......@@ -68,13 +68,13 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
static Dimension boundsCube = new Dimension(70,70);
static Dimension boundsPort = new Dimension(15,15);
static Dimension boundsPortCell = new Dimension(30,30);
/** boundsRect define the dimension of a rectangle form composant such as ApplyProcess, Serialize,...
* ie: this composant are included in rectangle boxe
*/
static Dimension boundsRect = new Dimension(70,50);
ArrayList tmp =null;
public ProcessGraph() {
......@@ -191,21 +191,21 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
if(arg instanceof Call)
{
if(arg instanceof Dispatch)
addVertex(arg,new Point(10,10),FCConstants.DISPATCH);
addVertex(arg,FCConstants.DISPATCH);
else if(arg instanceof Merge)
addVertex(arg,new Point(10,10),FCConstants.MERGE);
addVertex(arg,FCConstants.MERGE);
else if(arg instanceof ApplyProcess)
addVertex(arg,new Point(10,10),FCConstants.APPLYPROCESS);
addVertex(arg,FCConstants.APPLYPROCESS);
else if(arg instanceof ApplyExternal)
addVertex(arg,new Point(10,10),FCConstants.APPLYEXTERNAL);
addVertex(arg,FCConstants.APPLYEXTERNAL);
else if(arg instanceof Generate)
addVertex(arg,new Point(10,10),FCConstants.GENERATE);
addVertex(arg,FCConstants.GENERATE);
else if(arg instanceof Serialize)
addVertex(arg,new Point(10,10),FCConstants.SERIALIZE);
addVertex(arg,FCConstants.SERIALIZE);
else if(arg instanceof ApplyQuery)
addVertex(arg,new Point(10,10),FCConstants.APPLYQUERY);
addVertex(arg,FCConstants.APPLYQUERY);
else if(arg instanceof ApplyRuleset)
addVertex(arg,new Point(10,10),FCConstants.APPLYRULESET);
addVertex(arg,FCConstants.APPLYRULESET);
}
}
}
......@@ -592,44 +592,48 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
/** add a Cell to the Graph
*
*/
public void addVertex(Object userObject,Point point,int number) {
public void addVertex(Object userObject,int type) {
int u = GraphConstants.PERCENT;
Rectangle bounds;
Point position = new Point(10,10);
if(marquee instanceof FCMarqueeHandler)
position = new Point(((FCMarqueeHandler)marquee).getCurrentPoint());
DefaultGraphCell cell = null;
Map viewMap = new Hashtable();
// Create Vertex
switch (number) {
switch (type) {
case FCConstants.MERGE :
cell = new MergeCell(userObject);
bounds = new Rectangle(point,boundsCube);
bounds = new Rectangle(position,boundsCube);
addCell(cell,viewMap,bounds);
addPort(cell,viewMap,FCConstants.PORTOUTPUT);
// updatePorts(FCConstants.PORTOUTPUT,cell);
break;
case FCConstants.GENERATE :
cell = new GenerateCell(userObject);
bounds = new Rectangle(point,boundsRect);
bounds = new Rectangle(position,boundsRect);
addCell(cell,viewMap,bounds);
addPort(cell,viewMap,FCConstants.PORTOUTPUT);
//updatePorts(FCConstants.PORTOUTPUT,cell);
break;
case FCConstants.SERIALIZE :
cell = new SerializeCell(userObject);
bounds = new Rectangle(point,boundsRect);
bounds = new Rectangle(position,boundsRect);
addCell(cell,viewMap,bounds);
addPort(cell,viewMap,FCConstants.PORTINPUT);
break;
case FCConstants.DISPATCH :
cell = new DispatchCell(userObject);
bounds = new Rectangle(point,boundsCube);
bounds = new Rectangle(position,boundsCube);
addCell(cell,viewMap,bounds);
addPort(cell,viewMap,FCConstants.PORTINPUT);
break;
case FCConstants.APPLYEXTERNAL :
cell = new ApplyExternalCell(userObject);
bounds = new Rectangle(point,boundsRect);
bounds = new Rectangle(position,boundsRect);
addCell(cell,viewMap,bounds);
Call call = (Call)userObject;
......@@ -648,25 +652,25 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
break;
case FCConstants.APPLYPROCESS :
cell = new ApplyProcessCell(userObject);
bounds = new Rectangle(point,boundsRect);
bounds = new Rectangle(position,boundsRect);
addCell(cell,viewMap,bounds);
break;
case FCConstants.APPLYRULESET :
cell = new ApplyRulesetCell(userObject);
bounds = new Rectangle(point,boundsRect);
bounds = new Rectangle(position,boundsRect);
addCell(cell,viewMap,bounds);
addPort(cell,viewMap,FCConstants.PORTINPUT);
addPort(cell,viewMap,FCConstants.PORTOUTPUT);
break;
case FCConstants.APPLYQUERY :
cell = new ApplyQueryCell(userObject);
bounds = new Rectangle(point,boundsCube);
bounds = new Rectangle(position,boundsCube);
addCell(cell,viewMap,bounds);
addPort(cell,viewMap,FCConstants.PORTINPUT);
addPort(cell,viewMap,FCConstants.PORTOUTPUT);
break;
case FCConstants.PORTPROCESS :
bounds = new Rectangle(point,boundsCube);
bounds = new Rectangle(position,boundsCube);
addCell(cell,viewMap,bounds);
addPort(cell,viewMap,FCConstants.PORTOUTPUT);
break;
......@@ -700,7 +704,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
{
if(getSelectionCount()==0)
{
addVertex(null,new Point(0,100),FCConstants.PORTPROCESS);
//addVertex(null,new Point(0,100),FCConstants.PORTPROCESS);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment