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 / DynObjectSwingManager.java @ 245

History | View | Annotate | Download (4.57 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
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
package org.gvsig.tools.swing.api.dynobject;
23

    
24
import org.gvsig.tools.dynobject.DynClass;
25
import org.gvsig.tools.dynobject.DynField;
26
import org.gvsig.tools.dynobject.DynObject;
27
import org.gvsig.tools.dynobject.DynObjectSet;
28
import org.gvsig.tools.exception.BaseException;
29
import org.gvsig.tools.service.Manager;
30
import org.gvsig.tools.service.ServiceException;
31
import org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent;
32
import org.gvsig.tools.swing.api.dynobject.dynfield.ValueField;
33
import org.gvsig.tools.swing.api.dynobject.set.JDynObjectSetComponent;
34

    
35
/**
36
 * Manager for DynObject related Swing components.
37
 * 
38
 * @author gvSIG team
39
 */
40
public interface DynObjectSwingManager extends Manager {
41

    
42
        /** Full DynObject visualization or editing form mode. */
43
        public static final String MODE_FORM = "form";
44
        /** DynObject visualization in a list mode. */
45
        public static final String MODE_LIST = "list";
46

    
47
        /**
48
         * Creates a {@link JDynFieldComponent} to render a {@link DynObject} field.
49
         * 
50
         * @param dynClass
51
         *            with the value to render
52
         * @return the component
53
         * @throws ServiceException
54
         */
55
        public DynObjectModel createDynObjectModel(DynClass dynClass)
56
                        throws ServiceException;
57

    
58
        /**
59
         * Creates a {@link JDynFieldComponent} to render a {@link DynObject} field.
60
         * 
61
         * @param dynClass
62
         *            with the value to render
63
         * @return the component
64
         * @throws ServiceException
65
         */
66
        public DynObjectModel createEmptyDynObjectModel(DynClass dynClass)
67
                        throws ServiceException;
68

    
69
        /**
70
         * Creates a {@link JDynFieldComponent} to render a {@link DynObject} field.
71
         * 
72
         * @param field
73
         *            to render
74
         * @param dynObject
75
         *            with the value to render
76
         * @return the component
77
         * @throws ServiceException
78
         */
79
        public JDynFieldComponent createJDynFieldComponent(ValueField valueItem,
80
                        DynField field) throws ServiceException;
81

    
82
        /**
83
         * Creates a {@link JDynObjectComponent} for a {@link DynObject} in the
84
         * default mode.
85
         * 
86
         * @param dynObject
87
         *            to create the component for
88
         * @return a {@link JDynObjectComponent}
89
         * @throws ServiceException
90
         */
91
        public JDynObjectComponent createJDynObjectComponent(DynObject dynObject)
92
                        throws ServiceException;
93

    
94
        /**
95
         * Creates a {@link JDynObjectComponent} for a {@link DynObject}.
96
         * 
97
         * @param dynObject
98
         *            to create the component for
99
         * @param mode
100
         * @return a {@link JDynObjectComponent}
101
         * @throws ServiceException
102
         */
103
        public JDynObjectComponent createJDynObjectComponent(DynObject dynObject,
104
                        DynObjectModel model) throws ServiceException;
105

    
106
        /**
107
         * Creates a {@link JDynObjectComponent} for a {@link DynObject}.
108
         * 
109
         * @param dynObject
110
         *            to create the component for
111
         * @param mode
112
         * @return a {@link JDynObjectComponent}
113
         * @throws ServiceException
114
         */
115
        public JDynObjectComponent createJDynObjectComponent(DynObject dynObject,
116
                        DynObjectModel model, String mode) throws ServiceException;
117

    
118
        /**
119
         * Creates a {@link JDynObjectComponent} for a {@link DynObject}.
120
         * 
121
         * @param dynObject
122
         *            to create the component for
123
         * @param mode
124
         * @return a {@link JDynObjectComponent}
125
         * @throws ServiceException
126
         */
127
        public JDynObjectComponent createJDynObjectComponent(DynObject dynObject,
128
                        String mode) throws ServiceException;
129

    
130
    /**
131
     * Creates a {@link JDynObjectSetComponent} to render a {@link DynObjectSet}
132
     * .
133
     * 
134
     * @param dynObjectSet
135
     *            to create the component for
136
     * @return a {@link JDynObjectSetComponent}
137
     * @throws BaseException
138
     *             if there is an error creating the component
139
     */
140
        public JDynObjectSetComponent createJDynObjectSetComponent(
141
        DynObjectSet dynObjectSet) throws BaseException;
142

    
143
}