Search in sources :

Example 31 with SolarPanel

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

the class SetSolarPanelArrayOnRackCustomCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final SolarPanel s = rack.getSolarPanel();
    newValue = (SolarPanel) s.copy(false);
    copySolarPanelProperties(s, oldValue);
    rack.ensureFullSolarPanels(false);
    rack.draw();
}
Also used : SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 32 with SolarPanel

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

the class SetSolarPanelSizeForAllRacksCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = racks.size();
    for (int i = 0; i < n; i++) {
        final Rack r = racks.get(i);
        r.setRackWidth(newRackWidths[i]);
        r.setRackHeight(newRackHeights[i]);
        final SolarPanel s = r.getSolarPanel();
        s.setPanelWidth(newWidths[i]);
        s.setPanelHeight(newHeights[i]);
        s.setNumberOfCellsInX(newCellNxs[i]);
        s.setNumberOfCellsInY(newCellNys[i]);
        r.ensureFullSolarPanels(false);
        r.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 33 with SolarPanel

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

the class SetSolarPanelSizeForRacksOnFoundationCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = racks.size();
    for (int i = 0; i < n; i++) {
        final Rack r = racks.get(i);
        r.setRackWidth(newRackWidths[i]);
        r.setRackHeight(newRackHeights[i]);
        final SolarPanel s = r.getSolarPanel();
        s.setPanelWidth(newWidths[i]);
        s.setPanelHeight(newHeights[i]);
        s.setNumberOfCellsInX(newCellNxs[i]);
        s.setNumberOfCellsInY(newCellNys[i]);
        r.ensureFullSolarPanels(false);
        r.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 34 with SolarPanel

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

the class SetSolarTrackersForAllCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    if (panels != null) {
        final int n = panels.size();
        newValues = new int[n];
        for (int i = 0; i < n; i++) {
            final SolarPanel p = panels.get(i);
            newValues[i] = p.getTracker();
            p.setTracker(oldValues[i]);
            p.draw();
        }
    } else if (racks != null) {
        final int n = racks.size();
        newValues = new int[n];
        for (int i = 0; i < n; i++) {
            final Rack r = racks.get(i);
            newValues[i] = r.getTracker();
            r.setTracker(oldValues[i]);
            r.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 35 with SolarPanel

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

the class SetSolarTrackersForAllCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    if (panels != null) {
        final int n = panels.size();
        for (int i = 0; i < n; i++) {
            final SolarPanel p = panels.get(i);
            p.setTracker(newValues[i]);
            p.draw();
        }
    } else if (racks != null) {
        final int n = racks.size();
        for (int i = 0; i < n; i++) {
            final Rack r = racks.get(i);
            r.setTracker(newValues[i]);
            r.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel)

Aggregations

SolarPanel (org.concord.energy3d.model.SolarPanel)109 Rack (org.concord.energy3d.model.Rack)66 HousePart (org.concord.energy3d.model.HousePart)58 Foundation (org.concord.energy3d.model.Foundation)43 Window (org.concord.energy3d.model.Window)25 Roof (org.concord.energy3d.model.Roof)24 Wall (org.concord.energy3d.model.Wall)23 Mirror (org.concord.energy3d.model.Mirror)20 Door (org.concord.energy3d.model.Door)17 FresnelReflector (org.concord.energy3d.model.FresnelReflector)14 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)14 ActionEvent (java.awt.event.ActionEvent)13 ActionListener (java.awt.event.ActionListener)13 ParabolicDish (org.concord.energy3d.model.ParabolicDish)13 Vector3 (com.ardor3d.math.Vector3)11 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)11 JMenuItem (javax.swing.JMenuItem)10 JDialog (javax.swing.JDialog)9 JPanel (javax.swing.JPanel)9 Tree (org.concord.energy3d.model.Tree)9