本文整理汇总了Java中weka.core.xml.XStream类的典型用法代码示例。如果您正苦于以下问题:Java XStream类的具体用法?Java XStream怎么用?Java XStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XStream类属于weka.core.xml包,在下文中一共展示了XStream类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validateFileFormat
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Validate the file format. After this bean is deserialized, classes for XML
* serialization may not be in the classpath any more.
*
* @param ff the current file format to validate
*/
public Tag validateFileFormat(Tag ff) {
Tag r = ff;
if (ff.getID() == BINARY) {
return ff;
}
if (ff.getID() == KOMLV && !KOML.isPresent()) {
r = null;
}
if (ff.getID() == XSTREAM && !XStream.isPresent()) {
r = null;
}
return r;
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:23,代码来源:SerializedModelSaver.java
示例2: validateFileFormat
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Validate the file format. After this bean is deserialized, classes for
* XML serialization may not be in the classpath any more.
*
* @param ff the current file format to validate
*/
public Tag validateFileFormat(Tag ff) {
Tag r = ff;
if (ff.getID() == BINARY) {
return ff;
}
if (ff.getID() == KOMLV && !KOML.isPresent()) {
r = null;
}
if (ff.getID() == XSTREAM && !XStream.isPresent()) {
r = null;
}
return r;
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:23,代码来源:SerializedModelSaver.java
示例3: serializeClassifierAsJson
import weka.core.xml.XStream; //导入依赖的package包/类
public String serializeClassifierAsJson() throws IOException
{
try {
return XStream.serialize(trainedClassifier);
} catch (Exception e) {
if(e instanceof IOException)
throw (IOException)e;
else
throw new OperationFailedUnexpectedly(e);
}
}
开发者ID:javanotes,项目名称:reactive-data,代码行数:12,代码来源:RegressionModel.java
示例4: deserializeClassifierFromJson
import weka.core.xml.XStream; //导入依赖的package包/类
public Classifier deserializeClassifierFromJson(String xmlString) throws IOException
{
try
{
if (!StringUtils.isEmpty(classifierImpl)) {
Class.forName(classifierImpl);
trainedClassifier = (Classifier) XStream.deSerialize(xmlString);
}
} catch (Exception e) {
throw new IOException(e);
}
return trainedClassifier;
}
开发者ID:javanotes,项目名称:reactive-data,代码行数:15,代码来源:RegressionModel.java
示例5: setupFileChooser
import weka.core.xml.XStream; //导入依赖的package包/类
protected void setupFileChooser() {
if (m_fileChooser == null) {
m_fileChooser =
new JFileChooser(new File(System.getProperty("user.dir")));
}
m_fileChooser.addChoosableFileFilter(m_binaryFilter);
if (KOML.isPresent()) {
m_fileChooser.addChoosableFileFilter(m_KOMLFilter);
}
if (XStream.isPresent()) {
m_fileChooser.addChoosableFileFilter(m_XStreamFilter);
}
m_fileChooser.setFileFilter(m_binaryFilter);
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:16,代码来源:Classifier.java
示例6: saveXStream
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Save a model in XStream deep object serialized XML form.
*
* @param saveTo the file name to save to
* @param model the model to save
* @param header the header of the data that was used to train the model
* (optional)
*/
public static void saveXStream(File saveTo, Object model, Instances header)
throws Exception {
Vector<Object> v = new Vector<Object>();
v.add(model);
if (header != null) {
v.add(header);
}
v.trimToSize();
XStream.write(saveTo.getAbsolutePath(), v);
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:19,代码来源:SerializedModelSaver.java
示例7: setupFileChooser
import weka.core.xml.XStream; //导入依赖的package包/类
protected void setupFileChooser() {
if (m_fileChooser == null) {
m_fileChooser =
new JFileChooser(new File(System.getProperty("user.dir")));
}
m_fileChooser.addChoosableFileFilter(m_binaryFilter);
if (KOML.isPresent()) {
m_fileChooser.addChoosableFileFilter(m_KOMLFilter);
}
if (XStream.isPresent()) {
m_fileChooser.addChoosableFileFilter(m_XStreamFilter);
}
m_fileChooser.setFileFilter(m_binaryFilter);
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:16,代码来源:Classifier.java
示例8: saveModel
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Helper routine to actually save the models.
*/
private void saveModel(String fileName, Instances trainHeader, Object model) {
m_fileFormat = validateFileFormat(m_fileFormat);
if (m_fileFormat == null) {
// default to binary if validation fails
m_fileFormat = s_fileFormatsAvailable.get(0);
}
try {
switch (m_fileFormat.getID()) {
case KOMLV:
fileName = fileName + KOML.FILE_EXTENSION + FILE_EXTENSION;
saveKOML(new File(fileName), model, trainHeader);
break;
case XSTREAM:
fileName = fileName + XStream.FILE_EXTENSION + FILE_EXTENSION;
saveXStream(new File(fileName), model, trainHeader);
break;
default:
fileName = fileName + "." + FILE_EXTENSION;
saveBinary(new File(fileName), model, trainHeader);
break;
}
} catch (Exception ex) {
stop(); // stop all processing
System.err.println("[SerializedModelSaver] Problem saving model");
if (m_logger != null) {
m_logger.logMessage("[SerializedModelSaver] "
+ statusMessagePrefix() + " Problem saving model");
m_logger.statusMessage(statusMessagePrefix()
+ "ERROR (See log for details)");
}
}
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:36,代码来源:SerializedModelSaver.java
示例9: saveXStream
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Save a model in XStream deep object serialized XML form.
*
* @param saveTo the file name to save to
* @param model the model to save
* @param header the header of the data that was used to train the model (optional)
*/
public static void saveXStream(File saveTo, Object model, Instances header) throws Exception {
Vector v = new Vector();
v.add(model);
if (header != null) {
v.add(header);
}
v.trimToSize();
XStream.write(saveTo.getAbsolutePath(), v);
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:17,代码来源:SerializedModelSaver.java
示例10: setupFileChooser
import weka.core.xml.XStream; //导入依赖的package包/类
protected void setupFileChooser() {
if (m_fileChooser == null) {
m_fileChooser = new JFileChooser(new File(System.getProperty("user.dir")));
}
m_fileChooser.addChoosableFileFilter(m_binaryFilter);
if (KOML.isPresent()) {
m_fileChooser.addChoosableFileFilter(m_KOMLFilter);
}
if (XStream.isPresent()) {
m_fileChooser.addChoosableFileFilter(m_XStreamFilter);
}
m_fileChooser.setFileFilter(m_binaryFilter);
}
开发者ID:williamClanton,项目名称:jbossBA,代码行数:15,代码来源:Classifier.java
示例11: saveModel
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Helper routine to actually save the models.
*/
private void saveModel(String fileName, Instances trainHeader, Object model) {
m_fileFormat = validateFileFormat(m_fileFormat);
if (m_fileFormat == null) {
// default to binary if validation fails
m_fileFormat = s_fileFormatsAvailable.get(0);
}
try {
switch (m_fileFormat.getID()) {
case KOMLV:
fileName = fileName + KOML.FILE_EXTENSION + FILE_EXTENSION;
saveKOML(new File(fileName), model, trainHeader);
break;
case XSTREAM:
fileName = fileName + XStream.FILE_EXTENSION + FILE_EXTENSION;
saveXStream(new File(fileName), model, trainHeader);
break;
default:
fileName = fileName + "." + FILE_EXTENSION;
saveBinary(new File(fileName), model, trainHeader);
break;
}
} catch (Exception ex) {
System.err.println(Messages.getInstance().getString(
"SerializedModelSaver_SaveModel_Error_Text"));
if (m_logger != null) {
m_logger.logMessage(Messages.getInstance().getString(
"SerializedModelSaver_SaveModel_LogMessage_Text_First")
+ statusMessagePrefix()
+ Messages.getInstance().getString(
"SerializedModelSaver_SaveModel_LogMessage_Text_Second")
+ " : "
+ ex.getMessage());
m_logger.statusMessage(statusMessagePrefix()
+ Messages.getInstance().getString(
"SerializedModelSaver_SaveModel_StatusMessage_Text"));
}
}
}
开发者ID:williamClanton,项目名称:jbossBA,代码行数:43,代码来源:SerializedModelSaver.java
示例12: saveXStream
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Save a model in XStream deep object serialized XML form.
*
* @param saveTo the file name to save to
* @param model the model to save
* @param header the header of the data that was used to train the model
* (optional)
*/
public static void saveXStream(File saveTo, Object model, Instances header)
throws Exception {
Vector v = new Vector();
v.add(model);
if (header != null) {
v.add(header);
}
v.trimToSize();
XStream.write(saveTo.getAbsolutePath(), v);
}
开发者ID:williamClanton,项目名称:jbossBA,代码行数:19,代码来源:SerializedModelSaver.java
示例13: loadModel
import weka.core.xml.XStream; //导入依赖的package包/类
public void loadModel() {
try {
if (m_fileChooser == null) {
// i.e. after de-serialization
setupFileChooser();
}
int returnVal = m_fileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File loadFrom = m_fileChooser.getSelectedFile();
// add extension if necessary
if (m_fileChooser.getFileFilter() == m_binaryFilter) {
if (!loadFrom.getName().toLowerCase().endsWith("." + FILE_EXTENSION)) {
loadFrom =
new File(loadFrom.getParent(), loadFrom.getName() + "."
+ FILE_EXTENSION);
}
} else if (m_fileChooser.getFileFilter() == m_KOMLFilter) {
if (!loadFrom.getName().toLowerCase()
.endsWith(KOML.FILE_EXTENSION + FILE_EXTENSION)) {
loadFrom =
new File(loadFrom.getParent(), loadFrom.getName()
+ KOML.FILE_EXTENSION + FILE_EXTENSION);
}
} else if (m_fileChooser.getFileFilter() == m_XStreamFilter) {
if (!loadFrom.getName().toLowerCase()
.endsWith(XStream.FILE_EXTENSION + FILE_EXTENSION)) {
loadFrom =
new File(loadFrom.getParent(), loadFrom.getName()
+ XStream.FILE_EXTENSION + FILE_EXTENSION);
}
}
loadFromFile(loadFrom);
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(Classifier.this,
"Problem loading classifier.\n" + ex.getMessage(), "Load Model",
JOptionPane.ERROR_MESSAGE);
if (m_log != null) {
m_log.statusMessage(statusMessagePrefix() + "ERROR: unable to load "
+ "model (see log).");
m_log.logMessage("[Classifier] " + statusMessagePrefix()
+ "Problem loading classifier. " + ex.getMessage());
}
}
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:48,代码来源:Classifier.java
示例14: saveModel
import weka.core.xml.XStream; //导入依赖的package包/类
public void saveModel() {
try {
if (m_fileChooser == null) {
// i.e. after de-serialization
setupFileChooser();
}
int returnVal = m_fileChooser.showSaveDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File saveTo = m_fileChooser.getSelectedFile();
String fn = saveTo.getAbsolutePath();
if (m_fileChooser.getFileFilter() == m_binaryFilter) {
if (!fn.toLowerCase().endsWith("." + FILE_EXTENSION)) {
fn += "." + FILE_EXTENSION;
}
} else if (m_fileChooser.getFileFilter() == m_KOMLFilter) {
if (!fn.toLowerCase().endsWith(KOML.FILE_EXTENSION + FILE_EXTENSION)) {
fn += KOML.FILE_EXTENSION + FILE_EXTENSION;
}
} else if (m_fileChooser.getFileFilter() == m_XStreamFilter) {
if (!fn.toLowerCase().endsWith(
XStream.FILE_EXTENSION + FILE_EXTENSION)) {
fn += XStream.FILE_EXTENSION + FILE_EXTENSION;
}
}
saveTo = new File(fn);
// now serialize model
// KOML?
if ((KOML.isPresent())
&& saveTo.getAbsolutePath().toLowerCase()
.endsWith(KOML.FILE_EXTENSION + FILE_EXTENSION)) {
SerializedModelSaver.saveKOML(saveTo, m_Classifier,
(m_trainingSet != null) ? new Instances(m_trainingSet, 0) : null);
/*
* Vector v = new Vector(); v.add(m_Classifier); if (m_trainingSet !=
* null) { v.add(new Instances(m_trainingSet, 0)); } v.trimToSize();
* KOML.write(saveTo.getAbsolutePath(), v);
*/
} /* XStream */else if ((XStream.isPresent())
&& saveTo.getAbsolutePath().toLowerCase()
.endsWith(XStream.FILE_EXTENSION + FILE_EXTENSION)) {
SerializedModelSaver.saveXStream(saveTo, m_Classifier,
(m_trainingSet != null) ? new Instances(m_trainingSet, 0) : null);
/*
* Vector v = new Vector(); v.add(m_Classifier); if (m_trainingSet !=
* null) { v.add(new Instances(m_trainingSet, 0)); } v.trimToSize();
* XStream.write(saveTo.getAbsolutePath(), v);
*/
} else /* binary */{
ObjectOutputStream os =
new ObjectOutputStream(new BufferedOutputStream(
new FileOutputStream(saveTo)));
os.writeObject(m_Classifier);
if (m_trainingSet != null) {
Instances header = new Instances(m_trainingSet, 0);
os.writeObject(header);
}
os.close();
}
if (m_log != null) {
m_log.statusMessage(statusMessagePrefix() + "Model saved.");
m_log.logMessage("[Classifier] " + statusMessagePrefix()
+ " Saved classifier " + getCustomName());
}
}
} catch (Exception ex) {
JOptionPane
.showMessageDialog(Classifier.this, "Problem saving classifier.\n",
"Save Model", JOptionPane.ERROR_MESSAGE);
if (m_log != null) {
m_log.statusMessage(statusMessagePrefix() + "ERROR: unable to"
+ " save model (see log).");
m_log.logMessage("[Classifier] " + statusMessagePrefix()
+ " Problem saving classifier " + getCustomName() + ex.getMessage());
}
}
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:79,代码来源:Classifier.java
示例15: loadLayout
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Load a pre-saved layout
*/
private void loadLayout() {
m_loadB.setEnabled(false);
m_saveB.setEnabled(false);
m_playB.setEnabled(false);
m_playBB.setEnabled(false);
int returnVal = m_FileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
// stopFlow();
// determine filename
File oFile = m_FileChooser.getSelectedFile();
// set internal flow directory environment variable
// add extension if necessary
if (m_FileChooser.getFileFilter() == m_KfFilter) {
if (!oFile.getName().toLowerCase().endsWith(FILE_EXTENSION)) {
oFile = new File(oFile.getParent(), oFile.getName() + FILE_EXTENSION);
}
} else if (m_FileChooser.getFileFilter() == m_KOMLFilter) {
if (!oFile.getName().toLowerCase().endsWith(KOML.FILE_EXTENSION + "kf")) {
oFile = new File(oFile.getParent(), oFile.getName()
+ KOML.FILE_EXTENSION + "kf");
}
} else if (m_FileChooser.getFileFilter() == m_XMLFilter) {
if (!oFile.getName().toLowerCase().endsWith(FILE_EXTENSION_XML)) {
oFile = new File(oFile.getParent(), oFile.getName()
+ FILE_EXTENSION_XML);
}
} else if (m_FileChooser.getFileFilter() == m_XStreamFilter) {
if (!oFile.getName().toLowerCase()
.endsWith(XStream.FILE_EXTENSION + "kf")) {
oFile = new File(oFile.getParent(), oFile.getName()
+ XStream.FILE_EXTENSION + "kf");
}
}
String flowName = oFile.getName();
if (flowName.lastIndexOf('.') > 0) {
flowName = flowName.substring(0, flowName.lastIndexOf('.'));
}
loadLayout(oFile, getAllowMultipleTabs());
}
m_loadB.setEnabled(true);
m_playB.setEnabled(true);
m_playBB.setEnabled(true);
m_saveB.setEnabled(true);
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:53,代码来源:KnowledgeFlowApp.java
示例16: saveLayout
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Serialize the layout to a file
*/
private void saveLayout(int tabIndex, boolean showDialog) {
getBackground();
File sFile = m_mainKFPerspective.getFlowFile(tabIndex);
int returnVal = JFileChooser.APPROVE_OPTION;
boolean shownDialog = false;
if (showDialog || sFile.getName().equals("-NONE-")) {
returnVal = m_FileChooser.showSaveDialog(this);
shownDialog = true;
}
if (returnVal == JFileChooser.APPROVE_OPTION) {
// temporarily remove this panel as a property changle listener from
// each bean
Vector<Object> beans = BeanInstance.getBeanInstances(tabIndex);
detachFromLayout(beans);
// determine filename (if necessary)
if (shownDialog) {
sFile = m_FileChooser.getSelectedFile();
}
// add extension if necessary
if (m_FileChooser.getFileFilter() == m_KfFilter) {
if (!sFile.getName().toLowerCase().endsWith(FILE_EXTENSION)) {
sFile = new File(sFile.getParent(), sFile.getName() + FILE_EXTENSION);
}
} else if (m_FileChooser.getFileFilter() == m_KOMLFilter) {
if (!sFile.getName().toLowerCase().endsWith(KOML.FILE_EXTENSION + "kf")) {
sFile = new File(sFile.getParent(), sFile.getName()
+ KOML.FILE_EXTENSION + "kf");
}
} else if (m_FileChooser.getFileFilter() == m_XStreamFilter) {
if (!sFile.getName().toLowerCase()
.endsWith(XStream.FILE_EXTENSION + "kf")) {
sFile = new File(sFile.getParent(), sFile.getName()
+ XStream.FILE_EXTENSION + "kf");
}
} else if (m_FileChooser.getFileFilter() == m_XMLFilter) {
if (!sFile.getName().toLowerCase().endsWith(FILE_EXTENSION_XML)) {
sFile = new File(sFile.getParent(), sFile.getName()
+ FILE_EXTENSION_XML);
}
}
saveLayout(sFile, m_mainKFPerspective.getCurrentTabIndex(), false);
m_mainKFPerspective.setFlowFile(tabIndex, sFile);
}
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:55,代码来源:KnowledgeFlowApp.java
示例17: loadModel
import weka.core.xml.XStream; //导入依赖的package包/类
public void loadModel() {
try {
if (m_fileChooser == null) {
// i.e. after de-serialization
setupFileChooser();
}
int returnVal = m_fileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File loadFrom = m_fileChooser.getSelectedFile();
// add extension if necessary
if (m_fileChooser.getFileFilter() == m_binaryFilter) {
if (!loadFrom.getName().toLowerCase().endsWith("." + FILE_EXTENSION)) {
loadFrom = new File(loadFrom.getParent(),
loadFrom.getName() + "." + FILE_EXTENSION);
}
} else if (m_fileChooser.getFileFilter() == m_KOMLFilter) {
if (!loadFrom.getName().toLowerCase().endsWith(KOML.FILE_EXTENSION
+ FILE_EXTENSION)) {
loadFrom = new File(loadFrom.getParent(),
loadFrom.getName() + KOML.FILE_EXTENSION
+ FILE_EXTENSION);
}
} else if (m_fileChooser.getFileFilter() == m_XStreamFilter) {
if (!loadFrom.getName().toLowerCase().endsWith(XStream.FILE_EXTENSION
+ FILE_EXTENSION)) {
loadFrom = new File(loadFrom.getParent(),
loadFrom.getName() + XStream.FILE_EXTENSION
+ FILE_EXTENSION);
}
}
loadFromFile(loadFrom);
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(Classifier.this,
"Problem loading classifier.\n"
+ ex.getMessage(),
"Load Model",
JOptionPane.ERROR_MESSAGE);
if (m_log != null) {
m_log.statusMessage(statusMessagePrefix() + "ERROR: unable to load " +
"model (see log).");
m_log.logMessage("[Classifier] " + statusMessagePrefix()
+ "Problem loading classifier. "
+ ex.getMessage());
}
}
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:50,代码来源:Classifier.java
示例18: loadLayout
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Load a pre-saved layout
*/
private void loadLayout() {
m_loadB.setEnabled(false);
m_saveB.setEnabled(false);
m_playB.setEnabled(false);
m_playBB.setEnabled(false);
int returnVal = m_FileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
stopFlow();
// determine filename
File oFile = m_FileChooser.getSelectedFile();
// set internal flow directory environment variable
// add extension if necessary
if (m_FileChooser.getFileFilter() == m_KfFilter) {
if (!oFile.getName().toLowerCase().endsWith(FILE_EXTENSION)) {
oFile = new File(oFile.getParent(),
oFile.getName() + FILE_EXTENSION);
}
} else if (m_FileChooser.getFileFilter() == m_KOMLFilter) {
if (!oFile.getName().toLowerCase().endsWith(KOML.FILE_EXTENSION + "kf")) {
oFile = new File(oFile.getParent(),
oFile.getName() + KOML.FILE_EXTENSION + "kf");
}
} else if (m_FileChooser.getFileFilter() == m_XMLFilter) {
if (!oFile.getName().toLowerCase().endsWith(FILE_EXTENSION_XML)) {
oFile = new File(oFile.getParent(),
oFile.getName() + FILE_EXTENSION_XML);
}
} else if (m_FileChooser.getFileFilter() == m_XStreamFilter) {
if (!oFile.getName().toLowerCase().endsWith(XStream.FILE_EXTENSION +"kf")) {
oFile = new File(oFile.getParent(),
oFile.getName() + XStream.FILE_EXTENSION + "kf");
}
}
String flowName = oFile.getName();
if (flowName.lastIndexOf('.') > 0) {
flowName = flowName.substring(0, flowName.lastIndexOf('.'));
}
loadLayout(oFile, getAllowMultipleTabs());
}
m_loadB.setEnabled(true);
m_playB.setEnabled(true);
m_playBB.setEnabled(true);
m_saveB.setEnabled(true);
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:53,代码来源:KnowledgeFlowApp.java
示例19: saveLayout
import weka.core.xml.XStream; //导入依赖的package包/类
/**
* Serialize the layout to a file
*/
private void saveLayout(int tabIndex, boolean showDialog) {
// m_loadB.setEnabled(false);
// m_saveB.setEnabled(false);
java.awt.Color bckC = getBackground();
File sFile = m_mainKFPerspective.getFlowFile(tabIndex);
int returnVal = JFileChooser.APPROVE_OPTION;
if (showDialog || sFile.getName().equals("-NONE-")) {
returnVal = m_FileChooser.showSaveDialog(this);
}
if (returnVal == JFileChooser.APPROVE_OPTION) {
// temporarily remove this panel as a property changle listener from
// each bean
Vector beans =
BeanInstance.getBeanInstances(tabIndex);
detachFromLayout(beans);
// determine filename
sFile = m_FileChooser.getSelectedFile();
// add extension if necessary
if (m_FileChooser.getFileFilter() == m_KfFilter) {
if (!sFile.getName().toLowerCase().endsWith(FILE_EXTENSION)) {
sFile = new File(sFile.getParent(),
sFile.getName() + FILE_EXTENSION);
}
} else if (m_FileChooser.getFileFilter() == m_KOMLFilter) {
if (!sFile.getName().toLowerCase().endsWith(KOML.FILE_EXTENSION + "kf")) {
sFile = new File(sFile.getParent(),
sFile.getName() + KOML.FILE_EXTENSION + "kf");
}
} else if (m_FileChooser.getFileFilter() == m_XStreamFilter) {
if (!sFile.getName().toLowerCase().endsWith(XStream.FILE_EXTENSION + "kf")) {
sFile = new File(sFile.getParent(),
sFile.getName() + XStream.FILE_EXTENSION + "kf");
}
} else if (m_FileChooser.getFileFilter() == m_XMLFilter) {
if (!sFile.getName().toLowerCase().endsWith(FILE_EXTENSION_XML)) {
sFile = new File(sFile.getParent(),
sFile.getName() + FILE_EXTENSION_XML);
}
}
saveLayout(sFile, m_mainKFPerspective.getCurrentTabIndex(), false);
m_mainKFPerspective.setFlowFile(tabIndex, sFile);
}
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:54,代码来源:KnowledgeFlowApp.java
注:本文中的weka.core.xml.XStream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论