Statistics
| Revision:

gvsig-tools / 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 @ 306

History | View | Annotate | Download (4.16 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

    
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.JComponent;
32
import javax.swing.JLabel;
33
import javax.swing.JPanel;
34

    
35
import org.gvsig.tools.dynobject.DynField;
36
import org.gvsig.tools.dynobject.DynObject;
37
import org.gvsig.tools.service.ServiceException;
38
import org.gvsig.tools.swing.api.dynobject.DynObjectModel;
39
import org.gvsig.tools.swing.api.dynobject.JDynObjectComponent;
40
import org.gvsig.tools.swing.api.dynobject.ValueChangedListener;
41
import org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent;
42
import org.gvsig.tools.swing.spi.AbstractDynObjectComponent;
43

    
44
/**
45
 * Simple {@link JDynObjectComponent} implementation which shows a
46
 * {@link DynObject} as a String.
47
 * <p>
48
 * <strong>NOTE:</strong> initial dummy implementation to be replaced with a
49
 * more complete one.
50
 * </p>
51
 * 
52
 * @author 2010- C?sar Ordi?ana - gvSIG team
53
 */
54
public class StringJDynObjectComponent extends AbstractDynObjectComponent
55
    implements JDynObjectComponent {
56

    
57
    private static final long serialVersionUID = 5716325904557339463L;
58
    private JPanel panel;
59

    
60
    /**
61
     * @throws ServiceException
62
     * @see JDynObjectView#JDynObjectView(DynObject).
63
     */
64
        public StringJDynObjectComponent(DynObject dynObject, DynObjectModel model,
65
                        boolean writable)
66
        throws ServiceException {
67
                super(dynObject, model);
68
        this.initUI();
69
    }
70

    
71
    /*
72
     * (non-Javadoc)
73
     * 
74
     * @seeorg.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent#
75
     * addValueChangedListener
76
     * (org.gvsig.tools.swing.api.dynobject.ValueChangedListener)
77
     */
78
    public void addValueChangedListener(ValueChangedListener listener) {
79
        // TODO Auto-generated method stub
80

    
81
    }
82

    
83
    /*
84
     * (non-Javadoc)
85
     * 
86
     * @see org.gvsig.tools.swing.api.dynobject.JComponent#getComponent()
87
     */
88
    public JComponent asJComponent() {
89
        return panel;
90
    }
91

    
92

    
93

    
94
    /*
95
     * (non-Javadoc)
96
     * 
97
     * @see
98
     * 
99
     * org.gvsig.tools.swing.api.dynobject.ValueChangedListener#handleValueChanged
100
     * (org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent)
101
     */
102
    public void handleValueChanged(JDynFieldComponent field) {
103
        // TODO Auto-generated method stub
104

    
105
    }
106

    
107
    private void initUI() {
108
        panel = new JPanel();
109
        panel.setLayout(new BorderLayout());
110
        JLabel label =
111
            new JLabel("<html><pre>".concat(this.getDynObject().toString())
112
                .concat("</pre></html>"));
113
        panel.add(label, BorderLayout.CENTER);
114
    }
115

    
116
    public void setValue(Object value) {
117
        // TODO Auto-generated method stub
118
        
119
    }
120

    
121
    public void requestFocus() {
122
        // TODO Auto-generated method stub
123
        
124
    }
125

    
126
    public Object getDefaultFieldValue() {
127
        // TODO Auto-generated method stub
128
        return null;
129
    }
130

    
131
    public DynField getDynField() {
132
        // TODO Auto-generated method stub
133
        return null;
134
    }
135

    
136
    public Object getFieldValue() {
137
        // TODO Auto-generated method stub
138
        return null;
139
    }
140

    
141
    public void setFieldValue(Object value) {
142
        // TODO Auto-generated method stub
143
        
144
    }
145

    
146
    public Object getValue() {
147
        // TODO Auto-generated method stub
148
        return null;
149
    }
150
}