Revision 8447 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/panels/attributesTree/CheckBoxNode.java

View differences:

CheckBoxNode.java
61 61
 *
62 62
 * $Id$
63 63
 * $Log$
64
 * Revision 1.1  2006-10-27 11:33:19  jorpiell
64
 * Revision 1.2  2006-10-31 12:24:04  jorpiell
65
 * Comprobado el caso en el que los atributos no tienen tipo
66
 *
67
 * Revision 1.1  2006/10/27 11:33:19  jorpiell
65 68
 * A?adida la treetable con los check box para seleccionar los atributos
66 69
 *
67 70
 *
......
73 76
	private XMLElement element = null;	
74 77
	private CheckBoxNode parent = null;
75 78
	private Vector children = new Vector();	
76
			
79
	
77 80
	public CheckBoxNode(XMLElement element,CheckBoxNode parent){
78 81
		super();
79 82
		this.parent = parent;
......
84 87
		this.setBackground(Color.WHITE);
85 88
		this.setText(fillNameWithBlancs(element.getName()));
86 89
		this.element = element;
87
		if (element.getEntityType().getType() == IXMLType.COMPLEX){
88
			Vector subElements = ((XMLComplexType)element.getEntityType()).getAttributes();
89
			for (int i=0 ; i<subElements.size() ; i++){
90
				XMLElement child = (XMLElement)subElements.get(i);
91
				children.add(new CheckBoxNode(child,this));					
90
		if (element.getEntityType() != null){
91
			if (element.getEntityType().getType() == IXMLType.COMPLEX){
92
				Vector subElements = ((XMLComplexType)element.getEntityType()).getAttributes();
93
				for (int i=0 ; i<subElements.size() ; i++){
94
					XMLElement child = (XMLElement)subElements.get(i);
95
					children.add(new CheckBoxNode(child,this));					
96
				}
97
			}else if(element.getEntityType().getType() == IXMLType.GML_GEOMETRY){
98
				this.setSelected(true);			
92 99
			}
93
		}else if(element.getEntityType().getType() == IXMLType.GML_GEOMETRY){
94
			this.setSelected(true);			
95 100
		}
96 101
	}
97 102
	
......
133 138
	public String toString(){
134 139
		return getElement().getName();
135 140
	}
136

  
141
	
137 142
	/**
138 143
	 * @return Returns the parent.
139 144
	 */
......
142 147
	}
143 148
}
144 149
//public class CheckBoxNode extends JPanel{
145
//	private XMLElement element = null;	
146
//	private CheckBoxNode parent = null;
147
//	private Vector children = new Vector();	
148
//	private TetraStateCheckBox checkBox = null;
149
//			
150
//	public CheckBoxNode(XMLElement element,CheckBoxNode parent){
151
//		super();
152
//		this.parent = parent;
153
//		initialize(element);
154
//	}
155
//	
156
//	private void initialize(XMLElement element){	
157
//		this.setSize(new Dimension(300,400));
158
//		checkBox = new TetraStateCheckBox();
159
//		this.add(checkBox);		
160
//		this.add(new JLabel(element.getName()));
161
//		this.setBackground(Color.BLUE);		
162
//		this.element = element;
163
//		if (element.getEntityType().getType() == IXMLType.COMPLEX){
164
//			Vector subElements = ((XMLComplexType)element.getEntityType()).getAttributes();
165
//			for (int i=0 ; i<subElements.size() ; i++){
166
//				XMLElement child = (XMLElement)subElements.get(i);
167
//				children.add(new CheckBoxNode(child,this));					
168
//			}
169
//		}
170
//	}
171
//	
172
//	public boolean isSelected(){
173
//		return checkBox.isSelected();
174
//	}
175
//	
176
//	public void setSelected(boolean selected){
177
//		checkBox.setSelected(selected);
178
//	}
179
//	
180
//	public void setColor(int color){
181
//		checkBox.setColor(color);
182
//	}
183
//	
184
//	/**
185
//	 * @return Returns the element.
186
//	 */
187
//	public XMLElement getElement() {
188
//		return element;
189
//	}
190
//	
191
//	/**
192
//	 * @return Returns the children.
193
//	 */
194
//	public Vector getChildren() {
195
//		return children;
196
//	}
197
//	
198
//	public String toString(){
199
//		return getElement().getName();
200
//	}
150
//private XMLElement element = null;	
151
//private CheckBoxNode parent = null;
152
//private Vector children = new Vector();	
153
//private TetraStateCheckBox checkBox = null;
201 154
//
202
//	/**
203
//	 * @return Returns the parent.
204
//	 */
205
//	public CheckBoxNode getParentNode() {
206
//		return parent;
207
//	}
155
//public CheckBoxNode(XMLElement element,CheckBoxNode parent){
156
//super();
157
//this.parent = parent;
158
//initialize(element);
159
//}
160
//
161
//private void initialize(XMLElement element){	
162
//this.setSize(new Dimension(300,400));
163
//checkBox = new TetraStateCheckBox();
164
//this.add(checkBox);		
165
//this.add(new JLabel(element.getName()));
166
//this.setBackground(Color.BLUE);		
167
//this.element = element;
168
//if (element.getEntityType().getType() == IXMLType.COMPLEX){
169
//Vector subElements = ((XMLComplexType)element.getEntityType()).getAttributes();
170
//for (int i=0 ; i<subElements.size() ; i++){
171
//XMLElement child = (XMLElement)subElements.get(i);
172
//children.add(new CheckBoxNode(child,this));					
173
//}
174
//}
175
//}
176
//
177
//public boolean isSelected(){
178
//return checkBox.isSelected();
179
//}
180
//
181
//public void setSelected(boolean selected){
182
//checkBox.setSelected(selected);
183
//}
184
//
185
//public void setColor(int color){
186
//checkBox.setColor(color);
187
//}
188
//
189
///**
190
//* @return Returns the element.
191
//*/
192
//public XMLElement getElement() {
193
//return element;
194
//}
195
//
196
///**
197
//* @return Returns the children.
198
//*/
199
//public Vector getChildren() {
200
//return children;
201
//}
202
//
203
//public String toString(){
204
//return getElement().getName();
205
//}
206
//
207
///**
208
//* @return Returns the parent.
209
//*/
210
//public CheckBoxNode getParentNode() {
211
//return parent;
212
//}
208 213
//}

Also available in: Unified diff