Search in sources :

Example 76 with Foundation

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

the class MainFrame method getEnableAllEditPointsMenuItem.

private JMenuItem getEnableAllEditPointsMenuItem() {
    if (enableAllEditPointsMenuItem == null) {
        enableAllEditPointsMenuItem = new JMenuItem("Enable All Base Edit Points");
        enableAllEditPointsMenuItem.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent e) {
                final List<Foundation> foundations = Scene.getInstance().getAllFoundations();
                SceneManager.getTaskManager().update(new Callable<Object>() {

                    @Override
                    public Object call() throws Exception {
                        for (final Foundation f : foundations) {
                            f.setLockEdit(false);
                        }
                        return null;
                    }
                });
                Scene.getInstance().setEdited(true);
            }
        });
    }
    return enableAllEditPointsMenuItem;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) ArrayList(java.util.ArrayList) List(java.util.List) ResultList(org.concord.energy3d.agents.ResultList) Foundation(org.concord.energy3d.model.Foundation) JMenuItem(javax.swing.JMenuItem) Callable(java.util.concurrent.Callable)

Example 77 with Foundation

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

the class MainFrame method getDailyEnergyAnalysisMenuItem.

public JMenuItem getDailyEnergyAnalysisMenuItem() {
    if (dailyEnergyAnalysisMenuItem == null) {
        dailyEnergyAnalysisMenuItem = new JMenuItem("Daily Energy Analysis for Selected Building...");
        dailyEnergyAnalysisMenuItem.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent e) {
                if (EnergyPanel.getInstance().checkCity()) {
                    if (EnergyPanel.getInstance().adjustCellSize()) {
                        return;
                    }
                    if (SceneManager.getInstance().autoSelectBuilding(true) instanceof Foundation) {
                        final EnergyDailyAnalysis analysis = new EnergyDailyAnalysis();
                        if (SceneManager.getInstance().getSolarHeatMap()) {
                            analysis.updateGraph();
                        }
                        analysis.show("Daily Energy");
                    }
                }
            }
        });
    }
    return dailyEnergyAnalysisMenuItem;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) EnergyDailyAnalysis(org.concord.energy3d.simulation.EnergyDailyAnalysis) Foundation(org.concord.energy3d.model.Foundation) JMenuItem(javax.swing.JMenuItem)

Example 78 with Foundation

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

the class MainFrame method getDisableAllEditPointsMenuItem.

private JMenuItem getDisableAllEditPointsMenuItem() {
    if (disableAllEditPointsMenuItem == null) {
        disableAllEditPointsMenuItem = new JMenuItem("Disable All Base Edit Points");
        disableAllEditPointsMenuItem.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent e) {
                final List<Foundation> foundations = Scene.getInstance().getAllFoundations();
                SceneManager.getTaskManager().update(new Callable<Object>() {

                    @Override
                    public Object call() throws Exception {
                        for (final Foundation f : foundations) {
                            f.setLockEdit(true);
                        }
                        return null;
                    }
                });
                Scene.getInstance().setEdited(true);
            }
        });
    }
    return disableAllEditPointsMenuItem;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) ArrayList(java.util.ArrayList) List(java.util.List) ResultList(org.concord.energy3d.agents.ResultList) Foundation(org.concord.energy3d.model.Foundation) JMenuItem(javax.swing.JMenuItem) Callable(java.util.concurrent.Callable)

Example 79 with Foundation

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

the class MainFrame method getDailyPvAnalysisMenuItem.

