Package org.gephi.preview.spi
Interface PreviewUI
-
public interface PreviewUISPI interface to add UI settings components to the Preview.Implementations of this interface provide a
JPanelcomponent which will be placed in a separated tab in the Preview Settings. When a workspace is selected this class receives the currentPreviewModelso the panel can access the centralPreviewPropertiesand 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IcongetIcon()Returns the icon of the tab ornullif noneJPanelgetPanel()Returns theJPanelcomponent to be displayed.StringgetPanelTitle()Returns the title of the tabvoidsetup(PreviewModel previewModel)Initialization method called when a workspace is selected and a panel is about to be requested.voidunsetup()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 thengetPanel().- Parameters:
previewModel- the model associated to the current workspace
-
getPanel
JPanel getPanel()
Returns theJPanelcomponent 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 afterunsetup()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 newPreviewModelis passed throughsetup().
-
getIcon
Icon getIcon()
Returns the icon of the tab ornullif none- Returns:
- the tab's icon or
null
-
getPanelTitle
String getPanelTitle()
Returns the title of the tab- Returns:
- the tab's title
-
-