| 
 | JGraph X 1.4.1.0 | |||||||||
| 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 | gGlobal graphics handle to the image. | 
| protected  Hashtable<String,Image> | imageCacheCache for images. | 
| protected  CellRendererPane | rendererPaneOptional renderer pane to be used for HTML label rendering. | 
| protected  boolean | replaceHtmlLinefeedsSpecifies if linefeeds should be replaced with breaks in HTML markup. | 
| protected static Map<String,mxIShape> | shapesMaps from names to mxIVertexShape instances. | 
| static String | TEXT_SHAPE_DEFAULT | 
| static String | TEXT_SHAPE_HTML | 
| protected static Map<String,mxITextShape> | textShapesMaps from names to mxITextShape instances. | 
| 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 | |
|---|---|
|  Paint | createFillPaint(mxRectangle bounds,
                Map<String,Object> style) | 
|  Stroke | createStroke(Map<String,Object> style) | 
|  Graphics2D | createTemporaryGraphics(Map<String,Object> style,
                        float opacity,
                        mxRectangle bounds) | 
|  Object | drawCell(mxCellState state)Draws the given cell. | 
|  void | drawImage(Rectangle bounds,
          String imageUrl) | 
|  Object | drawLabel(String text,
          mxCellState state,
          boolean html)Draws the given label. | 
|  void | fillShape(Shape shape) | 
|  void | fillShape(Shape shape,
          boolean shadow) | 
|  void | flushImageCache() | 
|  Graphics2D | getGraphics()Returns the graphics object for this canvas. | 
|  CellRendererPane | getRendererPane() | 
|  mxIShape | getShape(Map<String,Object> style) | 
|  mxITextShape | getTextShape(Map<String,Object> style,
             boolean html) | 
|  boolean | isReplaceHtmlLinefeeds()Returns replaceHtmlLinefeeds | 
|  Image | loadImage(String image)Returns an image instance for the given URL. | 
|  void | paintPolyline(mxPoint[] points,
              boolean rounded) | 
|  void | paintRectangle(Rectangle bounds,
               Color background,
               Color border) | 
| static void | putShape(String name,
         mxIShape shape) | 
| static void | putTextShape(String name,
             mxITextShape shape) | 
|  void | setGraphics(Graphics2D g)Sets the graphics object for this canvas. | 
|  void | setReplaceHtmlLinefeeds(boolean value)Returns replaceHtmlLinefeeds | 
| 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 | 
|---|
public static final String TEXT_SHAPE_DEFAULT
public static final String TEXT_SHAPE_HTML
protected static Map<String,mxIShape> shapes
protected static Map<String,mxITextShape> textShapes
protected Hashtable<String,Image> imageCache
protected boolean replaceHtmlLinefeeds
protected CellRendererPane rendererPane
protected Graphics2D g
| Constructor Detail | 
|---|
public mxGraphics2DCanvas()
public mxGraphics2DCanvas(Graphics2D g)
| Method Detail | 
|---|
public static void putShape(String name,
                            mxIShape shape)
public mxIShape getShape(Map<String,Object> style)
public static void putTextShape(String name,
                                mxITextShape shape)
public mxITextShape getTextShape(Map<String,Object> style,
                                 boolean html)
public CellRendererPane getRendererPane()
public boolean isReplaceHtmlLinefeeds()
public void setReplaceHtmlLinefeeds(boolean value)
public Graphics2D getGraphics()
public void setGraphics(Graphics2D g)
public Object drawCell(mxCellState state)
mxICanvas
state - State of the cell to be painted.
public Object drawLabel(String text,
                        mxCellState state,
                        boolean html)
mxICanvas
text - String that represents the label.state - State of the cell whose label is to be painted.html - Specifies if the label contains HTML markup.
public Image loadImage(String image)
public void flushImageCache()
public void drawImage(Rectangle bounds,
                      String imageUrl)
public void paintPolyline(mxPoint[] points,
                          boolean rounded)
public void paintRectangle(Rectangle bounds,
                           Color background,
                           Color border)
public void fillShape(Shape shape)
public void fillShape(Shape shape,
                      boolean shadow)
public Stroke createStroke(Map<String,Object> style)
public Paint createFillPaint(mxRectangle bounds,
                             Map<String,Object> style)
public Graphics2D createTemporaryGraphics(Map<String,Object> style,
                                          float opacity,
                                          mxRectangle bounds)
| 
 | JGraph X 1.4.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||