Package kiyut.sketsa.canvas
Class CanvasModel
- java.lang.Object
-
- kiyut.sketsa.canvas.CanvasModel
-
public class CanvasModel extends Object
Canvas Model for VectorCanvas- Author:
- KIYUT
-
-
Constructor Summary
Constructors Constructor Description CanvasModel(VectorCanvas canvas)Creates a new instance of CanvasModel
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidappendChild(Element element)Convenience method to addElementto the Document Rootvoiddispose()Disposeorg.apache.batik.bridge.SVGAnimationEnginegetAnimationEngine()Returns theSVGAnimationEnginefor the document or null.org.w3c.dom.svg.SVGDocumentgetBrokenLinkDocument(Element e, String url, String message)Return SVG that show broken link.
Adapted from Batik CodeEditorUserAgentgetEditorUserAgent()ReturnEditorUserAgentorg.apache.batik.gvt.GraphicsNodegetGraphicsNode(org.w3c.dom.svg.SVGElement svgElement)GetGraphicsNodeof specified element ornullorg.apache.batik.gvt.GraphicsNodegetRoot()Returns the root graphics node.org.w3c.dom.svg.SVGDocumentgetSVGDocument()ReturnSVGDocumentorg.w3c.dom.svg.SVGElementgetSVGElement(org.apache.batik.gvt.GraphicsNode graphicsNode)Get SVGElement of specifiedGraphicsNodeornulldoublegetSVGHeight()Return SVG heightStringgetSVGNameSpace()Deprecated.replaced bySVGConstants.SVG_NAMESPACE_URIorg.w3c.dom.svg.SVGSVGElementgetSVGSVGElement()ReturnSVGSVGElementdoublegetSVGWidth()Return SVG widthvoidsetSVGDocument(org.w3c.dom.svg.SVGDocument doc)SetSVGDocument
-
-
-
Constructor Detail
-
CanvasModel
public CanvasModel(VectorCanvas canvas)
Creates a new instance of CanvasModel- Parameters:
canvas- The VectorCanvas
-
-
Method Detail
-
dispose
public void dispose()
Dispose
-
setSVGDocument
public void setSVGDocument(org.w3c.dom.svg.SVGDocument doc)
SetSVGDocument- Parameters:
doc-SVGDocument
-
getSVGDocument
public org.w3c.dom.svg.SVGDocument getSVGDocument()
ReturnSVGDocument- Returns:
SVGDocument
-
getEditorUserAgent
public EditorUserAgent getEditorUserAgent()
ReturnEditorUserAgent- Returns:
EditorUserAgent
-
getAnimationEngine
public org.apache.batik.bridge.SVGAnimationEngine getAnimationEngine()
Returns theSVGAnimationEnginefor the document or null.- Returns:
SVGAnimationEngineor null
-
getRoot
public org.apache.batik.gvt.GraphicsNode getRoot()
Returns the root graphics node.- Returns:
- root graphics node
-
getSVGNameSpace
@Deprecated public String getSVGNameSpace()
Deprecated.replaced bySVGConstants.SVG_NAMESPACE_URIReturns the SVG namespace- Returns:
- SVG namespace String
-
getSVGSVGElement
public org.w3c.dom.svg.SVGSVGElement getSVGSVGElement()
ReturnSVGSVGElement- Returns:
SVGSVGElement
-
getSVGWidth
public double getSVGWidth()
Return SVG width- Returns:
- SVG width
-
getSVGHeight
public double getSVGHeight()
Return SVG height- Returns:
- SVG height
-
appendChild
public void appendChild(Element element)
Convenience method to addElementto the Document Root- Parameters:
element-Element
-
getSVGElement
public org.w3c.dom.svg.SVGElement getSVGElement(org.apache.batik.gvt.GraphicsNode graphicsNode)
Get SVGElement of specifiedGraphicsNodeornull- Parameters:
graphicsNode- theGraphicsNodeassociated with theSVGElementto return- Returns:
SVGElementornull
-
getGraphicsNode
public org.apache.batik.gvt.GraphicsNode getGraphicsNode(org.w3c.dom.svg.SVGElement svgElement)
GetGraphicsNodeof specified element ornull- Parameters:
svgElement- theSVGElementassociated withGraphicsNodeto return- Returns:
GraphicsNodeornull
-
getBrokenLinkDocument
public org.w3c.dom.svg.SVGDocument getBrokenLinkDocument(Element e, String url, String message)
Return SVG that show broken link.
Adapted from Batik Code- Parameters:
e- The <image> element that can't be loaded.url- The resolved url that can't be loaded.message- As best as can be determined the reason it can't be loaded (not available, corrupt, unknown format,...).- Returns:
- SVG that show broken link
-
-