|
JGraph X 1.2.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mxgraph.canvas.mxBasicCanvas
com.mxgraph.canvas.mxGraphics2DCanvas
public class mxGraphics2DCanvas
An implementation of a canvas that uses Graphics2D for painting.
Field Summary | |
---|---|
protected Graphics2D |
g
Global graphics handle to the image. |
protected Hashtable<String,Image> |
imageCache
Cache for images. |
protected CellRendererPane |
rendererPane
Optional renderer pane to be used for HTML label rendering. |
Fields inherited from class com.mxgraph.canvas.mxBasicCanvas |
---|
DEFAULT_IMAGEBASEPATH, drawLabels, imageBasePath, scale, translate |
Constructor Summary | |
---|---|
mxGraphics2DCanvas()
Constructs a new graphics canvas with an empty graphics object. |
|
mxGraphics2DCanvas(Graphics2D g)
Constructs a new graphics canvas for the given graphics object. |
Method Summary | |
---|---|
protected Polygon |
createArrow(mxPoint p0,
mxPoint pe)
Creates a polygon that represents an arrow. |
protected void |
drawActor(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow)
Draws an actor shape for the given parameters. |
protected void |
drawArrow(List<mxPoint> pts,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow)
Draws the given arrow shape. |
protected void |
drawCloud(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow)
Draws a cloud shape for the given parameters. |
protected void |
drawConnector(List<mxPoint> pts,
float penWidth,
Color penColor,
Object startMarker,
float startSize,
Object endMarker,
float endSize,
boolean dashed,
boolean rounded)
Draws the given connector shape. |
protected void |
drawCylinder(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean isShadow)
Draws a cylinder for the given parameters. |
Object |
drawEdge(List<mxPoint> pts,
Map<String,Object> style)
Draws the given edge. |
protected void |
drawHexagon(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow,
String direction)
Draws a hexagon shape for the given parameters. |
protected void |
drawHtmlText(String text,
int x,
int y,
int w,
int h,
Map<String,Object> style)
Draws the specified HTML markup. |
protected void |
drawImage(int x,
int y,
int w,
int h,
String image)
Draws an image for the given parameters. |
Object |
drawLabel(String label,
int x,
int y,
int w,
int h,
Map<String,Object> style,
boolean isHtml)
Draws the given label. |
void |
drawLine(int x0,
int y0,
int x1,
int y1)
Draws the given line if the line is inside the clipping area. |
void |
drawLine(List<mxPoint> pts,
Map<String,Object> style)
Draws the given lines as segments between all points of the given list of mxPoints. |
mxPoint |
drawMarker(Object type,
mxPoint p0,
mxPoint pe,
float size,
float strokeWidth)
Draws the given type of marker. |
protected void |
drawOval(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow)
Draws an oval for the given parameters. |
protected void |
drawPath(GeneralPath path,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow)
Draws a path for the given parameters. |
protected void |
drawPlainText(String text,
int x,
int y,
int w,
int h,
Map<String,Object> style)
Draws the specified string as plain text. |
protected void |
drawPolygon(Polygon polygon,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow)
Draws a a polygon for the given parameters. |
protected void |
drawRect(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow,
boolean rounded)
Draws a rectangle for the given parameters. |
protected void |
drawRhombus(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow)
Draws a rhombus (aka. |
void |
drawShape(int x,
int y,
int w,
int h,
Map<String,Object> style)
Draws the shape specified with the STYLE_SHAPE key in the given style. |
protected void |
drawTriangle(int x,
int y,
int w,
int h,
Color fillColor,
Paint fillPaint,
Color penColor,
boolean shadow,
String direction)
Draws a triangle shape for the given parameters. |
Object |
drawVertex(int x,
int y,
int w,
int h,
Map<String,Object> style)
Draws the given vertex. |
static int |
getArcSize(int w,
int h)
Computes the arc size for the given dimension. |
protected Paint |
getFillPaint(Rectangle bounds,
Color fillColor,
Map<String,Object> style)
|
Graphics2D |
getGraphics()
Returns the graphics object for this canvas. |
protected Image |
loadImage(String image)
Returns an image instance for the given URL. |
void |
setGraphics(Graphics2D g)
Sets the graphics object for this canvas. |
Methods inherited from class com.mxgraph.canvas.mxBasicCanvas |
---|
getImageBasePath, getImageForStyle, getScale, getTranslate, isDrawLabels, setDrawLabels, setImageBasePath, setScale, setTranslate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Hashtable<String,Image> imageCache
protected CellRendererPane rendererPane
protected Graphics2D g
Constructor Detail |
---|
public mxGraphics2DCanvas()
public mxGraphics2DCanvas(Graphics2D g)
Method Detail |
---|
public Graphics2D getGraphics()
public void setGraphics(Graphics2D g)
protected Image loadImage(String image)
public Object drawVertex(int x, int y, int w, int h, Map<String,Object> style)
mxICanvas
x
- X-coordinate of the vertex.y
- Y-coordinate of the vertex.w
- Width of the vertex.h
- Height of the vertex.style
- Style of the vertex.
public Object drawEdge(List<mxPoint> pts, Map<String,Object> style)
mxICanvas
pts
- List of mxPoints that make up the edge.style
- Style of the edge.
public Object drawLabel(String label, int x, int y, int w, int h, Map<String,Object> style, boolean isHtml)
mxICanvas
label
- String that represents the label.x
- X-coordinate of the label.y
- Y-coordinate of the label.w
- Width of the label.h
- Height of the label.style
- Style of the label.isHtml
- Specifies if the label contains HTML markup.
public void drawShape(int x, int y, int w, int h, Map<String,Object> style)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.style
- Style of the the shape.protected void drawPolygon(Polygon polygon, Color fillColor, Paint fillPaint, Color penColor, boolean shadow)
polygon
- Points of the polygon.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.protected void drawPath(GeneralPath path, Color fillColor, Paint fillPaint, Color penColor, boolean shadow)
path
- Path object to be drawn.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.protected void drawRect(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean shadow, boolean rounded)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.rounded
- Boolean indicating if the rectangle is rounded.protected void drawImage(int x, int y, int w, int h, String image)
x
- X-coordinate of the image.y
- Y-coordinate of the image.w
- Width of the image.h
- Height of the image.image
- URL of the image.protected void drawOval(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean shadow)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.protected void drawRhombus(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean shadow)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.protected void drawCylinder(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean isShadow)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.isShadow
- Boolean indicating if a shadow should be painted.protected void drawActor(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean shadow)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.protected void drawCloud(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean shadow)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.protected void drawTriangle(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean shadow, String direction)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.protected void drawHexagon(int x, int y, int w, int h, Color fillColor, Paint fillPaint, Color penColor, boolean shadow, String direction)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.fillColor
- Optional fill color of the shape.fillPaint
- Optional paint of the shape.penColor
- Optional stroke color.shadow
- Boolean indicating if a shadow should be painted.public static int getArcSize(int w, int h)
w
- Width of the rectangle.h
- Height of the rectangle.
protected Polygon createArrow(mxPoint p0, mxPoint pe)
p0
- Start point of the arrow.pe
- End point of the arrow.
protected void drawArrow(List<mxPoint> pts, Color fillColor, Paint fillPaint, Color penColor, boolean shadow)
pts
- List of points that define the line.protected void drawConnector(List<mxPoint> pts, float penWidth, Color penColor, Object startMarker, float startSize, Object endMarker, float endSize, boolean dashed, boolean rounded)
pts
- List of points that define the line.protected Paint getFillPaint(Rectangle bounds, Color fillColor, Map<String,Object> style)
fillColor
- style
-
public void drawLine(List<mxPoint> pts, Map<String,Object> style)
pts
- List of points that define the line.style
- Style to be used for painting the line.public void drawLine(int x0, int y0, int x1, int y1)
public mxPoint drawMarker(Object type, mxPoint p0, mxPoint pe, float size, float strokeWidth)
type
- p0
- pe
- size
- strokeWidth
-
protected void drawHtmlText(String text, int x, int y, int w, int h, Map<String,Object> style)
text
- HTML markup to be painted.x
- X-coordinate of the text.y
- Y-coordinate of the text.w
- Width of the text.h
- Height of the text.style
- Style to be used for painting the text.protected void drawPlainText(String text, int x, int y, int w, int h, Map<String,Object> style)
text
- HTML markup to be painted.x
- X-coordinate of the text.y
- Y-coordinate of the text.w
- Width of the text.h
- Height of the text.style
- Style to be used for painting the text.
|
JGraph X 1.2.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |