Revision 25564

View differences:

branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/data/feature/swing/FeatureTable.java
2 2
*
3 3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4 4
* of the Valencian Gobernment (CIT)
5
* 
5
*
6 6
* This program is free software; you can redistribute it and/or
7 7
* modify it under the terms of the GNU General Public License
8 8
* as published by the Free Software Foundation; either version 2
9 9
* of the License, or (at your option) any later version.
10
* 
10
*
11 11
* This program is distributed in the hope that it will be useful,
12 12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 14
* GNU General Public License for more details.
15
* 
15
*
16 16
* You should have received a copy of the GNU General Public License
17 17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 19
* MA  02110-1301, USA.
20
* 
20
*
21 21
*/
22 22

  
23 23
/*
......
26 26
 */
27 27
package org.gvsig.fmap.data.feature.swing;
28 28

  
29
import java.awt.Color;
30

  
29 31
import javax.swing.JTable;
30 32
import javax.swing.ListSelectionModel;
31 33
import javax.swing.table.TableColumnModel;
......
39 41

  
40 42
/**
41 43
 * Table extension to show Feature values.
42
 * 
44
 *
43 45
 * It's based on the usage of a FeatureTableModel, and adds renderers for
44 46
 * Geometry and Feature cell values.
45
 * 
47
 *
46 48
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
47 49
 */
48 50
public class FeatureTable extends JTable {
......
51 53
     * Generated Serial UID
52 54
     */
53 55
    private static final long serialVersionUID = -6139395189283163964L;
54
    
56

  
55 57
    /**
56 58
     * @see JTable#JTable(TableModel)
57 59
     */
58 60
    public FeatureTable(FeatureTableModel dm) {
59 61
        super(dm);
62
        setSelectionForeground(Color.blue);
63
		setSelectionBackground(Color.yellow);
60 64
    }
61
    
65

  
62 66
    /**
63 67
     * @see JTable#JTable(TableModel, TableColumnModel)
64 68
     */
65 69
    public FeatureTable(FeatureTableModel dm, TableColumnModel cm) {
66 70
        super(dm, cm);
71
        setSelectionForeground(Color.blue);
72
		setSelectionBackground(Color.yellow);
67 73
    }
68 74

  
69 75
    /**
......
72 78
    public FeatureTable(FeatureTableModel dm, TableColumnModel cm,
73 79
            ListSelectionModel sm) {
74 80
        super(dm, cm, sm);
81
        setSelectionForeground(Color.blue);
82
		setSelectionBackground(Color.yellow);
75 83
    }
76 84

  
77 85
    @Override
branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/data/feature/swing/table/FeatureTypesControl.java
11 11
import javax.swing.JPanel;
12 12
import javax.swing.JScrollPane;
13 13

  
14
import org.gvsig.fmap.dal.DataTypes;
15 14
import org.gvsig.fmap.dal.exception.DataException;
16
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
17 15
import org.gvsig.fmap.dal.feature.FeatureStore;
18 16
import org.gvsig.fmap.dal.feature.FeatureType;
19 17

  
20 18
public class FeatureTypesControl extends JPanel{
21 19

  
22
//	private JPanel jPanel = null;  //  @jve:decl-index=0:visual-constraint="119,38"
23 20
	private JScrollPane jScrollPane = null;  //  @jve:decl-index=0:visual-constraint="10,94"
24 21
	private JList jList = null;
25
//	private FeatureType featureType;
26 22
	private ArrayList<FeatureTypeChangeListener> featureTypeChangeListeners=new ArrayList<FeatureTypeChangeListener>();
27 23
	private FeatureStore featureStore;
28 24

  
......
74 70
				e1.printStackTrace();
75 71
			}
76 72

  
77
			Iterator iterator= list.iterator();
73
			Iterator<FeatureType> iterator= list.iterator();
78 74

  
79 75
			while (iterator.hasNext()) {
80
				FeatureType ft = (FeatureType) iterator.next();
76
				FeatureType ft = iterator.next();
81 77
				listmodel.addFeatureType(ft);
82 78
			}
83 79

  
84 80
			jList = new javax.swing.JList();
85 81
			jList.setModel(listmodel);
86

  
87
//			for (int i = 0; i < liVistas.getModel().getSize(); i++) {
88
//				if (fframeDependence != null) {
89
//					fframeview = (FFrameView) liVistas.getModel().getElementAt(i);
90
//
91
//					if (fframeview == fframelegend.getFFrameDependence()[0]) {
92
//						liVistas.setSelectedIndex(i);
93
//						nameLayers=fframelegend.getNameLayers();
94
//						areVisible=fframelegend.getAreVisible();
95
//						refreshLayerPanel();
96
//					}
97
//				}
98
//			}
99

  
100 82
			jList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
101 83
					public void valueChanged(
102 84
								javax.swing.event.ListSelectionEvent e) {
......
105 87
						for (int i = 0; i < featureTypeChangeListeners.size(); i++) {
106 88
							featureTypeChangeListeners.get(i).change(featureStore,(FeatureType)jList.getModel().getElementAt(selectInt), true);
107 89
						}
108

  
109

  
110
//							IFFrame[] fframes=m_layout.getLayoutContext().getFFrames();
111
//							int selectInt =((JList) e.getSource())
112
//									.getSelectedIndex();
113
//							if (selectInt != selectIndex) {
114
//								selectIndex = selectInt;
115
//								if (selectIndex == -1)
116
//									return;
117
//								fframeview = (FFrameView) liVistas.getModel()
118
//										.getElementAt(selectInt);
119
//
120
//								for (int i = 0; i < fframes.length; i++) {
121
//									IFFrame f = fframes[i];
122
//
123
//									if (f instanceof FFrameView) {
124
//										if (((FFrameView) f).getView() == fframeview
125
//												.getView()) {
126
//											fframeDependence=fframeview;
127
////											fframelegend
128
////													.setFFrameDependence(fframeview);
129
//											refreshLayerPanel();
130
//										}
131
//									}
132
//								}
133
//
134
//								// fframelegend.setFFrameView(fframeview);
135
//							}
136
						}
137

  
138
					});
90
					}
91
			});
139 92
		}
140 93

  
141 94
		return jList;
branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/data/feature/swing/FeatureTypesTablePanel.java
21 21
	/**
22 22
	 *
23 23
	 */
24
	private static final long serialVersionUID = 5857146295213412304L;
24
private static final long serialVersionUID = 5857146295213412304L;
25 25
private FeatureTablePanel tablePanel;
26 26
private FeatureTypesControl typesControl;
27 27
private FeatureType featureType;  //  @jve:decl-index=0:
......
76 76
        throws DataException {
77 77
	super();
78 78
    tablePanel=new FeatureTablePanel(featureStore,featureQuery,isDoubleBuffered);
79
    typesControl=new FeatureTypesControl(featureStore);
79 80
	this.featureStore = featureStore;
80 81
    this.featureType = featureQuery.getFeatureType();
81 82
    this.intializeUI();

Also available in: Unified diff