Commit 43c145918eabd3704b09ff8f2ce42a3284db8faf

Authored by Nathanael Jourdane
1 parent 1353e182
Exists in master

View: Add methods to fill the tables.

src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java
... ... @@ -37,6 +37,15 @@ public class EpnTapController {
37 37 */
38 38 public EpnTapController() {
39 39 view = new EpnTapMainView();
  40 +
  41 + String[] sColumns = { "service name", "service value" };
  42 + String[][] sValues = { { "s1", "s2" }, { "789", "357" } };
  43 +
  44 + String[] rColumns = { "result name", "result value" };
  45 + String[][] rValues = { { "r1", "r2" }, { "123", "456" } };
  46 +
  47 + view.fillServices(sColumns, sValues);
  48 + view.fillResults(rColumns, rValues);
40 49 }
41 50  
42 51 /**
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java
... ... @@ -49,15 +49,25 @@ public class EpnTapMainView extends JPanel {
49 49 results = new VOTableView();
50 50 queryArea = new JTextArea("");
51 51  
52   - String[] sColumns = { "service name", "service value" };
53   - String[][] sValues = { { "s1", "s2" }, { "789", "357" } };
54   - services.buildArray(sColumns, sValues);
  52 + buildWindow();
  53 + }
55 54  
56   - String[] rColumns = { "result name", "result value" };
57   - String[][] rValues = { { "r1", "r2" }, { "123", "456" } };
58   - results.buildArray(rColumns, rValues);
  55 + /**
  56 + * @param columns The name of each column to fill the Service table.
  57 + * @param values A 2D array, where the first dimension represents the rows of the Services
  58 + * table. The second one represents each element, in the same order as the `columns`.
  59 + */
  60 + public void fillServices(String[] columns, Object[][] values) {
  61 + services.buildArray(columns, values);
  62 + }
59 63  
60   - buildWindow();
  64 + /**
  65 + * @param columns The name of each column to fill the Results table.
  66 + * @param values A 2D array, where the first dimension represents the rows of the Results table.
  67 + * The second one represents each element, in the same order as the `columns`.
  68 + */
  69 + public void fillResults(String[] columns, Object[][] values) {
  70 + results.buildArray(columns, values);
61 71 }
62 72  
63 73 /**
... ...