version 1.36 | version 1.37 |
---|
| |
| |
public void init() | public void init() |
{ | { |
| |
if(null != getParameter("TEST")) { | if(null != getParameter("TEST")) { |
return; | return; |
} | } |
| |
} | } |
| |
try { | try { |
if(!file.startsWith("http")) { | |
| if((!file.startsWith("/")) && (!file.startsWith("http"))) { |
// this is a file in the applet directory, so | // this is a file in the applet directory, so |
// reformat the URL | // reformat the URL |
URL u = getDocumentBase(); | URL u = getDocumentBase(); |
| |
file = strURL + "/" +file; | file = strURL + "/" +file; |
} | } |
fileChooserBean1.setFileName(file); | fileChooserBean1.setFileName(file); |
URL u = new URL(file); | |
if(file.endsWith(".wrl")) { | if(file.endsWith(".wrl")) { |
mainBean1.m_mgMolecGraphics.loadVRMLFile(file); | mainBean1.m_mgMolecGraphics.loadVRMLFile(file); |
mainBean1.m_Molecule = null; | mainBean1.m_Molecule = null; |
| mainBean1.m_iRep = MolecGraphics.VRML; |
| |
} | } |
else { | else { |
| URL u = new URL(file); |
mainBean1.m_Molecule = | mainBean1.m_Molecule = |
mainBean1.m_MolecIO.LoadMolecule(u.openStream()); | mainBean1.m_MolecIO.LoadMolecule(u.openStream()); |
} | } |
| |
* @param args ignored | * @param args ignored |
*/ | */ |
public static void main(String[] args) { | public static void main(String[] args) { |
m_jfMainFrame = new JMainFrame(new JMVApplication(), 378, 580); | int appHeight = 500; |
| int appWidth = 500; |
| try { |
| appHeight = Integer.parseInt(args[0]); |
| appWidth = Integer.parseInt(args[1]); |
| } catch (Exception e) { |
| System.out.println("Usage:\njava JMV width height"); |
| } |
| m_jfMainFrame = new JMainFrame(new JMVApplication(), appHeight, appWidth); |
} | } |
| |
static JFrame m_jfMainFrame = null; | static JFrame m_jfMainFrame = null; |