当前位置: 首页>>代码示例>>Java>>正文


Java TableColumnModelEvent.getFromIndex方法代码示例

本文整理汇总了Java中javax.swing.event.TableColumnModelEvent.getFromIndex方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumnModelEvent.getFromIndex方法的具体用法?Java TableColumnModelEvent.getFromIndex怎么用?Java TableColumnModelEvent.getFromIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.event.TableColumnModelEvent的用法示例。


在下文中一共展示了TableColumnModelEvent.getFromIndex方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
public void columnMoved(TableColumnModelEvent event)
   {
if(isEmpty() || getEventSource() != null) {
    return;
}

setEventSource(event.getSource());

int columnIndex = event.getFromIndex();
int newIndex = event.getToIndex();

Collection<TableColumnModel> models = values();
for (TableColumnModel model : models) {
    if(model == getEventSource())
	continue;
    model.moveColumn(columnIndex, newIndex);
}

if(columnIndex != newIndex) {
    TableColumnSynchronizer column = columns.get(columnIndex);
    columns.remove(columnIndex);
    columns.add(newIndex, column);
}

setEventSource(null);
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:27,代码来源:TableColumnModelSynchronizer.java

示例2: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
@Override
public void columnMoved(TableColumnModelEvent e) {
    int from = e.getFromIndex();
    int to = e.getToIndex();
    if(from == to) {
        return;
    }
    table.getTableHeader().getColumnModel().getColumn(from).setModelIndex(from);
    table.getTableHeader().getColumnModel().getColumn(to).setModelIndex(to);
    tableModel.moveColumn(from, to);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:IssueTable.java

示例3: columnAdded

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
@Override
public void columnAdded(TableColumnModelEvent e) {
	TableColumnModel sourceModel = (TableColumnModel) e.getSource();
	for (int i = e.getFromIndex(); i < e.getToIndex(); i++) {
		TableColumn sourceColumn = sourceModel.getColumn(i);
		handleColumnAdded(sourceColumn);
	}
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:9,代码来源:SynchronizedTableColumnModel.java

示例4: columnRemoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
@Override
public void columnRemoved(TableColumnModelEvent e) {
	TableColumnModel sourceModel = (TableColumnModel) e.getSource();
	for (int i = e.getFromIndex(); i < e.getToIndex(); i++) {
		TableColumn sourceColumn = sourceModel.getColumn(i);
		handleColumnRemoved(sourceColumn);
	}
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:9,代码来源:SynchronizedTableColumnModel.java

示例5: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
@Override
public void columnMoved(TableColumnModelEvent e)
{
	final int indexFrom = e.getFromIndex();
	final int indexTo = e.getToIndex();
	saveColumnMoved(indexFrom, indexTo);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:8,代码来源:CTableColumns2GridTabSynchronizer.java

示例6: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
@Override
public void columnMoved(final TableColumnModelEvent e) {
    if (e.getFromIndex() != e.getToIndex()) {
        columnMoveOccured = true;
    }
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:7,代码来源:TableImpl.java

示例7: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
public void columnMoved(final TableColumnModelEvent evt) {
    if (evt.getFromIndex() == evt.getToIndex())
        return;
    sortOrderChanged = true;
    // rebuild();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:7,代码来源:BugTreeModel.java

示例8: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
public void columnMoved(TableColumnModelEvent tcme){
	int original_index, new_index;
	original_index = tcme.getFromIndex();
	new_index = tcme.getToIndex();
	
	if(original_index == new_index){
		// user is just dragging around without reordering
		// leave quickly
		return;
	}
	
	// since columns have been moved, set flag that files need to be written
	need_to_write = true;
	need_to_sync = true;
	
	boolean in_range = bjt.getColumnCount() > original_index && bjt.getColumnCount() > new_index;
	if(tcme.getSource() == tjt.getColumnModel() && in_range){
		// can update columns on lower table and lds2
		// commented lines out, since currently lds objects are being synced in the
		// syncTables() method when the mouse is release,
		// and just the GUI can be done now
		//MatchingTableModel mtm_top = (MatchingTableModel)tjt.getModel();
		//MatchingTableModel mtm_bottom = (MatchingTableModel)bjt.getModel();
		
		//TableColumn tc_bottom = bjt.getColumnModel().getColumn(original_index);
		//TableColumn tc2_bottom = bjt.getColumnModel().getColumn(new_index);
		
		//TableColumn tc = tjt.getColumnModel().getColumn(original_index);
		//TableColumn tc2 = tjt.getColumnModel().getColumn(new_index);
		
		//tc_bottom.setHeaderValue(tc.getHeaderValue());
		//tc2_bottom.setHeaderValue(tc2.getHeaderValue());
		
		//rm_conf.getLinkDataSource2().getDataColumn(tc_bottom.getModelIndex()).setIncludePosition(new_index);
		//rm_conf.getLinkDataSource2().getDataColumn(tc2_bottom.getModelIndex()).setIncludePosition(original_index);
		
		//removeAndReplaceTableColumns(bjt);
	}
	
	
}
 
开发者ID:openmrs,项目名称:openmrs-module-patientmatching,代码行数:42,代码来源:DataPanel.java

示例9: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
public void columnMoved(TableColumnModelEvent e) {
	super.columnMoved(e);
	if (e.getFromIndex() != e.getToIndex())
		tree.doLayout();
}
 
开发者ID:Sciss,项目名称:TreeTable,代码行数:6,代码来源:BasicTreeTableUI.java

示例10: columnMoved

import javax.swing.event.TableColumnModelEvent; //导入方法依赖的package包/类
@Override
public void columnMoved(TableColumnModelEvent e) {
    if (e.getFromIndex() != e.getToIndex()) {
        setModified(true);
    }
}
 
开发者ID:qspin,项目名称:qtaste,代码行数:7,代码来源:TestRequirementEditor.java


注:本文中的javax.swing.event.TableColumnModelEvent.getFromIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。