Examples of UniverseContextIO


Examples of barsuift.simLife.universe.UniverseContextIO

    public void testOpen() throws OpenException, SaveException {
        // create a test file to be read
        BasicUniverseContextFactory factory = new BasicUniverseContextFactory();
        UniverseContext universeContext = factory.createRandom();
        UniverseContextIO io = new UniverseContextIO(saveFile);
        io.write(universeContext);
        // now try to read it
        UniverseContext universeContext2 = application.openUniverse(saveFile);
        assertEquals(universeContext.getState(), universeContext2.getState());
    }
View Full Code Here

Examples of barsuift.simLife.universe.UniverseContextIO

        return currentUniverseContext;
    }


    public UniverseContext openUniverse(File saveFile) throws OpenException {
        UniverseContextIO envIO = new UniverseContextIO(saveFile);
        this.currentUniverseContext = envIO.read();
        this.window.changeUniverse(currentUniverseContext);
        this.currentSaveFile = saveFile;
        setChanged();
        notifyObservers(ApplicationUpdateCode.OPEN);
        return currentUniverseContext;
View Full Code Here

Examples of barsuift.simLife.universe.UniverseContextIO

            throw new IllegalStateException("No current save file");
        }
        if (currentUniverseContext == null) {
            throw new IllegalStateException("No current universe context to save");
        }
        UniverseContextIO envIO = new UniverseContextIO(currentSaveFile);
        envIO.write(currentUniverseContext);
        setChanged();
        notifyObservers(ApplicationUpdateCode.SAVE);
    }
View Full Code Here

Examples of barsuift.simLife.universe.UniverseContextIO

    public void saveUniverseAs(File saveFile) throws SaveException {
        if (currentUniverseContext == null) {
            throw new IllegalStateException("No current universe context to save");
        }
        UniverseContextIO envIO = new UniverseContextIO(saveFile);
        envIO.write(currentUniverseContext);
        this.currentSaveFile = saveFile;
        setChanged();
        notifyObservers(ApplicationUpdateCode.SAVE_AS);
    }
View Full Code Here

Examples of barsuift.simLife.universe.UniverseContextIO

    public void testOpen() throws OpenException, SaveException {
        // create a test file to be read
        BasicUniverseContextFactory factory = new BasicUniverseContextFactory();
        UniverseContext universeContext = factory.createRandom();
        UniverseContextIO io = new UniverseContextIO(saveFile);
        io.write(universeContext);
        // now try to read it
        UniverseContext universeContext2 = application.openUniverse(saveFile);
        assertEquals(universeContext.getState(), universeContext2.getState());
    }
View Full Code Here

Examples of barsuift.simLife.universe.UniverseContextIO

        return currentUniverseContext;
    }


    public UniverseContext openUniverse(File saveFile) throws OpenException {
        UniverseContextIO envIO = new UniverseContextIO(saveFile);
        this.currentUniverseContext = envIO.read();
        this.window.changeUniverse(currentUniverseContext);
        this.currentSaveFile = saveFile;
        setChanged();
        notifySubscribers(ApplicationUpdateCode.OPEN);
        return currentUniverseContext;
View Full Code Here

Examples of barsuift.simLife.universe.UniverseContextIO

            throw new IllegalStateException("No current save file");
        }
        if (currentUniverseContext == null) {
            throw new IllegalStateException("No current universe context to save");
        }
        UniverseContextIO envIO = new UniverseContextIO(currentSaveFile);
        envIO.write(currentUniverseContext);
        setChanged();
        notifySubscribers(ApplicationUpdateCode.SAVE);
    }
View Full Code Here

Examples of barsuift.simLife.universe.UniverseContextIO

    public void saveUniverseAs(File saveFile) throws SaveException {
        if (currentUniverseContext == null) {
            throw new IllegalStateException("No current universe context to save");
        }
        UniverseContextIO envIO = new UniverseContextIO(saveFile);
        envIO.write(currentUniverseContext);
        this.currentSaveFile = saveFile;
        setChanged();
        notifySubscribers(ApplicationUpdateCode.SAVE_AS);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.