Package strategy
Class FileDraw
- java.lang.Object
-
- strategy.FileDraw
-
- All Implemented Interfaces:
FileHandler
public class FileDraw extends java.lang.Object implements FileHandler
Class that is responsible to save and open draw as serializable file.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FileInputStream
fileInputStream
private java.io.FileOutputStream
fileOutputStream
private DrawingModel
model
-
Constructor Summary
Constructors Constructor Description FileDraw(DrawingModel model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
open(java.io.File file)
Open serializable file and load it to draw adding shapes to model.void
save(java.io.File file)
Save forwarded file as serializable.
-
-
-
Field Detail
-
fileOutputStream
private java.io.FileOutputStream fileOutputStream
-
fileInputStream
private java.io.FileInputStream fileInputStream
-
model
private DrawingModel model
-
-
Constructor Detail
-
FileDraw
public FileDraw(DrawingModel model)
-
-
Method Detail
-
save
public void save(java.io.File file)
Save forwarded file as serializable.- Specified by:
save
in interfaceFileHandler
-
open
public void open(java.io.File file)
Open serializable file and load it to draw adding shapes to model.- Specified by:
open
in interfaceFileHandler
-
-