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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations