24 |
24 |
import org.txm.chartsengine.rcp.IChartComponent;
|
25 |
25 |
import org.txm.chartsengine.rcp.editors.ChartEditor;
|
26 |
26 |
import org.txm.chartsengine.rcp.swt.SwingChartComposite;
|
|
27 |
import org.txm.chartsengine.svgbatik.rcp.Messages;
|
27 |
28 |
import org.txm.chartsengine.svgbatik.rcp.swing.SVGCanvas;
|
28 |
29 |
import org.txm.core.messages.TXMCoreMessages;
|
29 |
30 |
import org.txm.utils.logger.Log;
|
... | ... | |
90 |
91 |
// FIXME: SJ: we should use Batik listener system to check if the file has been well loaded
|
91 |
92 |
public void loadSVGDocument(final File file) {
|
92 |
93 |
if (file == null) {
|
93 |
|
Log.severe("SVG file doesn't exist.");
|
|
94 |
Log.severe(Messages.SVGFileDoesntExist);
|
94 |
95 |
return;
|
95 |
96 |
}
|
96 |
97 |
if (file.length() == 0) {
|
97 |
|
Log.severe(TXMCoreMessages.bind("SVG file {0} is empty.", file));
|
|
98 |
Log.severe(TXMCoreMessages.bind(Messages.SVGFileP0IsEmpty, file));
|
98 |
99 |
return;
|
99 |
100 |
}
|
100 |
101 |
|
... | ... | |
107 |
108 |
public void run() {
|
108 |
109 |
|
109 |
110 |
try {
|
110 |
|
Log.fine(TXMCoreMessages.bind("Loading SVG document from file: {0}...", file.getAbsolutePath()));
|
|
111 |
Log.fine(TXMCoreMessages.bind("Loading SVG document from file: {0}...", file.getAbsolutePath())); //$NON-NLS-1$
|
111 |
112 |
|
112 |
113 |
getSVGCanvas().loadSVGDocument(file.toURL().toExternalForm());
|
113 |
114 |
|
114 |
|
Log.fine(TXMCoreMessages.bind("File {0} loaded.", file.getAbsolutePath()));
|
|
115 |
Log.fine(TXMCoreMessages.bind("File {0} loaded.", file.getAbsolutePath())); //$NON-NLS-1$
|
115 |
116 |
|
116 |
117 |
}
|
117 |
118 |
catch (Exception e) {
|
118 |
|
Log.severe(TXMCoreMessages.bind("Can't load SVG document from file {0}.", file));
|
|
119 |
Log.severe(TXMCoreMessages.bind(Messages.CantLoadSVGDocumentFromFileP0, file));
|
119 |
120 |
Log.printStackTrace(e);
|
120 |
121 |
}
|
121 |
122 |
|
... | ... | |
147 |
148 |
|
148 |
149 |
@Override
|
149 |
150 |
public void clearChartItemsSelection() {
|
150 |
|
Log.severe("SVGChartComposite.clearChartItemsSelection(): not implemented.");
|
|
151 |
Log.severe("SVGChartComposite.clearChartItemsSelection(): not implemented."); //$NON-NLS-1$
|
151 |
152 |
}
|
152 |
153 |
|
153 |
154 |
|
... | ... | |
189 |
190 |
// ?
|
190 |
191 |
|
191 |
192 |
// Adjust dimensions from component
|
192 |
|
((Element) this.getSVGDocument().getFirstChild()).setAttribute("width", String.valueOf(this.getSVGCanvas().getWidth()));
|
193 |
|
((Element) this.getSVGDocument().getFirstChild()).setAttribute("height", String.valueOf(this.getSVGCanvas().getHeight()));
|
|
193 |
((Element) this.getSVGDocument().getFirstChild()).setAttribute("width", String.valueOf(this.getSVGCanvas().getWidth())); //$NON-NLS-1$
|
|
194 |
((Element) this.getSVGDocument().getFirstChild()).setAttribute("height", String.valueOf(this.getSVGCanvas().getHeight())); //$NON-NLS-1$
|
194 |
195 |
|
195 |
196 |
|
196 |
197 |
TranscoderInput input = new TranscoderInput(this.getSVGDocument());
|