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


Java TableColumn.getCellRenderer方法代碼示例

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


在下文中一共展示了TableColumn.getCellRenderer方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCellRenderer

import javax.swing.table.TableColumn; //導入方法依賴的package包/類
/** Always returns the default renderer for Object.class for the tree column */
@Override
public TableCellRenderer getCellRenderer(int row, int column) {
    int c = convertColumnIndexToModel(column);
    TableCellRenderer result;
    if (c == 0) {
        TableColumn tableColumn = getColumnModel().getColumn(column);
        TableCellRenderer renderer = tableColumn.getCellRenderer();
        if (renderer == null) {
            result = getDefaultRenderer(Object.class);
        } else {
            result = renderer;
        }
    } else {
        result = super.getCellRenderer(row, column);
    }
    return result;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:Outline.java

示例2: getCellRenderer

import javax.swing.table.TableColumn; //導入方法依賴的package包/類
public TableCellRenderer getCellRenderer(int row, int column) {
  TableColumn tableColumn = getColumnModel().getColumn(column);
  TableCellRenderer renderer = tableColumn.getCellRenderer();
  if (renderer == null) {
    Class<?> c = getColumnClass(column);
    if( c.equals(Object.class) )
    {
      Object o = getValueAt(row,column);
      if( o != null )
        c = getValueAt(row,column).getClass();
    }
    renderer = getDefaultRenderer(c);
  }
  return renderer;
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:16,代碼來源:TranslateWindow.java

示例3: copyValues

import javax.swing.table.TableColumn; //導入方法依賴的package包/類
public void copyValues(TableColumn base) {
	modelIndex = base.getModelIndex();
	identifier = base.getIdentifier();
	width = base.getWidth();
	minWidth = base.getMinWidth();
	setPreferredWidth(base.getPreferredWidth());
	maxWidth = base.getMaxWidth();
	headerRenderer = base.getHeaderRenderer();
	headerValue = base.getHeaderValue();
	cellRenderer = base.getCellRenderer();
	cellEditor = base.getCellEditor();
	isResizable = base.getResizable();
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:14,代碼來源:EditableTableHeaderColumn.java

示例4: findTotalMaximumRowSize

import javax.swing.table.TableColumn; //導入方法依賴的package包/類
/**
 * Look through all columns and get the renderer.  If it is
 * also a TextAreaRenderer, we look at the maximum height in
 * its hash table for this row.
 */
private int findTotalMaximumRowSize(JTable table, int row) {
    int maximum_height = 0;
    Enumeration columns = table.getColumnModel().getColumns();
    while (columns.hasMoreElements()) {
        TableColumn tc = (TableColumn) columns.nextElement();
        TableCellRenderer cellRenderer = tc.getCellRenderer();
        if (cellRenderer instanceof TextAreaRenderer) {
            TextAreaRenderer tar = (TextAreaRenderer) cellRenderer;
            maximum_height = Math.max(maximum_height, findMaximumRowSize(table, row));
        }
    }
    return maximum_height;
}
 
開發者ID:dmitrykolesnikovich,項目名稱:featurea,代碼行數:19,代碼來源:TableResizeUtil.java

示例5: setRenderer

import javax.swing.table.TableColumn; //導入方法依賴的package包/類
private static void setRenderer(TableColumn column) {
    if (!(column.getCellRenderer() instanceof TableClassNameRenderer)) {
        column.setCellRenderer(new TableClassNameRenderer());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:TableUISupport.java


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