Search in sources :

Example 26 with HousePart

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();
    }
}
Also used : Wall(org.concord.energy3d.model.Wall) HousePart(org.concord.energy3d.model.HousePart)

Example 27 with HousePart

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;
}
Also used : Floor(org.concord.energy3d.model.Floor) ArrayList(java.util.ArrayList) HousePart(org.concord.energy3d.model.HousePart) RemoveMultiplePartsCommand(org.concord.energy3d.undo.RemoveMultiplePartsCommand)

Example 28 with HousePart

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();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough) HousePart(org.concord.energy3d.model.HousePart)

Example 29 with HousePart

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;
}
Also used : Human(org.concord.energy3d.model.Human) ArrayList(java.util.ArrayList) HousePart(org.concord.energy3d.model.HousePart) RemoveMultiplePartsCommand(org.concord.energy3d.undo.RemoveMultiplePartsCommand)

Example 30 with HousePart

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();
}
Also used : Rack(org.concord.energy3d.model.Rack) HousePart(org.concord.energy3d.model.HousePart)

Aggregations

HousePart (org.concord.energy3d.model.HousePart)277 Foundation (org.concord.energy3d.model.Foundation)153 Rack (org.concord.energy3d.model.Rack)69 SolarPanel (org.concord.energy3d.model.SolarPanel)60 Roof (org.concord.energy3d.model.Roof)47 Wall (org.concord.energy3d.model.Wall)45 Window (org.concord.energy3d.model.Window)43 ActionEvent (java.awt.event.ActionEvent)42 ActionListener (java.awt.event.ActionListener)42 ArrayList (java.util.ArrayList)41 Mirror (org.concord.energy3d.model.Mirror)38 JMenuItem (javax.swing.JMenuItem)36 JDialog (javax.swing.JDialog)35 FresnelReflector (org.concord.energy3d.model.FresnelReflector)34 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)32 ParabolicDish (org.concord.energy3d.model.ParabolicDish)28 Tree (org.concord.energy3d.model.Tree)26 Door (org.concord.energy3d.model.Door)25 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)21 JPanel (javax.swing.JPanel)21