|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.idv.ControlDescriptor
public class ControlDescriptor
This holds a description, derived from a controls.xml file,
of a DisplayControl. It provides facilities
for instantiating the DisplayControl it represents.
| Field Summary | |
|---|---|
static String |
ATTR_CANSTANDALONE
Xml "canstandalone" attribute name for the control descriptor xml |
static String |
ATTR_CATEGORIES
Xml "categories" attribute name for the control descriptor xml |
static String |
ATTR_CLASS
Xml "class" attribute name for the control descriptor xml |
static String |
ATTR_CODE
Xml "code" attribute name for the control descriptor xml |
static String |
ATTR_DESCRIPTION
Xml "description" attribute name for the control descriptor xml |
static String |
ATTR_DISPLAYCATEGORY
Xml "displaycategory" attribute name for the control descriptor xml |
static String |
ATTR_DOESLEVELS
|
static String |
ATTR_ICON
Xml "icon" attribute name for the control descriptor xml |
static String |
ATTR_ID
Xml "id" attribute name for the control descriptor xml |
static String |
ATTR_LABEL
Xml "label" attribute name for the control descriptor xml |
static String |
ATTR_NAME
Xml "name" attribute name for the display xml |
static String |
ATTR_PROPERTIES
Xml "properties" attribute name for the control descriptor xml |
static String |
ATTR_SOURCE
Xml "source" attribute name for the display xml |
static String |
ATTR_TYPE
Xml "type" attribute name for the display xml |
static String |
ATTR_VALUE
Xml "name" attribute value for the display xml |
static 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. |
String |
className
The name of the DisplayControl class this descriptor represents |
static String |
DISPLAYID_MAP
The id in the controls.xml file for the map display |
boolean |
doesLevels
Does this control do levels |
static String |
ID_DISPLAYTEMPLATE
Special control descriptor ID for the display templates |
static String |
PROP_DISPLAYNAME
Xml "label" attribute name for the control descriptor xml |
static String |
TAG_CONTROL
Xml "control" tag name for the control descriptor xml |
static String |
TAG_CONTROLS
Xml "controls" tag name for the control descriptor xml |
static String |
TAG_DATACHOICE
Xml "datachoice" tag name for the display xml |
static String |
TAG_DATASOURCE
Xml "datasource" tag name for the display xml |
static String |
TAG_DISPLAY
Xml "display" tag name for the display xml |
static String |
TAG_PROPERTY
Xml "properties" attribute name for the control descriptor xml |
| Constructor Summary | |
|---|---|
ControlDescriptor()
Parameterless constructor for xml encoding/decoding |
|
ControlDescriptor(IntegratedDataViewer idv,
Element node)
Create the descriptor |
|
ControlDescriptor(IntegratedDataViewer idv,
String displayTemplateFile,
DisplayControl prototype)
Constructor for when we are a wrapper around a display template |
|
| Method Summary | |
|---|---|
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(List categories)
Go through the list of categories. |
boolean |
canStandAlone()
Can this descriptor stand alone |
static void |
createControlDescriptor(IntegratedDataViewer idv,
Element node)
Create the control descriptor described by the given control node |
static void |
createControlDescriptors(IntegratedDataViewer idv,
Element root)
Create the control descriptors described under the root xml element. |
boolean |
doesLevels()
Does levels |
DisplayControl |
doMakeDisplay(DataChoice dataChoice,
IntegratedDataViewer viewer,
String argProperties,
DataSelection dataSelection)
Wrapper method that makes a single element array of DataChoices with the given DataChoice parameter. |
DisplayControl |
doMakeDisplay(List dataChoices,
IntegratedDataViewer viewer,
Hashtable argProperties,
DataSelection dataSelection,
boolean initDisplayInThread)
Instantiate the DisplayControl defined by the Class data member. |
DisplayControl |
doMakeDisplay(List dataChoices,
IntegratedDataViewer viewer,
String argPropertiesString,
DataSelection dataSelection,
boolean initDisplayInThread)
Instantiate the DisplayControl defined by the Class data member. |
static List |
getApplicableControlDescriptors(List categories,
List descriptors)
This finds and returns the set of ControlDescriptors,
from the given descriptors list,
that are applicable to any of the DataCategorys
in the given categories list. |
static List |
getApplicableControlDescriptors(List categories,
List descriptors,
boolean includeStandAlone,
boolean includeIfEmpty)
Find the list of control descriptors that are applicable applicable to the given data categories. |
List |
getCategories()
Get the list of DataCategorys |
String |
getControlId()
Get the control id Mostly used for xml encoding |
String |
getDescription()
get the description Mostly used for xml encoding |
protected void |
getDescriptorXml(StringBuffer sb)
Get the xml representation of the controls.xml node |
String |
getDisplayCategory()
Get the display category. |
String |
getDisplayTemplateFile()
Get the DisplayTemplateFile property. |
String |
getIcon()
Get the path to the icon used in the GUI |
String |
getLabel()
Get the label Mostly used for xml encoding |
Hashtable |
getProperties()
Get the semi-color delimited list of name=value properties that is passed to the display control |
String |
getToolTipText()
Get the tooltip text |
void |
initControl(DisplayControl control,
List newDataChoices,
IntegratedDataViewer idv,
Hashtable newProperties,
DataSelection dataSelection)
Initializes the DisplayControl |
void |
initControl(DisplayControl control,
List newDataChoices,
IntegratedDataViewer idv,
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(String msg,
Throwable exc)
Log the error |
static void |
processDisplayXml(IntegratedDataViewer idv,
String xml)
Process the given display xml file. |
void |
setCategories(List categoryList)
Set the list of DataCategorys |
void |
setDescription(String description)
Set the description Mostly used for xml encoding |
void |
setDisplayCategory(String c)
Set the display category. |
void |
setDisplayTemplateFile(String value)
Set the DisplayTemplateFile property. |
void |
setLabel(String label)
Set the label Mostly used for xml encoding |
void |
showHelp()
Show help for the display control |
String |
toString()
String representation of this object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ID_DISPLAYTEMPLATE
public static final String DISPLAYID_MAP
public static final String TAG_CONTROLS
public static final String TAG_CONTROL
public static final String ATTR_CATEGORIES
public static final String ATTR_DOESLEVELS
public static final String ATTR_DISPLAYCATEGORY
public static final String ATTR_CLASS
public static final String ATTR_DESCRIPTION
public static final String ATTR_CODE
public static final String ATTR_ICON
public static final String ATTR_ID
public static final String ATTR_LABEL
public static final String TAG_PROPERTY
public static final String ATTR_PROPERTIES
public static final String ATTR_CANSTANDALONE
public static final String ATTR_VIEWMANAGERS
public static final String TAG_DISPLAY
public static final String TAG_DATACHOICE
public static final String TAG_DATASOURCE
public static final String ATTR_NAME
public static final String ATTR_VALUE
public static final String ATTR_SOURCE
public static final String ATTR_TYPE
public static final String PROP_DISPLAYNAME
public String className
DisplayControl class this descriptor represents
public boolean canStandAlone
DisplayControl this descriptor represents
can be created without any data choices. (e.g., radar rings)
public boolean doesLevels
| Constructor Detail |
|---|
public ControlDescriptor()
public ControlDescriptor(IntegratedDataViewer idv,
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,
Element node)
throws ClassNotFoundException
idv - The IDVnode - The xml node that defines this descriptor
ClassNotFoundException - When the Class defined by the classname attribute cannot
be found.| Method Detail |
|---|
protected void getDescriptorXml(StringBuffer sb)
sb - buffer to append to
protected static void load(IntegratedDataViewer idv,
XmlResourceCollection resources)
idv - The IDVresources - The collection of controls descriptor .xml files
public static void createControlDescriptors(IntegratedDataViewer idv,
Element root)
idv - The IDVroot - The root of the control descriptor xml
public static void processDisplayXml(IntegratedDataViewer idv,
String xml)
idv - The IDVxml - The xml (e.g., from resources/controls.xml)
public static void createControlDescriptor(IntegratedDataViewer idv,
Element node)
idv - The IDVnode - The control node
public static List getApplicableControlDescriptors(List categories,
List descriptors)
ControlDescriptors,
from the given descriptors list,
that are applicable to any of the DataCategorys
in the given categories list.
categories - List of DataCategorysdescriptors - List of control descriptors
public static List getApplicableControlDescriptors(List categories,
List descriptors,
boolean includeStandAlone,
boolean includeIfEmpty)
categories - The categoriesdescriptors - The descriptors to checkincludeStandAlone - dittoincludeIfEmpty - If we have no categories do we keep going
public void showHelp()
public boolean canStandAlone()
public boolean doesLevels()
public Hashtable getProperties()
public String getIcon()
public List getCategories()
DataCategorys
public void setCategories(List categoryList)
DataCategorys
categoryList - The new category listpublic boolean applicableTo(DataChoice dataChoice)
DataChoice.
dataChoice - The data choice we get the categories from
public boolean applicableTo(DataCategory category)
category - The category to add into the list
public boolean applicableTo(List categories)
categories - The list of DataCategorys
public DisplayControl doMakeDisplay(DataChoice dataChoice,
IntegratedDataViewer viewer,
String argProperties,
DataSelection dataSelection)
throws InstantiationException,
VisADException,
RemoteException,
IllegalAccessException,
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.
IllegalAccessException - When we cannot access the constructor through reflection
InstantiationException - When something bad happens in the reflection based object creation
InvocationTargetException - When something bad happens in the reflection based object creation
RemoteException - When something bad happens in the instantiated DisplayControl
VisADException - When something bad happens in the instantiated DisplayControl
public DisplayControl doMakeDisplay(List dataChoices,
IntegratedDataViewer viewer,
String argPropertiesString,
DataSelection dataSelection,
boolean initDisplayInThread)
throws InstantiationException,
VisADException,
RemoteException,
IllegalAccessException,
InvocationTargetException
dataChoices - List of DataChoices
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 here
IllegalAccessException - When we cannot access the constructor through reflection
InstantiationException - When something bad happens in the reflection based object creation
InvocationTargetException - When something bad happens in the reflection based object creation
RemoteException - When something bad happens in the instantiated DisplayControl
VisADException - When something bad happens in the instantiated DisplayControl
public DisplayControl doMakeDisplay(List dataChoices,
IntegratedDataViewer viewer,
Hashtable argProperties,
DataSelection dataSelection,
boolean initDisplayInThread)
throws InstantiationException,
VisADException,
RemoteException,
IllegalAccessException,
InvocationTargetException
dataChoices - List of DataChoices
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 here
IllegalAccessException - When we cannot access the constructor through reflection
InstantiationException - When something bad happens in the reflection based object creation
InvocationTargetException - When something bad happens in the reflection based object creation
RemoteException - When something bad happens in the instantiated DisplayControl
VisADException - When something bad happens in the instantiated DisplayControl
public void initControl(DisplayControl control,
List newDataChoices,
IntegratedDataViewer idv,
String properties,
DataSelection dataSelection)
DisplayControl
control - The control to initializenewDataChoices - List of DataChoices
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,
List newDataChoices,
IntegratedDataViewer idv,
Hashtable newProperties,
DataSelection dataSelection)
DisplayControl
control - The control to initializenewDataChoices - List of DataChoices
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 String getLabel()
public void setLabel(String label)
label - The labelpublic String getControlId()
public String getDescription()
public String getToolTipText()
public void setDescription(String description)
description - The descriptionpublic String toString()
toString in class Object
public static void logException(String msg,
Throwable exc)
msg - error messageexc - The exceptionpublic String getDisplayCategory()
public void setDisplayCategory(String c)
c - The display categorypublic void setDisplayTemplateFile(String value)
value - The new value for DisplayTemplateFilepublic String getDisplayTemplateFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||