source: src/main/java/genius/gui/progress/session/SessionProgressUI.java@ 337

Last change on this file since 337 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: 2.1 KB
Line 
1package genius.gui.progress.session;
2
3import javax.swing.JPanel;
4import javax.swing.JScrollPane;
5import javax.swing.JSplitPane;
6import javax.swing.JTable;
7import javax.swing.JTextArea;
8
9import genius.gui.panels.VflowPanelWithBorder;
10
11/**
12 * Shows the progress in a multiparty single session run
13 */
14@SuppressWarnings("serial")
15public class SessionProgressUI extends VflowPanelWithBorder {
16
17 private JSplitPane verticalsplit; // split on y axis
18 private JSplitPane horizontalsplit; // split on x axis
19
20 /**
21 *
22 * @param model
23 * an {@link OutcomesListModel} of this session.
24 * @param showChart
25 * true iff any chart (normal or bi) has to be shown
26 * @param useBiChart
27 * if true, a {@link SessionProgressUI} will be used that shows
28 * utils of first two participants in util-util graph. Ignored if
29 * showChart is false.
30 * @param textmodel
31 * a {@link ActionDocumentModel}
32 */
33 public SessionProgressUI(OutcomesListModel model, ActionDocumentModel textmodel, boolean showChart,
34 boolean useBiChart, boolean showAllBids) {
35 super("Session Progress");
36
37 createSplitPanes();
38 VflowPanelWithBorder textarea = new VflowPanelWithBorder("Negotiation log");
39 textarea.add(new JScrollPane(new JTextArea(textmodel)));
40 horizontalsplit.setLeftComponent(textarea);
41 verticalsplit.setRightComponent(new JScrollPane(new JTable(new OutcomesModelToTableModelAdapter(model))));
42 JPanel chart;
43 if (showChart) {
44 chart = useBiChart ? new ProgressChartBi(model, showAllBids) : new ProgressChart(model);
45 } else {
46 chart = new JPanel();
47 }
48 verticalsplit.setLeftComponent(chart);
49 add(horizontalsplit);
50
51 }
52
53 /**
54 * Creates overall layout of this panel: a panel with a vertical split, with
55 * in the right side a panel with a horizontal split .
56 */
57 private void createSplitPanes() {
58 horizontalsplit = new JSplitPane();
59 horizontalsplit.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
60
61 verticalsplit = new JSplitPane();
62 verticalsplit.setOrientation(JSplitPane.VERTICAL_SPLIT);
63
64 horizontalsplit.setRightComponent(verticalsplit);
65 }
66
67}
Note: See TracBrowser for help on using the repository browser.