本文整理汇总了Java中javax.swing.table.DefaultTableModel.getDataVector方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultTableModel.getDataVector方法的具体用法?Java DefaultTableModel.getDataVector怎么用?Java DefaultTableModel.getDataVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.table.DefaultTableModel
的用法示例。
在下文中一共展示了DefaultTableModel.getDataVector方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refreshModel
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
private void refreshModel(final ProfilerTable table) {
Object selected = null;
Set original = new HashSet();
int selrow = table.getSelectedRow();
int column = table.convertColumnIndexToView(0);
for (int row = 0; row < table.getRowCount(); row++) {
Object value = table.getValueAt(row, column);
original.add(value);
if (row == selrow) selected = value;
}
final DefaultTableModel model = (DefaultTableModel)table.getModel();
Vector data = model.getDataVector();
data.clear();
for (JavaPlatform platform : JavaPlatform.getPlatforms()) {
data.add(new Vector(Arrays.asList(platform, null)));
if (!original.contains(platform)) selected = platform;
}
table.clearSelection();
model.fireTableDataChanged();
if (selected != null) table.selectValue(selected, column, true);
RequestProcessor.getDefault().post(new Runnable() {
public void run() { refreshTimes(model); }
});
}
示例2: getBuildArgs
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
public Map<String, String> getBuildArgs() {
Map<String, String> result = new TreeMap<>();
DefaultTableModel model = (DefaultTableModel) buildargsTable.getModel();
if (buildargsTable.isEditing()) {
buildargsTable.getCellEditor().stopCellEditing();
}
for (Object o : model.getDataVector()) {
Vector v = (Vector) o;
String name = (String) v.elementAt(0);
String value = (String) v.elementAt(1);
if (name != null && value != null) {
result.put(name, value);
}
}
return result;
}
示例3: getVolumesTable
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
public Map<String, String> getVolumesTable() {
Map<String, String> result = new TreeMap<>();
DefaultTableModel model = (DefaultTableModel) volumesTable.getModel();
if (volumesTable.isEditing()) {
volumesTable.getCellEditor().stopCellEditing();
}
for (Object o : model.getDataVector()) {
Vector v = (Vector) o;
String target = (String) v.elementAt(0);
String source = (String) v.elementAt(1);
if (target != null && source != null) {
result.put(target, source);
}
}
return result;
}
示例4: storeRoots
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
private void storeRoots( ModuleRoots roots, DefaultTableModel tableModel ) throws MalformedURLException {
Vector data = tableModel.getDataVector();
URL[] rootURLs = new URL[data.size()];
String []rootPaths = new String[data.size()];
final LinkedList<URL> oldRootURLs = new LinkedList<>(Arrays.asList (roots.getRootURLs (false)));
final LinkedList<String> oldRootPathProps = new LinkedList<>(Arrays.asList (roots.getRootPathProperties()));
boolean rootsAreSame = true;
for (int i=0; i<data.size();i++) {
File f = (File) ((Vector)data.elementAt(i)).elementAt(0);
rootURLs[i] = Utilities.toURI(f).toURL();
if (!rootURLs[i].toExternalForm().endsWith("/")) { //NOI18N
rootURLs[i] = new URL(rootURLs[i]+"/");
}
validateURL(rootURLs[i],f);
rootPaths[i] = (String) ((Vector)data.elementAt(i)).elementAt(1);
rootsAreSame &= !oldRootURLs.isEmpty() &&
oldRootURLs.removeFirst().equals(rootURLs[i]) &&
roots.getRootPath(oldRootPathProps.removeFirst()).equals(rootPaths[i]);
}
if (!rootsAreSame || !oldRootURLs.isEmpty ()) {
roots.putModuleRoots(rootURLs, rootPaths);
}
}
示例5: storeRoots
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
private void storeRoots( SourceRoots roots, DefaultTableModel tableModel ) throws MalformedURLException {
Vector data = tableModel.getDataVector();
URL[] rootURLs = new URL[data.size()];
String []rootLabels = new String[data.size()];
final LinkedList<URL> oldRootURLs = new LinkedList<URL>(Arrays.asList (roots.getRootURLs (false)));
final LinkedList<String> oldRootLabels = new LinkedList<String>(Arrays.asList(roots.getRootNames()));
final LinkedList<String> oldRootProps = new LinkedList<String>(Arrays.asList (roots.getRootProperties()));
boolean rootsAreSame = true;
for (int i=0; i<data.size();i++) {
File f = (File) ((Vector)data.elementAt(i)).elementAt(0);
rootURLs[i] = Utilities.toURI(f).toURL();
if (!rootURLs[i].toExternalForm().endsWith("/")) { //NOI18N
rootURLs[i] = new URL(rootURLs[i]+"/");
}
validateURL(rootURLs[i],f);
rootLabels[i] = (String) ((Vector)data.elementAt(i)).elementAt(1);
rootsAreSame &= !oldRootURLs.isEmpty() &&
oldRootURLs.removeFirst().equals(rootURLs[i]) &&
roots.getRootDisplayName(oldRootLabels.removeFirst(), oldRootProps.removeFirst()).equals(rootLabels[i]);
}
if (!rootsAreSame || !oldRootURLs.isEmpty ()) {
roots.putRoots(rootURLs,rootLabels);
}
}
示例6: deletecol
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
/**
* Delete a single column from the table model
*
* @param table target table
* @param col target column
* @deprecated
*/
static void deletecol(JTable table, int col) {
DefaultTableModel tmodel = (DefaultTableModel) table.getModel();
DefaultTableModel tmodel1 = new DefaultTableModel();
TableModelListener[] listeners = tmodel.getTableModelListeners();
Vector<?> v = tmodel.getDataVector();
Vector<?> v1 = newvector(v, col);
tmodel1.setDataVector(v1, getColumnIdentifiersremovecol(table, col));
table.setModel(tmodel1);
for (TableModelListener l : listeners) {
tmodel1.addTableModelListener(l);
}
}
示例7: loadIncludesExcludes
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
void loadIncludesExcludes(IncludeExcludeVisualizer v) {
Set<File> roots = new HashSet<File>();
for (DefaultTableModel model : new DefaultTableModel[] {MODULE_ROOTS_MODEL, TEST_MODULE_ROOTS_MODEL}) {
for (Object row : model.getDataVector()) {
File d = (File) ((Vector) row).elementAt(0);
if (/* #104996 */d.isDirectory()) {
roots.add(d);
}
}
}
v.setRoots(roots.toArray(new File[roots.size()]));
v.setIncludePattern(includes);
v.setExcludePattern(excludes);
}
示例8: loadIncludesExcludes
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
void loadIncludesExcludes(IncludeExcludeVisualizer v) {
Set<File> roots = new HashSet<File>();
for (DefaultTableModel model : new DefaultTableModel[] {SOURCE_ROOTS_MODEL, TEST_ROOTS_MODEL}) {
for (Object row : model.getDataVector()) {
File d = (File) ((Vector) row).elementAt(0);
if (/* #104996 */d.isDirectory()) {
roots.add(d);
}
}
}
v.setRoots(roots.toArray(new File[roots.size()]));
v.setIncludePattern(includes);
v.setExcludePattern(excludes);
}
示例9: getTableModel4Slot
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
/**
* This returns the 'DefaultTableModel' for a single
* class out of the ontology-classes.
*
* @return the table model4 slot
*/
public DefaultTableModel getTableModel4Slot() {
DefaultTableModel tm4s = new DefaultTableModel();
tm4s.addColumn("Name");
tm4s.addColumn("Cardinality");
tm4s.addColumn("Type");
tm4s.addColumn("Other Facets");
if (ontologySubClass == null) {
return tm4s;
}
// --- Nach den entsprechenden Slots im Vokabular filtern ---
Hashtable<String, String> ontoSlotHash = ontologyClass.ontologieVocabulary.getSlots(ontologySubClass);
ReflectClass reflectedClass = new ReflectClass(ontologySubClass, ontoSlotHash);
Vector<String> v = new Vector<String>( ontoSlotHash.keySet() );
Collections.sort(v);
Iterator<String> it = v.iterator();
while (it.hasNext()) {
// --- Get Word of the ontology -------------------------
String key = it.next();
String word = ontoSlotHash.get(key);
// --- Get Slot... --------------------------------------
Slot currSlot = reflectedClass.getSlot(word);
// --- Add table row ------------------------------------
Vector<String> rowData = new Vector<String>();
rowData.add(word );
rowData.add(currSlot.Cardinality);
rowData.add(currSlot.VarType);
rowData.add(currSlot.OtherFacts);
tm4s.addRow(rowData);
}
// ----------------------------------------------------------
// --- Are there slots from the parent Node? ----------------
// ----------------------------------------------------------
if (parentOntologyClassTreeObject!=null) {
DefaultTableModel subTBmodel = parentOntologyClassTreeObject.getTableModel4Slot();
Vector<?> subDataVector = subTBmodel.getDataVector();
for (int i = 0; i < subDataVector.size(); i++) {
Vector<?> rowVector = (Vector<?>) subDataVector.get(i);
tm4s.addRow(rowVector);
}
Sorter.sortTableModel(tm4s, 0);
}
// ----------------------------------------------------------
return tm4s;
}
示例10: updateResultSetDataFromTableModel
import javax.swing.table.DefaultTableModel; //导入方法依赖的package包/类
public void updateResultSetDataFromTableModel(DefaultTableModel aTableModel) {
resultSetData = new Vector(aTableModel.getDataVector());
resultSetColumns = new Vector<String>();
// Get columns names
for (int i = 0; i < aTableModel.getColumnCount(); i++) {
resultSetColumns.add(aTableModel.getColumnName(i));
}
}