private JMenuItem getDailyPvAnalysisMenuItem() {
    if (dailyPvAnalysisMenuItem == null) {
        dailyPvAnalysisMenuItem = new JMenuItem("Daily Yield Analysis of Solar Panels...");
        dailyPvAnalysisMenuItem.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent e) {
                if (EnergyPanel.getInstance().checkCity()) {
                    int n = Scene.getInstance().countParts(new Class[] { SolarPanel.class, Rack.class });
                    if (n <= 0) {
                        JOptionPane.showMessageDialog(MainFrame.this, "There is no solar panel to analyze.", "No Solar Panel", JOptionPane.WARNING_MESSAGE);
                        return;
                    }
                    if (EnergyPanel.getInstance().adjustCellSize()) {
                        return;
                    }
                    final HousePart selectedPart = SceneManager.getInstance().getSelectedPart();
                    if (selectedPart != null) {
                        Foundation foundation;
                        if (selectedPart instanceof Foundation) {
                            foundation = (Foundation) selectedPart;
                        } else {
                            foundation = selectedPart.getTopContainer();
                        }
                        if (foundation != null) {
                            n = foundation.countParts(new Class[] { SolarPanel.class, Rack.class });
                            if (n <= 0) {
                                JOptionPane.showMessageDialog(MainFrame.this, "There is no solar panel on this foundation to analyze.", "No Solar Panel", JOptionPane.WARNING_MESSAGE);
                                return;
                            }
                        }
                    }
                    final PvDailyAnalysis a = new PvDailyAnalysis();
                    if (SceneManager.getInstance().getSolarHeatMap()) {
                        a.updateGraph();
                    }
                    a.show();
                }
            }
        });
    }
    return dailyPvAnalysisMenuItem;
}
Also used : Rack(org.concord.energy3d.model.Rack) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) SolarPanel(org.concord.energy3d.model.SolarPanel) Foundation(org.concord.energy3d.model.Foundation) PvDailyAnalysis(org.concord.energy3d.simulation.PvDailyAnalysis) JMenuItem(javax.swing.JMenuItem) HousePart(org.concord.energy3d.model.HousePart)

Example 80 with Foundation

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

the class MainFrame method getAnnualEnergyAnalysisMenuItem.

private JMenuItem getAnnualEnergyAnalysisMenuItem() {
    if (annualEnergyAnalysisMenuItem == null) {
        annualEnergyAnalysisMenuItem = new JMenuItem("Annual Energy Analysis for Selected Building...");
        annualEnergyAnalysisMenuItem.setAccelerator(KeyStroke.getKeyStroke("F3"));
        annualEnergyAnalysisMenuItem.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent e) {
                if (EnergyPanel.getInstance().checkCity()) {
                    if (EnergyPanel.getInstance().adjustCellSize()) {
                        return;
                    }
                    if (SceneManager.getInstance().autoSelectBuilding(true) instanceof Foundation) {
                        new EnergyAnnualAnalysis().show("Annual Energy");
                    }
                }
            }
        });
    }
    return annualEnergyAnalysisMenuItem;
}
Also used : EnergyAnnualAnalysis(org.concord.energy3d.simulation.EnergyAnnualAnalysis) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) Foundation(org.concord.energy3d.model.Foundation) JMenuItem(javax.swing.JMenuItem)

Aggregations

Foundation (org.concord.energy3d.model.Foundation)174 HousePart (org.concord.energy3d.model.HousePart)153 Rack (org.concord.energy3d.model.Rack)47 SolarPanel (org.concord.energy3d.model.SolarPanel)45 Window (org.concord.energy3d.model.Window)39 ActionEvent (java.awt.event.ActionEvent)38 ActionListener (java.awt.event.ActionListener)38 Roof (org.concord.energy3d.model.Roof)38 Wall (org.concord.energy3d.model.Wall)37 ArrayList (java.util.ArrayList)35 JDialog (javax.swing.JDialog)35 JMenuItem (javax.swing.JMenuItem)33 Mirror (org.concord.energy3d.model.Mirror)32 FresnelReflector (org.concord.energy3d.model.FresnelReflector)27 Door (org.concord.energy3d.model.Door)24 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)24 Tree (org.concord.energy3d.model.Tree)24 Vector3 (com.ardor3d.math.Vector3)22 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)22 ParabolicDish (org.concord.energy3d.model.ParabolicDish)22