View Javadoc
1   package fr.ifremer.quadrige3.ui.swing.table.state;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 UI Common
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  import java.util.HashMap;
27  import java.util.Map;
28  
29  /**
30   * Object used by SwingTableSessionState
31   * It represents the columns visibility, width and sort order of a table
32   * <p/>
33   * Created by Ludovic on 26/11/2015.
34   */
35  public class SwingTableState {
36  
37      // column visibility
38      private Map<String, Integer> visibility;
39  
40      // pmfm column visibility
41      private Map<Integer, Integer> pmfmVisibility;
42  
43      // column width
44      protected Map<String, Integer> width;
45  
46      // pmfm column width
47      protected Map<Integer, Integer> pmfmWidth;
48  
49      // column sorting
50      private Map<String, String> sortOrder;
51  
52      /**
53       * <p>Constructor for SwingTableState.</p>
54       */
55      public SwingTableState() {
56          visibility = new HashMap<>();
57          pmfmVisibility = new HashMap<>();
58          width = new HashMap<>();
59          pmfmWidth = new HashMap<>();
60          sortOrder = new HashMap<>();
61      }
62  
63      // <Dont' delete> these getters ans setters used by SwingSession
64  
65      public Map<String, Integer> getVisibility() {
66          return visibility;
67      }
68  
69      public Map<Integer, Integer> getPmfmVisibility() {
70          return pmfmVisibility;
71      }
72  
73      public Map<String, Integer> getWidth() {
74          return width;
75      }
76  
77      public Map<Integer, Integer> getPmfmWidth() {
78          return pmfmWidth;
79      }
80  
81      public Map<String, String> getSortOrder() {
82          return sortOrder;
83      }
84  
85      @SuppressWarnings("unused")
86      public void setVisibility(Map<String, Integer> visibility) {
87          this.visibility = visibility;
88      }
89  
90      @SuppressWarnings("unused")
91      public void setPmfmVisibility(Map<Integer, Integer> pmfmVisibility) {
92          this.pmfmVisibility = pmfmVisibility;
93      }
94  
95      @SuppressWarnings("unused")
96      public void setWidth(Map<String, Integer> width) {
97          this.width = width;
98      }
99  
100     @SuppressWarnings("unused")
101     public void setPmfmWidth(Map<Integer, Integer> pmfmWidth) {
102         this.pmfmWidth = pmfmWidth;
103     }
104 
105     @SuppressWarnings("unused")
106     public void setSortOrder(Map<String, String> sortOrder) {
107         this.sortOrder = sortOrder;
108     }
109 
110 }