Search in sources :

Example 36 with ParabolicDish

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

the class ChangeStructureTypeForAllParabolicDishesCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = dishes.size();
    newValues = new int[n];
    for (int i = 0; i < n; i++) {
        final ParabolicDish d = dishes.get(i);
        newValues[i] = d.getStructureType();
        d.setStructureType(oldValues[i]);
        d.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish)

Example 37 with ParabolicDish

use of org.concord.energy3d.model.ParabolicDish 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 38 with ParabolicDish

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

the class SetRibsForAllParabolicDishesCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = dishes.size();
    newValues = new int[n];
    for (int i = 0; i < n; i++) {
        final ParabolicDish d = dishes.get(i);
        newValues[i] = d.getNumberOfRibs();
        d.setNumberOfRibs(oldValues[i]);
    }
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish)

Example 39 with ParabolicDish

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

the class SetRibsForParabolicDishesOnFoundationCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = dishes.size();
    for (int i = 0; i < n; i++) {
        final ParabolicDish d = dishes.get(i);
        d.setNumberOfRibs(newValues[i]);
        d.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish)

Example 40 with ParabolicDish

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

the class SetRimRadiusForAllParabolicDishesCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final int n = dishes.size();
    newValues = new double[n];
    for (int i = 0; i < n; i++) {
        final ParabolicDish d = dishes.get(i);
        newValues[i] = d.getRimRadius();
        d.setRimRadius(oldValues[i]);
    }
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish)

Aggregations

ParabolicDish (org.concord.energy3d.model.ParabolicDish)43 HousePart (org.concord.energy3d.model.HousePart)26 Foundation (org.concord.energy3d.model.Foundation)20 FresnelReflector (org.concord.energy3d.model.FresnelReflector)17 Mirror (org.concord.energy3d.model.Mirror)17 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)17 Rack (org.concord.energy3d.model.Rack)15 SolarPanel (org.concord.energy3d.model.SolarPanel)13 Window (org.concord.energy3d.model.Window)13 Wall (org.concord.energy3d.model.Wall)10 Door (org.concord.energy3d.model.Door)9 Roof (org.concord.energy3d.model.Roof)9 ArrayList (java.util.ArrayList)5 Calendar (java.util.Calendar)5 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)3 CullHint (com.ardor3d.scenegraph.hint.CullHint)3 List (java.util.List)3 JDialog (javax.swing.JDialog)3 Human (org.concord.energy3d.model.Human)3 SolarCollector (org.concord.energy3d.model.SolarCollector)3