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

update zoom+fault

parent 53fa7920
......@@ -145,5 +145,9 @@ public class FCGraphUI extends BasicGraphUI{
rendererPane.paintComponent(g, component, graph, bounds.x, bounds.y,
bounds.width, bounds.height, true);
}
}
}
/**
* $Id: FCMarqueeHandler.java,v 1.30 2002-06-13 14:18:50 gchomat Exp $
* $Id: FCMarqueeHandler.java,v 1.31 2002-06-13 15:28:53 frederic Exp $
*
* Transmorpher
*
......@@ -110,6 +110,7 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
/* Return true if this handler should be preferred over other handlers. */
public boolean isForceMarqueeEvent(MouseEvent e) {
return !marquee.isSelected() || super.isForceMarqueeEvent(e);
}
public void mousePressed(MouseEvent e) {
......@@ -155,7 +156,8 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
g.setXORMode(fg);
overlay(g);
event.consume();
}
}
else System.out.println("ta mere en slip");
......
/**
*
*$Id: FlowComposer.java,v 1.47 2002-06-13 14:18:50 gchomat Exp $
*$Id: FlowComposer.java,v 1.48 2002-06-13 15:28:53 frederic Exp $
*
* Transmorpher
*
......@@ -689,7 +689,8 @@ public class FlowComposer extends JPanel implements GraphModelListener,
redoAction.update();
portLeftAction.update();
portRightAction.update();
//ZoomInAction.update();
// ZoomOutAction.update();
}
......@@ -853,7 +854,8 @@ public class FlowComposer extends JPanel implements GraphModelListener,
protected UndoAction undoAction = new UndoAction();
protected RedoAction redoAction = new RedoAction();
protected ZoomInAction zoomInAction = new ZoomInAction(this);
protected ZoomOutAction zoomOutAction = new ZoomOutAction(this);
protected PortRightAction portRightAction = new PortRightAction(this);
protected PortLeftAction portLeftAction = new PortLeftAction(this);
......@@ -861,11 +863,11 @@ public class FlowComposer extends JPanel implements GraphModelListener,
undoAction,
redoAction,
portRightAction,
portLeftAction,
portLeftAction,
new LoadAction(this),
new ZoomInAction(this),
zoomInAction,
new ZoomAction(),
new ZoomOutAction(this),
zoomOutAction,
new ImportAction(),
new ExportAction(),
new SaveAction(),
......@@ -1696,8 +1698,7 @@ public class FlowComposer extends JPanel implements GraphModelListener,
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))){
if ((cell instanceof DefaultEdge)||(!((cell instanceof DispatchCell)||(cell instanceof ApplyProcessCell)))){
accept=false;
}
}
......@@ -1737,10 +1738,9 @@ public class FlowComposer extends JPanel implements GraphModelListener,
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;
break;
if((cell instanceof DefaultEdge)||(!((cell instanceof MergeCell)||(cell instanceof ApplyProcessCell)))){
accept=false;
}
}
if (accept) setEnabled (true);
......@@ -1767,7 +1767,7 @@ public class FlowComposer extends JPanel implements GraphModelListener,
}
}
class ZoomInAction extends AbstractAction {
class ZoomInAction extends AbstractAction {
private FlowComposer flow;
ZoomInAction(FlowComposer flow) {
super("zoomIn"+actionSuffix);
......@@ -1781,7 +1781,13 @@ public class FlowComposer extends JPanel implements GraphModelListener,
if ((flow.getGraph()).getSelectionCell() != null)
(flow.getGraph()).scrollCellToVisible((flow.getGraph()).getSelectionCell());
}
}
protected void update(){
/* if (currentProcess != null) {
double s = (flow.getGraph()).getScale();
if (s==16.0*/
}
}
class ZoomOutAction extends AbstractAction {
......@@ -1797,7 +1803,10 @@ public class FlowComposer extends JPanel implements GraphModelListener,
if ((flow.getGraph()).getSelectionCell() != null)
(flow.getGraph()).scrollCellToVisible((flow.getGraph()).getSelectionCell());
}
protected void update() {
}
}
......
/**
* $Id: ProcessGraph.java,v 1.31 2002-06-13 14:18:50 gchomat Exp $
* $Id: ProcessGraph.java,v 1.32 2002-06-13 15:28:53 frederic Exp $
*
* Transmorpher
*
......@@ -162,7 +162,7 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
* @param cell reference to the object in the model
*/
public CellView createView(Object cell, CellMapper map) {
CellView view = null;
if (cell instanceof PortCell)
view = createPortView((PortCell) cell, map);
......@@ -179,7 +179,9 @@ public class ProcessGraph extends JGraph implements Comparator, Observer{
}
protected PortView createPortView(PortCell p, CellMapper cm){
return new FCPortView(p, this, cm);
}
/*protected PortView createPortView(Port p, CellMapper cm){
......@@ -787,11 +789,11 @@ addVertex(call, position,FCConstants.MERGE);
Object[] tmp = getSelectionCells();
DefaultGraphCell cell;
String name ="";
Port port ;
if (tmp.length != 0) {
for (int i = 0; i <tmp.length; i++){
cell = (DefaultGraphCell)tmp[i];
......@@ -802,7 +804,7 @@ addVertex(call, position,FCConstants.MERGE);
}
}
else {
TransformationImpl transformation = (TransformationImpl)userObject;
port = new Port(name,transformation,type);
......
/**
* $Id: ProcessGraphModel.java,v 1.8 2002-06-13 14:05:26 frederic Exp $
* $Id: ProcessGraphModel.java,v 1.9 2002-06-13 15:28:53 frederic Exp $
*
* Transmorpher
*
......@@ -64,20 +64,24 @@ public class ProcessGraphModel extends DefaultGraphModel{
public boolean acceptsSource(Object edge,Object port) {
Object portTarget = ((Edge)edge).getTarget();
Object portSource = ((Edge)edge).getSource();
System.out.println(portTarget);
//Object portSource = ((Edge)edge).getSource();
//System.out.println(portSource);
Object cellTarget = getParent(portTarget);
System.out.println(cellTarget);
Object cell = getParent(port);
return ((!cellTarget.equals(cell))&&(((PortCell)portSource).getType()==((PortCell)port).getType()));
System.out.println(cell);
return ((!cellTarget.equals(cell))&&(((PortCell)portTarget).getType()!=((PortCell)port).getType()));
}
public boolean acceptsTarget(Object edge,Object port) {
Object portSource = ((Edge)edge).getSource();
Object portTarget = ((Edge)edge).getTarget();
//Object portTarget = ((Edge)edge).getTarget();
Object cellSource = getParent(portSource);
Object cell = getParent(port);
return ((!cellSource.equals(cell))&&(((PortCell)portTarget).getType()==((PortCell)port).getType()));
return ((!cellSource.equals(cell))&&(((PortCell)portSource).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