Logo Search packages:      
Sourcecode: javamorph version File versions  Download package

void javamorph::CMeshDecorator::run (  )  [inline]

Save-on-exit-thread. Save the mesh.

Definition at line 156 of file CMeshDecorator.java.

References f_mesh, mesh, and parent.

                     {
        try{
            /* Do not save a mesh with zero points => avoid empty array. */
            if(0 < mesh.size()){
                /* Provide the file stream. */
                FileOutputStream out = new FileOutputStream(f_mesh);
                out.write('\n');
                /* For all points of the mesh: Write booth coordinates to file. */
                for(Point p: mesh){
                    out.write(("" + p.x + ' ').getBytes());
                    out.write(("" + p.y + '\n').getBytes());
                }
                out.close();
            }else{
                f_mesh.delete();
            }
        }catch(Exception e){
            System.err.println(e.getMessage());
            e.printStackTrace();
            /* Show error pop up. */
            JOptionPane.showMessageDialog
                (parent, "Can't save mesh. See also console output!");
        }
    }


Generated by  Doxygen 1.6.0   Back to index