Class TLcyMapComponentFactory

java.lang.Object
com.luciad.lucy.map.ALcyMapComponentFactory
com.luciad.lucy.map.TLcyMapComponentFactory
Direct Known Subclasses:
TLcyMapOverviewComponentFactory

public class TLcyMapComponentFactory extends ALcyMapComponentFactory
Factory for the creation of map components. This factory was designed so that it is easy to modify small parts of the creation process. This can be done by subclassing this class and overriding certain methods.

For maximum flexibility, this factory was designed to create objects using a create method, and to insert them using an insert or a set method. The toolbar is an example of such a create/set pair of methods: there is a


 ILcyToolBar createToolBar( TLcyMapComponent )
 
method and a

 void setToolBar( ILcyToolBar, TLcyMapComponent )
 
method. The first method serves the purpose of creating the toolbar, the second method is responsible to put the toolbar into the map component. So if you don't like the default toolbar, you subclass this factory and you can create an instance of your preference and return it. Furthermore if you are not happy with its positioning, you can override setToolBar and add the toolbar to another part of the gui.

The methods createComponent and insertComponent are a nice example of a create/insert method pair. We have


 Component createComponent( int aID, TLcyMapComponent aMapComponent )
 
and

 void insertComponent( int aID, Component aComponent, TLcyMapComponent aMapComponentSFCT )
 
The idea is exactly the same: the create method only instantiates, the insert method just inserts the object created by the create method into its context.

Note however that we also have an ID here. This is because there are different types of components that can be created: the map scale label, the layer control, ... All possible ID's that can be passed to the createComponent method all end with the same suffix "component". The same thing goes for "Action" (createAction, insertAction), "Controller" (createController, insertController), ...

As an example, imagine you want to change the behavior of the edit current projection action. Browsing this class learns there is a EDIT_CURRENT_PROJECTION_ACTION constant. Because it ends with "Action", this constant can only be passed to the createAction method. Therefore we can override the method createAction, check if the ID is EDIT_CURRENT_PROJECTION_ACTION and return a custom action instance. Or use super.createAction and change the icon before returning it. If you want to remove the action completely, you can simply return null.

  • Field Details

    • CONTROLLERS_GROUP_DESCRIPTOR

      public static final TLcyGroupDescriptor CONTROLLERS_GROUP_DESCRIPTOR
      The group descriptor used to group the controllers of the view together.
    • PROJECTION_GROUP_DESCRIPTOR

      public static final TLcyGroupDescriptor PROJECTION_GROUP_DESCRIPTOR
      The group descriptor used to group the active settables that change the projection.
    • OPEN_SAVE_GROUP_DESCRIPTOR

      public static final TLcyGroupDescriptor OPEN_SAVE_GROUP_DESCRIPTOR
      The group descriptor used to group the open/save related actions.
    • FULL_SCREEN_GROUP_DESCRIPTOR

      public static final TLcyGroupDescriptor FULL_SCREEN_GROUP_DESCRIPTOR
      The group descriptor for the full screen active settable.
    • CONTROLLER_HELP_ID_PREFIX

      public static final String CONTROLLER_HELP_ID_PREFIX
      Context sensitive help id prefix for controllers.
      See Also:
    • MAP_HELP_ID

      public static final String MAP_HELP_ID
      The help id for the map.
      See Also:
    • FILE_MENU

      protected static final String[] FILE_MENU
      The file menu.
    • MAP_MENU

      protected static final String[] MAP_MENU
      The map menu.
    • CONTROLLER_MENU

      protected static final String[] CONTROLLER_MENU
      The submenus where the controllers will go.
    • PROJECTION_MENU

      protected static final String[] PROJECTION_MENU
      The submenus where the projection active settables will go.
    • SIMPLE_RECTANGULAR_PROJECTION_ACTIVE_SETTABLE

      @Deprecated public static final int SIMPLE_RECTANGULAR_PROJECTION_ACTIVE_SETTABLE
      Deprecated.
      use EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE instead.
      See Also:
    • EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE

      public static final int EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE

      Constant for an active settable to change the current projection of the ILcdGXYView to equidistant cylindrical.

      By default, it is added in the projection combo box.

      See Also:
    • ORTOGRAPHIC_PROJECTION_ACTIVE_SETTABLE

      public static final int ORTOGRAPHIC_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for orthographic projection.
      See Also:
    • STEREOGRAPHIC_PROJECTION_ACTIVE_SETTABLE

      public static final int STEREOGRAPHIC_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for stereographic projection.
      See Also:
    • MERCATOR_PROJECTION_ACTIVE_SETTABLE

      public static final int MERCATOR_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for mercator projection.
      See Also:
    • TRANSVERSE_MERCATOR_PROJECTION_ACTIVE_SETTABLE

      public static final int TRANSVERSE_MERCATOR_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for transverse mercator projection.
      See Also:
    • OBLIQUE_MERCATOR_PROJECTION_ACTIVE_SETTABLE

      public static final int OBLIQUE_MERCATOR_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for Oblique Mercator projection
      See Also:
    • LAMBERT_CONFORMAL_PROJECTION_ACTIVE_SETTABLE

      public static final int LAMBERT_CONFORMAL_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for lambert conformal projection.
      See Also:
    • LAMBERT_AZIMUTHAL_EQUAL_AREA_PROJECTION_ACTIVE_SETTABLE

      public static final int LAMBERT_AZIMUTHAL_EQUAL_AREA_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for lambert azimuthal equal area projection.
      See Also:
    • POLAR_STEREOGRAPHIC_NORTH_PROJECTION_ACTIVE_SETTABLE

      public static final int POLAR_STEREOGRAPHIC_NORTH_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for north polar stereographic projection.
      See Also:
    • POLAR_STEREOGRAPHIC_SOUTH_PROJECTION_ACTIVE_SETTABLE

      public static final int POLAR_STEREOGRAPHIC_SOUTH_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for south polar stereographic projection.
      See Also:
    • PSEUDO_MERCATOR_PROJECTION_ACTIVE_SETTABLE

      public static final int PSEUDO_MERCATOR_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for pseudo mercator projection
      See Also:
    • ALBERS_EQUAL_AREA_CONIC_PROJECTION_ACTIVE_SETTABLE

      public static final int ALBERS_EQUAL_AREA_CONIC_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for the Albers Equal Area Conic projection
      See Also:
    • GNOMONIC_PROJECTION_ACTIVE_SETTABLE

      public static final int GNOMONIC_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for the Gnomonic projection
      See Also:
    • CASSINI_PROJECTION_ACTIVE_SETTABLE

      public static final int CASSINI_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for the Cassini projection
      See Also:
    • ELLIPSOIDAL_EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE

      public static final int ELLIPSOIDAL_EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE
      Similar to EQUIDISTANT_CYLINDRICAL_PROJECTION_ACTIVE_SETTABLE, but for the Ellipsoidal Equidistant Cylindrical projection
      Since:
      2015.1
      See Also:
    • FULL_SCREEN_ACTIVE_SETTABLE

      public static final int FULL_SCREEN_ACTIVE_SETTABLE

      Constant for an active settable to set the map full screen.

      By default, it is added as the 'Map|Full Screen' menu item.

      See Also:
    • EDIT_CURRENT_PROJECTION_ACTION

      public static final int EDIT_CURRENT_PROJECTION_ACTION

      Constant for an action to edit the current properties of the ILcdXYWorldReference of the ILcdGXYView.

      By default, it is added as the 'Map|Projection|Edit Current' menu item.

      See Also:
    • EDIT_MAP_COMPONENT_ACTION

      public static final int EDIT_MAP_COMPONENT_ACTION

      Constant for an action to edit certain properties of the map, such as the name and visibility of toolbar, layer control and status bar.

      By default, it is added as the 'Edit|Map Properties' menu item.

      See Also:
    • CHANGE_BACKGROUND_COLOR_ACTION

      public static final int CHANGE_BACKGROUND_COLOR_ACTION

      Constant for an action to let the user choose a new background color for the map.

      By default, it is added as the 'Map|Colors|Background' menu item.

      See Also:
    • DELETE_SELECTION_ACTION

      public static final int DELETE_SELECTION_ACTION

      Constant for an action that deletes the selected objects from the ILcdModel they are contained in. The action is enabled if the layer is editable, and if ILcdModel.canRemoveElement returns true.

      By default, it is added to the right click menu of the select controller.

      See Also:
    • CENTER_SELECTION_ACTION

      public static final int CENTER_SELECTION_ACTION

      Constant for an action that centers the map around the selected objects.

      By default, it is added to the right click menu of the select controller.

      See Also:
    • FIT_SELECTION_ACTION

      public static final int FIT_SELECTION_ACTION

      Constant for an action that fits the map around the selected objects.

      By default, it is added to the right click menu of the select controller.

      See Also:
    • OPEN_FILE_ACTION

      public static final int OPEN_FILE_ACTION

      Constant for an action to load a file from disk using the ILcdModelDecoders that are registered to ILcyLucyEnv.

      By default, it is added as the 'File|Open' menu item.

      See Also:
    • SAVE_TO_FILE_ACTION

      public static final int SAVE_TO_FILE_ACTION

      Constant for an action to save the ILcdModel of an ILcdGXYLayer of choice to a file. It does so by using the ILcdModelEncoder that is registered to the ILcdModel.

      By default, it is added as the 'File|Save' menu item.

      See Also:
    • SAVE_AS_FILE_ACTION

      public static final int SAVE_AS_FILE_ACTION

      Constant for an action to save the ILcdModel of an ILcdGXYLayer of choice to a file. It does so by using the ILcdModelEncoders that are registered to ILcyLucyEnv.

      By default, it is added as the 'File|Save As...' menu item.

      See Also:
    • COPY_LAYERS_ACTION

      public static final int COPY_LAYERS_ACTION
      See Also:
    • CLOSE_MAP_ACTION

      @Deprecated public static final int CLOSE_MAP_ACTION
      Deprecated.
      This constant is obsolete.
      See Also:
    • SAVE_LAYER_ACTION

      public static final int SAVE_LAYER_ACTION

      Constant for an action to save the style settings of an ILcdGXYLayer of choice to a file. It does so by using the ILcdGXYLayerEncoders that are registered to ILcyLucyEnv.

      By default, it is added as the 'File|Save Layer Style' menu item.

      See Also:
    • SAVE_LAYER_AS_ACTION

      public static final int SAVE_LAYER_AS_ACTION

      Constant for an action to save the style settings of an ILcdGXYLayer of choice to a file. It does so by using the ILcdGXYLayerEncoders that are registered to ILcyLucyEnv.

      By default, it is added as the 'File|Save Layer Style As' menu item.

      See Also:
    • SAVE_VIEW_AS_IMAGE_ACTION

      public static final int SAVE_VIEW_AS_IMAGE_ACTION

      Constant for an action that will save the main gxy view of the mapcomponent to an image. This image can possibly be georeferenced.

      The action created by the default implementation of TLcyMapComponentFactory will offer the possibility to encode to the non-georeferenced formats JPEG, PNG and GIF, and will also create an ILcdModel and retrieve all ILcdModelEncoder instances that can encode this model. This way these encoders can save the gxy view as a georeferenced image.

      This model will have an TLcdRasterModelDescriptor as model descriptor and contain a single ILcdRaster instance that contains the image of the main gxy view.

      Furthermore this action will try to create an ILcyCustomizerPanel to display and modify the properties of the ILcdModelEncoder instances. For this purpose it will iterate over all registered ILcyCustomizerPanelFactory instances registered with Lucy's user interface manager with a TLcyModelEncoderContext object.

      By default, it is added as the 'File|Save As Image|Map' menu item.

      See Also:
    • COPY_POINT_COORDINATE_ACTION

      public static final int COPY_POINT_COORDINATE_ACTION

      Constant for an action that copies the location of the selected point to the clip board. The coordinate system (model reference) is the native reference of that point. An exception is when ILcyLucyEnv.getDefaultModelReference() returns a non-null value: the specified reference is than used.

      By default, it is added to the right click menu of the select controller.

      Since:
      2016.1.05
      See Also:
    • COPY_LAST_CLICKED_COORDINATE_ACTION

      public static final int COPY_LAST_CLICKED_COORDINATE_ACTION

      Constant for an action that copies the location of the last mouse click to the clip board in a WGS 84 reference. An exception is when ILcyLucyEnv.getDefaultModelReference() returns a non-null value: the specified reference is than used, consistent with how the coordinate read-out on the map behaves.

      When a point is selected, the action disables itself to avoid confusing the user. Note that when this is the case, COPY_POINT_COORDINATE_ACTION will be enabled.

      By default, it is added to the right click menu of the select controller.

      Since:
      2016.1.05
      See Also:
    • SELECT_CONTROLLER

      public static final int SELECT_CONTROLLER

      Constant for an ILcdGXYController to select objects on an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • PAN_CONTROLLER

      public static final int PAN_CONTROLLER

      Constant for an ILcdGXYController to pan an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • ZOOM_CONTROLLER

      public static final int ZOOM_CONTROLLER

      Constant for an ILcdGXYController to zoom an ILcdGXYView.

      By default, it is not added.

      See Also:
    • CONTINUOUS_ZOOM_CONTROLLER

      public static final int CONTINUOUS_ZOOM_CONTROLLER

      Constant for an ILcdGXYController to continuously zoom an ILcdGXYView, by dragging up and down.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • RULER_CONTROLLER

      public static final int RULER_CONTROLLER

      Constant for an ILcdGXYController to measure distances on an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • RECENTER_CONTROLLER

      public static final int RECENTER_CONTROLLER

      Constant for an ILcdGXYController to recenter the projection of an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • MAGNIFIER_CONTROLLER

      public static final int MAGNIFIER_CONTROLLER

      Constant for an ILcdGXYController to magnify a small area of an ILcdGXYView.

      By default, it is added in the menu bar.

      See Also:
    • TOUCH_NAVIGATE_CONTROLLER

      public static final int TOUCH_NAVIGATE_CONTROLLER

      Constant for an ILcdGXYController to navigate an ILcdGXYView using a multitouch device.

      By default it allows panning with one finger and zooming with two.

      See Also:
    • TOUCH_SELECT_CONTROLLER

      public static final int TOUCH_SELECT_CONTROLLER

      Constant for an ILcdGXYController to select and edit object on an ILcdGXYView using a multitouch device.

      See Also:
    • TOUCH_RULER_CONTROLLER

      public static final int TOUCH_RULER_CONTROLLER

      Constant for an ILcdGXYController that can be used to measure distances and angles on an ILcdGXYView using a multitouch device.

      See Also:
    • SELECT_CONTROLLER_ACTIVE_SETTABLE

      public static final int SELECT_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the select controller on an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • PAN_CONTROLLER_ACTIVE_SETTABLE

      public static final int PAN_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the pan controller on an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • ZOOM_CONTROLLER_ACTIVE_SETTABLE

      public static final int ZOOM_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the zoom controller on an ILcdGXYView.

      By default, it is not added.

      See Also:
    • CONTINUOUS_ZOOM_CONTROLLER_ACTIVE_SETTABLE

      public static final int CONTINUOUS_ZOOM_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the continuous zoom controller on an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • RULER_CONTROLLER_ACTIVE_SETTABLE

      public static final int RULER_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the ruler controller on an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • RECENTER_CONTROLLER_ACTIVE_SETTABLE

      public static final int RECENTER_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the recenter controller on an ILcdGXYView.

      By default, it is added on the map tool bar, and in the menu bar.

      See Also:
    • MAGNIFIER_CONTROLLER_ACTIVE_SETTABLE

      public static final int MAGNIFIER_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the magnifier controller on an ILcdGXYView.

      By default, it is added in the menu bar.

      See Also:
    • TOUCH_NAVIGATE_CONTROLLER_ACTIVE_SETTABLE

      public static final int TOUCH_NAVIGATE_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the touch navigation controller on an ILcdGXYView.

      By default, it is added in the menu bar.

      See Also:
    • TOUCH_SELECT_CONTROLLER_ACTIVE_SETTABLE

      public static final int TOUCH_SELECT_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the touch select controller on an ILcdGXYView.

      By default, it is not added in the menu bar and the toolbar.

      See Also:
    • TOUCH_RULER_CONTROLLER_ACTIVE_SETTABLE

      public static final int TOUCH_RULER_CONTROLLER_ACTIVE_SETTABLE

      Constant for an active settable to enable the touch ruler controller on an ILcdGXYView.

      By default, it is not added in the menu bar and the toolbar.

      See Also:
    • GLOBAL_LABEL_DECONFLICTION_ACTIVE_SETTABLE

      public static final int GLOBAL_LABEL_DECONFLICTION_ACTIVE_SETTABLE

      Constant for an active settable to toggle the global label deconfliction of an ILcdGXYView.

      By default, it is added in the menu bar as 'Map|Global Label Decluttering'.

      See Also:
    • SHOW_SCALE_ICON_ACTIVE_SETTABLE

      public static final int SHOW_SCALE_ICON_ACTIVE_SETTABLE

      Constant for an active settable to toggle the visibility of a scale icon on the map.

      By default, it is added in the menu bar as 'Map|Show Scale'.

      See Also:
    • MOUSE_LOCATION_ACTIVE_SETTABLE

      public static final int MOUSE_LOCATION_ACTIVE_SETTABLE

      Constant for an active settable to toggle the on-map mouse location.

      By default, it is added in the menu bar as 'Map|Show Mouse Location'.

      See Also:
    • PROJECTION_CHOICE_COMPONENT

      public static final int PROJECTION_CHOICE_COMPONENT

      Constant for a Component to choose the projection of an ILcdGXYView.

      By default, it is added as a combo box on the tool bar of the map.

      See Also:
    • MAP_SCALE_LABEL_COMPONENT

      public static final int MAP_SCALE_LABEL_COMPONENT

      Constant for a Component to choose the scale of an ILcdGXYView.

      By default, it is added as a combo box on the tool bar of the map.

      See Also:
    • STATUS_BAR_COMPONENT

      public static final int STATUS_BAR_COMPONENT

      Constant for a Component containing status information about the map.

      By default, it contains the mouse location, and is located below the map.

      See Also:
    • LAYER_CONTROL_COMPONENT

      public static final int LAYER_CONTROL_COMPONENT

      Constant for a Component containing a layer control for the map.

      By default, it is created by an associated TLcyMapLayerControlFactory, and located in a separate ILcyApplicationPane.

      See Also:
    • MOUSE_LOCATION_COMPONENT

      public static final int MOUSE_LOCATION_COMPONENT

      Constant for a Component containing the coordinates of the current mouse location over the view.

      See Also:
    • LOGO_ICON_COMPONENT

      public static final int LOGO_ICON_COMPONENT

      Constant for the logo icon component added to the map.

      By default, it is at the lower left of the map.

      See Also:
    • NORTH_CONTAINER

      public static final int NORTH_CONTAINER

      Constant for a Container, typically located at the north of the map.

      By default, it contains the tool bar and the right tool bar.

      See Also:
    • SOUTH_CONTAINER

      public static final int SOUTH_CONTAINER

      Constant for a Container, typically located at the south of the map.

      By default, it contains the status bar.

      See Also:
    • EAST_CONTAINER

      public static final int EAST_CONTAINER

      Constant for a Container, typically located at the east of the map.

      By default, it contains nothing.

      See Also:
    • WEST_CONTAINER

      public static final int WEST_CONTAINER

      Constant for a Container, typically located at the west of the map.

      By default, it contains nothing.

      See Also:
    • CENTER_CONTAINER

      public static final int CENTER_CONTAINER

      Constant for a Container, typically located at the center.

      By default, it contains the main map. It can also contain components that are added over the main view ( see ILcyGenericMapComponent.getMapOverlayPanel() ) .

      See Also:
    • AREA_OF_INTEREST_LAYER

      public static final int AREA_OF_INTEREST_LAYER

      Constant for the area of interest layer. The area of interest is used to let the end-user identify a certain area, for example to load data in that area, etc.

      By default, it is a layer of the map.

      See Also:
    • GRID_LAYER

      public static final int GRID_LAYER

      Constant for the grid layer.

      By default, it is a layer of the map. For instance, this could be a TLcdMapLonLatGridLayer

      See Also:
    • SCALE_ICON

      public static final int SCALE_ICON

      Constant for the icon that indicates the map scale.

      By default, it is at the lower right of the map.

      See Also:
  • Constructor Details

    • TLcyMapComponentFactory

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

      public TLcyMapComponentFactory(ILcyLucyEnv aLucyEnv)
      Creates a new TLcyMapComponentFactory.
      Parameters:
      aLucyEnv - The lucy environment where this map will belong to.
  • Method Details

    • getLucyEnv

      public ILcyLucyEnv getLucyEnv()
      Returns the lucy env associated with this factory.
      Specified by:
      getLucyEnv in class ALcyMapComponentFactory
      Returns:
      the lucy env associated with this factory.
      See Also:
    • setLucyEnv

      public void setLucyEnv(ILcyLucyEnv aLucyEnv)
      Sets the lucy env associated with this factory.
      Specified by:
      setLucyEnv in class ALcyMapComponentFactory
      Parameters:
      aLucyEnv - The lucy environment to set.
      See Also:
    • getConfigSourceName

      public String getConfigSourceName()
      Returns the config source name.
      Returns:
      the config source name.
      See Also:
    • setConfigSourceName

      public void setConfigSourceName(String aConfigSourceName)
      Sets the config source name (e.g. a file name). This factory uses the given configuration source to parse certain creation properties from. Note that all properties can be modified by extending this factory and overriding create and insert/set methods, but sometimes it might be easier to simply adapt the configuration file.
      Parameters:
      aConfigSourceName - The source name of the configuration.
    • getConfigPrefix

      public String getConfigPrefix()
      Returns the configuration prefix. This prefix is used when reading properties from the configuration file.
      Returns:
      The config prefix.
      See Also:
    • setConfigPrefix

      public void setConfigPrefix(String aConfigPrefix)
      Sets the config prefix used to read properties from the configuration file.

      For backward compatibility this prefix is not applied to all properties, only to those properties that start with 'TLcyMapAddon' in 'map_addon.cfg' or 'TLcyMapOverviewAddOn' in 'mapoverview_addon.cfg'.

      Parameters:
      aConfigPrefix - The config prefix to set.
      See Also:
    • getMapLayerControlFactory

      public ILcyMapLayerControlFactory getMapLayerControlFactory()
      Returns the set ILcyMapLayerControlFactory. The default is a TLcyMapLayerControlFactory.
      Returns:
      the set ILcyMapLayerControlFactory.
      See Also:
    • setMapLayerControlFactory

      public void setMapLayerControlFactory(ILcyMapLayerControlFactory aMapLayerControlFactory)
      Sets the ILcyMapLayerControlFactory that is used to create a layer control for a created map component.
      Parameters:
      aMapLayerControlFactory - The factory.
      See Also:
    • createMapComponent

      public ILcyMapComponent createMapComponent()
      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.
      Specified by:
      createMapComponent in class ALcyMapComponentFactory
      Returns:
      a newly created and initialized TLcyMapComponent.
    • finalizeCreation

      protected void finalizeCreation(TLcyMapComponent aMapComponent)
      Method called to finalize the creation process. Can be used for clean up tasks etc.
      Parameters:
      aMapComponent - The map component under construction.
    • createEmptyMapComponent

      protected TLcyMapComponent createEmptyMapComponent()
      Creates an empty (uninitialized) map component.
      Returns:
      an empty (uninitialized) map component.
    • createInitialMapBounds

      protected ILcdBounds createInitialMapBounds(TLcyMapComponent aMapComponent)

      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

      .
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      the bounds
    • setInitialMapBounds

      protected void setInitialMapBounds(ILcdBounds aBounds, TLcyMapComponent aMapComponentSFCT)
      Sets the given bounds as the current bounds to the given map component
      Parameters:
      aBounds - The bounds to set
      aMapComponentSFCT - The map component under construction.
    • createMapName

      protected String createMapName(TLcyMapComponent aMapComponent)
      Creates a map name for the given map.
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      a map name.
    • addNumberToMapNameIfNeeded

      protected String addNumberToMapNameIfNeeded(String aMapName, ILcyMapManager aMapManager)
      Utility method to add a number to a given map name if the map name already exists.
      Parameters:
      aMapName - The base map name.
      aMapManager - The manager containing all existing maps.
      Returns:
      The map name with possibly a number added.
    • setMapName

      protected void setMapName(String aMapName, TLcyMapComponent aMapComponent)
      Sets the given name as the map name of the given map component.
      Parameters:
      aMapName - The map name to set.
      aMapComponent - The map component under construction.
    • createAction

      protected ILcdAction createAction(int aID, TLcyMapComponent aMapComponent)
      Creates an action for the given ID.
      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.
    • insertActionInMenu

      protected void insertActionInMenu(int aID, ILcdAction aAction, TLcyMapComponent aMapComponentSFCT)
      Inserts the given action with the given ID in the menu bar of the given map.
      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.
    • insertActionInPopupMenu

      protected void insertActionInPopupMenu(int aID, ILcdAction aAction, TLcyMapComponent aMapComponentSFCT)
      Inserts the given action with the given ID in the popup menu of the given map.
      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.
    • createActiveSettable

      protected ILcyActiveSettable createActiveSettable(int aID, TLcyMapComponent aMapComponent)
      Creates an active settable for the given ID.
      Parameters:
      aID - The ID of the active settable to create. This is a constant that ends in ACTIVE_SETTABLE, but not in CONTROLLER_ACTIVE_SETTABLE.
      aMapComponent - The map component under construction.
      Returns:
      the newly created active settable, or null.
    • insertActiveSettableInMenu

      protected void insertActiveSettableInMenu(int aID, ILcyActiveSettable aActiveSettable, TLcyMapComponent aMapComponentSFCT)
      Inserts the given active settable into the menu bar of the given map component.
      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.
    • insertActiveSettableInToolBar

      protected void insertActiveSettableInToolBar(int aID, ILcyActiveSettable aActiveSettable, TLcyMapComponent aMapComponentSFCT)
      Inserts the given active settable into the toolbar of the given map component.
      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 toolbar.
      aMapComponentSFCT - The map component into whose toolbar the active settable will be inserted.
    • createGXYController

      protected ILcdGXYController createGXYController(int aID, TLcyMapComponent aMapComponent)
      Creates a ILcdGXYController for the given ID.
      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.
    • insertGXYController

      protected void insertGXYController(int aID, ILcdGXYController aGXYController, TLcyMapComponent aMapComponentSFCT)
      Inserts the given controller into the given map component.
      Parameters:
      aID - The id of the controller to insert. This is a constant that ends in CONTROLLER.
      aGXYController - The controller to insert.
      aMapComponentSFCT - The map to insert the controller into.
    • createGXYControllerActiveSettable

      protected ILcyActiveSettable createGXYControllerActiveSettable(int aID, ILcdGXYController aController, TLcyMapComponent aMapComponent)
      Creates an active settable to toggle the given controller.
      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.
    • createComponent

      protected Component createComponent(int aID, TLcyMapComponent aMapComponent)
      Creates a component for the given ID.
      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)
      Inserts the given component into the given map component.
      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.
    • createContainer

      protected Container createContainer(int aID, TLcyMapComponent aMapComponent)
      Creates a container for the given ID.
      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.
    • insertContainer

      protected void insertContainer(int aID, Container aContainer, TLcyMapComponent aMapComponentSFCT)
      Inserts the given container into the given map component.
      Parameters:
      aID - The ID of the container to insert. This is a constant that ends in CONTAINER.
      aContainer - The container to insert.
      aMapComponentSFCT - The map component to insert the container in.
    • createIcon

      protected ILcdIcon createIcon(int aID, TLcyMapComponent aMapComponent)
      Creates a icon for the given ID.
      Parameters:
      aID - The ID of the icon to create. This is a constant that ends in ICON.
      aMapComponent - The map component under construction.
      Returns:
      The newly created icon, or null.
    • insertIcon

      protected void insertIcon(int aID, ILcdIcon aIcon, TLcyMapComponent aMapComponentSFCT)
      Inserts the given icon into the given map component.
      Parameters:
      aID - The ID of the icon to insert. This is a constant that ends in ICON.
      aIcon - The icon to insert.
      aMapComponentSFCT - The map component to insert the icon into.
    • createGXYLayer

      protected ILcdGXYLayer createGXYLayer(int aID, TLcyMapComponent aMapComponent)
      Creates a layer for the given ID.
      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.
    • insertGXYLayer

      protected void insertGXYLayer(int aID, ILcdGXYLayer aGXYLayer, TLcyMapComponent aMapComponentSFCT)
      Inserts the given layer into the given map component.
      Parameters:
      aID - The ID of the layer to insert. This is a constant that ends in LAYER.
      aGXYLayer - The layer to insert.
      aMapComponentSFCT - The map component where the layer will be inserted into.
    • createGXYView

      protected ILcdGXYView createGXYView(TLcyMapComponent aMapComponent)

      Creates the main ILcdGXYView for the given map component. The view is based on the ILcdTreeLayeredSupport created in 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.

      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      The newly create gxy view. This must not be null!
      See Also:
    • createTreeLayeredSupport

      protected ILcdTreeLayeredSupport createTreeLayeredSupport(TLcyMapComponent aMapComponent)

      Creates the ILcdTreeLayeredSupport used to store the layers of the view created by createGXYView(TLcyMapComponent). The rootnode of the resulting ILcdTreeLayeredSupport is created by calling createRootNode(TLcyMapComponent).

      Parameters:
      aMapComponent - the map component under construction
      Returns:
      the ILcdTreeLayeredSupport used to store the layers of the view
      See Also:
    • createRootNode

      protected ILcdLayerTreeNode createRootNode(TLcyMapComponent aMapComponent)

      Creates the root node of the ILcdTreeLayeredSupport created by createTreeLayeredSupport(TLcyMapComponent).

      Parameters:
      aMapComponent - the map component under construction
      Returns:
      a root node
      See Also:
    • setGXYView

      protected void setGXYView(ILcdGXYView aGXYView, TLcyMapComponent aMapComponentSFCT)
      Sets the given gxy view to the given map component.
      Parameters:
      aGXYView - The gxy view to set.
      aMapComponentSFCT - The map component to set the gxy view to.
    • createGXYLayerOrderManager

      protected ILcyGXYLayerOrderManager createGXYLayerOrderManager(TLcyMapComponent aMapComponent)
      Creates the layer ordering algorithm. Note that the algorithm uses the type provides described in the developer guide (see also ILcyModelContentTypeProvider and ILcyGXYLayerTypeProvider), and usually the correct ordering can be achieved by providing the correct type providers. Replacing the algorithm is rarely needed. If you decide to override this method, you may want to call ALcyAsynchronousPaintFacade.createGXYAsynchronousLayerOrderManager(ILcyGXYLayerOrderManager) to add support for asynchronously painted layers.
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      The layer ordering algorithm.
    • setGXYLayerOrderManager

      protected void setGXYLayerOrderManager(ILcyGXYLayerOrderManager aLayerOrderManager, TLcyMapComponent aMapComponentSFCT)
      Sets the given ILcyGXYLayerOrderManager to the given TLcyMapComponent.
      Parameters:
      aLayerOrderManager - The layer ordering algorithm to set.
      aMapComponentSFCT - The map component under construction.
    • createToolBar

      protected ILcyToolBar createToolBar(TLcyMapComponent aMapComponent)
      Creates a toolbar for the given map component.
      Parameters:
      aMapComponent - The map component under construction.
      Returns:
      The toolbar, or null.
      See Also:
    • createRightToolBar

      protected ILcyToolBar createRightToolBar(TLcyMapComponent aMapComponent)

      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.

      Parameters:
      aMapComponent - The map component under construction
      Returns:
      The tool bar, or null
      Since:
      2016.0
      See Also:
    • createOnMapActionBar

      protected ILcyToolBar createOnMapActionBar(TLcyMapComponent aMapComponent)
      Creates a on map action bar for the given map component. This is a toolbar typically added on top of the map. You can add actions and active settables to it in the same way as you would add them to another toolbar.
      Parameters:
      aMapComponent - The map component under construction
      Returns:
      The toolbar, or null
    • setToolBar

      protected void setToolBar(ILcyToolBar aToolBar, TLcyMapComponent aMapComponentSFCT)
      Sets the given toolbar to the given map component.
      Parameters:
      aToolBar - The toolbar to set.
      aMapComponentSFCT - The map component to set the toolbar to.
      See Also:
    • setRightToolBar

      protected void setRightToolBar(ILcyToolBar aRightToolBar, TLcyMapComponent aMapComponentSFCT)
      Sets the given tool bar to the given map component.
      Parameters:
      aRightToolBar - The tool bar to set. This tool bar was created using the createRightToolBar(TLcyMapComponent) method.
      aMapComponentSFCT - The map component to set the tool bar to
      Since:
      2016.0
      See Also:
    • createPopupMenu

      protected ILcyPopupMenu createPopupMenu(TLcyMapComponent aMapComponent)
      Create a popup menu for the given map component.
      Parameters:
      aMapComponent - The map component to create a popup menu for.
      Returns:
      The popup menu, or null.
    • setPopupMenu

      protected void setPopupMenu(ILcyPopupMenu aPopupMenu, TLcyMapComponent aMapComponentSFCT)
      Sets the given popup menu to the given map component.
      Parameters:
      aPopupMenu - The popup menu to set to the map component.
      aMapComponentSFCT - The map component to set the given popup menu to.
    • createMenuBar

      protected ILcyMenuBar createMenuBar(TLcyMapComponent aMapComponent)
      Creates a menu bar for the given map component.
      Parameters:
      aMapComponent - The map component to create a menu bar for.
      Returns:
      The menu bar, or null.
    • createStatusBar

      protected ILcyToolBar createStatusBar(TLcyMapComponent aMapComponent)
      Creates a status bar for the given map component.
      Parameters:
      aMapComponent - the map component to create a status bar for.
      Returns:
      The status bar, or null
    • setMenuBar

      protected void setMenuBar(ILcyMenuBar aMenuBar, TLcyMapComponent aMapComponentSFCT)
      Sets the given menu bar to the given map component.
      Parameters:
      aMenuBar - The menu bar to set to the map component.
      aMapComponentSFCT - The map component to set the given menu bar to.
    • createBalloonManager

      protected ALcdBalloonManager createBalloonManager(TLcyMapComponent aMapComponent)

      Creates the balloon manager for aMapComponent.

      This method is called from createMapComponent() and it is that method which sets the created balloon manager on the map component. This method is only called when all other parts of the map component are already created and set.

      The default implementation also adds an ILcdSelectionListener to the view of the map component, which calls ALcdBalloonManager.setBalloonDescriptor(com.luciad.view.swing.ALcdBalloonDescriptor) when only one object is selected on the view.

      This default balloon manager uses the balloon content providers registered as a service in the lucy backend.

      Override this method if you want to change the default ALcdBalloonManager.

      Parameters:
      aMapComponent - the map component to create a ALcdBalloonManager for
      Returns:
      the balloon manager, or null
      See Also: