There are 3 code examples for java.beans.beancontext.BeanContextSupport.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: weka Package: weka.gui.beans
Source Code: SQLViewerPerspective.java (Click to view .java file)
Method Code:
protected void newFlow(){
m_newFlowBut.setEnabled(false);
String user=m_viewer.getUser();
String password=m_viewer.getPassword();
String uRL=m_viewer.getURL();
String query=m_viewer.getQuery();
if (query == null) {
query="";
}
try {
DatabaseLoader dbl=new DatabaseLoader();
dbl.setUser(user);
dbl.setPassword(password);
dbl.setUrl(uRL);
dbl.setQuery(query);
BeanContextSupport bc=new BeanContextSupport();
bc.setDesignTime(true);
Loader loaderComp=new Loader();
bc.add(loaderComp);
loaderComp.setLoader(dbl);
KnowledgeFlowApp singleton=KnowledgeFlowApp.getSingleton();
m_mainPerspective.addTab("DBSource");
BeanInstance beanI=new BeanInstance(m_mainPerspective.getBeanLayout(m_mainPerspective.getNumTabs() - 1),loaderComp,50,50,m_mainPerspective.getNumTabs() - 1);
Vector beans=BeanInstance.getBeanInstances(m_mainPerspective.getNumTabs() - 1);
Vector connections=BeanConnection.getConnections(m_mainPerspective.getNumTabs() - 1);
singleton.integrateFlow(beans,connections,true,false);
singleton.setActivePerspective(0);
m_newFlowBut.setEnabled(true);
}
catch ( Exception ex) {
ex.printStackTrace();
}
}
Project Name: weka Package: weka.gui.beans
Source Code: KnowledgeFlowApp.java (Click to view .java file)
Method Code:
/**
* Save the knowledge flow into the OutputStream passed at input. Only
* supports saving the layout data (no trained models) to XML.
* @param out the output stream to save the layout in
*/
public void saveLayout(OutputStream out,int tabIndex){
Vector beans=BeanInstance.getBeanInstances(tabIndex);
for (int i=0; i < beans.size(); i++) {
BeanInstance tempB=(BeanInstance)beans.elementAt(i);
if (tempB.getBean() instanceof Visible) {
((Visible)(tempB.getBean())).getVisual().removePropertyChangeListener(this);
if (tempB.getBean() instanceof MetaBean) {
((MetaBean)tempB.getBean()).removePropertyChangeListenersSubFlow(this);
}
}
}
try {
Vector v=new Vector();
v.setSize(2);
v.set(XMLBeans.INDEX_BEANINSTANCES,beans);
v.set(XMLBeans.INDEX_BEANCONNECTIONS,BeanConnection.getConnections(tabIndex));
XMLBeans xml=new XMLBeans(m_beanLayout,m_bcSupport,tabIndex);
xml.write(out,v);
}
catch ( Exception ex) {
ex.printStackTrace();
}
finally {
for (int i=0; i < beans.size(); i++) {
BeanInstance tempB=(BeanInstance)beans.elementAt(i);
if (tempB.getBean() instanceof Visible) {
((Visible)(tempB.getBean())).getVisual().addPropertyChangeListener(this);
if (tempB.getBean() instanceof MetaBean) {
((MetaBean)tempB.getBean()).addPropertyChangeListenersSubFlow(this);
}
}
}
}
}
Project Name: weka Package: weka.gui.beans.xml
Source Code: XMLBeans.java (Click to view .java file)
Method Code:
/**
* initializes the serialization for different types of data
* @param layout the component that manages the layout
* @param context the bean context support to use
* @param datatype the type of data to read/write
* @throws Exception if initialization fails
*/
public XMLBeans(JComponent layout,BeanContextSupport context,int datatype,int tab) throws Exception {
super();
m_vectorIndex=tab;
m_BeanLayout=layout;
m_BeanContextSupport=context;
setDataType(datatype);
}