use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method connectWalls.
public void connectWalls() {
List<Wall> walls = null;
for (final HousePart part : parts) {
if (part instanceof Wall) {
if (walls == null) {
walls = new ArrayList<Wall>();
}
walls.add((Wall) part);
part.reset();
}
}
if (walls != null && !walls.isEmpty()) {
for (final Wall w : walls) {
w.connectedWalls();
}
for (final Wall w : walls) {
w.computeInsideDirectionOfAttachedWalls(false);
}
walls.clear();
}
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method removeAllFloors.
public void removeAllFloors() {
final ArrayList<HousePart> floors = new ArrayList<HousePart>();
for (final HousePart part : parts) {
if (part instanceof Floor && !part.getLockEdit()) {
floors.add(part);
}
}
if (floors.isEmpty()) {
JOptionPane.showMessageDialog(MainFrame.getInstance(), "There is no floor to remove.", "No Floor", JOptionPane.INFORMATION_MESSAGE);
return;
}
if (JOptionPane.showConfirmDialog(MainFrame.getInstance(), "Do you really want to remove all " + floors.size() + " floors?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) != JOptionPane.YES_OPTION) {
return;
}
final RemoveMultiplePartsCommand c = new RemoveMultiplePartsCommand(floors);
for (final HousePart part : floors) {
remove(part, false);
}
redrawAll();
SceneManager.getInstance().getUndoManager().addEdit(c);
edited = true;
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setSemilatusRectumForAllParabolicTroughs.
public void setSemilatusRectumForAllParabolicTroughs(final double semilatusRectum) {
for (final HousePart p : parts) {
if (p instanceof ParabolicTrough) {
final ParabolicTrough t = (ParabolicTrough) p;
t.setSemilatusRectum(semilatusRectum);
t.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method removeAllHumans.
public void removeAllHumans() {
final ArrayList<HousePart> humans = new ArrayList<HousePart>();
for (final HousePart part : parts) {
if (part instanceof Human) {
humans.add(part);
}
}
if (humans.isEmpty()) {
JOptionPane.showMessageDialog(MainFrame.getInstance(), "There is no human to remove.", "No Human", JOptionPane.INFORMATION_MESSAGE);
return;
}
if (JOptionPane.showConfirmDialog(MainFrame.getInstance(), "Do you really want to remove all " + humans.size() + " humans?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) != JOptionPane.YES_OPTION) {
return;
}
final RemoveMultiplePartsCommand c = new RemoveMultiplePartsCommand(humans);
for (final HousePart part : humans) {
remove(part, false);
}
redrawAll();
SceneManager.getInstance().getUndoManager().addEdit(c);
edited = true;
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setSolarPanelColorForAllRacks.
public void setSolarPanelColorForAllRacks(final int colorOption) {
for (final HousePart p : parts) {
if (p instanceof Rack) {
final Rack rack = (Rack) p;
rack.getSolarPanel().setColorOption(colorOption);
rack.draw();
}
}
SceneManager.getInstance().refresh();
}
Aggregations