@SuppressWarnings("unchecked") public void loadLayout(Reader reader,boolean newTab,String flowName) throws Exception {
  if (!newTab) {
    stopFlow();
  }
  m_loadB.setEnabled(false);
  m_saveB.setEnabled(false);
  m_playB.setEnabled(false);
  m_playBB.setEnabled(false);
  if (newTab) {
    m_mainKFPerspective.addTab(flowName);
    m_mainKFPerspective.setEditedStatus(false);
  }
  XMLBeans xml=new XMLBeans(m_beanLayout,m_bcSupport,m_mainKFPerspective.getCurrentTabIndex());
  Vector<Vector<?>> v=(Vector<Vector<?>>)xml.read(reader);
  Vector<Object> beans=(Vector<Object>)v.get(XMLBeans.INDEX_BEANINSTANCES);
  Vector<BeanConnection> connections=(Vector<BeanConnection>)v.get(XMLBeans.INDEX_BEANCONNECTIONS);
  integrateFlow(beans,connections,true,false);
  setEnvironment();
  if (newTab) {
    m_logPanel.clearStatus();
    m_logPanel.statusMessage("@!@[KnowledgeFlow]|Flow loaded.");
  }
  m_loadB.setEnabled(true);
  m_saveB.setEnabled(true);
  m_playB.setEnabled(true);
  m_playBB.setEnabled(true);
}

@ SuppressWarnings ( "unchecked" ) public void loadLayout ( Reader reader , boolean newTab , String flowName ) throws Exception { if ( ! newTab ) { stopFlow ( ) ; } m_loadB . setEnabled ( false ) ; m_saveB . setEnabled ( false ) ; m_playB . setEnabled ( false ) ; m_playBB . setEnabled ( false ) ; if ( newTab ) { m_mainKFPerspective . addTab ( flowName ) ; m_mainKFPerspective . setEditedStatus ( false ) ; } XMLBeans xml = new XMLBeans ( m_beanLayout , m_bcSupport , m_mainKFPerspective . getCurrentTabIndex ( ) ) ; Vector < Vector < ? > > v = ( Vector < Vector < ? > > ) xml . read ( reader ) ; Vector < Object > beans = ( Vector < Object > ) v . get ( XMLBeans . INDEX_BEANINSTANCES ) ; Vector < BeanConnection > connections = ( Vector < BeanConnection > ) v . get ( XMLBeans . INDEX_BEANCONNECTIONS ) ; integrateFlow ( beans , connections , true , false ) ; setEnvironment ( ) ; if ( newTab ) { m_logPanel . clearStatus ( ) ; m_logPanel . statusMessage ( "@!@[KnowledgeFlow]|Flow loaded." ) ; } m_loadB . setEnabled ( true ) ; m_saveB . setEnabled ( true ) ; m_playB . setEnabled ( true ) ; m_playBB . setEnabled ( true ) ; }
load a flow file from a reader . only supports xml serialized flows .
