use of org.concord.energy3d.model.Rack in project energy3d by concord-consortium.
the class SetSolarPanelColorForRacksOnFoundationCommand 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.getSolarPanel().setColorOption(newValues[i]);
r.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.Rack in project energy3d by concord-consortium.
the class SetSolarPanelShadeToleranceForAllRacksCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
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.getSolarPanel().getShadeTolerance();
r.getSolarPanel().setShadeTolerance(oldValues[i]);
}
}
use of org.concord.energy3d.model.Rack 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();
}
use of org.concord.energy3d.model.Rack 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();
}
use of org.concord.energy3d.model.Rack 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();
}
Aggregations