Class McvComponentHolder
- All Implemented Interfaces:
PropertyChangeListener,EventListener,Sharable
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 Summary
FieldsModifier and TypeFieldDescriptionprivate JComponentstatic final StringIDV friendly description of a dynamic XML skin.static final StringUsed to distinguish a dynamic skin from other things.private UIManagerKept around to avoid annoying casting.Fields inherited from class ucar.unidata.idv.ui.IdvComponentHolder
TYPE_CHOOSERS, TYPE_DEFAULT, TYPE_SKINFields inherited from class ucar.unidata.ui.ComponentHolder
ATTR_NAME, BORDER_NAMES, BORDERS, displayBtn, header, isRemoved, nameFld, parentFields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for serialization.McvComponentHolder(IntegratedDataViewer idv, Object obj) Fairly typical constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateXmlNode(Document doc) Overridden so that we can (one day) do the required extra work to write out the XML for this skin.Overridden so that McV can do the required extra work if this holder is holding a dynamic XML skin.voiddoRemove()Lets the IDV take care of the details, but does null out the local reference to the UIManager.Overridden so that McV can return a more accurate category if this holder is holding a dynamic skin.Overridden so that McV can return a more accurate description if this holder is holding a dynamic skin.Build the UI component using the XML skin contained by this holder.protected JComponentmakeSkin()If the object being held in this component holder is a skin, calling this method will create a component based upon the skin.booleanHandles the user attempting to remove thisComponentHolder.voidTell this component holder's component group that the tab corresponding to this holder should become the active tab.voidMostly used to ensure that the local reference to the UI manager is valid when deserializing.voidSet the name of this component holder to the contents ofvalue.Methods inherited from class ucar.unidata.idv.ui.IdvComponentHolder
displayControlHasInitialized, getIcon, getIdv, getName, getObject, getPopupMenuItems, getType, getViewManagers, initWith, removeDisplayControl, setObject, setType, setViewManagers, undockControlMethods inherited from class ucar.unidata.ui.ComponentHolder
applyProperties, clearContents, doMakeHeader, getBeingShown, getBorder, getBorderLayoutLocation, getContents, getHierachicalName, getInternalFrame, getInternalFrameShown, getLayoutRect, getParent, getPropertiesComponents, getRoot, getShowHeader, makeTree, print, setBorder, setBorder, setBorderLayoutLocation, setCategory, setInternalFrameShown, setLayoutRect, setParent, setShowHeader, setState, showPopup, toString, wrapContentsMethods inherited from class ucar.unidata.collab.PropertiedThing
addPropertyChangeListener, doApplyProperties, firePropertyChange, firePropertyChange, getPropertyListeners, getPropertyTabs, isShowing, propertyChange, removePropertyChangeListener, showProperties, showPropertiesMethods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
-
Field Details
-
CATEGORY_DESCRIPTION
IDV friendly description of a dynamic XML skin.- See Also:
-
TYPE_DYNAMIC_SKIN
Used to distinguish a dynamic skin from other things.- See Also:
-
uiManager
Kept around to avoid annoying casting. -
cached
-
-
Constructor Details
-
McvComponentHolder
public McvComponentHolder()Default constructor for serialization. -
McvComponentHolder
Fairly typical constructor.- Parameters:
idv- Reference to the main IDV object.obj- object being held in this component holder.
-
-
Method Details
-
createXmlNode
Overridden so that we can (one day) do the required extra work to write out the XML for this skin.- Overrides:
createXmlNodein classIdvComponentHolder- 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:
doMakeContentsin classIdvComponentHolder- Returns:
- Contents of this holder as a UI component.
-
doRemove
Lets the IDV take care of the details, but does null out the local reference to the UIManager.- Overrides:
doRemovein classIdvComponentHolder
-
removeDisplayComponent
Handles the user attempting to remove thisComponentHolder.Overridden in McIDAS-V to intercept what happens when this holder is either the last tab in the current window, or the last tab in the application session.
If either of the above are true, we hand control off to
IdvWindow.doClose(), which knows when to close the current window vs the entire application.Otherwise, we proceed as normal using
ComponentHolder.removeDisplayComponent().- Overrides:
removeDisplayComponentin classComponentHolder- Returns:
trueif the user decided to close the tab,falseotherwise.
-
getCategory
Overridden so that McV can return a more accurate category if this holder is holding a dynamic skin.- Overrides:
getCategoryin classIdvComponentHolder- Returns:
- Category name for the type of thing we're holding.
-
getTypeName
Overridden so that McV can return a more accurate description if this holder is holding a dynamic skin.- Overrides:
getTypeNamein classIdvComponentHolder- Returns:
- The description of what is being held.
-
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:
makeSkinin classIdvComponentHolder- Returns:
- The component represented by this holder's skin.
-
setIdv
Mostly used to ensure that the local reference to the UI manager is valid when deserializing.- Overrides:
setIdvin classIdvComponentHolder- Parameters:
idv- Main IDV reference!
-
setName
Set the name of this component holder to the contents ofvalue.Overridden so that McV can tell the ViewPanel to update upon a name change.
- Overrides:
setNamein classComponentHolder- 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
Tell this component holder's component group that the tab corresponding to this holder should become the active tab.
-