Skip to content

Commit f724673

Browse files
committed
Merge commit '9e94a436' into develop
# Conflicts: # src/main/java/com/mxgraph/svg2xml/Svg2Xml.java
2 parents c4bd232 + 9e94a43 commit f724673

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

src/main/java/com/mxgraph/svg2xml/Svg2Xml.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.List;
2626
import java.util.Map;
2727

28+
import javax.swing.JOptionPane;
2829
import javax.xml.parsers.DocumentBuilder;
2930
import javax.xml.parsers.DocumentBuilderFactory;
3031
import javax.xml.transform.OutputKeys;
@@ -125,6 +126,8 @@ public void convertToXml(File[] sourceFiles, File destPath) {
125126

126127
// TODO add SVG viewbox support, or manual setting of viewbox
127128

129+
ArrayList<File> destPaths = new ArrayList<File>();
130+
128131
boolean isLastInGroup = true;
129132
boolean isNewGroup = true;
130133
String groupXml = new String();
@@ -626,19 +629,40 @@ else if (aspectRatio.toLowerCase().equals("variable"))
626629
writer.write(groupXml);
627630
writer.close();
628631
System.out.println("File written");
632+
633+
// JOptionPane.showMessageDialog(gui.getFrame(), "Conversion completed.\nThe library is genereted in:\n" + myDestRoot);
634+
if (!destPaths.contains(myDestRoot))
635+
{
636+
destPaths.add(myDestRoot);
637+
}
638+
629639
}
630640
catch(Exception ex)
631641
{
632642
ex.printStackTrace();
633643
}
634644
}
645+
635646
}
636647
catch (Exception e)
637648
{
638649
e.printStackTrace();
639650
}
640651
}
641652

653+
String destFolders = new String();
654+
655+
for (int i = 0; i < destPaths.size(); i++)
656+
{
657+
String currPath = destPaths.get(i).getAbsolutePath();
658+
659+
if (!destFolders.contains(currPath))
660+
{
661+
destFolders = destFolders + "\n" + currPath;
662+
}
663+
}
664+
665+
JOptionPane.showMessageDialog(gui.getFrame(), "Conversion completed.\nThe libraries are genereted in:" + destFolders);
642666
}
643667

644668
/**

src/main/java/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();
@@ -92,7 +93,6 @@ public void startHere(String[] args, Svg2XmlGui gui)
9293
return; // prevent the GUI to show up after processing
9394
}
9495

95-
JFrame frame = new JFrame();
9696

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

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

0 commit comments

Comments
 (0)