/** * Store a Drawing under a given name. If the file name does not have the correct file extension, * then the file extension is added. * * @param fileName file name of the Drawing under which it should be stored * @param saveDrawing drawing to be saved * @return file name with correct file extension */ public String store(String fileName, Drawing saveDrawing) throws IOException { FileOutputStream stream = new FileOutputStream(adjustFileName(fileName)); StorableOutput output = new StorableOutput(stream); output.writeStorable(saveDrawing); output.close(); return adjustFileName(fileName); }
public void write(StorableOutput dw) { super.write(dw); dw.writeStorable(getStartConnector()); dw.writeStorable(getEndConnector()); }