add battery wastage indicator
This commit is contained in:
parent
2ba8aad195
commit
e39fb9fd90
|
@ -43,7 +43,7 @@ public class AboutDialog extends JDialog {
|
||||||
public AboutDialog() {
|
public AboutDialog() {
|
||||||
|
|
||||||
super(App.mainFrame, "About");
|
super(App.mainFrame, "About");
|
||||||
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.4, 0.64);
|
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.5, 0.64);
|
||||||
setContentPane(contentPane);
|
setContentPane(contentPane);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,9 @@ public class PowerSourceForm {
|
||||||
powerNameBuilder.append(powerSource.getName());
|
powerNameBuilder.append(powerSource.getName());
|
||||||
powerNameBuilder.append(" ").append(powerSource.getManufacturer());
|
powerNameBuilder.append(" ").append(powerSource.getManufacturer());
|
||||||
powerNameBuilder.append(" ").append(powerSource.getDeviceName());
|
powerNameBuilder.append(" ").append(powerSource.getDeviceName());
|
||||||
powerNameBuilder.append(" ").append(powerSource.getChemistry());
|
if (!"unknown".equals(powerSource.getChemistry())) {
|
||||||
|
powerNameBuilder.append(" ").append(powerSource.getChemistry());
|
||||||
|
}
|
||||||
powerNameLabel.setText(powerNameBuilder.toString());
|
powerNameLabel.setText(powerNameBuilder.toString());
|
||||||
powerPanel.add(powerNameLabel, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
powerPanel.add(powerNameLabel, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
|
||||||
|
@ -100,7 +102,8 @@ public class PowerSourceForm {
|
||||||
capacityBuilder.append("Current ").append(powerSource.getCurrentCapacity());
|
capacityBuilder.append("Current ").append(powerSource.getCurrentCapacity());
|
||||||
capacityBuilder.append(" / ").append("Max ").append(powerSource.getMaxCapacity());
|
capacityBuilder.append(" / ").append("Max ").append(powerSource.getMaxCapacity());
|
||||||
capacityBuilder.append(" / ").append("Design ").append(powerSource.getDesignCapacity());
|
capacityBuilder.append(" / ").append("Design ").append(powerSource.getDesignCapacity());
|
||||||
capacityBuilder.append(" (").append(powerSource.getCapacityUnits()).append(")");
|
capacityBuilder.append(" (").append(powerSource.getCapacityUnits()).append(") ");
|
||||||
|
capacityBuilder.append((powerSource.getDesignCapacity() - powerSource.getMaxCapacity()) * 100 / powerSource.getDesignCapacity()).append("% wastage");
|
||||||
capacityLabel.setText(capacityBuilder.toString());
|
capacityLabel.setText(capacityBuilder.toString());
|
||||||
powerPanel.add(capacityLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
powerPanel.add(capacityLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue