Commit 1dc3e93a authored by Guillaume Chomat's avatar Guillaume Chomat
Browse files

fix minor bug in save action and editCall class

parent 4d37acc0
/**
*
*$Id: FlowComposer.java,v 1.66 2002-07-05 08:07:15 gchomat Exp $
*$Id: FlowComposer.java,v 1.67 2002-07-05 10:08:09 gchomat Exp $
*
* Transmorpher
*
......@@ -1822,6 +1822,8 @@ public class FlowComposer extends JPanel implements GraphModelListener,
public void actionPerformed(ActionEvent e) {
boolean ok =true;
if(file == null)
{
String fileChoosen = saveDialog();
......@@ -1835,32 +1837,36 @@ public class FlowComposer extends JPanel implements GraphModelListener,
String name = filename.substring(filename.lastIndexOf(File.separatorChar)+1,filename.indexOf('.'));
transmorpher.setName(name);
}
else
else{
ok = false;
setFile(temporaryFile);
}
}
PrintStream out = System.out;
String directory = file.getParentFile().getAbsolutePath();
try{
out = new PrintStream(new BufferedOutputStream(new FileOutputStream(file.getAbsolutePath())));
}
catch(FileNotFoundException ex)
{
Alert.show(null,"file " +file.getAbsolutePath()+"is not found","WARNING",JOptionPane.WARNING_MESSAGE);
return;
if(ok){
PrintStream out = System.out;
String directory = file.getParentFile().getAbsolutePath();
try{
out = new PrintStream(new BufferedOutputStream(new FileOutputStream(file.getAbsolutePath())));
}
catch(FileNotFoundException ex)
{
Alert.show(null,"file " +file.getAbsolutePath()+"is not found","WARNING",JOptionPane.WARNING_MESSAGE);
return;
}
System.setOut(out);
System.setErr(out);
transmorpher.generateXML();
out.close();
System.setOut(out);
System.setErr(out);
transmorpher.generateXML();
out.close();
//generating RDF
ReadWrite fileRDF = new ReadWrite(directory+""+File.separator+""+transmorpher.getName()+".rdf",ReadWrite.WRITE);
generateFileRDF(fileRDF);
//generating RDF
ReadWrite fileRDF = new ReadWrite(directory+""+File.separator+""+transmorpher.getName()+".rdf",ReadWrite.WRITE);
generateFileRDF(fileRDF);
fileRDF.Close();
fileRDF.Close();
}
}
}
......@@ -2322,7 +2328,9 @@ public class FlowComposer extends JPanel implements GraphModelListener,
if(call instanceof ApplyProcess){
for (Enumeration e = transmorpher.getTransformations().getKeys() ; e.hasMoreElements() ;) {
refChooser.addItem(e.nextElement());
Object key = e.nextElement();
if(!(transmorpher.getTransformation((String)key) instanceof MainProcess))
refChooser.addItem(key);
}
}
Object[] compRef = new Object[]{refJLabel,refChooser};
......
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