Salut à tous
Bon , mon objectif est de créer un fichier svg qui contient un diagramme de classe. alors pour ceci je saisie mes données via un interface swing java . ces données sont recuperées et inserer dans fichier Xml en utilisant " JDOM" . Afin d'avoir ce fichier svg je dois utiliser XSLT car elle difinit mon template en qlq sorte . pour cela mon fichier XSLT est généré suivant mes données . mon problemes alors comment je peux avoir ce fichier SVG ??? j'ai essayé qd-meme mais j'ai obtenue à la fin que deux rectangles intitulé ( C1 , C2 : les nomes que 'ai les saisies au debut ) mais le reste s'affiche plus , ni attribut , ni methodes , ni ligne qui relie antre mes deux classes ???
je veux vous montrer un peu de mon code :

* classe insertData.java (ds laquelle je sasis mes données de depart )
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
 
 
 
package application_uml;
public class InsertData extends javax.swing.JFrame {
    public InsertData() {
        initComponents();
 
    }                       
    private void initComponents() {
 
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
        System.exit(0);
    }                                            
 
    private void classTypeActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
    }                                         
 
    private void class_varActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
        String enter = class_var.getText();
    }                                         
 
    private void add_classActionPerformed(java.awt.event.ActionEvent evt) {                                          
        class_var.setText(class_var.getText().trim()); // enlever les espaces au debut et à la fin
        if (class_var.getText().indexOf(" ") != -1) {
            JOptionPane.showMessageDialog(null, "Le nom de la classe ne doit pas etre vide ou contenant des espaces");
            return;
        }
        Classe classe = new Classe();
        classe.attributs = new ArrayList<Attribut>();
        classe.methodes = new ArrayList<Methode>();
        classe.nom = class_var.getText();
        classe.accessControl = (String) acces_class.getSelectedItem();
        classe.container = (String) class_container.getSelectedItem();
        // classe.containerValue = (String) class_value.getSelectedItem();
        indexClasses++;
        classe.id = String.valueOf(indexClasses + 1);
        classes.add(classe);
 
        recharger();
 
    }                                         
 
    public void recharger() {
        fromClass.removeAllItems();
        toClass.removeAllItems();
        for (int i = 0; i < classes.size(); i++) {
            fromClass.addItem(classes.get(i).nom);
            toClass.addItem(classes.get(i).nom);
        }
    }
    private void att_varActionPerformed(java.awt.event.ActionEvent evt) {                                        
    }                                       
 
    private void add_attActionPerformed(java.awt.event.ActionEvent evt) {                                        
        att_var.setText(att_var.getText().trim()); // enlever les espaces au debut et à la fin
        if (att_var.getText().indexOf(" ") != -1) {
            JOptionPane.showMessageDialog(null, "Le nom de l'attribut ne doit pas etre vide ou contenant des espaces");
            return;
        }
        if (!verifierAttribut()) {
            return;
        }
        Attribut attribut = new Attribut();
        attribut.nom = att_var.getText();
        attribut.accesControl = (String) acces_att.getSelectedItem();
        attribut.typeAttribut = (String) type_att.getSelectedItem();
        classes.get(indexClasses).attributs.add(attribut);
        att_var.setText("");
    }                                       
 
    private boolean verifierAttribut() {
        if (att_var.getText().equalsIgnoreCase(classes.get(indexClasses).nom)) {
            JOptionPane.showMessageDialog(null, "Le nom de l'attribut est identique au nom de la classe");
            return false;
        }
        for (int i = 0; i < classes.get(indexClasses).attributs.size(); i++) {
            if (classes.get(indexClasses).attributs.get(i).nom.equalsIgnoreCase(att_var.getText())) {
                JOptionPane.showMessageDialog(null, "Le nom de l'attribut existe déjà");
                return false;
            }
        }
        return true;
    }
    private void add_methActionPerformed(java.awt.event.ActionEvent evt) {                                         
        nomMethode.setText(nomMethode.getText().trim()); // enlever les espaces au debut et à la fin
 
        if (nomMethode.getText().indexOf(" ") != -1) {
            JOptionPane.showMessageDialog(null, "Le nom de la méthode ne doit pas etre vide ou contenant des espaces");
            return;
        }
        if (nomMethode.getText().equalsIgnoreCase(classes.get(indexClasses).nom)) {
            JOptionPane.showMessageDialog(null, "Le nom de la méthode est identique au nom de la classe");
            return;
        }
        Methode methode = new Methode();
        methode.nom = nomMethode.getText();
        methode.accesControl = (String) acces_meth.getSelectedItem();
        methode.typeMethode = (String) type_meth.getSelectedItem();
        classes.get(indexClasses).methodes.add(methode);
        nomMethode.setText("");
    }
 
    private void acces_attActionPerformed(java.awt.event.ActionEvent evt) {
}                                        
 
    private void acces_classActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
        String class_slected = "";
        class_slected = class_slected + acces_class.getSelectedItem().toString();
    }                                           
 
    private void nomMethodeActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
        String enter3 = nomMethode.getText();
    }                                          
 
    private void class_containerActionPerformed(java.awt.event.ActionEvent evt) {                                                
        // TODO add your handling code here:
        String container_slected = "";
        container_slected = container_slected + class_container.getSelectedItem().toString();
    }                                               
 
    /*
    private void acces_attActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
    }                                         
     */
    private void type_attActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        // TODO add your handling code here:
        // recuperer valeur selctionée
        String type_att_slected = "";
        type_att_slected = type_att_slected + type_att.getSelectedItem().toString();
    }                                        
 
    private void acces_methActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
        String method_slected = "";
        method_slected = method_slected + acces_meth.getSelectedItem().toString();
    }                                          
 
    private void type_methActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
        String type_meth_slected = "";
        type_meth_slected = type_meth_slected + type_meth.getSelectedItem().toString();
    }                                         
 
    private void acces_classItemStateChanged(java.awt.event.ItemEvent evt) {                                             
        // TODO add your handling code here:
        // String str_class = (String) acces_class.getSlectedItem();
    }                                            
 
    private void typeCardActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
    }                                        
 
    private void fromClassAncestorMoved(javax.swing.event.AncestorEvent evt) {                                        
        // TODO add your handling code here:
    }                                       
 
    private void btnExportActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
        try {
 
 
//l'element root du document xml
            Element root = new Element("classDiagram");
            Document doc = new Document(root);

            for (int i = 0; i < classes.size(); i++) {
                //un noeud classe
                Element nodeClass = new Element("class");
                nodeClass.setAttribute("classID", classes.get(i).id);

                Element nodeClassName = new Element("name");
                nodeClassName.setText(classes.get(i).nom);
                nodeClass.addContent(nodeClassName);

                // Element nodeClassAbstract = new Element("isAbstract");
                //nodeClassAbstract.setText(classes.get(i).isAbstract);
                //nodeClass.setContent(nodeClassAbstract);

                Element nodeClassVisibility = new Element("visibility");
                nodeClassVisibility.setText(classes.get(i).accessControl);
                nodeClass.addContent(nodeClassVisibility);

                // Ajouter les attributs
                if (classes.get(i).attributs.size() > 0) {
                    for (int j = 0; j < classes.get(i).attributs.size(); j++) {
                        Element nodeAttribut = new Element("attribut");
 
 
                        Element nodeAttributName = new Element("name");
                        nodeAttributName.setText(classes.get(i).attributs.get(j).nom);
                        nodeAttribut.addContent(nodeAttributName);
 
                        Element nodeAttributType = new Element("type");
                        nodeAttributType.setText(classes.get(i).attributs.get(j).typeAttribut);
                        nodeAttribut.addContent(nodeAttributType);
 
                        Element nodeAttributVisibility = new Element("visibility");
                        nodeAttributVisibility.setText(classes.get(i).attributs.get(j).accesControl);
                        nodeAttribut.addContent(nodeAttributVisibility);
 
                        nodeClass.addContent(nodeAttribut);
 
                    }
                    //nodeClass.addContent(nodeAttributs);
                }
                // Ajouter les méthodes
                if (classes.get(i).methodes.size() > 0) {
                    //Element nodeMethodes = new Element("methodes");
                    for (int j = 0; j < classes.get(i).methodes.size(); j++) {
                        //un noeud
 
                        Element nodeMethod = new Element("method");
 
                        Element nodeMethodName = new Element("name");
                        nodeMethodName.setText(classes.get(i).methodes.get(j).nom);
                        nodeMethod.addContent(nodeMethodName);
 
                        Element nodeMethodType = new Element("type");
                        nodeMethodType.setText(classes.get(i).methodes.get(j).typeMethode);
                        nodeMethod.addContent(nodeMethodType);
 
                        Element nodeMethodVisibility = new Element("visibility");
                        nodeMethodVisibility.setText(classes.get(i).methodes.get(j).accesControl);
                        nodeMethod.addContent(nodeMethodVisibility);
 
                        nodeClass.addContent(nodeMethod);
                        root.addContent(nodeClass);
                    }
 
                }
 
 
            }
 
 
            if (cardinalites.size() > 0) {
                for (int i = 0; i < cardinalites.size(); i++) {
                    Element nodeCardinality = new Element("relation");
 
                    Element nodeCardinalityType = new Element("type");
                    nodeCardinalityType.setText(cardinalites.get(i).type);
                    nodeCardinality.addContent(nodeCardinalityType);
 
                    Element nodeCardinalityFrom = new Element("start");
                    nodeCardinalityFrom.setText(cardinalites.get(i).cardinalityFrom);
                    nodeCardinality.addContent(nodeCardinalityFrom);
 
                    Element nodeCardinalityTo = new Element("end");
                    nodeCardinalityTo.setText(cardinalites.get(i).cardinalityTo);
                    nodeCardinality.addContent(nodeCardinalityTo);
 
                    Element nodeCardinalityAction = new Element("action");
                    nodeCardinalityAction.setText(cardinalites.get(i).action);
                    nodeCardinality.addContent(nodeCardinalityAction);
 
 
                    Element nodeCardinalityFromClass = new Element("from");
                    nodeCardinalityFromClass.setText(cardinalites.get(i).fromClass);
                    nodeCardinality.addContent(nodeCardinalityFromClass);
 
                    Element nodeCardinalityToClass = new Element("to");
                    nodeCardinalityToClass.setText(cardinalites.get(i).toClass);
                    nodeCardinality.addContent(nodeCardinalityToClass);
                    root.addContent(nodeCardinality);
 
                }
 
            }
            AffciheFile affiche = new AffciheFile(doc);
            affiche.setVisible(true);
 
 
        } catch (Throwable e) {
            e.printStackTrace();
        }
 
 
    }                                         
 
    private void formWindowOpened(java.awt.event.WindowEvent evt) {                                  
        // TODO add your handling code here:
    }                                 
 
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        if (cardFrom.getSelectedItem().toString().equals(cardTo.getSelectedItem().toString())) {
            JOptionPane.showMessageDialog(null, "Erreur cardinalité");
            return;
        }
        Cardinalite cardinalite = new Cardinalite();
        cardinalite.fromClass = (String) fromClass.getSelectedItem();
        cardinalite.toClass = (String) toClass.getSelectedItem();
        cardinalite.cardinalityFrom = (String) cardFrom.getSelectedItem();
        cardinalite.cardinalityTo = (String) cardTo.getSelectedItem();
        cardinalite.type = (String) typeCard.getSelectedItem();
        cardinalite.action = action.getText();
        cardinalites.add(cardinalite);
    }                                        
 
    private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
        AffciheFile affiche = new AffciheFile(null);
        affiche.setVisible(true);
 
    }                                            
 
    private void fileMenuActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
    }                                        
 
    /////////       ajouter comme premier
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
 
            public void run() {
                new InsertData().setVisible(true);
            }
        });
    }
    List<Classe> classes = new ArrayList<Classe>();
    List<Cardinalite> cardinalites = new ArrayList<Cardinalite>();
    int indexClasses = -1;
    int indexCardinalites = -1;
    // Variables declaration - do not modify                     
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JComboBox acces_att;
    private javax.swing.JComboBox acces_class;
    private javax.swing.JComboBox acces_meth;
    private javax.swing.JTextField action;
    private javax.swing.JButton add_att;
    private javax.swing.JButton add_class;
    private javax.swing.JButton add_meth;
    private javax.swing.JTextArea affich1;
    private javax.swing.JTextField att_var;
    private javax.swing.JButton btnExport;
    private javax.swing.JComboBox cardFrom;
    private javax.swing.JComboBox cardTo;
    private javax.swing.JComboBox classType;
    private javax.swing.JComboBox class_container;
    private javax.swing.JTextField class_var;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenuItem copyMenuItem;
    private javax.swing.JMenuItem cutMenuItem;
    private javax.swing.JMenuItem deleteMenuItem;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JComboBox fromClass;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JTextField nomMethode;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem pasteMenuItem;
    private javax.swing.JMenuItem saveAsMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    private javax.swing.JComboBox toClass;
    private javax.swing.JComboBox typeCard;
    private javax.swing.JComboBox type_att;
    private javax.swing.JComboBox type_meth;
    // End of variables declaration                   
}
* ma classe affichFile.java

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
 
 
 
