Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.swing / org.gvsig.tools.swing.api / src / main / java / org / gvsig / tools / swing / api / dynobject / DynObjectModel.java @ 632

History | View | Annotate | Download (3.96 KB)

1 170 cmartin
/* gvSIG. Geographic Information System of the Valencian Government
2 270 cmartin
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22 170 cmartin
/*
23
 * AUTHORS (In addition to CIT):
24
 * 2010 Institute of New Imaging Technologies (INIT):
25
 *   http://www.init.uji.es
26
 * Geographic Information research group:
27
 *   http://www.geoinfo.uji.es
28
 * Universitat Jaume I, Spain
29
 */
30
31
/**
32
 *
33
 */
34
package org.gvsig.tools.swing.api.dynobject;
35
36
import java.util.List;
37
38 272 cmartin
import org.gvsig.tools.dynobject.DynField;
39
import org.gvsig.tools.dynobject.DynObject;
40
41 170 cmartin
/**
42 270 cmartin
 *
43 272 cmartin
 * The view model of a given {@link DynObject}. It allows to add
44
 * {@link DynField}s into different
45
 * view groups, by defining different {@link DynFieldModel}s.
46
 *
47
 * @author 2010 - <a href="cordinyana@gvsig.org">C?sar Ordi?ana</a> - gvSIG Team
48
 * @author 2010 - <a href="mailto:reinhold@uji.es">Cristian Mart?n&nbsp;</a> -
49
 *         gvSIG Team
50
 * @version $Id$
51
 *
52 170 cmartin
 */
53
public interface DynObjectModel {
54
55 272 cmartin
    /**
56 302 cordinyana
     * Creates a new {@link DynFieldModel} with the given <b>group</b> and
57
     * <b>fieldName</b>.
58 272 cmartin
     * This {@link DynFieldModel} is then added to the list of
59
     * {@link DynFieldModel}s of this DynObjectModel
60
     * and then returned.
61
     *
62 302 cordinyana
     * @param group
63
     *            the group name of the associated {@link DynField}. If null,
64
     *            the group name will be set to <b>"General"</b>.
65 272 cmartin
     * @param fieldName
66
     *            the id name of the associated {@link DynField}.
67
     * @return
68
     *         the newly created {@link DynFieldModel} added to the list.
69
     */
70 302 cordinyana
    public DynFieldModel add(String group, String fieldName);
71 170 cmartin
72 272 cmartin
    /**
73 302 cordinyana
     * Creates a new {@link DynFieldModel} within the default "General"
74
     * <b>group</b>, but with the given <b>fieldName</b>.
75 272 cmartin
     * This {@link DynFieldModel} is then added to the list of
76
     * {@link DynFieldModel}s of this DynObjectModel
77
     * and then returned.
78
     *
79
     * @param fieldName
80
     *            the id name of the associated {@link DynField}.
81
     * @return
82
     *         the newly created {@link DynFieldModel} added to the list.
83
     */
84 302 cordinyana
    public DynFieldModel add(String fieldName);
85 270 cmartin
86 272 cmartin
    /**
87
     * Adds a group name to the {@link DynFieldModel}.
88
     *
89
     * @param group
90
     *            the group name.
91
     */
92 170 cmartin
    public void addGroup(String group);
93
94 272 cmartin
    /**
95
     * Retrieves the list of {@link DynFieldModel}s based on the group name.
96
     *
97
     * @param group
98
     *            the group name.
99
     * @return
100
     *         the list of {@link DynFieldModel}s.
101
     */
102 302 cordinyana
        public List<DynFieldModel> getGroupElements(String group);
103 170 cmartin
104 272 cmartin
    /**
105
     * Return an array of group names available for this {@link DynFieldModel}.
106
     *
107
     * @return
108
     *         the array of group names.
109
     */
110 170 cmartin
    public String[] getGroups();
111 529 cmartin
112 632 cmartin
        /**
113
         * Determines if a group contains compulsory fields or not
114
         *
115
         * @param groupName
116
         *            the current groupName
117
         *
118
         * @return if it has compulsory elements or not
119
         */
120
        public boolean isGroupCompulsory(String groupName);
121 529 cmartin
122 632 cmartin
        /**
123
         * Returns a generic label for this group
124
         *
125
         * @return
126
         */
127 529 cmartin
    public String getGenericLabel() ;
128 270 cmartin
}