use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setColorOfAllPartsOfSameType.
public void setColorOfAllPartsOfSameType(final HousePart part, final ReadOnlyColorRGBA color) {
for (final HousePart p : parts) {
if (p.getClass().equals(part.getClass())) {
p.setColor(color);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setTrackerForAllSolarPanels.
public void setTrackerForAllSolarPanels(final int tracker) {
for (final HousePart p : parts) {
if (p instanceof SolarPanel && !(p.getContainer() instanceof Rack)) {
// no tracker for solar panels on racks as they use rack trackers
((SolarPanel) p).setTracker(tracker);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setHeightForAllWalls.
public void setHeightForAllWalls(final double height) {
for (final HousePart p : parts) {
if (p instanceof Wall) {
final Wall w = (Wall) p;
w.setHeight(height, true);
}
}
redrawAllWallsNow();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setTiltAngleForAllRacks.
public void setTiltAngleForAllRacks(final double angle) {
for (final HousePart p : parts) {
if (p instanceof Rack) {
((Rack) p).setTiltAngle(angle);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method removeAllChildren.
public void removeAllChildren(final HousePart parent) {
final List<HousePart> children = parent.getChildren();
final String s = parent.getClass().getSimpleName();
// make a copy to avoid ConcurrentModificationException
final List<HousePart> copy = new ArrayList<HousePart>();
for (final HousePart p : children) {
if (p instanceof Roof) {
// make an exception of roof (it is a child of a wall)
continue;
}
copy.add(p);
}
if (copy.isEmpty()) {
JOptionPane.showMessageDialog(MainFrame.getInstance(), "There is no element to remove from " + s + ".", "No Element", JOptionPane.INFORMATION_MESSAGE);
return;
}
if (JOptionPane.showConfirmDialog(MainFrame.getInstance(), "Do you really want to remove all " + copy.size() + " elements of " + s + "?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.NO_OPTION) {
return;
}
final RemoveMultiplePartsCommand c = new RemoveMultiplePartsCommand(copy);
for (final HousePart p : copy) {
remove(p, false);
}
parent.draw();
SceneManager.getInstance().getUndoManager().addEdit(c);
edited = true;
SceneManager.getInstance().refresh();
}
Aggregations