JGraph X 1.2.0.8


com.mxgraph.canvas
Interface mxICanvas

All Known Implementing Classes:
mxBasicCanvas, mxGraphics2DCanvas, mxHtmlCanvas, mxImageCanvas, mxInteractiveCanvas, mxSvgCanvas, mxVmlCanvas

public interface mxICanvas

Defines the requirements for a canvas that paints the vertices and edges of a graph.


Method Summary
 Object drawEdge(List<mxPoint> pts, Map<String,Object> style)
          Draws the given edge.
 Object drawLabel(String label, int x, int y, int width, int height, Map<String,Object> style, boolean isHtml)
          Draws the given label.
 Object drawVertex(int x, int y, int width, int height, Map<String,Object> style)
          Draws the given vertex.
 double getScale()
          Returns the scale.
 Point getTranslate()
          Returns the current translation.
 void setScale(double scale)
          Sets the scale for the following drawing requests.
 void setTranslate(int x, int y)
          Sets the translation for the following drawing requests.
 

Method Detail

setTranslate

void setTranslate(int x,
                  int y)
Sets the translation for the following drawing requests.


getTranslate

Point getTranslate()
Returns the current translation.

Returns:
Returns the current translation.

setScale

void setScale(double scale)
Sets the scale for the following drawing requests.


getScale

double getScale()
Returns the scale.


drawVertex

Object drawVertex(int x,
                  int y,
                  int width,
                  int height,
                  Map<String,Object> style)
Draws the given vertex.

Parameters:
x - X-coordinate of the vertex.
y - Y-coordinate of the vertex.
width - Width of the vertex.
height - Height of the vertex.
style - Style of the vertex.
Returns:
Optional object that represents the vertex.

drawEdge

Object drawEdge(List<mxPoint> pts,
                Map<String,Object> style)
Draws the given edge.

Parameters:
pts - List of mxPoints that make up the edge.
style - Style of the edge.
Returns:
Optional object that represents the edge.

drawLabel

Object drawLabel(String label,
                 int x,
                 int y,
                 int width,
                 int height,
                 Map<String,Object> style,
                 boolean isHtml)
Draws the given label.

Parameters:
label - String that represents the label.
x - X-coordinate of the label.
y - Y-coordinate of the label.
width - Width of the label.
height - Height of the label.
style - Style of the label.
isHtml - Specifies if the label contains HTML markup.
Returns:
Optional object that represents the label.

JGraph X 1.2.0.8


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