package application_uml;
 
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.fop.apps.Driver;
import org.jdom.Document;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
 
 
public class AffciheFile extends javax.swing.JFrame {
 
    Document doc;
    String fileName;
 
    /** Creates new form AffciheFile */
    public AffciheFile() {
        initComponents();
        // jPanelTree.setBorder(javax.swing.BorderFactory.createTitledBorder("Arboresence"));
 
    }
 
 
    public AffciheFile(Document doc) {
        initComponents();
        this.doc = doc;
        try {
 
            File f = new File("tmp");
 
            if (!f.exists()) {
                f.mkdirs(); // créer le rep
            }
            SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
            fileName = "tmp\\tmp_" + df.format(new Date()) + ".xml";
 
            enregistreTmp(fileName, doc);
            afficheArea.setText("");
            InputStream ips = new FileInputStream(fileName);
            InputStreamReader ipsr = new InputStreamReader(ips);
            BufferedReader br = new BufferedReader(ipsr);
            String ligne;
            while ((ligne = br.readLine()) != null) {
                afficheArea.append(ligne + "\n");
            }
            br.close();
            afficheTree(fileName);
            if (f.exists()) {
                f.deleteOnExit();
            }
 
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
 
    /**
     *
     * @param fichier
     * @param document
     */
    private void enregistreTmp(String fichier, Document document) {
        try {
 
            //On utilise ici un affichage classique avec getPrettyFormat()
            XMLOutputter sortie = new XMLOutputter(Format.getPrettyFormat());
            //Remarquez qu'il suffit simplement de créer une instance de FileOutputStream
            //avec en argument le nom du fichier pour effectuer la sérialisation.
            sortie.output(document, new FileOutputStream(fichier));
 
        } catch (java.io.IOException e) {
        }
    }
 
    /**
     *
     * @param fichier
     * @param document
     */
    private void enregistre(Document document) {
        try {
            JFileChooser fc = new JFileChooser();
            int returnVal = fc.showSaveDialog(this);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                String name = file.getAbsolutePath();
 
                //On utilise ici un affichage classique avec getPrettyFormat()
                XMLOutputter sortie = new XMLOutputter(Format.getPrettyFormat());
                //Remarquez qu'il suffit simplement de créer une instance de FileOutputStream
                //avec en argument le nom du fichier pour effectuer la sérialisation.
                sortie.output(document, new FileOutputStream(name + ".xml"));
            }
        } catch (java.io.IOException e) {
        }
    }
 
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {
 
 
 
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
        System.exit(0);
    }                                            
 
    private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
 
        JFileChooser chooser = new JFileChooser();
        chooser.addChoosableFileFilter(
                new FileNameExtensionFilter("Fichiers xml", "xml"));
        int returnVal = chooser.showOpenDialog(AffciheFile.this);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            this.fileName = chooser.getSelectedFile().getAbsolutePath();
            afficheALL(this.fileName);
        }
 
 
    }                                            
    private void afficheTree(String filename) {
        org.w3c.dom.Document document = null;
        try {
            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbFactory.newDocumentBuilder();
            document = builder.parse(new File(filename));
            document.normalize();
            jPanelTree.setDocument(document);
 
            pack();
            setVisible(true);
        } catch (Exception e) {
            // e.printStackTrace();
            System.exit(1);
        }
    }
    private void saveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
        enregistre(doc);
    }                                            
 
    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {                                       
    }                                      
 
    private void menuPdfActionPerformed(java.awt.event.ActionEvent evt) {                                        
        try {
            if (this.fileName.isEmpty()) {
                JOptionPane.showMessageDialog(null, "Aucun fichier choisi");
                return;
            }
            creerPDF(this.fileName, "template.xsl", "pdf.pdf");
        } catch (Exception ex) {
            Logger.getLogger(AffciheFile.class.getName()).log(Level.SEVERE, null, ex);
        }
 
 
    }                                       
 
    private void menuHtmlActionPerformed(java.awt.event.ActionEvent evt) {                                         
        try {
            if (this.fileName.isEmpty()) {
                JOptionPane.showMessageDialog(null, "Aucun fichier choisi");
                return;
            }
            JFileChooser fc = new JFileChooser();
            int returnVal = fc.showSaveDialog(this);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                String name = file.getAbsolutePath();
                TransformerFactory tFactory = TransformerFactory.newInstance();
 
                Transformer transformer =
                        tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("template.xsl"));
 
                transformer.transform(new javax.xml.transform.stream.StreamSource(this.fileName),
                        new javax.xml.transform.stream.StreamResult(new FileOutputStream(name + ".html")));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }                                        
 
    private void menuImageActionPerformed(java.awt.event.ActionEvent evt) {                                          
        try {
            if (this.fileName.isEmpty()) {
                JOptionPane.showMessageDialog(null, "Aucun fichier choisi");
                return;
            }
            JFileChooser fc = new JFileChooser();
            int returnVal = fc.showSaveDialog(this);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                String name = file.getAbsolutePath();
                TransformerFactory tFactory = TransformerFactory.newInstance();
 
                Transformer transformer =
                        tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("svg_template.xsl"));
 
                transformer.transform(new javax.xml.transform.stream.StreamSource(this.fileName),
                        new javax.xml.transform.stream.StreamResult(new FileOutputStream(name + ".svg")));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }                                         
    public static void creerPDF(String xml, String xsl, String pdf) throws Exception {
        // création du résultat (pdf)
        Driver driver = new Driver();
        driver.setRenderer(Driver.RENDER_PDF);
        driver.setOutputStream(new java.io.FileOutputStream(pdf));
        Result resultat = new SAXResult(driver.getContentHandler());
 
        // récupération de la source xml
        Source source = new StreamSource(xml);
 
        // création du transformer en fonction du xsl
        Source style = new StreamSource(xsl);
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer(style);
 
        // transformation
        transformer.transform(source, resultat);
    }
 
    /**
     *
     * @param racine
     * @param fileName
     */
    private void afficheALL(String fileName) {
        try {
            afficheTree(fileName);
            // jTree1= DomTreeMaker.makeTree(fileName);
            // jScrollPane2 = new JScrollPane(DomTreeMaker.makeTree(fileName));
            //getContentPane().add(jScrollPane2);
            //pack();
            afficheArea.setText("");
            InputStream ips = new FileInputStream(fileName);
            InputStreamReader ipsr = new InputStreamReader(ips);
            BufferedReader br = new BufferedReader(ipsr);
            String ligne;
            while ((ligne = br.readLine()) != null) {
                afficheArea.append(ligne + "\n");
            }
            br.close();
        } catch (Exception e) {
            System.out.println(e.toString());
        }
 
    }
 
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
 
            public void run() {
                new AffciheFile().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify                     
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JTextArea afficheArea;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JPanel jPanel2;
    private application_uml.XMLTreePanel jPanelTree;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem menuHtml;
    private javax.swing.JMenuItem menuImage;
    private javax.swing.JMenuItem menuPdf;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    // End of variables declaration                   
}
qd je clique "bouton menu" sava as : image
j'ai tape nom du fichier . je l'ouvre avec Internet Explorer avec plugin suivant
http://download.adobe.com/pub/adobe/...en/SVGView.exe
bon si vous avez idée comment terminer mon diagramme dit moiiiii
merci à tous