use of org.cytoscape.graph.render.immed.GraphGraphics in project cytoscape-impl by cytoscape.
the class InnerCanvas method setBounds.
@Override
public void setBounds(int x, int y, int width, int height) {
super.setBounds(x, y, width, height);
if ((width > 0) && (height > 0)) {
final Image img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
GraphGraphics grafx = new GraphGraphics(img, false, true);
synchronized (m_lock) {
m_grafx = grafx;
if (m_view != null)
m_view.setViewportChanged();
}
}
}
use of org.cytoscape.graph.render.immed.GraphGraphics in project cytoscape-impl by cytoscape.
the class GraphRendererTest method setUp.
public void setUp() {
Image img = new BufferedImage(500, 500, BufferedImage.TYPE_INT_ARGB);
grafx = new GraphGraphics(img, false, true);
}
use of org.cytoscape.graph.render.immed.GraphGraphics in project cytoscape-impl by cytoscape.
the class DGraphView method drawSnapshot.
/**
* This method is called by the BirdsEyeView to get a snapshot of the graphics.
*/
// TODO: Need to fix up scaling and sizing.
public void drawSnapshot(VolatileImage img, GraphLOD lod, Paint bgPaint, double xMin, double yMin, double xCenter, double yCenter, double scaleFactor) {
// First paint the background
m_backgroundCanvas.drawCanvas(img, xMin, yMin, xCenter, yCenter, scaleFactor);
// final VisualMappingManager vmm = serviceRegistrar.getService(VisualMappingManager.class);
final Set<VisualPropertyDependency<?>> dependencies = vmm.getVisualStyle(this).getAllVisualPropertyDependencies();
// synchronized (m_lock) {
try {
// System.out.println("Calling renderGraph to draw snapshot: bgPaint="+bgPaint);
GraphRenderer.renderGraph(this, dummySpacialFactory.createSpacialIndex2D(), lod, m_nodeDetails, m_edgeDetails, new LongHash(), new GraphGraphics(img, false, false), bgPaint, xCenter, yCenter, scaleFactor, haveZOrder, dependencies);
} catch (Exception e) {
// We probably had a node or edge view removed out from underneath us. Just quietly return, but
// set content changed so we redraw again
setContentChanged();
}
// }
// Finally, draw the foreground
m_foregroundCanvas.drawCanvas(img, xMin, yMin, xCenter, yCenter, scaleFactor);
}
use of org.cytoscape.graph.render.immed.GraphGraphics in project cytoscape-impl by cytoscape.
the class InnerCanvas method printNoImposter.
@Override
public void printNoImposter(Graphics g) {
isPrinting = true;
final Image img = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
if (m_view != null)
renderGraph(new GraphGraphics(img, false, false), /* setLastRenderDetail = */
false, m_view.m_printLOD);
isPrinting = false;
}
use of org.cytoscape.graph.render.immed.GraphGraphics in project cytoscape-impl by cytoscape.
the class InnerCanvas method print.
@Override
public void print(Graphics g) {
isPrinting = true;
final int w = getWidth();
final int h = getHeight();
if (m_view != null && w > 0 && h > 0)
renderGraph(new GraphGraphics(new ImageImposter(g, w, h), /* debug = */
false, /* clear = */
false), /* setLastRenderDetail = */
false, m_view.m_printLOD);
isPrinting = false;
}
Aggregations