當前位置: 首頁>>代碼示例>>Java>>正文


Java TableColumnModelEvent.getToIndex方法代碼示例

本文整理匯總了Java中javax.swing.event.TableColumnModelEvent.getToIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java TableColumnModelEvent.getToIndex方法的具體用法?Java TableColumnModelEvent.getToIndex怎麽用?Java TableColumnModelEvent.getToIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.event.TableColumnModelEvent的用法示例。


在下文中一共展示了TableColumnModelEvent.getToIndex方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: columnAdded

import javax.swing.event.TableColumnModelEvent; //導入方法依賴的package包/類
@Override
public void columnAdded(TableColumnModelEvent e) {
    int minWidth;
    final int index = e.getToIndex();
    switch (index) {
        case 0:
        case 1:
            minWidth = 60;
            break;
        default:
            minWidth = 80;
    }
    TableColumnModel columnModel = (TableColumnModel) e.getSource();
    columnModel.getColumn(index).setPreferredWidth(minWidth);
    columnModel.getColumn(index).setCellRenderer(new RightAlignmentTableCellRenderer());
}
 
開發者ID:senbox-org,項目名稱:snap-desktop,代碼行數:17,代碼來源:PlacemarkManagerTopComponent.java

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: columnAdded

import javax.swing.event.TableColumnModelEvent; //導入方法依賴的package包/類
@Override
public void columnAdded(TableColumnModelEvent e) {
	super.columnAdded(e);
	int index = e.getToIndex();
	int width;

	switch (index) {

	case AtomFilterChainTableModel.INDEX_COLUMN :
		width = 50;
		break;

	case AtomFilterChainTableModel.BLOCKING_COLUMN :
		width = 40;
		break;

	case AtomFilterChainTableModel.ENABLED_COLUMN :
		width = 40;
		break;

	case AtomFilterChainTableModel.NAME_COLUMN :
	case AtomFilterChainTableModel.TYPE_COLUMN :
	default :
		width = 200;
		break;

	}

	getColumnModel().getColumn(index).setPreferredWidth(width);

}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:32,代碼來源:AtomFilterChainTable.java

示例8: columnAdded

import javax.swing.event.TableColumnModelEvent; //導入方法依賴的package包/類
/**
 * Does the same as {@link JTable#columnAdded(TableColumnModelEvent)} and
 * sets the preferred width of the cell to {@link
 * MontageFilterEnableTable#COLUMN_SIZE}.
 */
@Override
public void columnAdded(TableColumnModelEvent e) {
	super.columnAdded(e);
	int index = e.getToIndex();
	getColumnModel().getColumn(index).setPreferredWidth(COLUMN_SIZE);
}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:12,代碼來源:MontageFilterEnableTable.java

示例9: columnAdded

import javax.swing.event.TableColumnModelEvent; //導入方法依賴的package包/類
/**
 * Does the same as {@link JTable#columnAdded(TableColumnModelEvent)} and
 * sets the preferred width of the cell to {@link #CELL_SIZE}.
 */
@Override
public void columnAdded(TableColumnModelEvent e) {
	super.columnAdded(e);
	int index = e.getToIndex();
	getColumnModel().getColumn(index).setPreferredWidth(CELL_SIZE);
}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:11,代碼來源:ReferenceTable.java

示例10: 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

示例11: columnAdded

import javax.swing.event.TableColumnModelEvent; //導入方法依賴的package包/類
@Override
public void columnAdded(TableColumnModelEvent e) {
	super.columnAdded(e);
	int index = e.getToIndex();
	getColumnModel().getColumn(index).setPreferredWidth(CELL_SIZE);
}
 
開發者ID:BrainTech,項目名稱:svarog,代碼行數:7,代碼來源:TagComparisonTable.java

示例12: 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

示例13: 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

示例14: 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

示例15: 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.getToIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。