Gephi Toolkit Javadoc

org.gephi.preview.api
Interface PreviewModel

All Known Implementing Classes:
PreviewModelImpl

public interface PreviewModel

The Preview Model contains all items and all preview properties.

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.

Author:
Yudi Xue, Mathieu Bastian
See Also:
Item, Renderer

Method Summary
 java.awt.Dimension getDimensions()
          Returns the width and height of the graph in the graph coordinates.
 Item getItem(java.lang.String type, java.lang.Object source)
          Returns the item attached to source and with the type type.
 Item[] getItems(java.lang.Object source)
          Returns all items attached to source.
 Item[] getItems(java.lang.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.
 java.awt.Point getTopLeftPosition()
          Returns the top left position in the graph coordinate (i.e.
 void setManagedRenderers(ManagedRenderer[] managedRenderers)
          Sets an user-defined array of managed renderers to use when rendering.
 

Method Detail

getProperties

PreviewProperties getProperties()
Returns the preview properties attached to this model.

Returns:
the preview properties

getItems

Item[] getItems(java.lang.String type)
Returns all items with type as type.

Default types are Item.NODE, Item.EDGE, Item.NODE_LABEL and Item.EDGE_LABEL.

Parameters:
type - the item's type
Returns:
all items from this type

getItems

Item[] getItems(java.lang.Object source)
Returns all items attached to 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.

Parameters:
source - the item's source
Returns:
all items with source as source

getItem

Item getItem(java.lang.String type,
             java.lang.Object source)
Returns the item attached to 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.

Parameters:
type - the item's type
source - the item's source object
Returns:
the item or null if not found

getManagedRenderers

ManagedRenderer[] getManagedRenderers()

Returns currently managed renderers, or null.

If managedRenderers is set to null, all renderers will be executed when rendering, in default implementation order.

Returns:
Enabled renderers or null

setManagedRenderers

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.

Parameters:
managedRenderers - Managed renderers for future renderings

getManagedEnabledRenderers

Renderer[] getManagedEnabledRenderers()
Returns managedRenderers Renderers that are enabled, or null if managedRenderers is null.

Returns:
Enabled renderers or null

getDimensions

java.awt.Dimension getDimensions()
Returns the width and height of the graph in the graph coordinates.

Returns:
the graph dimensions

getTopLeftPosition

java.awt.Point getTopLeftPosition()
Returns the top left position in the graph coordinate (i.e. not the preview coordinates).

Returns:
the top left position point

Gephi Toolkit Javadoc