Commit d9ffd89e authored by SAINT-MARCEL Frederic's avatar SAINT-MARCEL Frederic
Browse files

update

parent 560f9f21
/**
* $Id: FCMarqueeHandler.java,v 1.28 2002-06-13 11:26:24 frederic Exp $
* $Id: FCMarqueeHandler.java,v 1.29 2002-06-13 14:05:26 frederic Exp $
*
* Transmorpher
*
......@@ -61,6 +61,8 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
protected PortView port, firstPort, lastPort;
protected PortView portSource,portTarget;
protected Call currentCall;
public transient JToggleButton marquee = new JToggleButton();
......@@ -124,6 +126,7 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
e.consume();
}
}
super.mousePressed(e);
//System.out.println("MousePressed End...");
......@@ -152,8 +155,11 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
g.setXORMode(fg);
overlay(g);
event.consume();
}
}
}
}
super.mouseDragged(event);
// System.out.println("MouseDragged End...");
......@@ -260,6 +266,7 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
}
event.consume();
}
marquee.doClick();
firstPort = null;
port = null;
......@@ -421,6 +428,7 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
paintPort(currentProcess.getGraphics());
if (start != null) {
if ((edgeNormal.isSelected()) && current != null)
g.drawLine(start.x, start.y, current.x, current.y);
}
}
......
/**
*
*$Id: FlowComposer.java,v 1.45 2002-06-13 12:04:50 gchomat Exp $
*$Id: FlowComposer.java,v 1.46 2002-06-13 14:05:26 frederic Exp $
*
* Transmorpher
*
......@@ -1681,24 +1681,37 @@ public class FlowComposer extends JPanel implements GraphModelListener,
public void actionPerformed(ActionEvent e) {
// ((ProcessGraph)currentProcess).actionRL(FCConstants.PORTPROCESS,FCConstants.PORTINPUT);
((ProcessGraph)currentProcess).newPort(FCConstants.PORTOUTPUT);
//((ProcessGraph)currentProcess).addOut();
((ProcessGraph)currentProcess).newPort(FCConstants.PORTINPUT);
}
protected void update(){
if (currentProcess != null) {
Object[] tmp = ((ProcessGraph)currentProcess).getSelectionCells();
if (((currentProcess).getUserObject() instanceof MainProcess)&&(tmp.length==0)){
setEnabled(false);
}
else{
setEnabled (true);
}
}
else setEnabled(false);
}
if (currentProcess != null) {
Object[] tmp = ((ProcessGraph)currentProcess).getSelectionCells();
if (((currentProcess).getUserObject() instanceof MainProcess)&&(tmp.length==0)){
setEnabled(false);
}
else{
if (tmp.length!=0) {
boolean accept = true;
DefaultGraphCell cell;
for (int i = 0; i <tmp.length; i++){
cell = (DefaultGraphCell)tmp[i];
if (cell instanceof DefaultEdge){}
else if (!((cell instanceof MergeCell)||(cell instanceof ApplyProcessCell))){
accept=false;
}
}
if (accept) setEnabled (true);
else setEnabled(false);
}
else setEnabled(true);
}
}
else setEnabled(false);
}
}
......@@ -1711,9 +1724,8 @@ public class FlowComposer extends JPanel implements GraphModelListener,
}
public void actionPerformed(ActionEvent e) {
((ProcessGraph)currentProcess).newPort(FCConstants.PORTINPUT);
//((ProcessGraph)currentProcess).addIn();
//((ProcessGraph)currentProcess).actionRL(FCConstants.PORTPROCESS,FCConstants.PORTOUTPUT);
((ProcessGraph)currentProcess).newPort(FCConstants.PORTOUTPUT);
}
protected void update(){
......@@ -1723,7 +1735,20 @@ public class FlowComposer extends JPanel implements GraphModelListener,
setEnabled(false);
}
else{
setEnabled (true);
if (tmp.length!=0) {
boolean accept = true;
DefaultGraphCell cell;
for (int i = 0; i <tmp.length; i++){
cell = (DefaultGraphCell)tmp[i];
if (cell instanceof DefaultEdge){}
else if (!((cell instanceof DispatchCell)||(cell instanceof ApplyProcessCell))){
accept=false;
}
}
if (accept) setEnabled (true);
else setEnabled(false);
}
else setEnabled(true);
}
}
else setEnabled(false);
......
/**
* $Id: ProcessGraphModel.java,v 1.7 2002-06-13 11:26:24 frederic Exp $
* $Id: ProcessGraphModel.java,v 1.8 2002-06-13 14:05:26 frederic Exp $
*
* Transmorpher
*
......@@ -62,18 +62,22 @@ public class ProcessGraphModel extends DefaultGraphModel{
}
public boolean acceptsSource(Object edge,Object port) {
Object portTarget = ((Edge)edge).getTarget();
Object portSource = ((Edge)edge).getSource();
Object cellTarget = getParent(portTarget);
Object cell = getParent(port);
return ((!cellTarget.equals(cell))&&(((PortCell)portSource).getType()==((PortCell)port).getType()));
Object portTarget = ((Edge)edge).getTarget();
Object portSource = ((Edge)edge).getSource();
Object cellTarget = getParent(portTarget);
Object cell = getParent(port);
return ((!cellTarget.equals(cell))&&(((PortCell)portSource).getType()==((PortCell)port).getType()));
}
public boolean acceptsTarget(Object edge,Object port) {
Object portSource = ((Edge)edge).getSource();
Object portTarget = ((Edge)edge).getTarget();
Object cellSource = getParent(portSource);
Object cell = getParent(port);
return ((!cellSource.equals(cell))&&(((PortCell)portTarget).getType()==((PortCell)port).getType()));
Object portSource = ((Edge)edge).getSource();
Object portTarget = ((Edge)edge).getTarget();
Object cellSource = getParent(portSource);
Object cell = getParent(port);
return ((!cellSource.equals(cell))&&(((PortCell)portTarget).getType()==((PortCell)port).getType()));
}
}
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