Package 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 currentPreviewModel
so the panel can access the centralPreviewProperties
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Icon
getIcon()
Returns the icon of the tab ornull
if noneJPanel
getPanel()
Returns theJPanel
component to be displayed.String
getPanelTitle()
Returns the title of the tabvoid
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 thengetPanel()
.- Parameters:
previewModel
- the model associated to the current workspace
-
getPanel
JPanel getPanel()
Returns theJPanel
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 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 newPreviewModel
is passed throughsetup()
.
-
getIcon
Icon getIcon()
Returns the icon of the tab ornull
if none- Returns:
- the tab's icon or
null
-
getPanelTitle
String getPanelTitle()
Returns the title of the tab- Returns:
- the tab's title
-
-