View Javadoc
1   package fr.ifremer.reefdb.ui.swing.content.manage.program.locations;
2   
3   /*
4    * #%L
5    * Reef DB :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2015 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 fr.ifremer.reefdb.dto.configuration.programStrategy.AppliedStrategyDTO;
27  import fr.ifremer.reefdb.ui.swing.content.manage.program.programs.ProgramsTableRowModel;
28  import fr.ifremer.reefdb.ui.swing.content.manage.program.strategies.StrategiesTableRowModel;
29  import fr.ifremer.reefdb.ui.swing.util.table.AbstractReefDbTableUIModel;
30  
31  /**
32   * Modele pour la zone des lieux.
33   */
34  public class LocationsTableUIModel extends AbstractReefDbTableUIModel<AppliedStrategyDTO, LocationsTableRowModel, LocationsTableUIModel> {
35  
36      /** Constant <code>PROPERTY_PERIODS_ENABLED="periodsEnabled"</code> */
37      public static final String PROPERTY_PERIODS_ENABLED = "periodsEnabled";
38      /** Constant <code>PROPERTY_LOADED="loaded"</code> */
39      public static final String PROPERTY_LOADED = "loaded";
40      /** Constant <code>PROPERTY_EDITABLE="editable"</code> */
41      public static final String PROPERTY_EDITABLE = "editable";
42      private boolean periodsEnabled;
43      private boolean loaded;
44      private boolean editable;
45      private ProgramsTableRowModel selectedProgram;
46  
47      private StrategiesTableRowModel selectedStrategy;
48  
49      /**
50       * Constructor.
51       */
52      public LocationsTableUIModel() {
53          super();
54      }
55  
56      /**
57       * <p>isPeriodsEnabled.</p>
58       *
59       * @return a boolean.
60       */
61      public boolean isPeriodsEnabled() {
62          return periodsEnabled;
63      }
64  
65      /**
66       * <p>Setter for the field <code>periodsEnabled</code>.</p>
67       *
68       * @param periodsEnabled a boolean.
69       */
70      public void setPeriodsEnabled(boolean periodsEnabled) {
71          this.periodsEnabled = periodsEnabled;
72          firePropertyChange(PROPERTY_PERIODS_ENABLED, null, periodsEnabled);
73      }
74  
75      /**
76       * <p>isLoaded.</p>
77       *
78       * @return a boolean.
79       */
80      public boolean isLoaded() {
81          return loaded;
82      }
83  
84      /**
85       * <p>Setter for the field <code>loaded</code>.</p>
86       *
87       * @param loaded a boolean.
88       */
89      public void setLoaded(boolean loaded) {
90          this.loaded = loaded;
91          firePropertyChange(PROPERTY_LOADED, null, loaded);
92      }
93  
94      /**
95       * <p>isEditable.</p>
96       *
97       * @return a boolean.
98       */
99      public boolean isEditable() {
100         return editable;
101     }
102 
103     /**
104      * <p>Setter for the field <code>editable</code>.</p>
105      *
106      * @param editable a boolean.
107      */
108     public void setEditable(boolean editable) {
109         this.editable = editable;
110         firePropertyChange(PROPERTY_EDITABLE, null, editable);
111     }
112 
113     /**
114      * <p>Getter for the field <code>selectedProgram</code>.</p>
115      *
116      * @return a {@link fr.ifremer.reefdb.ui.swing.content.manage.program.programs.ProgramsTableRowModel} object.
117      */
118     public ProgramsTableRowModel getSelectedProgram() {
119         return selectedProgram;
120     }
121 
122     /**
123      * <p>Setter for the field <code>selectedProgram</code>.</p>
124      *
125      * @param selectedProgram a {@link fr.ifremer.reefdb.ui.swing.content.manage.program.programs.ProgramsTableRowModel} object.
126      */
127     public void setSelectedProgram(ProgramsTableRowModel selectedProgram) {
128         this.selectedProgram = selectedProgram;
129     }
130 
131     /**
132      * <p>Getter for the field <code>selectedStrategy</code>.</p>
133      *
134      * @return a {@link fr.ifremer.reefdb.ui.swing.content.manage.program.strategies.StrategiesTableRowModel} object.
135      */
136     public StrategiesTableRowModel getSelectedStrategy() {
137         return selectedStrategy;
138     }
139 
140     /**
141      * <p>Setter for the field <code>selectedStrategy</code>.</p>
142      *
143      * @param selectedStrategy a {@link fr.ifremer.reefdb.ui.swing.content.manage.program.strategies.StrategiesTableRowModel} object.
144      */
145     public void setSelectedStrategy(StrategiesTableRowModel selectedStrategy) {
146         this.selectedStrategy = selectedStrategy;
147     }
148 }