com.mxgraph.canvas
Class mxBasicCanvas
- java.lang.Object
-
- com.mxgraph.canvas.mxBasicCanvas
-
- All Implemented Interfaces:
- mxICanvas
- Direct Known Subclasses:
- mxGraphics2DCanvas, mxHtmlCanvas, mxSvgCanvas, mxVmlCanvas
public abstract class mxBasicCanvas extends java.lang.Object implements mxICanvas
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringDEFAULT_IMAGEBASEPATHDefines the default value for the imageBasePath in all GDI canvases.static booleanPRESERVE_IMAGE_ASPECTSpecifies if image aspect should be preserved in drawImage.
-
Constructor Summary
Constructors Constructor and Description mxBasicCanvas()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidflushImageCache()java.lang.StringgetImageBasePath()java.lang.StringgetImageForStyle(java.util.Map<java.lang.String,java.lang.Object> style)Gets the image path from the given style.doublegetScale()Returns the scale.mxPointgetTranslate()Returns the current translate.booleanisDrawLabels()java.awt.image.BufferedImageloadImage(java.lang.String image)Returns an image instance for the given URL.voidsetDrawLabels(boolean drawLabels)voidsetImageBasePath(java.lang.String imageBasePath)voidsetScale(double scale)Sets the scale for the following drawing requests.voidsetTranslate(double dx, double dy)Sets the current translate.
-
-
-
Field Detail
-
PRESERVE_IMAGE_ASPECT
public static boolean PRESERVE_IMAGE_ASPECT
Specifies if image aspect should be preserved in drawImage. Default is true.
-
DEFAULT_IMAGEBASEPATH
public static java.lang.String DEFAULT_IMAGEBASEPATH
Defines the default value for the imageBasePath in all GDI canvases. Default is an empty string.
-
-
Method Detail
-
setTranslate
public void setTranslate(double dx, double dy)Sets the current translate.- Specified by:
setTranslatein interfacemxICanvas
-
getTranslate
public mxPoint getTranslate()
Returns the current translate.- Specified by:
getTranslatein interfacemxICanvas- Returns:
- Returns the current translation.
-
setScale
public void setScale(double scale)
Description copied from interface:mxICanvasSets the scale for the following drawing requests.
-
getScale
public double getScale()
Description copied from interface:mxICanvasReturns the scale.
-
setDrawLabels
public void setDrawLabels(boolean drawLabels)
-
getImageBasePath
public java.lang.String getImageBasePath()
-
setImageBasePath
public void setImageBasePath(java.lang.String imageBasePath)
-
isDrawLabels
public boolean isDrawLabels()
-
loadImage
public java.awt.image.BufferedImage loadImage(java.lang.String image)
Returns an image instance for the given URL. If the URL has been loaded before than an instance of the same instance is returned as in the previous call.
-
flushImageCache
public void flushImageCache()
-
getImageForStyle
public java.lang.String getImageForStyle(java.util.Map<java.lang.String,java.lang.Object> style)
Gets the image path from the given style. If the path is relative (does not start with a slash) then it is appended to the imageBasePath.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG