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

update

parent d4b6c8cd
/**
*
*$Id: FCPortView.java,v 1.2 2002-06-05 14:46:41 frederic Exp $
*$Id: FCPortView.java,v 1.3 2002-06-11 09:42:51 frederic Exp $
*
* Transmorpher
*
......@@ -46,7 +46,7 @@ public class FCPortView extends PortView{
/** Renderer for the class. */
public static FCPortRenderer renderer = new FCPortRenderer();
protected static int size = 15;
protected static int size = 10;
/**
......
/**
* $Id: FCProcessFactory.java,v 1.9 2002-06-10 09:47:42 gchomat Exp $
* $Id: FCProcessFactory.java,v 1.10 2002-06-11 09:42:51 frederic Exp $
*
* Transmorpher
*
......@@ -164,7 +164,6 @@ public class FCProcessFactory implements ProcessFactory,Observer{
try{
process = createProcess(arg);
}
catch(SingleMainProcessException e)
{
......
/**
*
*$Id: FlowComposer.java,v 1.41 2002-06-10 10:58:40 frederic Exp $
*$Id: FlowComposer.java,v 1.42 2002-06-11 09:42:51 frederic Exp $
*
* Transmorpher
*
......@@ -1689,7 +1689,7 @@ public class FlowComposer extends JPanel implements GraphModelListener,
public void actionPerformed(ActionEvent e) {
((ProcessGraph)currentProcess).actionRL(FCConstants.PORTPROCESS,FCConstants.PORTOUTPUT);
((ProcessGraph)currentProcess).actionRL(FCConstants.PORTPROCESS,FCConstants.PORTINPUT);
......@@ -1721,7 +1721,7 @@ public class FlowComposer extends JPanel implements GraphModelListener,
public void actionPerformed(ActionEvent e) {
((ProcessGraph)currentProcess).actionRL(FCConstants.PORTPROCESS,FCConstants.PORTINPUT);
((ProcessGraph)currentProcess).actionRL(FCConstants.PORTPROCESS,FCConstants.PORTOUTPUT);
}
protected void update(){
......
/**
* $Id: ProcessGraph.java,v 1.25 2002-06-11 09:38:57 gchomat Exp $
* $Id: ProcessGraph.java,v 1.26 2002-06-11 09:42:51 frederic Exp $
*
* Transmorpher
*
......@@ -67,7 +67,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
*/
static Dimension boundsCube = new Dimension(70,70);
static Dimension boundsPort = new Dimension(15,15);
static Dimension boundsPort = new Dimension(10,10);
static Dimension boundsPortCell = new Dimension(30,30);
/** boundsRect define the dimension of a rectangle form composant such as ApplyProcess, Serialize,...
......@@ -402,7 +402,18 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
return getView().getMapping(source, false);
}
/**
public Object[] getSelectionCells() {
Object[] tmp = getSelectionModel().getSelectionCells();
ArrayList list = new ArrayList();
for (int i = 0; i <tmp.length; i++){
DefaultGraphCell cell = (DefaultGraphCell)tmp[i];
if ((!(cell instanceof PortProcessCell))&&(!(cell instanceof PortCell))&&(!(cell instanceof DefaultEdge)))
list.add(tmp[i]);
}
return list.toArray();
}
/**
* Return the target's view of the specified edge.
* @param edge An object.
*/
......@@ -481,12 +492,9 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
public ArrayList getCellProcess(int portLocation) {
Object[] roots = getAll();
String user;
if (portLocation==FCConstants.PORTINPUT)
user="PInput";
else user="POutput";
ArrayList result = new ArrayList();
for (int i = 0; i < roots.length; i++){
if (((DefaultGraphCell)roots[i]).getUserObject().equals(user))
if ((((DefaultGraphCell)roots[i]).getUserObject().equals(""))&&((getPorts(roots[i],portLocation)).size()>0))
result.add(roots[i]);
}
return result;
......@@ -592,21 +600,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
/**
* add a Cell to the Graph
public void updateProcess() {
if (pCell!=null) {
GraphView v = getView();
Rectangle r = getBounds();
Map map = GraphConstants.createMap();
Map attributes = new Hashtable();
GraphConstants.setBounds(map,r);
CellView cellView = v.getMapping(pCell,true);
attributes.put(cellView,map);
v.edit(attributes);}
}
*/
/** add a Cell to the Graph
*
......@@ -616,13 +610,13 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
Rectangle bounds;
Point position = new Point(10,10);
if(marquee instanceof FCMarqueeHandler)
if(marquee instanceof FCMarqueeHandler && ((FCMarqueeHandler)marquee).getCurrentPoint()!= null)
position = new Point(((FCMarqueeHandler)marquee).getCurrentPoint());
DefaultGraphCell cell = null;
Map viewMap = new Hashtable();
Map attributes = null;
// Create Vertex
switch (type) {
case FCConstants.MERGE :
......@@ -655,7 +649,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
cell = new ApplyExternalCell(userObject);
bounds = new Rectangle(position,boundsRect);
attributes = commonAttributres(cell,bounds);
Call call = (Call)userObject;
if(call.getType().equals("xslt")){
addPort(cell,viewMap,FCConstants.PORTINPUT);
......@@ -663,7 +657,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
}
GraphConstants.setForeground(attributes, Color.white);
GraphConstants.setBackground(attributes, Color.lightGray);
break;
case FCConstants.APPLYPROCESS :
cell = new ApplyProcessCell(userObject);
......@@ -692,9 +686,9 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
default: System.out.println("pas de vertex correspondant la string : FlowComposerGraph+meth commonAttributres");break;
}
viewMap.put(cell,attributes);
getModel().insert(new Object[]{cell}, null, null, viewMap);
FlowComposer.editing=true;
return cell;
......@@ -711,9 +705,10 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
}
GraphConstants.setBounds(map, bounds);
GraphConstants.setOpaque(map, false);
GraphConstants.setBorderColor(map, Color.black);
GraphConstants.setOpaque(map, false);
GraphConstants.setBorderColor(map, Color.black);
return map;
}
public void createPort(int type)
......@@ -757,7 +752,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
break;
default : System.out.println("type de port inconnu : meth addPort");
}
PortCell pc = new PortCell("",type);
PortCell pc = new PortCell(port,type);
viewMap.put(pc, map);
cell.add(pc);
......@@ -780,8 +775,8 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
}
else {
if (portLocation==FCConstants.PORTINPUT)
cell= addVertex("PInput",type);
else cell= addVertex("POutput",type);
cell= addVertex("",type);
else cell= addVertex("",type);
addPortRL(cell,portLocation);
updateCellProcess(portLocation);
}
......@@ -797,7 +792,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
GraphConstants.setOffset(map, new Point((int)(u/2),(int)(u/2)));
switch (type) {
case FCConstants.PORTINPUT :
if (cell.getUserObject().equals("PInput")) {
if (cell.getUserObject().equals("")) {
index = (((Process)userObject).inPorts().length()==0)?0:((Process)userObject).inPorts().length()-1;
port = new fr.fluxmedia.transmorpher.Graph.Port(null,((Process)userObject),index);
......@@ -812,7 +807,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
}
break;
case FCConstants.PORTOUTPUT :
if (cell.getUserObject().equals("POutput")) {
if (cell.getUserObject().equals("")) {
index = (((Process)userObject).outPorts().length()==0)?0:((Process)userObject).outPorts().length()-1;
port = new fr.fluxmedia.transmorpher.Graph.Port(null,((Process)userObject),index);
......@@ -839,10 +834,6 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
}
public void updateCellProcess(int portLocation){
GraphView v = getView();
Rectangle rect = getBounds();
......@@ -852,7 +843,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
Map map = GraphConstants.createMap();
Map attributes = new Hashtable();
if (portLocation==FCConstants.PORTINPUT)
if (portLocation==FCConstants.PORTOUTPUT)
GraphConstants.setBounds(map,new Rectangle(new Point(rect.width-15,(int)(rect.height*(i+1))/(cell.size()+1)),boundsPort));
else GraphConstants.setBounds(map,new Rectangle(new Point(0,(int)(rect.height*(i+1))/(cell.size()+1)),boundsPort));
CellView cellView = v.getMapping(cell.get(i),true);
......
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