JGraph X 1.3.0.0

## 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
`static java.lang.String` `DEFAULT_IMAGEBASEPATH` Defines the default value for the imageBasePath in all GDI canvases.
`protected boolean` `drawLabels` Specifies whether labels should be painted.
`protected java.lang.String` `imageBasePath` Defines the base path for images with relative paths.
`protected double` `scale` Specifies the current scale.
`protected java.awt.Point` `translate` Specifies the current translation.

Constructor Summary
`mxBasicCanvas()`

Method Summary
`java.lang.String` `getImageBasePath()`
`protected java.lang.String` `getImageForStyle(java.util.Map<java.lang.String,java.lang.Object> style)` Gets the image path from the given style.
`double` `getScale()` Returns the scale.
`java.awt.Point` `getTranslate()` Returns the current translation.
`boolean` `isDrawLabels()`
`void` `setDrawLabels(boolean drawLabels)`
`void` `setImageBasePath(java.lang.String imageBasePath)`
`void` `setScale(double scale)` Sets the scale for the following drawing requests.
`void` `setTranslate(int dx, int dy)` Sets the translation for the following drawing requests.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.mxgraph.canvas.mxICanvas
`drawEdge, drawLabel, drawVertex`

Field Detail

### 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.

### imageBasePath

    protected java.lang.String imageBasePath

  Defines the base path for images with relative paths. Trailing slash is required. Default value is DEFAULT_IMAGEBASEPATH.

### translate

    protected java.awt.Point translate

  Specifies the current translation. Default is (0,0).

### scale

    protected double scale

  Specifies the current scale. Default is 1.

### drawLabels

    protected boolean drawLabels

  Specifies whether labels should be painted. Default is true.

Constructor Detail

### mxBasicCanvas

    public mxBasicCanvas()

Method Detail

### setTranslate

    public void setTranslate(int dx,
                             int dy)

  Description copied from interface: `mxICanvas`
  Sets the translation for the following drawing requests.

  Specified by:
    `setTranslate` in interface `mxICanvas`

### getTranslate

    public java.awt.Point getTranslate()

  Description copied from interface: `mxICanvas`
  Returns the current translation.

  Specified by:
    `getTranslate` in interface `mxICanvas`
  Returns:
    Returns the current translation.

### setScale

    public void setScale(double scale)

  Description copied from interface: `mxICanvas`
  Sets the scale for the following drawing requests.

  Specified by:
    `setScale` in interface `mxICanvas`

### getScale

    public double getScale()

  Description copied from interface: `mxICanvas`
  Returns the scale.

  Specified by:
    `getScale` in interface `mxICanvas`

### setDrawLabels

    public void setDrawLabels(boolean drawLabels)

### getImageBasePath

    public java.lang.String getImageBasePath()

### setImageBasePath

    public void setImageBasePath(java.lang.String imageBasePath)

### isDrawLabels

    public boolean isDrawLabels()

### getImageForStyle

    protected 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.

JGraph X 1.3.0.0

Copyright (c) 2008 Gaudenz Alder. All rights reserved.