File tree Expand file tree Collapse file tree
src/main/java/com/mxgraph/svg2xml Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525import java .util .List ;
2626import java .util .Map ;
2727
28+ import javax .swing .JOptionPane ;
2829import javax .xml .parsers .DocumentBuilder ;
2930import javax .xml .parsers .DocumentBuilderFactory ;
3031import 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.\n The libraries are genereted in:" + destFolders );
642666 }
643667
644668 /**
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments