Skip to content
Permalink
04f20711fb
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
66 lines (58 sloc) 2.56 KB
/*
* Projet :
* Package : fr.free.alexdp.violet.importexportfilters
* Auteur : a.depellegrin
* Cr�� le : 30 janv. 2008
*/
package fr.free.alexdp.violet.importexportfilters;
import java.io.OutputStream;
//tms import com.horstmann.violet.framework.display.clipboard.DiagramPanel;
//tms import com.horstmann.violet.framework.display.clipboard.DialogFactory;
//tmsimport com.horstmann.violet.framework.display.clipboard.IDiagramPanel;
import com.horstmann.violet.framework.file.ExtensionFilter;
import com.horstmann.violet.framework.file.FileChooserService;
import com.horstmann.violet.framework.file.FileSaverHandler;
import com.horstmann.violet.framework.file.FileService;
import com.horstmann.violet.framework.plugin.IDiagramPlugin;//tms, I added I in front of Diagram
import com.horstmann.violet.product.diagram.abstracts.IGraph;//tms I added I in front of Graph
//tms import com.horstmann.violet.product.diagram.abstracts.GraphService;
public class ImportExportFiltersPlugin{//tms implements DiagramPlugin {
public void start() {
}
// public IDiagramPanel diagramPanel;
/**
* Exports given diagram to xmi format.
*
* @param diagramPanel
* @param fileChooserService
*/
/* public void exportToXMI(DiagramPanel diagramPanel, FileChooserService fileChooserService)
{
if (diagramPanel == null || diagramPanel.view.getGraphPanel(diagramPanel) == null || diagramPanel.view.getGraphPanel(diagramPanel).getGraph() == null) return;
Graph graph = diagramPanel.view.getGraphPanel(diagramPanel).getGraph();
if (graph instanceof ClassDiagramGraph)
{
DialogFactory.getInstance().showErrorDialog(this.menuResourceBundle.getString("dialog.export_to_xmi.error"));
return;
}
try
{
String xmiExtension = FileService.getXMIFileExtension();
ExtensionFilter extensionFilter = FileService.getExtensionFilter(diagramPanel.view.getGraphPanel(diagramPanel).getGraph());
ExtensionFilter exportFilter = FileService.getXMIExtensionFilter();
FileSaverHandler save = fileChooserService.save(null, diagramPanel.getFilePath(), exportFilter, extensionFilter
.getExtensions()[0], xmiExtension);
OutputStream out = save.getOutputStream();
if (out != null)
{
GraphService.exportToXMI(graph, out);
out.close();
}
}
catch (Exception e)
{
// Well, we tried...
e.printStackTrace();
}
}*/
}