|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty.view.GraphicsContext
public class GraphicsContext
Provides additional context information to implementations during painting and rendering.
An instance of this class can be obtained from the Graphics2D
context
that is passed to the various paint(Graphics2D g)
methods spread throughout
the library that work in the context of rendering the contents of a Graph2DView
.
The view will create the context instance
and register
it with the graphics object using the YRenderingHints.GRAPHICS_CONTEXT_KEY
.
This instance can then be retrieved via the key or the YRenderingHints.getGraphicsContext(java.awt.Graphics2D)
convenience method.
Graph2DView.createGraphicsContext()
,
YRenderingHints.GRAPHICS_CONTEXT_KEY
Constructor Summary | |
---|---|
GraphicsContext()
|
Method Summary | |
---|---|
Graph2DView |
getGraph2DView()
Yields the view that is currently being painted on. |
java.awt.geom.AffineTransform |
getViewTransform()
Yields the transform that can be set on the graphics object to paint in the view coordinate system. |
boolean |
isExportPainting()
Indicates whether the current painting process is used to export the graphics. |
boolean |
isPrinting()
Indicates whether the current graphics should use printing quality. |
void |
setExportPainting(boolean exportPainting)
Indicates whether the current painting process is used to export the graphics. |
void |
setGraph2DView(Graph2DView graph2DView)
Sets the view for retrieval in getGraph2DView() . |
void |
setPrinting(boolean printing)
Indicates whether the current graphics should use printing quality. |
void |
setViewTransform(java.awt.geom.AffineTransform viewTransform)
Sets the value of the view transform for retrieval in getViewTransform() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GraphicsContext()
Method Detail |
---|
public java.awt.geom.AffineTransform getViewTransform()
set
on the
graphics object to paint in view coordinates.setViewTransform(java.awt.geom.AffineTransform)
public void setViewTransform(java.awt.geom.AffineTransform viewTransform)
getViewTransform()
.
Normally you don't have to call this method, the view will populate the property initially.
viewTransform
- the new transform.public Graph2DView getGraph2DView()
public void setGraph2DView(Graph2DView graph2DView)
getGraph2DView()
.
Normally you don't have to call this method, the view will populate the property initially.
graph2DView
- the new view.public void setPrinting(boolean printing)
true
by the graph view if Graph2DView.print(java.awt.Graphics)
is called. However client code could set this property to other values if desired.
printing
- whether the rendering should be of print quality.public boolean isPrinting()
public boolean isExportPainting()
public void setExportPainting(boolean exportPainting)
false
.
exportPainting
- Whether the current painting is done for exporting purposes.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |