本文整理汇总了Java中org.apache.batik.swing.JSVGCanvas.setSVGDocument方法的典型用法代码示例。如果您正苦于以下问题:Java JSVGCanvas.setSVGDocument方法的具体用法?Java JSVGCanvas.setSVGDocument怎么用?Java JSVGCanvas.setSVGDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.batik.swing.JSVGCanvas
的用法示例。
在下文中一共展示了JSVGCanvas.setSVGDocument方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NotationComposite
import org.apache.batik.swing.JSVGCanvas; //导入方法依赖的package包/类
public NotationComposite(Composite parent, SVGDocument initImage) {
super(parent, SWT.EMBEDDED);
canvas = new JSVGCanvas();
canvas.setSVGDocument(initImage);
canvas.setLayout(new BorderLayout());
frame = SWT_AWT.new_Frame(this);
Panel panel = new Panel();
JRootPane rootPane = new JRootPane();
panel.add(rootPane);
java.awt.Container contentPane = rootPane.getContentPane();
contentPane.setLayout(new BorderLayout());
contentPane.add(BorderLayout.CENTER, new JScrollPane(canvas));
frame.setLayout(new BorderLayout());
frame.add(BorderLayout.CENTER, panel);
frame.setEnabled(true);
}
示例2: noViewDemo
import org.apache.batik.swing.JSVGCanvas; //导入方法依赖的package包/类
private static void noViewDemo() {
JFrame frame = new JFrame("Svg Awt Demo");
frame.setLayout(new BorderLayout());
JSVGCanvas svgCanvas = new JSVGCanvas();
svgCanvas.setDocumentState(AbstractJSVGComponent.ALWAYS_DYNAMIC);
final SvgSvgElement svgRoot = DemoModel.createModel();
SvgRootDocumentMapper mapper = new SvgRootDocumentMapper(svgRoot);
mapper.attachRoot();
svgCanvas.setSVGDocument(mapper.getTarget());
svgCanvas.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
DemoModel.addCircle(svgRoot, e.getX(), e.getY());
}
});
frame.add(svgCanvas);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setSize(800, 600);
frame.setVisible(true);
}
示例3: display
import org.apache.batik.swing.JSVGCanvas; //导入方法依赖的package包/类
public void display() {
SVGDocument doc = this.getSvgDoc();
JSVGCanvas canvas = new JSVGCanvas();
org.w3c.dom.Element root = doc.getDocumentElement();
this.getRoot(root);
JFrame f = new JFrame();
f.getContentPane().add(canvas);
canvas.setSVGDocument(doc);
f.pack();
f.setVisible(true);
//f.dispose();
}