Search in sources :

Example 41 with Mirror

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

the class ChangeFoundationHeliostatAzimuthCommand 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.getRelativeAzimuth();
        m.setRelativeAzimuth(oldValues[i]);
        m.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : Mirror(org.concord.energy3d.model.Mirror)

Example 42 with Mirror

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

the class ChangeFoundationHeliostatTargetCommand 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 43 with Mirror

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

the class ChangeFoundationHeliostatTiltAngleCommand 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)

Example 44 with Mirror

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

the class ChangeFoundationHeliostatTiltAngleCommand 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.setTiltAngle(newValues[i]);
        m.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : Mirror(org.concord.energy3d.model.Mirror)

Example 45 with Mirror

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

the class ChangeAzimuthForAllHeliostatsCommand 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.getRelativeAzimuth();
        m.setRelativeAzimuth(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