Search in sources :

Example 46 with Mirror

use of org.concord.energy3d.model.Mirror in project energy3d by concord-consortium.

the class ChangeTargetForAllHeliostatsCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = mirrors.size();
    newValues = new Foundation[n];
    for (int i = 0; i < n; i++) {
        final Mirror m = mirrors.get(i);
        newValues[i] = m.getReceiver();
        m.setReceiver(oldValues[i]);
        m.draw();
        if (oldValues[i] != null) {
            oldValues[i].drawSolarReceiver();
        }
        if (newValues[i] != null) {
            newValues[i].drawSolarReceiver();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : Mirror(org.concord.energy3d.model.Mirror)

Example 47 with Mirror

use of org.concord.energy3d.model.Mirror in project energy3d by concord-consortium.

the class SetSizeForAllHeliostatsCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = mirrors.size();
    newWidths = new double[n];
    newHeights = new double[n];
    for (int i = 0; i < n; i++) {
        final Mirror m = mirrors.get(i);
        newWidths[i] = m.getMirrorWidth();
        m.setMirrorWidth(oldWidths[i]);
        newHeights[i] = m.getMirrorHeight();
        m.setMirrorHeight(oldHeights[i]);
        m.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : Mirror(org.concord.energy3d.model.Mirror)

Example 48 with Mirror

use of org.concord.energy3d.model.Mirror in project energy3d by concord-consortium.

the class SetSizeForAllHeliostatsCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = mirrors.size();
    for (int i = 0; i < n; i++) {
        final Mirror m = mirrors.get(i);
        m.setMirrorWidth(newWidths[i]);
        m.setMirrorHeight(newHeights[i]);
        m.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : Mirror(org.concord.energy3d.model.Mirror)

Example 49 with Mirror

use of org.concord.energy3d.model.Mirror in project energy3d by concord-consortium.

the class SetPartSizeCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    if (part instanceof Mirror) {
        final Mirror m = (Mirror) part;
        m.setMirrorWidth(newWidth);
        m.setMirrorHeight(newHeight);
    } else if (part instanceof ParabolicTrough) {
        final ParabolicTrough t = (ParabolicTrough) part;
        t.setApertureWidth(newWidth);
        t.setTroughLength(newHeight);
        t.setModuleLength(newModuleLength);
    } else if (part instanceof ParabolicDish) {
        final ParabolicDish d = (ParabolicDish) part;
        d.setRimRadius(newWidth);
    } else if (part instanceof FresnelReflector) {
        final FresnelReflector t = (FresnelReflector) part;
        t.setModuleWidth(newWidth);
        t.setLength(newHeight);
        t.setModuleLength(newModuleLength);
    } else if (part instanceof Rack) {
        final Rack r = (Rack) part;
        r.setRackWidth(newWidth);
        r.setRackHeight(newHeight);
    } else if (part instanceof Window) {
        final Window w = (Window) part;
        w.setWindowWidth(newWidth);
        w.setWindowHeight(newHeight);
        w.getContainer().draw();
    } else if (part instanceof Door) {
        final Door d = (Door) part;
        d.setDoorWidth(newWidth);
        d.setDoorHeight(newHeight);
        d.getContainer().draw();
    }
    part.draw();
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish) Window(org.concord.energy3d.model.Window) Rack(org.concord.energy3d.model.Rack) ParabolicTrough(org.concord.energy3d.model.ParabolicTrough) FresnelReflector(org.concord.energy3d.model.FresnelReflector) Mirror(org.concord.energy3d.model.Mirror) Door(org.concord.energy3d.model.Door)

Example 50 with Mirror

use of org.concord.energy3d.model.Mirror in project energy3d by concord-consortium.

the class ChangeTiltAngleForAllHeliostatsCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = mirrors.size();
    newValues = new double[n];
    for (int i = 0; i < n; i++) {
        final Mirror m = mirrors.get(i);
        newValues[i] = m.getTiltAngle();
        m.setTiltAngle(oldValues[i]);
        m.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : Mirror(org.concord.energy3d.model.Mirror)

Aggregations

Mirror (org.concord.energy3d.model.Mirror)55 HousePart (org.concord.energy3d.model.HousePart)35 Foundation (org.concord.energy3d.model.Foundation)29 FresnelReflector (org.concord.energy3d.model.FresnelReflector)21 Rack (org.concord.energy3d.model.Rack)21 SolarPanel (org.concord.energy3d.model.SolarPanel)19 ParabolicDish (org.concord.energy3d.model.ParabolicDish)17 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)17 Window (org.concord.energy3d.model.Window)16 Wall (org.concord.energy3d.model.Wall)14 Door (org.concord.energy3d.model.Door)11 Roof (org.concord.energy3d.model.Roof)11 ArrayList (java.util.ArrayList)10 Calendar (java.util.Calendar)5 List (java.util.List)5 JDialog (javax.swing.JDialog)5 Human (org.concord.energy3d.model.Human)5 Tree (org.concord.energy3d.model.Tree)5 ActionEvent (java.awt.event.ActionEvent)4 ActionListener (java.awt.event.ActionListener)4