Class WidgetPlugin

java.lang.Object
org.micromanager.quickaccess.QuickAccessPlugin
org.micromanager.quickaccess.WidgetPlugin
All Implemented Interfaces:
MMGenericPlugin, MMPlugin, org.scijava.plugin.SciJavaPlugin

public abstract class WidgetPlugin extends QuickAccessPlugin
This plugin allows arbitrary controls ("widgets") to be included in the Quick-Access Window. It gives you the maximum control over how your control will appear and behave. However, it also requires you to implement the most logic.
  • Field Details

    • CUSTOM_ICON_STRING

      public static final String CUSTOM_ICON_STRING
      Key used for custom icon information. If your plugin returns true in getCanCustomizeIcon(), then there may be a property, in the PropertyMap passed to createControl(), under this key. You should not need to read or modify this property; just pass your config to QuickAccessManager.getCustomIcon() to get the customized icon the user has requested.
      See Also:
  • Constructor Details

    • WidgetPlugin

      public WidgetPlugin()
  • Method Details

    • createControl

      public abstract JComponent createControl(PropertyMap config)
      Create the GUI components for this control.
      Parameters:
      config - A PropertyMap as output by configureControl used to configure this control. The PropertyMap may be empty or may be preserved from a previous session.
    • configureControl

      public abstract PropertyMap configureControl(Frame parent)
      Generate configuration information that can be used to configure a control generated by this plugin. This method is expected to block the Event Dispatch Thread (EDT) -- thus, any configuration UI should be modal. It is also only ever called from the EDT. If for any reason the control should not be created (for example, because the user canceled a dialog during configuration), then this method must return null.
      Parameters:
      parent - The Quick-Access Window
      Returns:
      A PropertyMap containing the information needed to generate the control, or null if the control should not be created.
    • getSize

      public Dimension getSize()
      Return the dimensionality of the widget, in cells. For example, a value of 2x1 here would indicate a widget that is 2 cells wide and 1 tall. The size of a single cell is the CELL_WIDTH and CELL_HEIGHT values in QuickAccessPlugin.
    • getCanCustomizeIcon

      public boolean getCanCustomizeIcon()
      Returns true if the widget can accept custom icons (i.e. the setIcon() method actually does something). This will allow users to provide their own icons for individual instances of the widget.