View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.program.pmfms;
2   
3   /*
4    * #%L
5    * Dali :: 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.dali.dto.configuration.programStrategy.PmfmStrategyDTO;
27  import fr.ifremer.dali.ui.swing.content.manage.program.ProgramsUIModel;
28  import fr.ifremer.dali.ui.swing.util.table.AbstractDaliTableUIModel;
29  
30  /**
31   * Modele pour la zone des programmes.
32   */
33  public class PmfmsTableUIModel extends AbstractDaliTableUIModel<PmfmStrategyDTO, PmfmsTableRowModel, PmfmsTableUIModel> {
34  
35      /** Constant <code>PROPERTY_LOADED="loaded"</code> */
36      public static final String PROPERTY_LOADED = "loaded";
37      /** Constant <code>PROPERTY_EDITABLE="editable"</code> */
38      public static final String PROPERTY_EDITABLE = "editable";
39      /** Constant <code>PROPERTY_UP_ALLOWED="upAllowed"</code> */
40      public static final String PROPERTY_UP_ALLOWED = "upAllowed";
41      /** Constant <code>PROPERTY_DOWN_ALLOWED="downAllowed"</code> */
42      public static final String PROPERTY_DOWN_ALLOWED = "downAllowed";
43      private boolean loaded;
44      private boolean editable;
45      private boolean upAllowed;
46      private boolean downAllowed;
47  
48      private ProgramsUIModel parentModel;
49  
50      /**
51       * Constructor.
52       */
53      public PmfmsTableUIModel() {
54          super();
55      }
56  
57      /**
58       * <p>isLoaded.</p>
59       *
60       * @return a boolean.
61       */
62      public boolean isLoaded() {
63          return loaded;
64      }
65  
66      /**
67       * <p>Setter for the field <code>loaded</code>.</p>
68       *
69       * @param loaded a boolean.
70       */
71      public void setLoaded(boolean loaded) {
72          this.loaded = loaded;
73          firePropertyChange(PROPERTY_LOADED, null, loaded);
74      }
75  
76      /**
77       * <p>isEditable.</p>
78       *
79       * @return a boolean.
80       */
81      public boolean isEditable() {
82          return editable;
83      }
84  
85      /**
86       * <p>Setter for the field <code>editable</code>.</p>
87       *
88       * @param editable a boolean.
89       */
90      public void setEditable(boolean editable) {
91          this.editable = editable;
92          firePropertyChange(PROPERTY_EDITABLE, null, editable);
93      }
94  
95      /**
96       * <p>isUpAllowed.</p>
97       *
98       * @return a boolean.
99       */
100     public boolean isUpAllowed() {
101         return upAllowed;
102     }
103 
104     /**
105      * <p>Setter for the field <code>upAllowed</code>.</p>
106      *
107      * @param upAllowed a boolean.
108      */
109     public void setUpAllowed(boolean upAllowed) {
110         this.upAllowed = upAllowed;
111         firePropertyChange(PROPERTY_UP_ALLOWED, null, upAllowed);
112     }
113 
114     /**
115      * <p>isDownAllowed.</p>
116      *
117      * @return a boolean.
118      */
119     public boolean isDownAllowed() {
120         return downAllowed;
121     }
122 
123     /**
124      * <p>Setter for the field <code>downAllowed</code>.</p>
125      *
126      * @param downAllowed a boolean.
127      */
128     public void setDownAllowed(boolean downAllowed) {
129         this.downAllowed = downAllowed;
130         firePropertyChange(PROPERTY_DOWN_ALLOWED, null, downAllowed);
131     }
132 
133     public ProgramsUIModel getParentModel() {
134         return parentModel;
135     }
136 
137     public void setParentModel(ProgramsUIModel parentModel) {
138         this.parentModel = parentModel;
139     }
140 
141     public void clear() {
142         setBeans(null);
143         setLoaded(false);
144     }
145 }