Package uk.ac.starlink.topcat.plot2

## Class MultiController<C>

- java.lang.Object
- - uk.ac.starlink.topcat.plot2.MultiController<C>

- Type Parameters:
    `C` - object that manages fixed `Control`s in the stack
  Direct Known Subclasses:
    `MultiAxisController`, `MultiShaderController`

      public class MultiController<C>
      extends java.lang.Object

  Manaages control of controller objects that work with multiple plotting zones. A controller (the parameterised type `<C>`) in this context is an object that manages one or more fixed `Control`s in the non-layer part of the control stack.
  Since:
    12 Feb 2016
  Author:
    Mark Taylor

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `MultiController.ControllerFactory<C>` | Defines how to interact with members of this class's controller type.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MultiController​(MultiController.ControllerFactory<C> cfact, ZoneFactory zfact, MultiConfigger configger)` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `MultiConfigger` | `getConfigger()` | Returns this controller's config manager.
    `C` | `getController​(ZoneId zid)` | Returns the controller associated with a particular zone.
    `protected java.util.Map<ZoneId,​C>` | `getControllerMap()` | Returns a map of zone ids to controller objects.
    `Control[]` | `getStackControls()` | Returns the fixed controls managed by this object that can be inserted into the control stack.
    `ZoneId[]` | `getZones()` | Returns the currently available list of zones.
    `void` | `setZones​(ZoneId[] zones, uk.ac.starlink.ttools.plot2.Gang gang)` | Sets the list of zone obects that are to be visible in the current state of the GUI.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MultiController

          public MultiController​(MultiController.ControllerFactory<C> cfact,
                                 ZoneFactory zfact,
                                 MultiConfigger configger)

      Constructor.
      Parameters:
        `cfact` - encapsulates management with a particular type of controller object `C`
        `zfact` - zone id factory
        `configger` - manages global and per-zone axis config items

  - ### Method Detail

    - #### getStackControls

          public Control[] getStackControls()

      Returns the fixed controls managed by this object that can be inserted into the control stack. The return value does not change over the lifetime of this object.
      Returns:
        control array

    - #### getController

          public C getController​(ZoneId zid)

      Returns the controller associated with a particular zone. This should be for a zone that has previously been submitted with a call to `setZones`.
      Parameters:
        `zid` - zone id
      Returns:
        controller for zone

    - #### getConfigger

          public MultiConfigger getConfigger()

      Returns this controller's config manager.
      Returns:
        configger manages global and per-zone axis config items

    - #### setZones

          public void setZones​(ZoneId[] zones,
                               uk.ac.starlink.ttools.plot2.Gang gang)

      Sets the list of zone obects that are to be visible in the current state of the GUI.
      Parameters:
        `zones` - ordered list of zoneIds whose configuration will be accessible from the GUI
        `gang` - gang to which the zones belong; the sequence of the zones array must match that of the gang elements

    - #### getZones

          public ZoneId[] getZones()

      Returns the currently available list of zones.
      Returns:
        most recently submitted zone list

    - #### getControllerMap

          protected java.util.Map<ZoneId,​C> getControllerMap()

      Returns a map of zone ids to controller objects.
      Returns:
        controller map