C
- public abstract class ComponentAddonUIAdapter<C extends Configuration> extends AddonUIAdapter<ComponentMetadata<C>> implements ComponentAddonUI<C>
Constructor and Description |
---|
ComponentAddonUIAdapter(ComponentMetadata<C> metadata,
YouScopeClient client,
YouScopeServer server)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addUIListener(ComponentAddonUIListener<? super C> listener)
Adds a listener to this configuration, which should e.g.
|
protected void |
closeAddon()
Call this function to signal that configuration in the UI has finished.
|
protected abstract void |
commitChanges(C configuration)
Is called when the current state of all forms etc.
|
protected java.awt.Component |
createUI()
Return a Component (typically a JPanel) containing the UI elements of the addon.
|
protected abstract java.awt.Component |
createUI(C configuration)
Return a Component (typically a JPanel) containing the UI elements of the addon.
|
C |
getConfiguration()
Returns the configuration data.
|
protected java.lang.Class<C> |
getConfigurationClass()
Returns the configuration class.
|
protected abstract void |
initializeDefaultConfiguration(C configuration)
This function is called, and only called, if
AddonUIAdapter.toFrame() or AddonUIAdapter.toPanel(YouScopeFrame) is called without
calling before setConfiguration(Configuration) . |
void |
removeUIListener(ComponentAddonUIListener<? super C> listener)
Removes a previously added listener.
|
void |
setConfiguration(Configuration configuration)
Initializes the addon to the configuration data.
|
addFrameListener, getAddonMetadata, getClient, getCloseButtonLabel, getContainingFrame, getMicroscope, getPreferredSize, getServer, getTitle, isInitialized, isMaximizable, isMaximize, isResizable, isSeparateFrame, isShowCloseButton, notifyLayoutChanged, removeFrameListener, sendErrorMessage, sendMessage, setCloseButtonLabel, setDescription, setMaximizable, setMaximize, setPreferredSize, setResizable, setShowCloseButton, setTitle, toFrame, toPanel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAddonMetadata
public ComponentAddonUIAdapter(ComponentMetadata<C> metadata, YouScopeClient client, YouScopeServer server) throws AddonException
metadata
- The metadata of the addon.client
- The YouScope client.server
- The YouScope server.AddonException
protected java.lang.Class<C> getConfigurationClass()
public void addUIListener(ComponentAddonUIListener<? super C> listener)
ComponentAddonUI
addUIListener
in interface ComponentAddonUI<C extends Configuration>
listener
- The listener to add.public void removeUIListener(ComponentAddonUIListener<? super C> listener)
ComponentAddonUI
removeUIListener
in interface ComponentAddonUI<C extends Configuration>
listener
- The listener to remove.protected final java.awt.Component createUI() throws AddonException
AddonUIAdapter
AddonUIAdapter.setShowCloseButton(boolean)
and AddonUIAdapter.setCloseButtonLabel(String)
).createUI
in class AddonUIAdapter<ComponentMetadata<C extends Configuration>>
AddonException
protected abstract void initializeDefaultConfiguration(C configuration) throws AddonException
AddonUIAdapter.toFrame()
or AddonUIAdapter.toPanel(YouScopeFrame)
is called without
calling before setConfiguration(Configuration)
. The configuration should then be initialized to its default settings,
which may depend on the state of the microscope, etc.configuration
- Configuration to set to initial values.AddonException
protected abstract java.awt.Component createUI(C configuration) throws AddonException
AddonUIAdapter.setShowCloseButton(boolean)
).configuration
- The current configuration which should be loaded.AddonException
protected void closeAddon()
closeAddon
in class AddonUIAdapter<ComponentMetadata<C extends Configuration>>
public void setConfiguration(Configuration configuration) throws AddonException, ConfigurationException
ComponentAddonUI
setConfiguration
in interface ComponentAddonUI<C extends Configuration>
configuration
- The configuration data.AddonException
- Thrown if error occurred while processing configuration data.ConfigurationException
- Thrown if configuration is invalid.protected abstract void commitChanges(C configuration)
configuration
- The configuration in which changes should be saved.public C getConfiguration()
ComponentAddonUI
Configuration.checkConfiguration()
).getConfiguration
in interface ComponentAddonUI<C extends Configuration>