Gephi Toolkit Javadoc

org.gephi.preview
Class PreviewControllerImpl

java.lang.Object
  extended by org.gephi.preview.PreviewControllerImpl
All Implemented Interfaces:
PreviewController

public class PreviewControllerImpl
extends java.lang.Object
implements PreviewController

Author:
Mathieu Bastian

Constructor Summary
PreviewControllerImpl()
           
 
Method Summary
 PreviewModelImpl getModel()
          Returns the current preview model in the current workspace.
 PreviewModelImpl getModel(Workspace workspace)
          Returns the preview model in workspace.
 Renderer[] getRegisteredRenderers()
          Uses Lookup to retrieve registered renderer providers but replaces default renderers with plugins that extend them.
 RenderTarget getRenderTarget(java.lang.String name)
          Creates a new render target of the given type.
 RenderTarget getRenderTarget(java.lang.String name, Workspace workspace)
          Creates a new render target of the given type in the preview model contained by workspace.
 boolean isAnyPluginRendererRegistered()
          Returns true if any renderer plugin is registered.
 void refreshPreview()
          Refreshes the current preview model.
 void refreshPreview(Workspace workspace)
          Refreshes the preview model in workspace.
 void render(RenderTarget target)
          Renders the current preview model to target.
 void render(RenderTarget target, Renderer[] renderers)
          Renders the current preview model to target.
 void render(RenderTarget target, Renderer[] renderers, Workspace workspace)
          Renders the preview model in workspace to target.
 void render(RenderTarget target, Workspace workspace)
          Renders the preview model in workspace to target.
 void updateDimensions(PreviewModelImpl model, Item[] nodeItems)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreviewControllerImpl

public PreviewControllerImpl()
Method Detail

refreshPreview

public void refreshPreview()
Description copied from interface: PreviewController
Refreshes the current preview model.

This task built all items from ItemBuilder implementations, refresh graph dimensions and call all Renderer.preProcess() method.

Specified by:
refreshPreview in interface PreviewController

refreshPreview

public void refreshPreview(Workspace workspace)
Description copied from interface: PreviewController
Refreshes the preview model in workspace.

This task built all items from ItemBuilder implementations, refresh graph dimensions and call all Renderer.preProcess() method.

Specified by:
refreshPreview in interface PreviewController
Parameters:
workspace - the workspace to get the preview model from

updateDimensions

public void updateDimensions(PreviewModelImpl model,
                             Item[] nodeItems)

render

public void render(RenderTarget target)
Description copied from interface: PreviewController
Renders the current preview model to target.

If preview model managedRenderers is null, this task looks for all Renderer implementations in their default order. Then all items in the preview model are rendered.

Specified by:
render in interface PreviewController
Parameters:
target - the target to render items to

render

public void render(RenderTarget target,
                   Workspace workspace)
Description copied from interface: PreviewController
Renders the preview model in workspace to target.

If preview model managedRenderers is null, this task looks for all Renderer implementations in their default order. Then all items in the preview model are rendered.

Specified by:
render in interface PreviewController
Parameters:
target - the target to render items to
workspace - the workspace to get the preview model from

render

public void render(RenderTarget target,
                   Renderer[] renderers)
Description copied from interface: PreviewController
Renders the current preview model to target.

This task overrides the preview model managedRenderers and uses the given Renderer array, respecting the array order. Then all items in the preview model are rendered.

Specified by:
render in interface PreviewController
Parameters:
target - the target to render items to

render

public void render(RenderTarget target,
                   Renderer[] renderers,
                   Workspace workspace)
Description copied from interface: PreviewController
Renders the preview model in workspace to target.

This task overrides the preview model managedRenderers and uses the given Renderer array, respecting the array order. Then all items in the preview model are rendered.

Specified by:
render in interface PreviewController
Parameters:
target - the target to render items to
workspace - the workspace to get the preview model from

getModel

public PreviewModelImpl getModel()
Description copied from interface: PreviewController
Returns the current preview model in the current workspace.

Specified by:
getModel in interface PreviewController
Returns:
the current preview model

getModel

public PreviewModelImpl getModel(Workspace workspace)
Description copied from interface: PreviewController
Returns the preview model in workspace.

Specified by:
getModel in interface PreviewController
Parameters:
workspace - the workspace to lookup
Returns:
the preview model in workspace

getRenderTarget

public RenderTarget getRenderTarget(java.lang.String name)
Description copied from interface: PreviewController
Creates a new render target of the given type.

Default render targets names are RenderTarget.PROCESSING_TARGET, RenderTarget.SVG_TARGET and RenderTarget.PDF_TARGET.

Render targets usually need some parameters when built. Parameters values should simply be put in the PreviewProperties.

Specified by:
getRenderTarget in interface PreviewController
Parameters:
name - the name of the render target
Returns:
a new render target or null if name is unknown

getRenderTarget

public RenderTarget getRenderTarget(java.lang.String name,
                                    Workspace workspace)
Description copied from interface: PreviewController
Creates a new render target of the given type in the preview model contained by workspace.

Default render targets names are RenderTarget.PROCESSING_TARGET, RenderTarget.SVG_TARGET and RenderTarget.PDF_TARGET.

Render targets usually need some parameters when built. Parameters values should simply be put in the PreviewProperties.

Specified by:
getRenderTarget in interface PreviewController
Parameters:
name - the name of the render target
workspace - the workspace to get the preview model from
Returns:
a new render target or null if name is unknown

getRegisteredRenderers

public Renderer[] getRegisteredRenderers()
Description copied from interface: PreviewController
Uses Lookup to retrieve registered renderer providers but replaces default renderers with plugins that extend them.

Specified by:
getRegisteredRenderers in interface PreviewController
Returns:
Registered renderers replacing default renderers with their extension plugins in case they exist
See Also:
Renderer

isAnyPluginRendererRegistered

public boolean isAnyPluginRendererRegistered()
Description copied from interface: PreviewController
Returns true if any renderer plugin is registered.

Specified by:
isAnyPluginRendererRegistered in interface PreviewController
Returns:
True if any plugin renderer is found in the system

Gephi Toolkit Javadoc