Class TLcyMapOverviewComponentFactory


public class TLcyMapOverviewComponentFactory extends TLcyMapComponentFactory
TLcyMapComponentFactory customized for generating overview map components: ` an overview layer is added, together with the necessary controllers, but no status bar, no area of interest, ... A TLcyMapOverviewAddOn should be associated with a factory as well as a ILcyLucyEnv
  • Field Details

    • MAP_OVERVIEW_HELP_ID

      public static final String MAP_OVERVIEW_HELP_ID
      The help ID for map overviews. Note that this variable overrides the variable of the super class.
      See Also:
    • OVERVIEW_CONTROLLER

      public static final int OVERVIEW_CONTROLLER
      The standard overview controller.
      See Also:
    • OVERVIEW_CONTROLLER_ACTIVE_SETTABLE

      public static final int OVERVIEW_CONTROLLER_ACTIVE_SETTABLE
      The standard overview controller.
      See Also:
    • LAYER_CONTROL_VISIBLE_ACTIVE_SETTABLE

      public static final int LAYER_CONTROL_VISIBLE_ACTIVE_SETTABLE
      Active settable that toggles the visibility state of the layer control.
      See Also:
    • ADD_SLAVEVIEW_ACTION

      public static final int ADD_SLAVEVIEW_ACTION
      An action that allows to add slave views. Every slave view is represented by its bounds. This action is disabled by default (in the config file).
      See Also:
    • REMOVE_SLAVEVIEW_ACTION

      public static final int REMOVE_SLAVEVIEW_ACTION
      An action that allows to remove slave views. This action is disabled by default (in the config file).
      See Also:
    • OVERVIEW_LAYER

      public static final int OVERVIEW_LAYER
      See Also:
    • COMBINED_CONTROLLER

      public static final int COMBINED_CONTROLLER
      A controller that combines zoom, pan, overview and recentre.
      See Also:
    • COMBINED_CONTROLLER_ACTIVE_SETTABLE

      public static final int COMBINED_CONTROLLER_ACTIVE_SETTABLE
      A controller that combines zoom, pan, overview and recentre.
      See Also:
  • Constructor Details

    • TLcyMapOverviewComponentFactory

      public TLcyMapOverviewComponentFactory()
      Creates a new TLcyMapOverviewComponentFactory. Note that you will have to set a ILcyLucyEnv before this instance can be used.
    • TLcyMapOverviewComponentFactory

      public TLcyMapOverviewComponentFactory(ILcyLucyEnv aLucyEnv)
      Creates a new TLcyMapOverviewComponentFactory.
      Parameters:
      aLucyEnv - The Lucy environment.
  • Method Details

    • createMapComponent

      public ILcyMapComponent createMapComponent()
      Description copied from class: TLcyMapComponentFactory
      Creates and initializes a new TLcyMapComponent. It will invoke all create, set and insert methods with the correct arguments to build a map component together. See top comment for more detailed information.
      Overrides:
      createMapComponent in class TLcyMapComponentFactory
      Returns:
      a newly created and initialized TLcyMapComponent.
    • insertActionInMenu

      protected void insertActionInMenu(int aID, ILcdAction aAction, TLcyMapComponent aMapComponentSFCT)
      Description copied from class: TLcyMapComponentFactory
      Inserts the given action with the given ID in the menu bar of the given map.
      Overrides:
      insertActionInMenu in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the action to add. This is a constant that ends in ACTION.
      aAction - The action to add.
      aMapComponentSFCT - The map component under construction.
    • finalizeCreation

      protected void finalizeCreation(TLcyMapComponent aMapComponent)
      Description copied from class: TLcyMapComponentFactory
      Method called to finalize the creation process. Can be used for clean up tasks etc.
      Overrides:
      finalizeCreation in class TLcyMapComponentFactory
      Parameters:
      aMapComponent - The map component under construction.
    • isAutoAddMaps

      public boolean isAutoAddMaps()
      If true, all maps that are added to the application's MapManager will be added to the overview as well (except for the overview itself). If a map is removed from the application, it is also removed from the overview.
      Returns:
      True to add and remove maps automatically.
      See Also:
    • setAutoAddMaps

      public void setAutoAddMaps(boolean aAutoAddMaps)

      If true, maps are added and removed automatically to/from the overview.

      Note that this factory allows much more customization by specifying a configuration file using TLcyMapComponentFactory.setConfigSourceName(String). Please refer to lucy/map/mapoverview_addon.cfg for more documentation about the properties that can be specified.

      Parameters:
      aAutoAddMaps - If true, maps are added and removed automatically to/from the overview.
      See Also:
    • isAutoRecentreOverview

      public boolean isAutoRecentreOverview()
      If true, the overview automatically recentres when the slave view changes.
      Returns:
      True if the overview automatically recentres when the slave view changes.
      See Also:
    • setAutoRecentreOverview

      public void setAutoRecentreOverview(boolean aAutoRecentreOverview)

      True if the overview automatically recentres when the slave view changes.

      Note that this factory allows much more customization by specifying a configuration file using TLcyMapComponentFactory.setConfigSourceName(String). Please refer to lucy/map/mapoverview_addon.cfg for more documentation about the properties that can be specified.

      Parameters:
      aAutoRecentreOverview - True if the overview recentres automatically.
    • createMenuBar

      protected ILcyMenuBar createMenuBar(TLcyMapComponent aMapComponent)
      Override: returns null if 'map_overview.create_toolbar' is false.
      Overrides:
      createMenuBar in class TLcyMapComponentFactory
      Parameters:
      aMapComponent - The map component to create a menu bar for.
      Returns:
      The menu bar, or null.
    • createGXYView

      protected ILcdGXYView createGXYView(TLcyMapComponent aMapComponent)
      Description copied from class: TLcyMapComponentFactory

      Creates the main ILcdGXYView for the given map component. The view is based on the ILcdTreeLayeredSupport created in TLcyMapComponentFactory.createTreeLayeredSupport(TLcyMapComponent).

      Note that if for example a TLcdMapJPanel is created, one should call TLcdMapJPanel#setGXYLayerFactory(getLucyEnv().getCompositeGXYLayerFactory()). Optionally, the setMinScale and setMaxScale can be set.

      If desired, the background color should be set on the view. Note that when a workspace is loaded, that workspace value takes precedence.

      Overrides:
      createGXYView in class TLcyMapComponentFactory
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      The newly create gxy view. This must not be null!
      See Also:
    • createAction

      protected ILcdAction createAction(int aID, TLcyMapComponent aMapComponent)
      Override: don't create the delete selection and edit current projection actions. Creates Add/remove slave view actions.
      Overrides:
      createAction in class TLcyMapComponentFactory
      Parameters:
      aID - The id describing which action to create. This is a constant that ends in ACTION.
      aMapComponent - The map component under construction.
      Returns:
      The newly created action, or null.
    • createGXYLayer

      protected ILcdGXYLayer createGXYLayer(int aID, TLcyMapComponent aMapComponent)
      Override: create grid layer without labels and create overview layer. Do not create area of interest layer.
      Overrides:
      createGXYLayer in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the layer to create. This is a constant that ends in LAYER.
      aMapComponent - The map component under construction.
      Returns:
      The newly created layer, or null.
    • createComponent

      protected Component createComponent(int aID, TLcyMapComponent aMapComponent)
      Override: Don't create status bar. Projection choice component and scale label are not created if there is no toolbar (see config file property create_toolbar).
      Overrides:
      createComponent in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the component to create. This is a constant that ends in COMPONENT.
      aMapComponent - The map component under construction.
      Returns:
      The newly created component, or null.
    • insertComponent

      protected void insertComponent(int aID, Component aComponent, TLcyMapComponent aMapComponentSFCT)
      Description copied from class: TLcyMapComponentFactory
      Inserts the given component into the given map component.
      Overrides:
      insertComponent in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the component to insert. This is a constant that ends in COMPONENT.
      aComponent - The component to insert.
      aMapComponentSFCT - The map component to insert the component into.
    • setMapOverviewAddOn

      public void setMapOverviewAddOn(TLcyMapOverviewAddOn aAddon)
      Sets the TLcyMapOverviewAddOn associated with this factory.
      Parameters:
      aAddon - The addon that should be associated with this factory
      See Also:
    • getMapOverviewAddOn

      public TLcyMapOverviewAddOn getMapOverviewAddOn()
      Returns the TLcyMapOverviewAddOn associated with this factory.
      Returns:
      The TLcyMapOverviewAddOn associated with this factory.
      See Also:
    • createMapName

      protected String createMapName(TLcyMapComponent aMapComponent)
      Description copied from class: TLcyMapComponentFactory
      Creates a map name for the given map.
      Overrides:
      createMapName in class TLcyMapComponentFactory
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      a map name.
    • createToolBar

      protected ILcyToolBar createToolBar(TLcyMapComponent aMapComponent)
      Override: returns null if 'map_overview.create_toolbar' is false.
      Overrides:
      createToolBar in class TLcyMapComponentFactory
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      The toolbar, or null.
      See Also:
    • createRightToolBar

      protected ILcyToolBar createRightToolBar(TLcyMapComponent aMapComponent)
      Description copied from class: TLcyMapComponentFactory

      Creates a tool bar for the given map component, which will be placed on the north-east side by default. This tool bar can be used for inserting actions/active settables which should be aligned at the north-east side instead of the north-west side.

      Overrides:
      createRightToolBar in class TLcyMapComponentFactory
      Parameters:
      aMapComponent - The map component under construction
      Returns:
      The tool bar, or null
      See Also:
    • createGXYController

      protected ILcdGXYController createGXYController(int aID, TLcyMapComponent aMapComponent)
      Override:Create combined controller and overview controller.
      Overrides:
      createGXYController in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the controller to create. This is a constant that ends in CONTROLLER.
      aMapComponent - The map component under construction.
      Returns:
      The newly created controller, or null.
    • insertActiveSettableInToolBar

      protected void insertActiveSettableInToolBar(int aID, ILcyActiveSettable aActiveSettable, TLcyMapComponent aMapComponentSFCT)
      Inserts the given active settable into the toolbar of the given map component.
      Overrides:
      insertActiveSettableInToolBar in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the active settable to insert.
      aActiveSettable - The active settable to insert into the toolbar.
      aMapComponentSFCT - The map component into whose toolbar the active settable will be inserted.
    • insertActiveSettableInMenu

      protected void insertActiveSettableInMenu(int aID, ILcyActiveSettable aActiveSettable, TLcyMapComponent aMapComponentSFCT)
      Description copied from class: TLcyMapComponentFactory
      Inserts the given active settable into the menu bar of the given map component.
      Overrides:
      insertActiveSettableInMenu in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the active settable to insert. This is a constant that ends in ACTIVE_SETTABLE.
      aActiveSettable - The active settable to insert into the menu.
      aMapComponentSFCT - The map component into whose menu bar the active settable will be inserted.
    • insertActionInToolBar

      protected void insertActionInToolBar(int aID, ILcdAction aAction, TLcyMapComponent aMapComponentSFCT)
      Inserts the given action with the given ID in the toolbar of the given map.
      Parameters:
      aID - The ID of the action to add.
      aAction - The action to add.
      aMapComponentSFCT - The map component under construction.
    • createGXYControllerActiveSettable

      protected ILcyActiveSettable createGXYControllerActiveSettable(int aID, ILcdGXYController aController, TLcyMapComponent aMapComponent)
      Description copied from class: TLcyMapComponentFactory
      Creates an active settable to toggle the given controller.
      Overrides:
      createGXYControllerActiveSettable in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the controller to create an active settable for, this is a constant that ends in CONTROLLER_ACTIVE_SETTABLE.
      aController - The controller to create an active settable for.
      aMapComponent - The map component under construction.
      Returns:
      The newly created active settable, or null.
    • createActiveSettable

      protected ILcyActiveSettable createActiveSettable(int aID, TLcyMapComponent aMapComponent)
      Overwrites createActiveSettable to create an active settable for LAYER_CONTROL_VISIBLE_ACTIVE_SETTABLE as well.
      Overrides:
      createActiveSettable in class TLcyMapComponentFactory
      Parameters:
      aID - see super.
      aMapComponent - see super.
      Returns:
      see super.
    • createContainer

      protected Container createContainer(int aID, TLcyMapComponent aMapComponent)
      Description copied from class: TLcyMapComponentFactory
      Creates a container for the given ID.
      Overrides:
      createContainer in class TLcyMapComponentFactory
      Parameters:
      aID - The ID of the container to create. This is a constant that ends in CONTAINER.
      aMapComponent - The map component under construction.
      Returns:
      The newly created container, or null.
    • createInitialMapBounds

      protected ILcdBounds createInitialMapBounds(TLcyMapComponent aMapComponent)
      Description copied from class: TLcyMapComponentFactory

      Create the initial bounds for the map in the WGS 84 reference system. The map is fit so that at least the given area is visible. Return null to avoid any fit operation.

      Please note that this information is also stored in a workspace, so if a workspace is loaded, the value given here will be ignored. This behavior can be changed, see property TLcyMapAddOn.workspaceCodec.restoreMapBounds in config file config/lucy/map/map_addon.cfg

      .
      Overrides:
      createInitialMapBounds in class TLcyMapComponentFactory
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      the bounds
    • isClassTraceOn

      @Deprecated public static boolean isClassTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • setClassTraceOn

      @Deprecated public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.