Gephi Toolkit Javadoc

org.gephi.preview.spi
Interface PreviewUI


public interface PreviewUI

SPI interface to add UI settings components to the Preview.

Implementations of this interface provide a JPanel component which will be placed in a separated tab in the Preview Settings. When a workspace is selected this class receives the current PreviewModel so the panel can access the central PreviewProperties and can read/write settings values.

PreviewUI are singleton services and implementations need to add the following annotation to be recognized by the system:

@ServiceProvider(service=PreviewUI.class)

Author:
Mathieu Bastian

Method Summary
 javax.swing.Icon getIcon()
          Returns the icon of the tab or null if none
 javax.swing.JPanel getPanel()
          Returns the JPanel component to be displayed.
 java.lang.String getPanelTitle()
          Returns the title of the tab
 void setup(PreviewModel previewModel)
          Initialization method called when a workspace is selected and a panel is about to be requested.
 void unsetup()
          Method called when the UI is unloaded and the panel to be destroyed.
 

Method Detail

setup

void setup(PreviewModel previewModel)
Initialization method called when a workspace is selected and a panel is about to be requested. The system first calls this method and then getPanel().

Parameters:
previewModel - the model associated to the current workspace

getPanel

javax.swing.JPanel getPanel()
Returns the JPanel component to be displayed.

This method is always called after setup() so the implementation can initialize the panel with the model. Note that the panel is destroyed after unsetup() is called. In other words, a new panel is requested at each workspace selection.

Returns:
the panel to be displayed

unsetup

void unsetup()
Method called when the UI is unloaded and the panel to be destroyed. This happens when the workspace changes and before a new PreviewModel is passed through setup().


getIcon

javax.swing.Icon getIcon()
Returns the icon of the tab or null if none

Returns:
the tab's icon or null

getPanelTitle

java.lang.String getPanelTitle()
Returns the title of the tab

Returns:
the tab's title

Gephi Toolkit Javadoc