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

*** empty log message ***

parent d7ad365c
/**
*
*$Id: FlowComposer.java,v 1.31 2002-05-30 16:20:40 frederic Exp $
*$Id: FlowComposer.java,v 1.32 2002-05-31 13:36:30 frederic Exp $
*
* Transmorpher
*
......@@ -677,7 +677,10 @@ public class FlowComposer extends JPanel implements GraphModelListener,
}
public void setScale(double scale) {
scale = Math.max(Math.min(scale, 1024), .01);
setScale(scale);
}
public String getFileName()
......@@ -797,9 +800,9 @@ public class FlowComposer extends JPanel implements GraphModelListener,
new PortRightAction(this),
new PortLeftAction(this),
new LoadAction(this),
new ZoomInAction(),
new ZoomInAction(this),
new ZoomAction(),
new ZoomOutAction(),
new ZoomOutAction(this),
new ImportAction(),
new ExportAction(),
new SaveAction(),
......@@ -1102,7 +1105,7 @@ public class FlowComposer extends JPanel implements GraphModelListener,
private FlowComposer flow;
LoadAction(FlowComposer flow) {
super("load"+actionSuffix);
flow=flow;
this.flow=flow;
}
public void actionPerformed(ActionEvent e) {
......@@ -1127,7 +1130,7 @@ public class FlowComposer extends JPanel implements GraphModelListener,
private FlowComposer flow;
PortRightAction(FlowComposer flow) {
super("portright"+actionSuffix);
flow=flow;
this.flow=flow;
}
public void actionPerformed(ActionEvent e) {
......@@ -1139,7 +1142,7 @@ public class FlowComposer extends JPanel implements GraphModelListener,
private FlowComposer flow;
PortLeftAction(FlowComposer flow) {
super("portleft"+actionSuffix);
flow=flow;
this.flow=flow;
}
public void actionPerformed(ActionEvent e) {
......@@ -1160,27 +1163,34 @@ public class FlowComposer extends JPanel implements GraphModelListener,
}
class ZoomInAction extends AbstractAction {
ZoomInAction() {
private FlowComposer flow;
ZoomInAction(FlowComposer flow) {
super("zoomIn"+actionSuffix);
setEnabled(true);
this.flow=flow;
}
public void actionPerformed(ActionEvent e) {
double s = (flow.getGraph()).getScale();
(flow.getGraph()).setScale((flow.getGraph()).getScale()+0.5);
if ((flow.getGraph()).getSelectionCell() != null)
(flow.getGraph()).scrollCellToVisible((flow.getGraph()).getSelectionCell());
}
}
}
class ZoomOutAction extends AbstractAction {
ZoomOutAction() {
private FlowComposer flow;
ZoomOutAction(FlowComposer flow) {
super("zoomOut"+actionSuffix);
setEnabled(true);
this.flow=flow;
}
public void actionPerformed(ActionEvent e) {
(flow.getGraph()).setScale((flow.getGraph()).getScale()-0.5);
if ((flow.getGraph()).getSelectionCell() != null)
(flow.getGraph()).scrollCellToVisible((flow.getGraph()).getSelectionCell());
}
}
......
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