Class TLcyKML22GUIFactory

java.lang.Object
com.luciad.lucy.gui.ALcyGUIFactory<Component>
com.luciad.lucy.addons.kml22.TLcyKML22GUIFactory

public class TLcyKML22GUIFactory extends ALcyGUIFactory<Component>

The main GUI Factory for the TLcyKML22AddOn. This GUI Factory creates the panel for the KML content tree. 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. The TLcyKML22GUIFactory creates the following for the KML model content tree:

  • A JTree
  • A TreeModel
  • A TreeCellRenderer
  • A panel containing the KML model content tree

It uses the concept of an ALcyGUIFactory, allowing the users of this class to modify almost every part of the creation process.

The created tree makes use of TLcyKML22TreeModelObject as its domain object.

Since:
10.0
See Also:
  • Field Details

  • Constructor Details

    • TLcyKML22GUIFactory

      public TLcyKML22GUIFactory(ILcyLucyEnv aLucyEnv)

      Creates a new GUI factory with the given parameters. This default constructor builds all actions, component and panels.

      Parameters:
      aLucyEnv - an instance of ILcyLucyEnv
  • Method Details

    • setup

      protected void setup(ALcyProperties aProperties)

      Sets up the KML content tree based on the given parameters. The model content tree will be set up in the following order:

      • Creation and setup of the model of the KML content tree.
      • Creation and setup of the cell renderer of the KML content tree.
      • Creation and setup of the KML content JTree itself.
      Overrides:
      setup in class ALcyGUIFactory<Component>
      Parameters:
      aProperties - a properties object that can be used to tune the behavior of this factory.
    • createGUIContent

      protected Component createGUIContent(ALcyProperties aProperties)
      Description copied from class: ALcyGUIFactory

      Retrieves all panels and lays them out in a java.awt.Component. Therefore, this method uses ALcyGUIFactory.getPanel(int) with all ID's that end in PANEL, and lays out those components in for example a javax.swing.JPanel.

      This function should be overridden when the global layout of the panel needs to be changed, for example when the main panels need to be rearranged, or when a new panel needs to be added.

      An example implementation could be:

      
       public Component createGUIContent( ALcyProperties aProperties ) {
         JPanel content = new JPanel( new BorderLayout() );
      
         Component somePanel = getPanel( SOME_PANEL );
         if ( somePanel != null ) content.add( somePanel, BorderLayout.NORTH );
      
         Component otherPanel = getPanel( OTHER_PANEL );
         if ( otherPanel != null ) content.add( otherPanel, BorderLayout.CENTER );
      
         return content;
        }
       

      Specified by:
      createGUIContent in class ALcyGUIFactory<Component>
      Parameters:
      aProperties - a properties object that can be used to tune the behavior of this factory.
      Returns:
      the component containing all panels, layed out appropriately.
    • createPanel

      protected Component createPanel(int aPanelID, ALcyProperties aProperties)
      Description copied from class: ALcyGUIFactory

      Creates a panel for the given ID. It is safe to use ALcyGUIFactory.getComponent(int) in this method, to build panels that are composed of components.

      An example implementation could be:

      
       protected Component createPanel( int aPanelID, ALcyProperties aProperties ) {
         if ( aPanelID == SOME_PANEL ) {
           JPanel content = new JPanel( new BorderLayout() );
      
           Component someComponent = getComponent( SOME_COMPONENT );
           if ( someComponent != null ) content.add( someComponent, BorderLayout.NORTH );
      
           Component otherComponent = getComponent( OTHER_COMPONENT );
           if ( otherComponent != null ) content.add( otherComponent, BorderLayout.CENTER );
      
           return content;
         }
         else if ( aPanelID == ... ) {
           ...
         }
       }
       

      Specified by:
      createPanel in class ALcyGUIFactory<Component>
      Parameters:
      aPanelID - the ID describing which panel to create. This is normally a constant that ends with PANEL.
      aProperties - a properties object that can be used to tune the behavior of this factory.
      Returns:
      the newly created java.awt.Component, or null.
    • createTree

      protected JTree createTree(int aTreeID, ALcyProperties aProperties)
      Creates the tree corresponding to the ID aTreeID. May return null.
      Parameters:
      aTreeID - the ID of the tree. This is typically a constant ending in TREE.
      aProperties - a properties object that can be used to tune the behavior of this factory.
      Returns:
      the tree corresponding to the ID aTreeID. May be null.
    • createTreeModel

      protected TreeModel createTreeModel(int aTreeModelID, ALcyProperties aProperties)
      Creates the tree model corresponding to the ID aTreeModelID. May return null.
      Parameters:
      aTreeModelID - the ID of the tree model. This is typically a constant ending in TREE_MODEL.
      aProperties - a properties object that can be used to tune the behavior of this factory.
      Returns:
      the tree model corresponding to the ID aTreeModelID. May be null.
    • createTreeCellRenderer

      protected TreeCellRenderer createTreeCellRenderer(int aTreeCellRendererID, ALcyProperties aProperties)
      Creates the tree cell renderer corresponding to the ID aTreeCellRendererID. May return null.
      Parameters:
      aTreeCellRendererID - the ID of the tree cell renderer. This is typically a constant ending in TREE_CELL_RENDERER.
      aProperties - a properties object that can be used to tune the behavior of this factory.
      Returns:
      the tree cell renderer corresponding to the ID aTreeCellRendererID. May be null.
    • getTreeIDs

      public ILcdIntList getTreeIDs()
      Returns the tree ID of the model content tree.
      Returns:
      the tree ID of the model content tree.
    • getTreeModelIDs

      public ILcdIntList getTreeModelIDs()
      Returns the tree model ID of the model content tree.
      Returns:
      the tree model ID of the model content tree.
    • getTreeCellRendererIDs

      public ILcdIntList getTreeCellRendererIDs()
      Returns the tree cell renderer ID of the model content tree.
      Returns:
      the tree cell renderer ID of the model content tree.
    • getTreeModel

      protected TreeModel getTreeModel(int aTreeModelID)

      Returns the TreeModel for the given ID.

      Please refer to setup to know when this method can be used.

      Parameters:
      aTreeModelID - the id describing which TreeModel to return. This is usually a constant that ends in TREE_MODEL.
      Returns:
      the TreeModel for the given ID.
    • getTreeCellRenderer

      protected TreeCellRenderer getTreeCellRenderer(int aTreeCellRendererID)

      Returns the TreeCellRenderer for the given ID.

      Please refer to setup to know when this method can be used.

      Parameters:
      aTreeCellRendererID - the id describing which TreeCellRenderer to return. This is normally a constant that ends in TREE_CELL_RENDERER.
      Returns:
      the TreeCellRenderer for the given ID.
    • getTree

      protected JTree getTree(int aTreeID)

      Returns the JTree for the given ID.

      Please refer to setup to know when this method can be used.

      Parameters:
      aTreeID - the id describing which JTree to return. This is normally a constant that ends in TREE.
      Returns:
      the JTree for the given ID.
    • createAction

      protected ILcdAction createAction(int aActionID, ALcyProperties aProperties)
      Description copied from class: ALcyGUIFactory

      Creates an ILcdAction for the given ID.

      Note: if the action should be inserted in the configured action bars, the ID_KEY of the returned action must be set (see TLcyActionBarUtil.ID_KEY).

      Specified by:
      createAction in class ALcyGUIFactory<Component>
      Parameters:
      aActionID - the ID describing which action to create. This is normally a constant that ends with ACTION.
      aProperties - a properties object that can be used to tune the behavior of this factory.
      Returns:
      the newly created ILcdAction, or null.
      See Also:
    • createActiveSettable

      protected ILcyActiveSettable createActiveSettable(int aActiveSettableID, ALcyProperties aProperties)
      Description copied from class: ALcyGUIFactory

      Creates an ILcyActiveSettable for the given ID.

      Note: if the active settable should be inserted in the configured action bars, the ID_KEY of the returned active settable must be set (see TLcyActionBarUtil.ID_KEY).

      Specified by:
      createActiveSettable in class ALcyGUIFactory<Component>
      Parameters:
      aActiveSettableID - the ID describing which active settable to create. This is normally a constant that ends with ACTIVE_SETTABLE.
      aProperties - a properties object that can be used to tune the behavior of this factory.
      Returns:
      the newly created ILcyActiveSettable, or null.
    • createComponent

      protected Component createComponent(int aComponentID, ALcyProperties aProperties)
      Description copied from class: ALcyGUIFactory

      Creates a widget for the given ID. It is safe to use the ALcyGUIFactory.getAction(int) and ALcyGUIFactory.getActiveSettable(int) methods in this method, to build widgets that use an action or active settable.

      These widgets might interact with the given properties object, to retrieve or store some state. Such a widget could for example be a check box whose 'selected' state is synchronized with some property.

      Specified by:
      createComponent in class ALcyGUIFactory<Component>
      Parameters:
      aComponentID - the ID describing which component to create. This is normally a constant that ends with COMPONENT.
      aProperties - a properties object that can be used to tune the behavior of this factory. state.
      Returns:
      the newly created java.awt.Component, or null.
    • cleanup

      protected void cleanup(ALcyProperties aProperties)
      Description copied from class: ALcyGUIFactory

      Performs cleanup operations, such as nullifying fields that are no longer needed.

      Warning: Should not be overridden without calling the super function.

      Overrides:
      cleanup in class ALcyGUIFactory<Component>
      Parameters:
      aProperties - a properties object that can be used to tune the behavior of this factory.