Class McvComponentHolder

All Implemented Interfaces:
PropertyChangeListener, EventListener, Sharable

McIDAS-V needs its own ComponentHolder merely to associate ViewManagers with their parent ComponentHolders. This association is later used in McIDASVViewPanel to create a "hierarchical name" for each ViewManager.

Instead of having something like "Panel 1" appearing in the layer controls, we now have "ComponentHolder Name>Panel 1".

Note: ComponentHolder names always double as tab names! McIDAS-V also intercepts ComponentHolder renaming and updates the layer controls instantly.

  • Field Details

  • Constructor Details

  • Method Details

    • createXmlNode

      Overridden so that we can (one day) do the required extra work to write out the XML for this skin.
      Overrides:
      createXmlNode in class IdvComponentHolder
      Parameters:
      doc - Parent document we'll use for XML generation.
      Returns:
      XML representation of what is being held.
    • doMakeContents

      Overridden so that McV can do the required extra work if this holder is holding a dynamic XML skin.
      Overrides:
      doMakeContents in class IdvComponentHolder
      Returns:
      Contents of this holder as a UI component.
    • doRemove

      public void doRemove()
      Lets the IDV take care of the details, but does null out the local reference to the UIManager.
      Overrides:
      doRemove in class IdvComponentHolder
    • getCategory

      public String getCategory()
      Overridden so that McV can return a more accurate category if this holder is holding a dynamic skin.
      Overrides:
      getCategory in class IdvComponentHolder
      Returns:
      Category name for the type of thing we're holding.
    • getTypeName

      public String getTypeName()
      Overridden so that McV can return a more accurate description if this holder is holding a dynamic skin.
      Overrides:
      getTypeName in class IdvComponentHolder
      Returns:
      The description of what is being held.
    • makeSkin

      protected JComponent makeSkin()
      If the object being held in this component holder is a skin, calling this method will create a component based upon the skin.

      Overridden so that McV can tell the UIManager to associate the skin's ViewManagers with this component holder. That association is used to build the hierarchical names in the ViewPanel.

      Overrides:
      makeSkin in class IdvComponentHolder
      Returns:
      The component represented by this holder's skin.
    • setIdv

      public void setIdv(IntegratedDataViewer idv)
      Mostly used to ensure that the local reference to the UI manager is valid when deserializing.
      Overrides:
      setIdv in class IdvComponentHolder
      Parameters:
      idv - Main IDV reference!
    • setName

      public void setName(String value)
      Set the name of this component holder to the contents of value.

      Overridden so that McV can tell the ViewPanel to update upon a name change.

      Overrides:
      setName in class ComponentHolder
      Parameters:
      value - New name of this component holder.
    • makeDynamicSkin

      Build the UI component using the XML skin contained by this holder.
      Returns:
      UI Component specified by the skin contained in this holder.
    • setAsActiveTab

      public void setAsActiveTab()
      Tell this component holder's component group that the tab corresponding to this holder should become the active tab.