Browse Source

added serializable to Figure

master
Hannes Dürr 3 years ago
parent
commit
853599a21b

+ 0
- 0
TEST View File


+ 2
- 2
src/mvcgrafik/controller/BtnController.java View File

try try
{ {
//model.datenSpeichern(selectedFile); //model.datenSpeichern(selectedFile);
model.speichereDatei("TEST");
model.speichereDatei(selectedFile.getAbsolutePath());
} }
catch (UnsupportedEncodingException ex) catch (UnsupportedEncodingException ex)
{ {
try try
{ {
//model.datenLesen(selectedFile); //model.datenLesen(selectedFile);
model.ladeDatei("TEST");
model.ladeDatei(selectedFile.getAbsolutePath());
} }
catch (UnsupportedEncodingException ex) catch (UnsupportedEncodingException ex)
{ {

+ 0
- 1
src/mvcgrafik/controller/GrafikController.java View File

} }
Point p = evt.getPoint(); Point p = evt.getPoint();
if(p_old != null){ if(p_old != null){
// view.drawLine(p, p_old);
view.drawLine(p, p_old); view.drawLine(p, p_old);
} }
p_old = p; p_old = p;

+ 2
- 1
src/mvcgrafik/model/Figure.java View File

package mvcgrafik.model; package mvcgrafik.model;


import java.awt.Point; import java.awt.Point;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
* *
* @author chris, hd * @author chris, hd
*/ */
public class Figure
public class Figure implements Serializable
{ {
private ArrayList<Point> punkte; private ArrayList<Point> punkte;

+ 0
- 1
src/mvcgrafik/model/GrafikModel.java View File

FileInputStream fis = new FileInputStream(dateiname); FileInputStream fis = new FileInputStream(dateiname);
BufferedInputStream buffin = new BufferedInputStream(fis); BufferedInputStream buffin = new BufferedInputStream(fis);
ObjectInputStream ois = new ObjectInputStream(buffin); ObjectInputStream ois = new ObjectInputStream(buffin);
Object obj = ois.readObject();
// if (obj instanceof ArrayList) // if (obj instanceof ArrayList)
// { // {
// punkte = (ArrayList<Point>) obj; // punkte = (ArrayList<Point>) obj;

Loading…
Cancel
Save