Revision 162
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.serv/org.gvsig.tools.swing.serv.jform/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
2 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.tools.swing.serv.jform</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
<name>org.gvsig.tools.swing.serv.jform</name> |
|
7 |
<parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.tools.swing.serv</artifactId> |
|
10 |
<version>2.1.0-SNAPSHOT</version> |
|
11 |
</parent> |
|
12 |
<dependencies> |
|
13 |
<dependency> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>org.gvsig.tools.swing.spi</artifactId> |
|
16 |
<version>2.1.0-SNAPSHOT</version> |
|
17 |
</dependency> |
|
18 |
</dependencies> |
|
19 |
</project> |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.serv/org.gvsig.tools.swing.serv.jform/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.tools.swing.serv.jform.ToolsSwingDefaultDynObjectImplLibrary |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.serv/org.gvsig.tools.swing.serv.jform/src/main/java/org/gvsig/tools/swing/serv/jform/StringDynObjectComponentFactory.java | ||
---|---|---|
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 |
/* |
|
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.serv.jform; |
|
35 |
|
|
36 |
import org.gvsig.tools.dynobject.DynObject; |
|
37 |
import org.gvsig.tools.service.ServiceException; |
|
38 |
import org.gvsig.tools.service.spi.ServiceFactory; |
|
39 |
import org.gvsig.tools.swing.api.dynobject.DynObjectModel; |
|
40 |
import org.gvsig.tools.swing.api.dynobject.JDynObjectComponent; |
|
41 |
import org.gvsig.tools.swing.api.dynobject.JDynObjectComponentFactory; |
|
42 |
import org.gvsig.tools.swing.spi.AbstractDynObjectFactory; |
|
43 |
|
|
44 |
/** |
|
45 |
* @author <a href="mailto:reinhold@uji.es">cmartin</a> |
|
46 |
* |
|
47 |
*/ |
|
48 |
public class StringDynObjectComponentFactory extends AbstractDynObjectFactory |
|
49 |
implements ServiceFactory, JDynObjectComponentFactory { |
|
50 |
|
|
51 |
private static final String SERVICE_NAME = "form.string"; |
|
52 |
|
|
53 |
/* |
|
54 |
* (non-Javadoc) |
|
55 |
* |
|
56 |
* @seeorg.gvsig.tools.swing.api.dynobject.JDynObjectComponentFactory# |
|
57 |
* createJDynObjectComponent |
|
58 |
* (org.gvsig.tools.swing.api.dynobject.DynObjectSwingManager, |
|
59 |
* org.gvsig.tools.dynobject.DynObject, |
|
60 |
* org.gvsig.tools.swing.api.dynobject.DynObjectComponentModel) |
|
61 |
*/ |
|
62 |
public JDynObjectComponent createJDynObjectComponent(DynObject dynObject, |
|
63 |
DynObjectModel model) throws ServiceException { |
|
64 |
return new StringJDynObjectComponent(dynObject, model); |
|
65 |
} |
|
66 |
|
|
67 |
/* |
|
68 |
* (non-Javadoc) |
|
69 |
* |
|
70 |
* @seeorg.gvsig.tools.swing.impl.dynobject.AbstractSwingServiceFactory# |
|
71 |
* getFactoryDescription() |
|
72 |
*/ |
|
73 |
@Override |
|
74 |
public String getFactoryDescription() { |
|
75 |
// TODO Auto-generated method stub |
|
76 |
return null; |
|
77 |
} |
|
78 |
|
|
79 |
/* |
|
80 |
* (non-Javadoc) |
|
81 |
* |
|
82 |
* @see |
|
83 |
* org.gvsig.tools.swing.serv.jform.AbstractDynObjectFactory#getFactoryName |
|
84 |
* () |
|
85 |
*/ |
|
86 |
@Override |
|
87 |
public String getFactoryName() { |
|
88 |
return SERVICE_NAME; |
|
89 |
} |
|
90 |
|
|
91 |
/* |
|
92 |
* (non-Javadoc) |
|
93 |
* |
|
94 |
* @seeorg.gvsig.tools.swing.impl.dynobject.AbstractSwingServiceFactory# |
|
95 |
* getFactorySubType() |
|
96 |
*/ |
|
97 |
@Override |
|
98 |
public String getFactorySubType() { |
|
99 |
// TODO Auto-generated method stub |
|
100 |
return null; |
|
101 |
} |
|
102 |
|
|
103 |
/* |
|
104 |
* (non-Javadoc) |
|
105 |
* |
|
106 |
* @seeorg.gvsig.tools.swing.impl.dynobject.AbstractSwingServiceFactory# |
|
107 |
* getFactoryType() |
|
108 |
*/ |
|
109 |
@Override |
|
110 |
public Integer getFactoryType() { |
|
111 |
// TODO Auto-generated method stub |
|
112 |
return 0; |
|
113 |
} |
|
114 |
} |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.serv/org.gvsig.tools.swing.serv.jform/src/main/java/org/gvsig/tools/swing/serv/jform/StringJDynObjectComponent.java | ||
---|---|---|
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 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {} {{Task}} |
|
26 |
*/ |
|
27 |
package org.gvsig.tools.swing.serv.jform; |
|
28 |
|
|
29 |
import java.awt.BorderLayout; |
|
30 |
|
|
31 |
import javax.swing.JLabel; |
|
32 |
import javax.swing.JPanel; |
|
33 |
|
|
34 |
import org.gvsig.tools.dynobject.DynObject; |
|
35 |
import org.gvsig.tools.service.ServiceException; |
|
36 |
import org.gvsig.tools.swing.api.dynobject.DynObjectModel; |
|
37 |
import org.gvsig.tools.swing.api.dynobject.JDynObjectComponent; |
|
38 |
import org.gvsig.tools.swing.api.dynobject.ValueChangedListener; |
|
39 |
import org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent; |
|
40 |
import org.gvsig.tools.swing.spi.AbstractDynObjectComponent; |
|
41 |
|
|
42 |
/** |
|
43 |
* Simple {@link JDynObjectComponent} implementation which shows a |
|
44 |
* {@link DynObject} as a String. |
|
45 |
* <p> |
|
46 |
* <strong>NOTE:</strong> initial dummy implementation to be replaced with a |
|
47 |
* more complete one. |
|
48 |
* </p> |
|
49 |
* |
|
50 |
* @author 2010- C?sar Ordi?ana - gvSIG team |
|
51 |
*/ |
|
52 |
public class StringJDynObjectComponent extends AbstractDynObjectComponent |
|
53 |
implements JDynObjectComponent { |
|
54 |
|
|
55 |
private static final long serialVersionUID = 5716325904557339463L; |
|
56 |
private JPanel panel; |
|
57 |
|
|
58 |
/** |
|
59 |
* @throws ServiceException |
|
60 |
* @see JDynObjectView#JDynObjectView(DynObject). |
|
61 |
*/ |
|
62 |
public StringJDynObjectComponent(DynObject dynObject, DynObjectModel model) |
|
63 |
throws ServiceException { |
|
64 |
super(dynObject, model); |
|
65 |
this.initUI(); |
|
66 |
} |
|
67 |
|
|
68 |
/* |
|
69 |
* (non-Javadoc) |
|
70 |
* |
|
71 |
* @seeorg.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent# |
|
72 |
* addValueChangedListener |
|
73 |
* (org.gvsig.tools.swing.api.dynobject.ValueChangedListener) |
|
74 |
*/ |
|
75 |
public void addValueChangedListener(ValueChangedListener listener) { |
|
76 |
// TODO Auto-generated method stub |
|
77 |
|
|
78 |
} |
|
79 |
|
|
80 |
/* |
|
81 |
* (non-Javadoc) |
|
82 |
* |
|
83 |
* @see org.gvsig.tools.swing.api.dynobject.JComponent#getComponent() |
|
84 |
*/ |
|
85 |
public Object getComponent() { |
|
86 |
return panel; |
|
87 |
} |
|
88 |
|
|
89 |
/* |
|
90 |
* (non-Javadoc) |
|
91 |
* |
|
92 |
* @see |
|
93 |
* org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent#getValue |
|
94 |
* () |
|
95 |
*/ |
|
96 |
@Override |
|
97 |
public Object getValue() { |
|
98 |
// TODO Auto-generated method stub |
|
99 |
return null; |
|
100 |
} |
|
101 |
|
|
102 |
/* |
|
103 |
* (non-Javadoc) |
|
104 |
* |
|
105 |
* @see |
|
106 |
* org.gvsig.tools.swing.api.dynobject.ValueChangedListener#handleValueChanged |
|
107 |
* (org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent) |
|
108 |
*/ |
|
109 |
public void handleValueChanged(JDynFieldComponent field) { |
|
110 |
// TODO Auto-generated method stub |
|
111 |
|
|
112 |
} |
|
113 |
|
|
114 |
private void initUI() { |
|
115 |
panel = new JPanel(); |
|
116 |
panel.setLayout(new BorderLayout()); |
|
117 |
JLabel label = new JLabel("<html><pre>".concat( |
|
118 |
this.getDynObject().toString()).concat("</pre></html>")); |
|
119 |
panel.add(label, BorderLayout.CENTER); |
|
120 |
} |
|
121 |
|
|
122 |
/* |
|
123 |
* (non-Javadoc) |
|
124 |
* |
|
125 |
* @see |
|
126 |
* org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent#isMandatory |
|
127 |
* () |
|
128 |
*/ |
|
129 |
public boolean isMandatory() { |
|
130 |
// TODO Auto-generated method stub |
|
131 |
return false; |
|
132 |
} |
|
133 |
|
|
134 |
/* |
|
135 |
* (non-Javadoc) |
|
136 |
* |
|
137 |
* @see |
|
138 |
* org.gvsig.tools.swing.spi.AbstractDynObjectComponent#isValid(org.gvsig |
|
139 |
* .tools.swing.api.dynobject.dynfield.JDynFieldComponent) |
|
140 |
*/ |
|
141 |
@Override |
|
142 |
protected boolean isValid(JDynFieldComponent component) { |
|
143 |
// TODO Auto-generated method stub |
|
144 |
return false; |
|
145 |
} |
|
146 |
|
|
147 |
/* |
|
148 |
* (non-Javadoc) |
|
149 |
* |
|
150 |
* @see |
|
151 |
* org.gvsig.tools.swing.api.dynobject.JDynObjectComponent#requestFocus() |
|
152 |
*/ |
|
153 |
public void requestFocus() { |
|
154 |
// TODO Auto-generated method stub |
|
155 |
|
|
156 |
} |
|
157 |
|
|
158 |
@Override |
|
159 |
public void saveStatus() { |
|
160 |
// Nothing to do, as this component is not able to edit the DynObject |
|
161 |
// data. |
|
162 |
} |
|
163 |
|
|
164 |
/* |
|
165 |
* (non-Javadoc) |
|
166 |
* |
|
167 |
* @see |
|
168 |
* org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent#setValue |
|
169 |
* (java.lang.Object) |
|
170 |
*/ |
|
171 |
public void setValue(Object value) { |
|
172 |
// TODO Auto-generated method stub |
|
173 |
|
|
174 |
} |
|
175 |
} |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.serv/org.gvsig.tools.swing.serv.jform/src/main/java/org/gvsig/tools/swing/serv/jform/ToolsSwingDefaultDynObjectImplLibrary.java | ||
---|---|---|
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.serv.jform; |
|
23 |
|
|
24 |
import org.gvsig.tools.library.AbstractLibrary; |
|
25 |
import org.gvsig.tools.library.Library; |
|
26 |
import org.gvsig.tools.library.LibraryException; |
|
27 |
import org.gvsig.tools.service.spi.ServiceManager; |
|
28 |
import org.gvsig.tools.swing.spi.ToolsSwingServiceLocator; |
|
29 |
|
|
30 |
/** |
|
31 |
* {@link Library} for the default tools swing implementation. |
|
32 |
* |
|
33 |
* @author 2010- C?sar Ordi?ana - gvSIG team |
|
34 |
*/ |
|
35 |
public class ToolsSwingDefaultDynObjectImplLibrary extends AbstractLibrary { |
|
36 |
|
|
37 |
@Override |
|
38 |
protected void doInitialize() throws LibraryException { |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
protected void doPostInitialize() throws LibraryException { |
|
43 |
ServiceManager dsManager = ToolsSwingServiceLocator.getServiceManager(); |
|
44 |
|
|
45 |
dsManager.addServiceFactory(new StringDynObjectComponentFactory()); |
|
46 |
// dsManager.addServiceFactory(new NumberFieldComponentFactory()); |
|
47 |
// dsManager.addServiceFactory(new NumberFieldComponentFactory()); |
|
48 |
// dsManager.addServiceFactory(new NumberFieldComponentFactory()); |
|
49 |
|
|
50 |
// .registerDynFieldComponentFactory(numberFactory, DataTypes.INT); |
|
51 |
// dsManager.registerDynFieldComponentFactory(numberFactory, |
|
52 |
// DataTypes.LONG); |
|
53 |
// dsManager.registerDynFieldComponentFactory(numberFactory, |
|
54 |
// DataTypes.FLOAT); |
|
55 |
// dsManager.registerDynFieldComponentFactory(numberFactory, |
|
56 |
// DataTypes.DOUBLE); |
|
57 |
} |
|
58 |
} |
|
0 | 59 |
Also available in: Unified diff