是否可以在Eclipse RCP中開發的應用程序中使用所有Batik組件? 您能否指點我相關文件。一起使用Eclipse RCP和Apache Batik
3
A
回答
1
在eclipse RCP應用程序中可以使用蠟染,因爲e4使用CSS引擎。請參閱http://www.eclipse.org/orbit瞭解最新的穩定版本,其中包含許多蠟染包。當然,在我們的RCP應用程序,我們使用以下一些+支持W3C包:
org.apache.batik.css_1.6.0.v201011041432.jar
org.apache.batik.util_1.6.0.v201011041432.jar
org.apache.batik.util.gui_1.6.0.v201011041432.jar
org.apache.batik.xml_1.6.0.v201011041432.jar
3
看一看下面的鏈接:
- http://sourceforge.net/projects/svgplugin/
- 您也可以使用
SWT/AWT Bridge
。見SWT Snippet Page.
>> SWT/AWT & Batik Sample Code
import java.awt.BorderLayout;
import java.io.File;
import java.io.IOException;
import javax.swing.JComponent;
import javax.swing.JPanel;
import org.apache.batik.swing.JSVGCanvas;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class BatikTest
{
public static void main(String[] args)
{
// Uncomment the below lines and set proper values if you are behind a proxy server
///System.setProperty("http.proxyHost", "");
///System.setProperty("http.proxyPort", "");
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setSize(200, 120);
shell.setText("SWT Batik Example");
shell.setLayout(new GridLayout());
shell.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
Composite composite = new Composite(shell, SWT.EMBEDDED);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
java.awt.Frame locationFrame = SWT_AWT.new_Frame(composite);
locationFrame.add(createComponents(new File("batik3D.svg")));
locationFrame.pack();
//shell.pack();
shell.open();
while(!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
private static JComponent createComponents(File f)
{
// Create a panel and add the button, status label and the SVG canvas.
final JPanel panel = new JPanel(new BorderLayout());
JSVGCanvas svgCanvas = new JSVGCanvas();
panel.add("Center", svgCanvas);
try {
svgCanvas.setURI(f.toURI().toURL().toString());
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return panel;
}
}
>>Output
相關問題
- 1. Apache Batik Text Wrapped SVG
- 2. Eclipse RCP和Eclipse插件
- 3. Eclipse RCP和使用org.eclipse.ui.activities來過濾UI
- 4. Eclipse RCP,RMI和Bundle
- 5. Eclipse RCP p2更新不起作用
- 6. 開始使用Eclipse RCP
- 7. 在RCP中使用Eclipse Papyrus
- 8. Netbeans RCP vs Eclipse RCP
- 9. Datanucleus 2.x和Eclipse RCP 3.4
- 10. 學習Eclipse RCP和SWT/JFace
- 11. 對於Eclipse插件和RCP
- 12. Eclipse RCP術語和概念
- 13. Lift和Eclipse RCP集成
- 14. 如何使用Apache Batik將一個SVG圖像疊加到另一個上?
- 15. 用Apache Batik繪製一個SVG Path元素
- 16. RCP應用程序和進度視圖在Eclipse RCP
- 17. 使用OSGi Eclipse RCP應用程序
- 18. Eclipse RCP + Spring Security
- 19. HOWTO在Eclipse RCP
- 20. eclipse Web RCP
- 21. Eclipse RCP與JFreeChart
- 22. Eclipse RCP AspectJ configure
- 23. Eclipse RCP問題
- 24. Eclipse RCP Databinding
- 25. 在Eclipse RCP中使用Spring 3.x AnnotationConfigApplicationContext
- 26. Eclipse RCP和遍歷透視和視圖
- 27. 使用Batik書寫unicode字符不起作用
- 28. Eclipse RCP的禁用EditorReference/IEditorPart
- 29. 使用Eclipse,GlassFish和Apache CXF的異常
- 30. 使用Eclipse Classic開發Eclipse RCP應用程序