Révision 3831

TXM/trunk/bundles/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/Messages.java (revision 3831)
1
package org.txm.chartsengine.svgbatik.rcp;
2

  
3
import org.eclipse.osgi.util.NLS;
4
import org.txm.utils.messages.Utf8NLS;
5

  
6
public class Messages extends NLS {
7
	private static final String BUNDLE_NAME = Messages.class.getPackageName() + ".messages"; //$NON-NLS-1$
8
	public static String CantLoadSVGDocumentFromFileP0;
9
	public static String SVGFileDoesntExist;
10
	public static String SVGFileP0IsEmpty;
11
	static {
12
		// initialize resource bundle
13
		Utf8NLS.initializeMessages(BUNDLE_NAME, Messages.class);
14
	}
15

  
16
	private Messages() {
17
	}
18
}
0 19

  
TXM/trunk/bundles/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGChartComposite.java (revision 3831)
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());
TXM/trunk/bundles/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/messages.properties (revision 3831)
1
CantLoadSVGDocumentFromFileP0=Can't load SVG document from file {0}.
2
SVGFileDoesntExist=SVG file doesn't exist.
3
SVGFileP0IsEmpty=SVG file {0} is empty.
0 4

  

Formats disponibles : Unified diff