public interface PreviewController
This controller is a service and can therefore be found in Lookup:
PreviewController gc = Lookup.getDefault().lookup(PreviewController.class);
PreviewModel
,
Item
,
Renderer
Modifier and Type | Method and Description |
---|---|
PreviewModel |
getModel()
Returns the current preview model in the current workspace.
|
PreviewModel |
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(String name)
Creates a new render target of the given type.
|
RenderTarget |
getRenderTarget(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 . |
boolean |
sendMouseEvent(PreviewMouseEvent event)
Sends a
PreviewMouseEvent to the current workspace, if any. |
boolean |
sendMouseEvent(PreviewMouseEvent event,
Workspace workspace)
Sends a
PreviewMouseEvent to the given workspace. |
void refreshPreview(Workspace workspace)
workspace
.
This task built all items from ItemBuilder
implementations,
refresh graph dimensions and call all Renderer.preProcess()
method.
workspace
- the workspace to get the preview model fromvoid refreshPreview()
This task built all items from ItemBuilder
implementations,
refresh graph dimensions and call all Renderer.preProcess()
method.
PreviewModel getModel()
PreviewModel getModel(Workspace workspace)
workspace
.workspace
- the workspace to lookupworkspace
void render(RenderTarget target)
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.
target
- the target to render items tovoid render(RenderTarget target, Workspace workspace)
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.
target
- the target to render items toworkspace
- the workspace to get the preview model fromvoid render(RenderTarget target, Renderer[] renderers)
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.
target
- the target to render items torenderers
- renderers to usevoid render(RenderTarget target, Renderer[] renderers, Workspace workspace)
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.
target
- the target to render items torenderers
- renderers to useworkspace
- the workspace to get the preview model fromRenderTarget getRenderTarget(String name)
Default render targets names are RenderTarget.G2D_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
.
name
- the name of the render targetnull
if name
is
unknownRenderTarget getRenderTarget(String name, Workspace workspace)
workspace
.
Default render targets names are RenderTarget.G2D_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
.
name
- the name of the render targetworkspace
- the workspace to get the preview model fromnull
if name
is
unknownRenderer[] getRegisteredRenderers()
Lookup
to retrieve registered renderer providers but replaces default renderers with plugins that extend them.Renderer
boolean isAnyPluginRendererRegistered()
boolean sendMouseEvent(PreviewMouseEvent event)
PreviewMouseEvent
to the current workspace, if any.event
- PreviewMouseEventboolean sendMouseEvent(PreviewMouseEvent event, Workspace workspace)
PreviewMouseEvent
to the given workspace.event
- PreviewMouseEventworkspace
- workspaceCopyright © 2007–2015 Gephi Consortium. All rights reserved.