Class TLcdDAFIFLoader

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class TLcdDAFIFLoader extends JPanel
This component can be used to control loading and unloading of DAFIF (or DAFIFT) data. It allows the user to select the ICAO regions he would like to see for each type of DAFIF (or DAFIFT) data and update the view accordingly.
See Also:
  • Constructor Details

    • TLcdDAFIFLoader

      public TLcdDAFIFLoader(String aDAFIFRoot)
      Create a new loader panel instance.
      Parameters:
      aDAFIFRoot - The source path for reading DAFIF data (split into regions).
    • TLcdDAFIFLoader

      @Deprecated public TLcdDAFIFLoader(String aDAFIFRoot, String aDecoderConfigFile, ALcdAISObjectFactory aDomainFactory)
      Deprecated.
      Create a new loader panel instance with the given arguments..
      Parameters:
      aDAFIFRoot - The source path for reading DAFIF data (split into regions).
      aDecoderConfigFile - The config file containing which decoders to use.
      aDomainFactory - The domain factory to use for creating domain objects.
      Throws:
      IllegalArgumentException - when unsplitted DAFIF edition 7 data is loaded.
    • TLcdDAFIFLoader

      public TLcdDAFIFLoader(String aDAFIFRoot, String aDecoderConfigFile, TLcdAISDataObjectFactory aDomainFactory)
      Create a new loader panel instance with the given arguments..
      Parameters:
      aDAFIFRoot - The source path for reading DAFIF data (split into regions).
      aDecoderConfigFile - The config file containing which decoders to use.
      aDomainFactory - The domain factory to use for creating domain objects.
      Throws:
      IllegalArgumentException - when unsplitted DAFIF edition 7 data is loaded.
    • TLcdDAFIFLoader

      @Deprecated public TLcdDAFIFLoader(String aDAFIFRoot, String aDecoderConfigFile, ALcdAISObjectFactory aDomainFactory, boolean aEnableSubTypeFiltering)
      Deprecated.
      Create a new loader panel instance with the given arguments.
      Parameters:
      aDAFIFRoot - The source path for reading DAFIF data (split into regions).
      aDecoderConfigFile - The config file containing which decoders to use.
      aDomainFactory - The domain factory to use for creating domain objects.
      aEnableSubTypeFiltering - If subtype filtering functionality should be enabled in the loader panel.
      Throws:
      IllegalArgumentException - when unsplitted DAFIF edition 7 data is loaded.
    • TLcdDAFIFLoader

      public TLcdDAFIFLoader(String aDAFIFRoot, String aDecoderConfigFile, TLcdAISDataObjectFactory aDomainFactory, boolean aEnableSubTypeFiltering)
      Create a new loader panel instance with the given arguments.
      Parameters:
      aDAFIFRoot - The source path for reading DAFIF data (split into regions).
      aDecoderConfigFile - The config file containing which decoders to use.
      aDomainFactory - The domain factory to use for creating domain objects.
      aEnableSubTypeFiltering - If subtype filtering functionality should be enabled in the loader panel.
      Throws:
      IllegalArgumentException - when unsplitted DAFIF edition 7 data is loaded.
    • TLcdDAFIFLoader

      @Deprecated public TLcdDAFIFLoader(String aDAFIFRoot, String aDecoderConfigFile, ALcdAISObjectFactory aDomainFactory, boolean aEnableSubTypeFiltering, ILcdStringTranslator aTranslator)
      Deprecated.
      Create a new loader panel instance. The ILcdStringTranslator is used to translate the label of the 'Update' button and the 'Types' in the user interface. It is also passed on to the TLcdDAFIFRegionChooser.
      Parameters:
      aDAFIFRoot - The source path for reading DAFIF data (split into regions).
      aDecoderConfigFile - The config file containing which decoders to use.
      aDomainFactory - The domain factory to use for creating domain objects.
      aEnableSubTypeFiltering - If subtype filtering functionality should be enabled in the loader panel.
      aTranslator - The string translator which will be used for translating strings.
      Throws:
      IllegalArgumentException - when unsplitted DAFIF edition 7 data is loaded.
    • TLcdDAFIFLoader

      public TLcdDAFIFLoader(String aDAFIFRoot, String aDecoderConfigFile, TLcdAISDataObjectFactory aDomainFactory, boolean aEnableSubTypeFiltering, ILcdStringTranslator aTranslator)
      Create a new loader panel instance. The ILcdStringTranslator is used to translate the label of the 'Update' button and the 'Types' in the user interface. It is also passed on to the TLcdDAFIFRegionChooser.
      Parameters:
      aDAFIFRoot - The source path for reading DAFIF data (split into regions).
      aDecoderConfigFile - The config file containing which decoders to use.
      aDomainFactory - The domain factory to use for creating domain objects.
      aEnableSubTypeFiltering - If subtype filtering functionality should be enabled in the loader panel.
      aTranslator - The string translator which will be used for translating strings.
      Throws:
      IllegalArgumentException - when unsplitted DAFIF edition 7 data is loaded.
  • Method Details

    • setEnabled

      public void setEnabled(boolean enabled)
      Overrides:
      setEnabled in class JComponent
    • dispose

      public void dispose()
      Remove all currently loaded data and prepares the loader for being garbage collected. Important note: An instance on which dispose() has been called, should no longer be used in any way.
    • update

      public void update()
      Updates the panel with data from the DAFIF source directory.
    • getLoaderLock

      public Object getLoaderLock()
      All threads needing to synchronize access to the DAFIFLoader should use this lock. (Locking on the TLcdDAFIFLoader itself will potentially block the AWT-thread, since the TLcdDAFIFLoader is a JPanel. This should be avoided.)
      Returns:
      A lock object.
    • isClassTraceOn

      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

      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.
    • modelRemovedExternally

      public void modelRemovedExternally(ILcdModel aModel)
      Signals that the given model has been removed by an external cause and that the current status of all DAFIF loaders should be updated.
      Parameters:
      aModel - The model that has been removed.
    • addStatusListener

      public void addStatusListener(ILcdStatusListener aListener)
      Adds an ILcdStatusListener to all DAFIF loaders used by this instance.
      Parameters:
      aListener - an ILcdStatusListener
    • removeStatusListener

      public void removeStatusListener(ILcdStatusListener aListener)
      Removes the specified status listener.
      Parameters:
      aListener - an ILcdStatusListener
    • addDAFIFLoaderListener

      public void addDAFIFLoaderListener(ILcdDAFIFLoaderListener aListener)
      Adds an ILcdDAFIFLoaderListener to all DAFIF loaders used by this instance.
      Parameters:
      aListener - an ILcdDAFIFLoaderListener
    • removeDAFIFLoaderListener

      public void removeDAFIFLoaderListener(ILcdDAFIFLoaderListener aListener)
      Removes the specified DAFIF loader listener.
      Parameters:
      aListener - an ILcdDAFIFLoaderListener
    • getDAFIFRegionChooser

      public TLcdDAFIFRegionChooser getDAFIFRegionChooser()
      Returns the region chooser panel.
      Returns:
      the region chooser panel.
    • getDAFIFTypeLoaderCount

      public int getDAFIFTypeLoaderCount()
      Returns the number of type loaders that exist within this DAFIF loader.
      Returns:
      The number of type loaders that exist within this DAFIF loader.
    • getDAFIFTypeLoader

      public TLcdDAFIFTypeLoader getDAFIFTypeLoader(int index)
      Returns the DAFIF type loader at the specified index.
      Parameters:
      index - Indicates which type loader you want
      Returns:
      The DAFIF type loader at the specified index.
    • setSelectedTypes

      public void setSelectedTypes(String[] aTypes)
      Sets the specified types active. This method allows you to programmatorically set the state of the check-boxes in the types list. All other types not included in the aTypes will be deselected.
      Parameters:
      aTypes - An array containing the names of the types you wish to select.
    • getSelectedTypes

      public String[] getSelectedTypes()
      Returns the checked types. This method allows you to retrieve the state of the check-boxes in the types list.
      Returns:
      An array with the names of the types that are selected.
    • getSelectedSubTypes

      public String[] getSelectedSubTypes(String aType)
      Returns the checked subTypes for a given type. This method allows you to retrieve the state of the check-boxes in the subtypes list of a type.
      Parameters:
      aType - The type for which the selected subtypes will be returned.
      Returns:
      An array with the names of the types that are selected.
    • setSelectedSubTypes

      public void setSelectedSubTypes(String aType, String[] aSubTypes)
      Sets the selected subtypes for a given type.
      Parameters:
      aType - The name of a type.
      aSubTypes - A list containing names of subtypes of aType, an empty list will clear the selection.