42 |
42 |
|
43 |
43 |
import java.awt.Color;
|
44 |
44 |
import java.awt.Component;
|
45 |
|
import java.awt.Label;
|
46 |
45 |
import java.awt.event.KeyAdapter;
|
47 |
46 |
import java.awt.event.KeyEvent;
|
48 |
47 |
import java.awt.event.KeyListener;
|
... | ... | |
59 |
58 |
import java.util.EventObject;
|
60 |
59 |
|
61 |
60 |
import javax.swing.BorderFactory;
|
62 |
|
import javax.swing.CellRendererPane;
|
63 |
61 |
import javax.swing.DefaultCellEditor;
|
64 |
62 |
import javax.swing.DefaultListSelectionModel;
|
65 |
|
import javax.swing.FocusManager;
|
66 |
63 |
import javax.swing.JComponent;
|
67 |
64 |
import javax.swing.JFileChooser;
|
68 |
65 |
import javax.swing.JFrame;
|
... | ... | |
78 |
75 |
import javax.swing.event.TableColumnModelEvent;
|
79 |
76 |
import javax.swing.event.TableColumnModelListener;
|
80 |
77 |
import javax.swing.table.AbstractTableModel;
|
81 |
|
import javax.swing.table.DefaultTableCellRenderer;
|
82 |
78 |
import javax.swing.table.DefaultTableColumnModel;
|
83 |
79 |
import javax.swing.table.TableCellRenderer;
|
84 |
80 |
import javax.swing.table.TableColumn;
|
... | ... | |
93 |
89 |
import com.iver.andami.messages.NotificationManager;
|
94 |
90 |
import com.iver.andami.ui.mdiFrame.MainFrame;
|
95 |
91 |
import com.iver.andami.ui.mdiManager.SingletonView;
|
96 |
|
import com.iver.andami.ui.mdiManager.View;
|
97 |
92 |
import com.iver.andami.ui.mdiManager.ViewInfo;
|
98 |
93 |
import com.iver.andami.ui.mdiManager.ViewListener;
|
99 |
94 |
import com.iver.andami.ui.mdiManager.ViewTransform;
|
... | ... | |
113 |
108 |
import com.iver.cit.gvsig.fmap.edition.writers.dbf.DbfWriter;
|
114 |
109 |
import com.iver.cit.gvsig.fmap.edition.writers.shp.ShpWriter;
|
115 |
110 |
import com.iver.cit.gvsig.fmap.layers.FLayer;
|
116 |
|
import com.iver.cit.gvsig.fmap.layers.FLayers;
|
117 |
111 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
|
118 |
112 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory;
|
119 |
113 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
|
... | ... | |
126 |
120 |
import com.iver.utiles.SimpleFileFilter;
|
127 |
121 |
import com.iver.utiles.swing.jtable.FieldSelectionEvent;
|
128 |
122 |
import com.iver.utiles.swing.jtable.FieldSelectionListener;
|
129 |
|
import com.iver.utiles.swing.jtable.JTable;
|
130 |
123 |
import com.iver.utiles.swing.jtable.SelectionHeaderSupport;
|
131 |
124 |
|
132 |
125 |
/**
|
... | ... | |
175 |
168 |
* @return DOCUMENT ME!
|
176 |
169 |
*/
|
177 |
170 |
public BitSet getSelectedFieldIndices() {
|
178 |
|
return headerSelectionSupport.getSelectedColumns();
|
|
171 |
BitSet bs=headerSelectionSupport.getSelectedColumns();
|
|
172 |
BitSet newbs=new BitSet();
|
|
173 |
for (int i =1;i<bs.length();i++){
|
|
174 |
if (bs.get(i))
|
|
175 |
newbs.set(i-1);
|
|
176 |
}
|
|
177 |
return newbs;
|
179 |
178 |
}
|
180 |
179 |
|
181 |
180 |
/**
|
... | ... | |
1122 |
1121 |
* @return Name of field
|
1123 |
1122 |
*/
|
1124 |
1123 |
public String getColumnName(int col) {
|
1125 |
|
if (col==0)
|
1126 |
|
return " ";
|
1127 |
|
col--;
|
1128 |
1124 |
return aliases[mapping[col]];
|
1129 |
1125 |
}
|
1130 |
1126 |
|
... | ... | |
1134 |
1130 |
* @return number of fields
|
1135 |
1131 |
*/
|
1136 |
1132 |
public int getColumnCount() {
|
1137 |
|
return mapping.length+1;
|
|
1133 |
return mapping.length;
|
1138 |
1134 |
}
|
1139 |
1135 |
|
1140 |
1136 |
/**
|
... | ... | |
1166 |
1162 |
return null;
|
1167 |
1163 |
}
|
1168 |
1164 |
col--;
|
1169 |
|
SelectableDataSource sds=des.getRecordset();
|
1170 |
1165 |
|
1171 |
1166 |
try {
|
1172 |
1167 |
if (orderIndexes != null) {
|
1173 |
1168 |
Object obj =null;
|
1174 |
1169 |
|
1175 |
1170 |
IRowEdited rowEdited=des.getRow((int)orderIndexes[row]);
|
1176 |
|
obj= rowEdited.getAttribute(col);
|
|
1171 |
obj= rowEdited.getAttribute(mapping[col]);
|
1177 |
1172 |
return obj;
|
1178 |
1173 |
} else {
|
1179 |
1174 |
Object obj =null;
|
1180 |
1175 |
|
1181 |
1176 |
IRowEdited rowEdited=des.getRow(row);
|
1182 |
|
obj= rowEdited.getAttribute(col);
|
|
1177 |
obj= rowEdited.getAttribute(mapping[col]);
|
1183 |
1178 |
//obj = sds.getFieldValue(row, col);
|
1184 |
1179 |
return obj;
|
1185 |
1180 |
}
|
... | ... | |
1219 |
1214 |
throw new UnsupportedOperationException("Row Number is a read-only column");
|
1220 |
1215 |
columnIndex--;
|
1221 |
1216 |
Value v;
|
1222 |
|
if (getValueAt(rowIndex,columnIndex+1)==null || getValueAt(rowIndex,columnIndex+1).toString().equals(aValue))
|
|
1217 |
if (getValueAt(rowIndex,columnIndex)==null || getValueAt(rowIndex,columnIndex).toString().equals(aValue))
|
1223 |
1218 |
return;
|
1224 |
1219 |
try {
|
1225 |
1220 |
v = ValueFactory.createValueByType(aValue.toString(),
|