use of org.concord.energy3d.simulation.DesignSpecs in project energy3d by concord-consortium.
the class BuildingCostGraph method updateBudget.
public void updateBudget() {
if (budgetPanel != null && foundation != null) {
calculateCost();
final DesignSpecs specs = Scene.getInstance().getDesignSpecs();
budgetBar.setEnabled(specs.isBudgetEnabled());
budgetBar.setMaximum(specs.getMaximumBudget());
final String t = "Total (" + (specs.isBudgetEnabled() ? "\u2264 $" + noDecimals.format(specs.getMaximumBudget()) : "$") + ")";
budgetPanel.setBorder(EnergyPanel.createTitledBorder(t, true));
budgetBar.setValue((float) totalCost);
budgetBar.repaint();
budgetPanel.repaint();
}
}
use of org.concord.energy3d.simulation.DesignSpecs in project energy3d by concord-consortium.
the class BuildingInfoPanel method updateAreaBounds.
public void updateAreaBounds() {
final DesignSpecs specs = Scene.getInstance().getDesignSpecs();
final double r = 3.28084 * 3.28084;
String t = "Area (";
switch(Scene.getInstance().getUnit()) {
case InternationalSystemOfUnits:
if (specs.isAreaEnabled()) {
t += twoDecimals.format(specs.getMinimumArea()) + " - " + twoDecimals.format(specs.getMaximumArea()) + " ";
}
t += "m\u00B2)";
areaBar.setMinimum(specs.getMinimumArea());
areaBar.setMaximum(specs.getMaximumArea());
break;
case USCustomaryUnits:
if (specs.isAreaEnabled()) {
t += noDecimals.format(specs.getMinimumArea() * r) + " - " + noDecimals.format(specs.getMaximumArea() * r) + " ";
}
t += "ft\u00B2)";
areaBar.setMinimum(specs.getMinimumArea() * r);
areaBar.setMaximum(specs.getMaximumArea() * r);
break;
}
areaPanel.setBorder(EnergyPanel.createTitledBorder(t, true));
areaBar.setEnabled(specs.isAreaEnabled());
areaBar.repaint();
}
use of org.concord.energy3d.simulation.DesignSpecs in project energy3d by concord-consortium.
the class BuildingInfoPanel method updateWindowNumberBounds.
public void updateWindowNumberBounds() {
final DesignSpecs specs = Scene.getInstance().getDesignSpecs();
String t = "Number of windows";
if (specs.isNumberOfWindowsEnabled()) {
if (specs.getMinimumNumberOfWindows() == 0) {
t += " (<" + specs.getMaximumNumberOfWindows() + ")";
} else {
t += " (" + specs.getMinimumNumberOfWindows() + " - " + specs.getMaximumNumberOfWindows() + ")";
}
}
windowCountBar.setMinimum(specs.getMinimumNumberOfWindows());
windowCountBar.setMaximum(specs.getMaximumNumberOfWindows());
windowCountPanel.setBorder(EnergyPanel.createTitledBorder(t, true));
windowCountBar.setEnabled(specs.isNumberOfWindowsEnabled());
windowCountBar.repaint();
}
Aggregations