Skip to content

Commit 9e94a43

Browse files
committed
Adds dialog at end of conversion
1 parent 2c63f5d commit 9e94a43

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

src/com/mxgraph/svg2xml/Svg2Xml.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.Hashtable;
2525
import java.util.Map;
2626

27+
import javax.swing.JOptionPane;
2728
import javax.xml.parsers.DocumentBuilder;
2829
import javax.xml.parsers.DocumentBuilderFactory;
2930
import javax.xml.transform.OutputKeys;
@@ -91,6 +92,8 @@ public Svg2Xml(Svg2XmlGui gui)
9192

9293
// TODO add SVG viewbox support, or manual setting of viewbox
9394

95+
ArrayList<File> destPaths = new ArrayList<File>();
96+
9497
boolean isLastInGroup = true;
9598
boolean isNewGroup = true;
9699
String groupXml = new String();
@@ -589,19 +592,39 @@ else if (aspectRatio.toLowerCase().equals("variable"))
589592
writer.write(groupXml);
590593
writer.close();
591594

595+
// JOptionPane.showMessageDialog(gui.getFrame(), "Conversion completed.\nThe library is genereted in:\n" + myDestRoot);
596+
if (!destPaths.contains(myDestRoot))
597+
{
598+
destPaths.add(myDestRoot);
599+
}
600+
592601
}
593602
catch(Exception ex)
594603
{
595604
ex.printStackTrace();
596605
}
597606
}
607+
598608
}
599609
catch (Exception e)
600610
{
601611
e.printStackTrace();
602612
}
603613
}
604-
614+
615+
String destFolders = new String();
616+
617+
for (int i = 0; i < destPaths.size(); i++)
618+
{
619+
String currPath = destPaths.get(i).getAbsolutePath();
620+
621+
if (!destFolders.contains(currPath))
622+
{
623+
destFolders = destFolders + "\n" + currPath;
624+
}
625+
}
626+
627+
JOptionPane.showMessageDialog(gui.getFrame(), "Conversion completed.\nThe libraries are genereted in:" + destFolders);
605628
}
606629

607630
/**

src/com/mxgraph/svg2xml/Svg2XmlGui.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public class Svg2XmlGui implements ActionListener{
6060
protected File[] sourceFiles;
6161
protected File destPath;
6262

63+
protected JFrame frame = new JFrame();
6364
protected JRadioButton useAbsScaleComponent = new JRadioButton();
6465
protected JTextField absXScaleComponent = new JTextField();
6566
protected JCheckBox calculateBorderComponent = new JCheckBox();
@@ -91,7 +92,6 @@ public void startHere(String[] args, Svg2XmlGui gui)
9192
Svg2Xml.main(args);
9293
}
9394

94-
JFrame frame = new JFrame();
9595

9696
JPanel filePanel = new JPanel(new GridLayout(1,2));
9797
JPanel settingsPanel = new JPanel();
@@ -321,6 +321,11 @@ public void setRelativeScaling(boolean relativeScaling)
321321
this.relativeScaling = relativeScaling;
322322
}
323323

324+
public JFrame getFrame()
325+
{
326+
return this.frame;
327+
}
328+
324329
public double getRelativeScaleRatio()
325330
{
326331
return relativeScaleRatio;

0 commit comments

Comments
 (0)