public class ControlDescriptor
extends java.lang.Object
DisplayControl
. It provides facilities
for instantiating the DisplayControl it represents.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_CANSTANDALONE
Xml "canstandalone" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_CATEGORIES
Xml "categories" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_CLASS
Xml "class" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_CODE
Xml "code" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_DESCRIPTION
Xml "description" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_DISPLAYCATEGORY
Xml "displaycategory" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_DOESLEVELS |
static java.lang.String |
ATTR_ICON
Xml "icon" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_ID
Xml "id" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_LABEL
Xml "label" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_LEVELS
Xml "levels" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_NAME
Xml "name" attribute name for the display xml
|
static java.lang.String |
ATTR_PROPERTIES
Xml "properties" attribute name for the control descriptor xml
|
static java.lang.String |
ATTR_SOURCE
Xml "source" attribute name for the display xml
|
static java.lang.String |
ATTR_TYPE
Xml "type" attribute name for the display xml
|
static java.lang.String |
ATTR_VALUE
Xml "name" attribute value for the display xml
|
static java.lang.String |
ATTR_VIEWMANAGERS
Xml "viewmanagers" attribute name for the control descriptor xml
|
boolean |
canStandAlone
If true the the
DisplayControl this descriptor represents
can be created without any data choices. |
java.lang.String |
className
The name of the
DisplayControl class this descriptor represents |
static java.lang.String |
DISPLAYID_MAP
The id in the controls.xml file for the map display
|
boolean |
doesLevels
Does this control do levels
|
static java.lang.String |
ID_DISPLAYTEMPLATE
Special control descriptor ID for the display templates
|
static java.lang.String |
PROP_DISPLAYNAME
Xml "label" attribute name for the control descriptor xml
|
static java.lang.String |
TAG_CONTROL
Xml "control" tag name for the control descriptor xml
|
static java.lang.String |
TAG_CONTROLS
Xml "controls" tag name for the control descriptor xml
|
static java.lang.String |
TAG_DATACHOICE
Xml "datachoice" tag name for the display xml
|
static java.lang.String |
TAG_DATASOURCE
Xml "datasource" tag name for the display xml
|
static java.lang.String |
TAG_DISPLAY
Xml "display" tag name for the display xml
|
static java.lang.String |
TAG_PROPERTY
Xml "properties" attribute name for the control descriptor xml
|
Constructor and Description |
---|
ControlDescriptor()
Parameterless constructor for xml encoding/decoding
|
ControlDescriptor(IntegratedDataViewer idv,
org.w3c.dom.Element node)
Create the descriptor
|
ControlDescriptor(IntegratedDataViewer idv,
java.lang.String displayTemplateFile,
DisplayControl prototype)
Constructor for when we are a wrapper around a display template
|
Modifier and Type | Method and Description |
---|---|
boolean |
applicableTo(DataCategory category)
Wrapper that calls applicableTo with a list that
contains the given category
|
boolean |
applicableTo(DataChoice dataChoice)
Wrapper that calls applicableTo
with the list of categories of the given
DataChoice . |
boolean |
applicableTo(java.util.List categories)
Go through the list of categories.
|
boolean |
canStandAlone()
Can this descriptor stand alone
|
static void |
createControlDescriptor(IntegratedDataViewer idv,
org.w3c.dom.Element node)
Create the control descriptor described by the given control node
|
static void |
createControlDescriptors(IntegratedDataViewer idv,
org.w3c.dom.Element root)
Create the control descriptors described under the root xml element.
|
boolean |
doesLevels()
Does levels
|
DisplayControl |
doMakeDisplay(DataChoice dataChoice,
IntegratedDataViewer viewer,
java.lang.String argProperties,
DataSelection dataSelection)
Wrapper method that makes a single element array of DataChoices with the given
DataChoice parameter.
|
DisplayControl |
doMakeDisplay(java.util.List dataChoices,
IntegratedDataViewer viewer,
java.util.Hashtable argProperties,
DataSelection dataSelection,
boolean initDisplayInThread)
Instantiate the DisplayControl defined by the Class data member.
|
DisplayControl |
doMakeDisplay(java.util.List dataChoices,
IntegratedDataViewer viewer,
java.lang.String argPropertiesString,
DataSelection dataSelection,
boolean initDisplayInThread)
Instantiate the DisplayControl defined by the Class data member.
|
static java.util.List |
getApplicableControlDescriptors(java.util.List categories,
java.util.List descriptors)
This finds and returns the set of
ControlDescriptor s,
from the given descriptors list,
that are applicable to any of the DataCategory s
in the given categories list. |
static java.util.List |
getApplicableControlDescriptors(java.util.List categories,
java.util.List descriptors,
boolean includeStandAlone,
boolean includeIfEmpty)
Find the list of control descriptors that are applicable
applicable to the given data categories.
|
java.util.List |
getCategories()
Get the list of
DataCategory s |
java.lang.String |
getControlId()
Get the control id
Mostly used for xml encoding
|
java.lang.String |
getDescription()
get the description
Mostly used for xml encoding
|
protected void |
getDescriptorXml(java.lang.StringBuffer sb)
Get the xml representation of the controls.xml node
|
java.lang.String |
getDisplayCategory()
Get the display category.
|
java.lang.String |
getDisplayTemplateFile()
Get the DisplayTemplateFile property.
|
java.lang.String |
getIcon()
Get the path to the icon used in the GUI
|
java.lang.String |
getLabel()
Get the label
Mostly used for xml encoding
|
java.util.List |
getLevels()
Get the levels
|
java.util.Hashtable |
getProperties()
Get the semi-color delimited list of name=value properties
that is passed to the display control
|
java.lang.String |
getToolTipText()
Get the tooltip text
|
void |
initControl(DisplayControl control,
java.util.List newDataChoices,
IntegratedDataViewer idv,
java.util.Hashtable newProperties,
DataSelection dataSelection)
Initializes the
DisplayControl |
void |
initControl(DisplayControl control,
java.util.List newDataChoices,
IntegratedDataViewer idv,
java.lang.String properties,
DataSelection dataSelection)
Deprecated.
Use other initControl
|
protected static void |
load(IntegratedDataViewer idv,
XmlResourceCollection resources)
Iterate through the ControlDescriptor describing xml files defined by the given
resources parameter and create the ControlDescriptor objects
|
static void |
logException(java.lang.String msg,
java.lang.Throwable exc)
Log the error
|
static void |
processDisplayXml(IntegratedDataViewer idv,
java.lang.String xml)
Process the given display xml file.
|
void |
setCategories(java.util.List categoryList)
Set the list of
DataCategory s |
void |
setDescription(java.lang.String description)
Set the description
Mostly used for xml encoding
|
void |
setDisplayCategory(java.lang.String c)
Set the display category.
|
void |
setDisplayTemplateFile(java.lang.String value)
Set the DisplayTemplateFile property.
|
void |
setLabel(java.lang.String label)
Set the label
Mostly used for xml encoding
|
void |
showHelp()
Show help for the display control
|
java.lang.String |
toString()
String representation of this object
|
public static final java.lang.String ID_DISPLAYTEMPLATE
public static final java.lang.String DISPLAYID_MAP
public static final java.lang.String TAG_CONTROLS
public static final java.lang.String TAG_CONTROL
public static final java.lang.String ATTR_CATEGORIES
public static final java.lang.String ATTR_DOESLEVELS
public static final java.lang.String ATTR_DISPLAYCATEGORY
public static final java.lang.String ATTR_CLASS
public static final java.lang.String ATTR_DESCRIPTION
public static final java.lang.String ATTR_CODE
public static final java.lang.String ATTR_ICON
public static final java.lang.String ATTR_ID
public static final java.lang.String ATTR_LABEL
public static final java.lang.String ATTR_LEVELS
public static final java.lang.String TAG_PROPERTY
public static final java.lang.String ATTR_PROPERTIES
public static final java.lang.String ATTR_CANSTANDALONE
public static final java.lang.String ATTR_VIEWMANAGERS
public static final java.lang.String TAG_DISPLAY
public static final java.lang.String TAG_DATACHOICE
public static final java.lang.String TAG_DATASOURCE
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_VALUE
public static final java.lang.String ATTR_SOURCE
public static final java.lang.String ATTR_TYPE
public static final java.lang.String PROP_DISPLAYNAME
public java.lang.String className
DisplayControl
class this descriptor representspublic boolean canStandAlone
DisplayControl
this descriptor represents
can be created without any data choices. (e.g., radar rings)public boolean doesLevels
public ControlDescriptor()
public ControlDescriptor(IntegratedDataViewer idv, java.lang.String displayTemplateFile, DisplayControl prototype)
idv
- The idvdisplayTemplateFile
- The template we are a wrapper around.prototype
- This is the prototype object that is created form the display template.
we get it passed in here so we can grab some of its state (e.g., categories).public ControlDescriptor(IntegratedDataViewer idv, org.w3c.dom.Element node) throws java.lang.ClassNotFoundException
idv
- The IDVnode
- The xml node that defines this descriptorjava.lang.ClassNotFoundException
- When the Class defined by the classname attribute cannot
be found.protected void getDescriptorXml(java.lang.StringBuffer sb)
sb
- buffer to append toprotected static void load(IntegratedDataViewer idv, XmlResourceCollection resources)
idv
- The IDVresources
- The collection of controls descriptor .xml filespublic static void createControlDescriptors(IntegratedDataViewer idv, org.w3c.dom.Element root)
idv
- The IDVroot
- The root of the control descriptor xmlpublic static void processDisplayXml(IntegratedDataViewer idv, java.lang.String xml)
idv
- The IDVxml
- The xml (e.g., from resources/controls.xml)public static void createControlDescriptor(IntegratedDataViewer idv, org.w3c.dom.Element node)
idv
- The IDVnode
- The control nodepublic static java.util.List getApplicableControlDescriptors(java.util.List categories, java.util.List descriptors)
ControlDescriptor
s,
from the given descriptors list,
that are applicable to any of the DataCategory
s
in the given categories list.categories
- List of DataCategory
sdescriptors
- List of control descriptorspublic static java.util.List getApplicableControlDescriptors(java.util.List categories, java.util.List descriptors, boolean includeStandAlone, boolean includeIfEmpty)
categories
- The categoriesdescriptors
- The descriptors to checkincludeStandAlone
- dittoincludeIfEmpty
- If we have no categories do we keep goingpublic void showHelp()
public boolean canStandAlone()
public java.util.List getLevels()
public boolean doesLevels()
public java.util.Hashtable getProperties()
public java.lang.String getIcon()
public java.util.List getCategories()
DataCategory
spublic void setCategories(java.util.List categoryList)
DataCategory
scategoryList
- The new category listpublic boolean applicableTo(DataChoice dataChoice)
DataChoice
.dataChoice
- The data choice we get the categories frompublic boolean applicableTo(DataCategory category)
category
- The category to add into the listpublic boolean applicableTo(java.util.List categories)
categories
- The list of DataCategory
spublic DisplayControl doMakeDisplay(DataChoice dataChoice, IntegratedDataViewer viewer, java.lang.String argProperties, DataSelection dataSelection) throws java.lang.InstantiationException, visad.VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
(List,IntegratedDataView,String,DataSelection)
dataChoice
- The data choice to create the display withviewer
- The IDVargProperties
- Semi-colon separated name=value property stringdataSelection
- The data selection that the user may have defined
for subsetting times, etc.java.lang.IllegalAccessException
- When we cannot access the constructor through reflectionjava.lang.InstantiationException
- When something bad happens in the reflection based object creationjava.lang.reflect.InvocationTargetException
- When something bad happens in the reflection based object creationjava.rmi.RemoteException
- When something bad happens in the instantiated DisplayControlvisad.VisADException
- When something bad happens in the instantiated DisplayControlpublic DisplayControl doMakeDisplay(java.util.List dataChoices, IntegratedDataViewer viewer, java.lang.String argPropertiesString, DataSelection dataSelection, boolean initDisplayInThread) throws java.lang.InstantiationException, visad.VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
dataChoices
- List of DataChoice
s
to instantiate the display control with.viewer
- The IDVargPropertiesString
- Semi-colon separated name=value property stringdataSelection
- The data selection that the user may have defined
for subsetting times, etc.initDisplayInThread
- If true then initialize the display in a thread, else do it herejava.lang.IllegalAccessException
- When we cannot access the constructor through reflectionjava.lang.InstantiationException
- When something bad happens in the reflection based object creationjava.lang.reflect.InvocationTargetException
- When something bad happens in the reflection based object creationjava.rmi.RemoteException
- When something bad happens in the instantiated DisplayControlvisad.VisADException
- When something bad happens in the instantiated DisplayControlpublic DisplayControl doMakeDisplay(java.util.List dataChoices, IntegratedDataViewer viewer, java.util.Hashtable argProperties, DataSelection dataSelection, boolean initDisplayInThread) throws java.lang.InstantiationException, visad.VisADException, java.rmi.RemoteException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
dataChoices
- List of DataChoice
s
to instantiate the display control with.viewer
- The IDVargProperties
- propertiesdataSelection
- The data selection that the user may have defined
for subsetting times, etc.initDisplayInThread
- If true then initialize the display in a thread, else do it herejava.lang.IllegalAccessException
- When we cannot access the constructor through reflectionjava.lang.InstantiationException
- When something bad happens in the reflection based object creationjava.lang.reflect.InvocationTargetException
- When something bad happens in the reflection based object creationjava.rmi.RemoteException
- When something bad happens in the instantiated DisplayControlvisad.VisADException
- When something bad happens in the instantiated DisplayControlpublic void initControl(DisplayControl control, java.util.List newDataChoices, IntegratedDataViewer idv, java.lang.String properties, DataSelection dataSelection)
DisplayControl
control
- The control to initializenewDataChoices
- List of DataChoice
s
to pass to the display controlidv
- The idvproperties
- propertiesdataSelection
- The data selection that the user may have defined
to hold data subsetting information (e.g., times)public void initControl(DisplayControl control, java.util.List newDataChoices, IntegratedDataViewer idv, java.util.Hashtable newProperties, DataSelection dataSelection)
DisplayControl
control
- The control to initializenewDataChoices
- List of DataChoice
s
to pass to the display controlidv
- The idvnewProperties
- Semi-colon delimited list of name=value propertiesdataSelection
- The data selection that the user may have defined
to hold data subsetting information (e.g., times)public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- The labelpublic java.lang.String getControlId()
public java.lang.String getDescription()
public java.lang.String getToolTipText()
public void setDescription(java.lang.String description)
description
- The descriptionpublic java.lang.String toString()
toString
in class java.lang.Object
public static void logException(java.lang.String msg, java.lang.Throwable exc)
msg
- error messageexc
- The exceptionpublic java.lang.String getDisplayCategory()
public void setDisplayCategory(java.lang.String c)
c
- The display categorypublic void setDisplayTemplateFile(java.lang.String value)
value
- The new value for DisplayTemplateFilepublic java.lang.String getDisplayTemplateFile()