當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。