public interface PreviewModel
Items are the visual elements built from the Graph
by ItemBuilder
implementations and can be retrieved from this
class. Each item has a type and default types are Item.NODE
, Item.EDGE
, Item.NODE_LABEL
and Item.EDGE_LABEL
.
A preview model is attached to it's workspace and
can be retrieved from the
PreviewController
.
Modifier and Type | Method and Description |
---|---|
PreviewMouseListener[] |
getEnabledMouseListeners() |
CanvasSize |
getGraphicsCanvasSize()
Computes the graphics canvas size.
|
Item |
getItem(String type,
Object source)
Returns the item attached to
source and with the type
type . |
Item[] |
getItems(Object source)
Returns all items attached to
source . |
Item[] |
getItems(String type)
Returns all items with
type as type. |
Renderer[] |
getManagedEnabledRenderers()
Returns
managedRenderers Renderers that are enabled, or null if
managedRenderers is null. |
ManagedRenderer[] |
getManagedRenderers()
Returns currently managed renderers, or null.
|
PreviewProperties |
getProperties()
Returns the preview properties attached to this model.
|
void |
setManagedRenderers(ManagedRenderer[] managedRenderers)
Sets an user-defined array of managed renderers to use when rendering.
|
PreviewProperties getProperties()
Item[] getItems(String type)
type
as type. Default types are Item.NODE
, Item.EDGE
, Item.NODE_LABEL
and Item.EDGE_LABEL
.
type
- the item's typeItem[] getItems(Object source)
source
. The source is the graph object behind the item (e.g.
Node
or Edge
). Multiple items can be created from the same source object. For instance both
Item.NODE
and
Item.NODE_LABEL
have the node object as source.
source
- the item's sourcesource
as sourceItem getItem(String type, Object source)
source
and with the type
type
. The source is the graph object behind the item (e.g.
Node
or Edge
) and the type a default or a custom type.
Default types are Item.NODE
, Item.EDGE
, Item.NODE_LABEL
and Item.EDGE_LABEL
.
type
- the item's typesource
- the item's source objectnull
if not foundManagedRenderer[] getManagedRenderers()
Returns currently managed renderers, or null.
If
managedRenderers
is set to null, all renderers will be executed when rendering, in default implementation order.
void setManagedRenderers(ManagedRenderer[] managedRenderers)
Sets an user-defined array of managed renderers to use when rendering.
Only the renderers marked as enabled will be executed when rendering, and respecting the array order
If the input array does not contain a managed renderer for some renderer existing implementation, a new not enabled managed renderer will be added to the end of the input array
If
managedRenderers
is set to null, all renderers will be executed when rendering, in default implementation order.
managedRenderers
- Managed renderers for future renderingsRenderer[] getManagedEnabledRenderers()
managedRenderers
Renderers that are enabled, or null if
managedRenderers
is null.PreviewMouseListener[] getEnabledMouseListeners()
CanvasSize getGraphicsCanvasSize()
Copyright © 2007–2016 Gephi Consortium. All rights reserved.