Gephi Toolkit Javadoc

org.gephi.preview.api
Interface ProcessingTarget

All Superinterfaces:
RenderTarget
All Known Implementing Classes:
ProcessingRenderTargetBuilder.ProcessingTargetImpl

public interface ProcessingTarget
extends RenderTarget

Rendering target to the Processing library.

Processing is using a Java2D mode so the underlying Processing object used is a PGraphicsJava2D object.

This render target supports two modes: applet or headless. The applet mode is what is used in Gephi GUI and is backed by a PApplet with zoom and pan control. The headless mode is tuned to work without GUI and is typically used in exports. Either way users should use getGraphics() method for drawing.

How to create a headless Processing canvas?

Before creating a processing target with the PreviewController.getRenderTarget(java.lang.String) method users should define a width and height property in the PreviewProperties:
 PreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);
 PreviewModel model = previewController.getModel();
 PreviewProperties props = model.getProperties();
 props.putValue("width", 800);
 props.putValue("height", 600);
 ProcessingTarget target = (ProcessingTarget)previewController.getRenderTarget(RenderTarget.PROCESSING_TARGET);
 

Author:
Mathieu Bastian

Field Summary
 
Fields inherited from interface org.gephi.preview.api.RenderTarget
PDF_TARGET, PROCESSING_TARGET, SVG_TARGET
 
Method Summary
 PApplet getApplet()
          Returns the current applet if the mode is set to applet.
 PGraphics getGraphics()
          Returns the current graphics object.
 boolean isRedrawn()
          Returns true if the applet is finished redrawing
 void refresh()
          Redraw the Processing canvas
 void resetZoom()
          Resets the zoom level to default
 void zoomMinus()
          Zooms out
 void zoomPlus()
          Zooms in
 

Method Detail

getGraphics

PGraphics getGraphics()
Returns the current graphics object. Use this method to draw to Processing. The PGRraphics object can be cast to PGraphicsJava2D.

Returns:
the current graphics to draw to

getApplet

PApplet getApplet()
Returns the current applet if the mode is set to applet. If in headless mode returns null. Always use getGraphics() for drawing.

Returns:
the current applet or null if in headless mode

resetZoom

void resetZoom()
Resets the zoom level to default


zoomPlus

void zoomPlus()
Zooms in


zoomMinus

void zoomMinus()
Zooms out


refresh

void refresh()
Redraw the Processing canvas


isRedrawn

boolean isRedrawn()
Returns true if the applet is finished redrawing

Returns:
true if the applet is redrawn, false otherwise

Gephi Toolkit Javadoc