Package weka.gui.beans.xml
Class XMLBeans
java.lang.Object
weka.core.xml.XMLSerialization
weka.core.xml.XMLBasicSerialization
weka.gui.beans.xml.XMLBeans
- All Implemented Interfaces:
RevisionHandler
This class serializes and deserializes a KnowledgeFlow setup to and fro XML.
- Version:
- $Revision: 13476 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
the data that is about to be read/written contains a complete layoutstatic final int
the data that is about to be read/written contains user-components, i.e., Metabeansstatic final int
the index in the Vector, where the BeanConnections are stored (Instances and Connections are stored in a Vector and then serialized)static final int
the index in the Vector, where the BeanInstances are stored (Instances and Connections are stored in a Vector and then serialized)static final String
the value of the animatedIconPath propertystatic final String
the value of the associatedConnections propertystatic final String
the value of the bean propertystatic final String
the value of the beanContext propertystatic final String
the value of the blue propertystatic final String
the value of the color propertystatic final String
the value of the customName propertystatic final String
the value of the dir propertystatic final String
the value of the eventname propertystatic final String
the value of the file propertystatic final String
the value of the font propertystatic final String
the value of the green propertystatic final String
the value of the height propertystatic final String
the value of the hidden propertystatic final String
the value of the iconpath propertystatic final String
the value of the id propertystatic final String
the value of the input propertystatic final String
the value of the input id propertystatic final String
the value of the loader propertystatic final String
the value of the location propertystatic final String
the value of the value propertystatic final String
the value of the options propertystatic final String
the value of the originalCoords propertystatic final String
the value of the outputs id propertystatic final String
the value of the outputs propertystatic final String
the value of the prefix propertystatic final String
the value of the red propertystatic final String
the value of the relationNameForFilename property (Saver)static final String
static final String
the value of the saver propertystatic final String
the value of the size propertystatic final String
the value of the source propertystatic final String
the value of the style propertystatic final String
the value of the subFlow propertystatic final String
the value of the target propertystatic final String
the value of the text propertystatic final String
the value of the width propertystatic final String
the value of the x propertystatic final String
the value of the y propertyFields inherited from class weka.core.xml.XMLBasicSerialization
VAL_CELLS, VAL_KEY, VAL_MAPPING, VAL_VALUE
Fields inherited from class weka.core.xml.XMLSerialization
ATT_ARRAY, ATT_ARRAY_DEFAULT, ATT_CLASS, ATT_NAME, ATT_NULL, ATT_NULL_DEFAULT, ATT_PRIMITIVE, ATT_PRIMITIVE_DEFAULT, ATT_VERSION, DOCTYPE, ROOT_NODE, SUPPRESS_PROPERTY_WARNINGS, TAG_OBJECT, VAL_NO, VAL_ROOT, VAL_YES
-
Constructor Summary
ConstructorDescriptionXMLBeans
(JComponent layout, BeanContextSupport context, int tab) initializes the serialization for layoutsXMLBeans
(JComponent layout, BeanContextSupport context, int datatype, int tab) initializes the serialization for different types of data -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methodsint
returns the type of data that is to be read/writtenreadBeanConnection
(Element node) builds the BeanConnection from the given DOM node.readBeanInstance
(Element node) builds the BeanInstance from the given DOM node.readBeanVisual
(Element node) builds the BeanVisual from the given DOM node.builds the Color from the given DOM node.readColorUIResource
(Element node) builds the ColorUIResource from the given DOM node.readDimension
(Element node) builds the Dimension from the given DOM node.builds the Font from the given DOM node.readFontUIResource
(Element node) builds the FontUIResource from the given DOM node.readLoader
(Element node) builds the Loader from the given DOM node.readMetaBean
(Element node) builds the MetaBean from the given DOM node.builds the Point from the given DOM node.builds the Saver from the given DOM node.void
setDataType
(int value) sets what kind of data is to be read/writtenwriteBeanConnection
(Element parent, Object o, String name) adds the given BeanConncetion to a DOM structure.writeBeanInstance
(Element parent, Object o, String name) adds the given BeanInstance to a DOM structure.writeBeanLoader
(Element parent, Object o, String name) adds the given Loader (a bean) to a DOM structure.writeBeanSaver
(Element parent, Object o, String name) adds the given Saver (a bean) to a DOM structure.writeBeanVisual
(Element parent, Object o, String name) adds the given BeanVisual to a DOM structure.writeColor
(Element parent, Object o, String name) adds the given Color to a DOM structure.writeColorUIResource
(Element parent, Object o, String name) adds the given ColorUIResource to a DOM structure.writeDimension
(Element parent, Object o, String name) adds the given Dimension to a DOM structure.adds the given Font to a DOM structure.writeFontUIResource
(Element parent, Object o, String name) adds the given FontUIResource to a DOM structure.writeLoader
(Element parent, Object o, String name) adds the given Loader to a DOM structure.writeMetaBean
(Element parent, Object o, String name) adds the given MetaBean to a DOM structure.writePoint
(Element parent, Object o, String name) adds the given Point to a DOM structure.writeSaver
(Element parent, Object o, String name) adds the given Saver to a DOM structure.Methods inherited from class weka.core.xml.XMLBasicSerialization
getRevision, readCollection, readCostMatrix, readCostMatrixOld, readDefaultListModel, readMap, readMatrix, readMatrixOld, writeCollection, writeCostMatrix, writeCostMatrixOld, writeDefaultListModel, writeMap, writeMatrix, writeMatrixOld
Methods inherited from class weka.core.xml.XMLSerialization
fromXML, getVersion, main, read, read, read, read, readBooleanFromXML, readByteFromXML, readCharFromXML, readDoubleFromXML, readFloatFromXML, readFromXML, readFromXML, readIntFromXML, readLongFromXML, readShortFromXML, setSuppressWarnings, toXML, write, write, write, write, writeToXML
-
Field Details
-
VAL_ID
the value of the id property- See Also:
-
VAL_X
the value of the x property- See Also:
-
VAL_Y
the value of the y property- See Also:
-
VAL_BEAN
the value of the bean property- See Also:
-
VAL_CUSTOM_NAME
the value of the customName property- See Also:
-
VAL_SOURCEID
the value of the source property- See Also:
-
VAL_TARGETID
the value of the target property- See Also:
-
VAL_EVENTNAME
the value of the eventname property- See Also:
-
VAL_HIDDEN
the value of the hidden property- See Also:
-
VAL_FILE
the value of the file property- See Also:
-
VAL_DIR
the value of the dir property- See Also:
-
VAL_PREFIX
the value of the prefix property- See Also:
-
VAL_RELATIVE_PATH
- See Also:
-
VAL_OPTIONS
the value of the options property- See Also:
-
VAL_SAVER
the value of the saver property- See Also:
-
VAL_LOADER
the value of the loader property- See Also:
-
VAL_TEXT
the value of the text property- See Also:
-
VAL_BEANCONTEXT
the value of the beanContext property- See Also:
-
VAL_WIDTH
the value of the width property- See Also:
-
VAL_HEIGHT
the value of the height property- See Also:
-
VAL_RED
the value of the red property- See Also:
-
VAL_GREEN
the value of the green property- See Also:
-
VAL_BLUE
the value of the blue property- See Also:
-
VAL_NAME
the value of the value property- See Also:
-
VAL_STYLE
the value of the style property- See Also:
-
VAL_LOCATION
the value of the location property- See Also:
-
VAL_SIZE
the value of the size property- See Also:
-
VAL_COLOR
the value of the color property- See Also:
-
VAL_FONT
the value of the font property- See Also:
-
VAL_ICONPATH
the value of the iconpath property- See Also:
-
VAL_ANIMATEDICONPATH
the value of the animatedIconPath property- See Also:
-
VAL_ASSOCIATEDCONNECTIONS
the value of the associatedConnections property- See Also:
-
VAL_INPUTS
the value of the input property- See Also:
-
VAL_INPUTSID
the value of the input id property- See Also:
-
VAL_OUTPUTS
the value of the outputs id property- See Also:
-
VAL_OUTPUTSID
the value of the outputs property- See Also:
-
VAL_SUBFLOW
the value of the subFlow property- See Also:
-
VAL_ORIGINALCOORDS
the value of the originalCoords property- See Also:
-
VAL_RELATIONNAMEFORFILENAME
the value of the relationNameForFilename property (Saver)- See Also:
-
INDEX_BEANINSTANCES
public static final int INDEX_BEANINSTANCESthe index in the Vector, where the BeanInstances are stored (Instances and Connections are stored in a Vector and then serialized)- See Also:
-
INDEX_BEANCONNECTIONS
public static final int INDEX_BEANCONNECTIONSthe index in the Vector, where the BeanConnections are stored (Instances and Connections are stored in a Vector and then serialized)- See Also:
-
DATATYPE_LAYOUT
public static final int DATATYPE_LAYOUTthe data that is about to be read/written contains a complete layout- See Also:
-
m_DataType
- Constant Field Values
-
DATATYPE_USERCOMPONENTS
public static final int DATATYPE_USERCOMPONENTSthe data that is about to be read/written contains user-components, i.e., Metabeans- See Also:
-
m_DataType
- Constant Field Values
-
-
Constructor Details
-
XMLBeans
initializes the serialization for layouts- Parameters:
layout
- the component that manages the layoutcontext
- the bean context support to usetab
- the index of the vector of bean instances or connections to use (this corresponds to a visible tab in the main KnowledgeFlow UI)- Throws:
Exception
- if initialization fails
-
XMLBeans
public XMLBeans(JComponent layout, BeanContextSupport context, int datatype, int tab) throws Exception initializes the serialization for different types of data- Parameters:
layout
- the component that manages the layoutcontext
- the bean context support to usedatatype
- the type of data to read/write- Throws:
Exception
- if initialization fails
-
-
Method Details
-
setDataType
public void setDataType(int value) sets what kind of data is to be read/written- Parameters:
value
- the type of data- See Also:
-
m_DataType
-
getDataType
public int getDataType()returns the type of data that is to be read/written- Returns:
- the type of data
- See Also:
-
m_DataType
-
clear
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods- Overrides:
clear
in classXMLBasicSerialization
- Throws:
Exception
- if something goes wrong
-
writeColor
adds the given Color to a DOM structure.- Overrides:
writeColor
in classXMLBasicSerialization
- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails- See Also:
-
readColor
builds the Color from the given DOM node.- Overrides:
readColor
in classXMLBasicSerialization
- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails- See Also:
-
writeDimension
adds the given Dimension to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readDimension
builds the Dimension from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeFont
adds the given Font to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readFont
builds the Font from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writePoint
adds the given Point to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readPoint
builds the Point from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeColorUIResource
adds the given ColorUIResource to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readColorUIResource
builds the ColorUIResource from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeFontUIResource
adds the given FontUIResource to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readFontUIResource
builds the FontUIResource from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeBeanInstance
adds the given BeanInstance to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readBeanInstance
builds the BeanInstance from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeBeanConnection
adds the given BeanConncetion to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readBeanConnection
builds the BeanConnection from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeBeanLoader
adds the given Loader (a bean) to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
writeBeanSaver
adds the given Saver (a bean) to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
writeLoader
adds the given Loader to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readLoader
builds the Loader from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeSaver
adds the given Saver to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readSaver
builds the Saver from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeBeanVisual
adds the given BeanVisual to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readBeanVisual
builds the BeanVisual from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-
writeMetaBean
adds the given MetaBean to a DOM structure.- Parameters:
parent
- the parent of this object, e.g. the class this object is a member ofo
- the Object to describe in XMLname
- the name of the object- Returns:
- the node that was created
- Throws:
Exception
- if the DOM creation fails
-
readMetaBean
builds the MetaBean from the given DOM node.- Parameters:
node
- the associated XML node- Returns:
- the instance created from the XML description
- Throws:
Exception
- if instantiation fails
-