1 package fr.ifremer.quadrige2.ui.swing.common.table.state;
2
3 /*-
4 * #%L
5 * Quadrige2 Core :: Quadrige2 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
27
28 import com.google.common.collect.Maps;
29
30 import java.util.Map;
31
32 /**
33 * Object used by SwingTableSessionState
34 * It represents the columns visibility, width and sort order of a table
35 * <p/>
36 * Created by Ludovic on 26/11/2015.
37 */
38 public class SwingTableState {
39
40 // column visibility
41 protected Map<String, Integer> visibility;
42
43 // pmfm column visibility
44 protected Map<Integer, Integer> pmfmVisibility;
45
46 // column width
47 protected Map<String, Integer> width;
48
49 // column sorting
50 protected Map<String, String> sortOrder;
51
52 /**
53 * <p>Constructor for SwingTableState.</p>
54 */
55 public SwingTableState() {
56 visibility = Maps.newHashMap();
57 pmfmVisibility = Maps.newHashMap();
58 width = Maps.newHashMap();
59 sortOrder = Maps.newHashMap();
60 }
61
62 /**
63 * <p>Getter for the field <code>visibility</code>.</p>
64 *
65 * @return a {@link Map} object.
66 */
67 public Map<String, Integer> getVisibility() {
68 return visibility;
69 }
70
71 /**
72 * <p>Setter for the field <code>visibility</code>.</p>
73 *
74 * @param visibility a {@link Map} object.
75 */
76 public void setVisibility(Map<String, Integer> visibility) {
77 this.visibility = visibility;
78 }
79
80 /**
81 * <p>Getter for the field <code>pmfmVisibility</code>.</p>
82 *
83 * @return a {@link Map} object.
84 */
85 public Map<Integer, Integer> getPmfmVisibility() {
86 return pmfmVisibility;
87 }
88
89 /**
90 * <p>Setter for the field <code>pmfmVisibility</code>.</p>
91 *
92 * @param pmfmVisibility a {@link Map} object.
93 */
94 public void setPmfmVisibility(Map<Integer, Integer> pmfmVisibility) {
95 this.pmfmVisibility = pmfmVisibility;
96 }
97
98 /**
99 * <p>Getter for the field <code>width</code>.</p>
100 *
101 * @return a {@link Map} object.
102 */
103 public Map<String, Integer> getWidth() {
104 return width;
105 }
106
107 /**
108 * <p>Setter for the field <code>width</code>.</p>
109 *
110 * @param width a {@link Map} object.
111 */
112 public void setWidth(Map<String, Integer> width) {
113 this.width = width;
114 }
115
116 /**
117 * <p>Getter for the field <code>sortOrder</code>.</p>
118 *
119 * @return a {@link Map} object.
120 */
121 public Map<String, String> getSortOrder() {
122 return sortOrder;
123 }
124
125 /**
126 * <p>Setter for the field <code>sortOrder</code>.</p>
127 *
128 * @param sortOrder a {@link Map} object.
129 */
130 public void setSortOrder(Map<String, String> sortOrder) {
131 this.sortOrder = sortOrder;
132 }
133 }