source: src/main/java/genius/gui/tree/IssueIntegerValuePanel.java@ 345

Last change on this file since 345 was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 1.2 KB
Line 
1package genius.gui.tree;
2
3import javax.swing.JLabel;
4
5import genius.core.issue.IssueInteger;
6import genius.core.issue.Objective;
7import genius.core.utility.EvaluatorInteger;
8
9/**
10 *
11 * @author Richard Noorlandt
12 *
13 */
14
15public class IssueIntegerValuePanel extends IssueValuePanel {
16
17 // Attributes
18
19 // Constructors
20 public IssueIntegerValuePanel(NegotiatorTreeTableModel model,
21 IssueInteger issue) {
22 super(model, issue);
23 init(issue);
24 }
25
26 // Methods
27 private void init(IssueInteger issue) {
28 String lowUtil = "";
29 String uppUtil = "";
30 if (model.getUtilitySpace() != null) {
31 EvaluatorInteger eval = (EvaluatorInteger) model.getUtilitySpace()
32 .getEvaluator(issue.getNumber());
33 if (eval != null) {
34 lowUtil = " ("
35 + String.format("%.3g%n", eval.getUtilLowestValue())
36 + ")";
37 uppUtil = " ("
38 + String.format("%.3g%n", eval.getUtilHighestValue())
39 + ")";
40 }
41 }
42 this.add(new JLabel("Min: " + issue.getLowerBound() + lowUtil
43 + " Max: " + issue.getUpperBound() + uppUtil));
44 }
45
46 public void displayValues(Objective node) {
47 this.removeAll();
48 init(((IssueInteger) node));
49 }
50}
Note: See TracBrowser for help on using the repository browser.