Interface ILspAWTView

All Superinterfaces:
ILcdLayered, ILcdPropertyChangeSource, ILcdTreeLayered, ILcdView, ILspView, Serializable
All Known Implementing Classes:
ALspAWTView, TLspAWTView, TLspSwingView

public interface ILspAWTView extends ILspView
Defines an ILspView which is represented on screen by an AWT or Swing component. Two components are actually provided by this interface:
  • The host component represents the actual view and is the one that should be added to the application's GUI;
  • The overlay component serves as a container for components that should be overlaid on the view. Examples of such components include map navigation controls as created with TLspNavigationControlsBuilder
Since:
2012.1.05
  • Method Details

    • getHostComponent

      Component getHostComponent()
      Returns the component representing this view. This is the component that should be added to the application's GUI.

      The host component can also be used to print the contents of the view (e.g. using TLcdPrintComponentAction). When creating a more elaborate printing layout, consider using TLspViewComponentPrintable instead.

      Returns:
      a component containing the view
    • getOverlayComponent

      Container getOverlayComponent()

      Returns a component whose contents are overlaid on top of the view.

      Whenever child components are added to or removed from a Swing component that is already showing on screen, care must be taken. This is often the case for the overlay panel. Please refer to TLcdAWTUtil for more explanation. These rules are general Swing considerations, so they also apply to all sub-components.

      A typical code snippet to add a component to the overlay looks like this:

         Container overlay = view.getOverlayComponent();
         TLcdAWTUtil.addComponent(overlay, new JLabel("Info"), TLcdOverlayLayout.Location.NORTH);
       
      Returns:
      a component whose contents are overlaid on top of the view