com.mxgraph.reader
Class mxGraphViewImageReader
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.mxgraph.reader.mxGraphViewReader
-
- com.mxgraph.reader.mxGraphViewImageReader
-
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class mxGraphViewImageReader extends mxGraphViewReader
A converter that renders display XML data onto a graphics canvas. This reader can only be used to generate images for encoded graph views.
-
-
Constructor Summary
Constructors Constructor and Description mxGraphViewImageReader()Constructs a new reader with a transparent background.mxGraphViewImageReader(java.awt.Color background)Constructs a new reader with the given background color.mxGraphViewImageReader(java.awt.Color background, int border)Constructs a new reader with a transparent background.mxGraphViewImageReader(java.awt.Color background, int border, boolean antiAlias)Constructs a new reader with a transparent background.mxGraphViewImageReader(java.awt.Color background, int border, boolean antiAlias, boolean cropping)Constructs a new reader with a transparent background.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.awt.image.BufferedImageconvert(org.xml.sax.InputSource inputSource, mxGraphViewImageReader viewReader)Creates the image for the given display XML input source.static java.awt.image.BufferedImageconvert(java.lang.String filename, mxGraphViewImageReader viewReader)Creates the image for the given display XML file.mxICanvascreateCanvas(java.util.Map<java.lang.String,java.lang.Object> attrs)Returns the canvas to be used for rendering.java.awt.ColorgetBackground()intgetBorder()mxRectanglegetClip()booleanisAntiAlias()booleanisCropping()Specifies the optional clipping rectangle.voidsetAntiAlias(boolean antiAlias)voidsetBackground(java.awt.Color background)voidsetBorder(int border)voidsetClip(mxRectangle value)voidsetCropping(boolean value)-
Methods inherited from class com.mxgraph.reader.mxGraphViewReader
getCanvas, isHtmlLabels, parseElement, parsePoints, parseState, setHtmlLabels, startElement
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
mxGraphViewImageReader
public mxGraphViewImageReader()
Constructs a new reader with a transparent background.
-
mxGraphViewImageReader
public mxGraphViewImageReader(java.awt.Color background)
Constructs a new reader with the given background color.
-
mxGraphViewImageReader
public mxGraphViewImageReader(java.awt.Color background, int border)Constructs a new reader with a transparent background.
-
mxGraphViewImageReader
public mxGraphViewImageReader(java.awt.Color background, int border, boolean antiAlias)Constructs a new reader with a transparent background.
-
mxGraphViewImageReader
public mxGraphViewImageReader(java.awt.Color background, int border, boolean antiAlias, boolean cropping)Constructs a new reader with a transparent background.
-
-
Method Detail
-
getBackground
public java.awt.Color getBackground()
-
setBackground
public void setBackground(java.awt.Color background)
-
getBorder
public int getBorder()
-
setBorder
public void setBorder(int border)
-
isAntiAlias
public boolean isAntiAlias()
-
setAntiAlias
public void setAntiAlias(boolean antiAlias)
-
isCropping
public boolean isCropping()
Specifies the optional clipping rectangle.
-
setCropping
public void setCropping(boolean value)
-
getClip
public mxRectangle getClip()
-
setClip
public void setClip(mxRectangle value)
-
createCanvas
public mxICanvas createCanvas(java.util.Map<java.lang.String,java.lang.Object> attrs)
Description copied from class:mxGraphViewReaderReturns the canvas to be used for rendering.- Specified by:
createCanvasin classmxGraphViewReader- Parameters:
attrs- Specifies the attributes of the new canvas.- Returns:
- Returns a new canvas.
-
convert
public static java.awt.image.BufferedImage convert(java.lang.String filename, mxGraphViewImageReader viewReader) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOExceptionCreates the image for the given display XML file. (Note: The XML file is an encoded mxGraphView, not mxGraphModel.)- Parameters:
filename- Filename of the display XML file.- Returns:
- Returns an image representing the display XML file.
- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOException
-
convert
public static java.awt.image.BufferedImage convert(org.xml.sax.InputSource inputSource, mxGraphViewImageReader viewReader) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOExceptionCreates the image for the given display XML input source. (Note: The XML is an encoded mxGraphView, not mxGraphModel.)- Parameters:
inputSource- Input source that contains the display XML.- Returns:
- Returns an image representing the display XML input source.
- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG