T
- The type of measurement configuration which should be displayed by this panel.public class MeasurementAddonUIAdapter<T extends MeasurementConfiguration> extends ComponentAddonUIAdapter<T>
Constructor and Description |
---|
MeasurementAddonUIAdapter(ComponentMetadata<T> metadata,
YouScopeClient client,
YouScopeServer server)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPage(MeasurementAddonUIPage<? super T> page)
Adds a page to the layout.
|
void |
clearPages()
Removes all pages from the current layout.
|
protected void |
commitChanges(T configuration)
Is called when the current state of all forms etc.
|
protected java.awt.Component |
createUI(T configuration)
Return a Component (typically a JPanel) containing the UI elements of the addon.
|
int |
getNumPages()
Returns the number of pages.
|
protected void |
initializeDefaultConfiguration(T configuration)
This function is called, and only called, if
AddonUIAdapter.toFrame() or AddonUIAdapter.toPanel(YouScopeFrame) is called without
calling before ComponentAddonUIAdapter.setConfiguration(Configuration) . |
void |
insertPage(MeasurementAddonUIPage<? super T> page,
int index)
Inserts a page into the layout at the given index.
|
addUIListener, closeAddon, createUI, getConfiguration, getConfigurationClass, removeUIListener, setConfiguration
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 MeasurementAddonUIAdapter(ComponentMetadata<T> metadata, YouScopeClient client, YouScopeServer server) throws AddonException
metadata
- The metadata of the addon.client
- The YouScope client.server
- The YouScope server.AddonException
public void addPage(MeasurementAddonUIPage<? super T> page)
AddonUIAdapter.toFrame()
or AddonUIAdapter.toPanel(org.youscope.clientinterfaces.YouScopeFrame)
is called.page
- Page to be added.public void insertPage(MeasurementAddonUIPage<? super T> page, int index) throws java.lang.IndexOutOfBoundsException
AddonUIAdapter.toFrame()
or AddonUIAdapter.toPanel(org.youscope.clientinterfaces.YouScopeFrame)
is called.page
- Page to be added.index
- Index where to add page. Must be bigger or equal to 0, and smaller or equal to getNumPages()
.java.lang.IndexOutOfBoundsException
- thrown if index is invalid.public void clearPages()
public int getNumPages()
protected java.awt.Component createUI(T configuration) throws AddonException
ComponentAddonUIAdapter
AddonUIAdapter.setShowCloseButton(boolean)
).createUI
in class ComponentAddonUIAdapter<T extends MeasurementConfiguration>
configuration
- The current configuration which should be loaded.AddonException
protected void commitChanges(T configuration)
ComponentAddonUIAdapter
commitChanges
in class ComponentAddonUIAdapter<T extends MeasurementConfiguration>
configuration
- The configuration in which changes should be saved.protected void initializeDefaultConfiguration(T configuration) throws AddonException
ComponentAddonUIAdapter
AddonUIAdapter.toFrame()
or AddonUIAdapter.toPanel(YouScopeFrame)
is called without
calling before ComponentAddonUIAdapter.setConfiguration(Configuration)
. The configuration should then be initialized to its default settings,
which may depend on the state of the microscope, etc.initializeDefaultConfiguration
in class ComponentAddonUIAdapter<T extends MeasurementConfiguration>
configuration
- Configuration to set to initial values.AddonException