javax.swing.table.TableColumn.getResizable()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中javax.swing.table.TableColumn.getResizable()方法的一些代码示例,展示了TableColumn.getResizable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.getResizable()方法的具体详情如下:
包路径:javax.swing.table.TableColumn
类名称:TableColumn
方法名:getResizable

TableColumn.getResizable介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

  1. /**
  2. * Adjust the width of the specified column in the table
  3. */
  4. public void adjustColumn(final int column) {
  5. TableColumn tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
  6. if (! tableColumn.getResizable()) {
  7. return;
  8. }
  9. int columnHeaderWidth = this.getColumnHeaderWidth( column );
  10. int columnDataWidth = this.getColumnDataWidth( column );
  11. int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
  12. this.updateTableColumn(column, preferredWidth);
  13. }

代码示例来源:origin: ron190/jsql-injection

  1. /**
  2. * Update the TableColumn with the newly calculated width
  3. */
  4. private void updateTableColumn(int column, int width) {
  5. final TableColumn tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
  6. if (! tableColumn.getResizable()) {
  7. return;
  8. }
  9. int calculatedWidth = width;
  10. calculatedWidth += this.spacing;
  11. // Don't shrink the column width
  12. if (this.isOnlyAdjustLarger) {
  13. calculatedWidth = Math.max(calculatedWidth, tableColumn.getPreferredWidth());
  14. }
  15. this.columnSizes.put(tableColumn, Integer.valueOf(tableColumn.getWidth()));
  16. this.tableAdjust.getTableHeader().setResizingColumn(tableColumn);
  17. tableColumn.setWidth(calculatedWidth);
  18. }

代码示例来源:origin: ron190/jsql-injection

  1. /**
  2. * Implement the TableModelListener
  3. */
  4. @Override
  5. public void tableChanged(TableModelEvent e) {
  6. if (! this.isColumnDataIncluded) {
  7. return;
  8. }
  9. // A cell has been updated
  10. if (e.getType() == TableModelEvent.UPDATE) {
  11. int column = this.tableAdjust.convertColumnIndexToView(e.getColumn());
  12. // Only need to worry about an increase in width for this cell
  13. if (this.isOnlyAdjustLarger) {
  14. int row = e.getFirstRow();
  15. TableColumn tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
  16. if (tableColumn.getResizable()) {
  17. int width = this.getCellDataWidth(row, column);
  18. this.updateTableColumn(column, width);
  19. }
  20. // Could be an increase of decrease so check all rows
  21. } else {
  22. this.adjustColumn( column );
  23. }
  24. // The update affected more than one column so adjust all columns
  25. } else {
  26. this.adjustColumns();
  27. }
  28. }

代码示例来源:origin: xyz.cofe/gui.swing

  1. public boolean getResizable() {
  2. return tableColumn.getResizable();
  3. }

代码示例来源:origin: com.eas.platypus/platypus-js-forms

  1. public void setResizeable(boolean aValue) {
  2. if (super.getResizable() != aValue) {
  3. boolean oldValue = super.getResizable();
  4. super.isResizable = aValue;
  5. changeSupport.firePropertyChange("resizable", oldValue, aValue);
  6. }
  7. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

  1. private boolean canResize(TableColumn column)
  2. {
  3. return (column!=null) && header.getResizingAllowed()
  4. && column.getResizable();
  5. }

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-common

  1. private boolean canResize(final TableColumn _column){
  2. return _column != null
  3. && table_.getTableHeader().getResizingAllowed()
  4. && _column.getResizable();
  5. }

代码示例来源:origin: org.activecomponents.jadex/jadex-commons-gui

  1. /**
  2. * Returns true, if resizing for the tableheader is allowed and
  3. * if the column is resizable.
  4. * @param column The column to check
  5. * @return True, if the column is resizeable, otherwise false.
  6. */
  7. private boolean canResize(TableColumn column)
  8. {
  9. return (column!=null) && getResizingAllowed() && column.getResizable();
  10. }

代码示例来源:origin: SKCraft/Launcher

  1. public void adjustColumn(final int column) {
  2. TableColumn tableColumn = table.getColumnModel().getColumn(column);
  3. if (!tableColumn.getResizable()) return;
  4. int columnHeaderWidth = getColumnHeaderWidth(column);
  5. int columnDataWidth = getColumnDataWidth(column);
  6. int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
  7. updateTableColumn(column, preferredWidth);
  8. }

代码示例来源:origin: kaikramer/keystore-explorer

  1. public void adjustColumn(final int column) {
  2. TableColumn tableColumn = table.getColumnModel().getColumn(column);
  3. if (!tableColumn.getResizable()) {
  4. return;
  5. }
  6. int columnHeaderWidth = getColumnHeaderWidth(column);
  7. int columnDataWidth = getColumnDataWidth(column);
  8. int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
  9. updateTableColumn(column, preferredWidth);
  10. }

代码示例来源:origin: SKCraft/Launcher

  1. private void updateTableColumn(int column, int width) {
  2. final TableColumn tableColumn = table.getColumnModel().getColumn(column);
  3. if (!tableColumn.getResizable()) return;
  4. width += spacing;
  5. // Don't shrink the column width
  6. if (isOnlyAdjustLarger) {
  7. width = Math.max(width, tableColumn.getPreferredWidth());
  8. }
  9. columnSizes.put(tableColumn, tableColumn.getWidth());
  10. table.getTableHeader().setResizingColumn(tableColumn);
  11. tableColumn.setWidth(width);
  12. }

代码示例来源:origin: kaikramer/keystore-explorer

  1. private void updateTableColumn(int column, int width) {
  2. final TableColumn tableColumn = table.getColumnModel().getColumn(column);
  3. if (!tableColumn.getResizable()) {
  4. return;
  5. }
  6. width += spacing;
  7. // Don't shrink the column width
  8. if (isOnlyAdjustLarger) {
  9. width = Math.max(width, tableColumn.getPreferredWidth());
  10. }
  11. columnSizes.put(tableColumn, Integer.valueOf(tableColumn.getWidth()));
  12. table.getTableHeader().setResizingColumn(tableColumn);
  13. tableColumn.setWidth(width);
  14. }

代码示例来源:origin: bspkrs/MCPMappingViewer

  1. public void adjustColumn(final int column)
  2. {
  3. TableColumn tableColumn = table.getColumnModel().getColumn(column);
  4. if (!tableColumn.getResizable())
  5. return;
  6. int columnHeaderWidth = getColumnHeaderWidth(column);
  7. int columnDataWidth = getColumnDataWidth(column);
  8. int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
  9. updateTableColumn(column, preferredWidth);
  10. }

代码示例来源:origin: net.sf.kerner-utils/kerner-utils

  1. public void adjustColumn(final int column) {
  2. final TableColumn tableColumn = table.getColumnModel().getColumn(column);
  3. if (!tableColumn.getResizable())
  4. return;
  5. final int columnHeaderWidth = getColumnHeaderWidth(column);
  6. final int columnDataWidth = getColumnDataWidth(column);
  7. final int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
  8. updateTableColumn(column, preferredWidth);
  9. }

代码示例来源:origin: net.sf.kerner-utils/kerner-utils

  1. private void updateTableColumn(final int column, int width) {
  2. final TableColumn tableColumn = table.getColumnModel().getColumn(column);
  3. if (!tableColumn.getResizable())
  4. return;
  5. width += spacing;
  6. // Don't shrink the column width
  7. if (isOnlyAdjustLarger) {
  8. width = Math.max(width, tableColumn.getPreferredWidth());
  9. }
  10. columnSizes.put(tableColumn, new Integer(tableColumn.getWidth()));
  11. table.getTableHeader().setResizingColumn(tableColumn);
  12. tableColumn.setWidth(width);
  13. }
  14. }

代码示例来源:origin: bspkrs/MCPMappingViewer

  1. private void updateTableColumn(int column, int width)
  2. {
  3. final TableColumn tableColumn = table.getColumnModel().getColumn(column);
  4. if (!tableColumn.getResizable())
  5. return;
  6. width += spacing;
  7. // Don't shrink the column width
  8. if (isOnlyAdjustLarger)
  9. {
  10. width = Math.max(width, tableColumn.getPreferredWidth());
  11. }
  12. columnSizes.put(tableColumn, new Integer(tableColumn.getWidth()));
  13. table.getTableHeader().setResizingColumn(tableColumn);
  14. tableColumn.setWidth(width);
  15. }

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

  1. /**
  2. * Returns true if the user <i>can</i> resize the TableColumn's width,
  3. * false otherwise. This is a usability override: it takes into account
  4. * the case where it's principally <i>allowed</i> to resize the column
  5. * but not possible because the column has fixed size.
  6. *
  7. * @return a boolean indicating whether the user can resize this column.
  8. */
  9. @Override
  10. public boolean getResizable() {
  11. // TODO JW: resizable is a bound property, so to be strict
  12. // we'll need to override setMin/MaxWidth to fire resizable
  13. // property change.
  14. return super.getResizable() && (getMinWidth() < getMaxWidth());
  15. }

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

  1. /**
  2. * Returns true if the user <i>can</i> resize the TableColumn's width,
  3. * false otherwise. This is a usability override: it takes into account
  4. * the case where it's principally <i>allowed</i> to resize the column
  5. * but not possible because the column has fixed size.
  6. *
  7. * @return a boolean indicating whether the user can resize this column.
  8. */
  9. @Override
  10. public boolean getResizable() {
  11. // TODO JW: resizable is a bound property, so to be strict
  12. // we'll need to override setMin/MaxWidth to fire resizable
  13. // property change.
  14. return super.getResizable() && (getMinWidth() < getMaxWidth());
  15. }

代码示例来源:origin: com.eas.platypus/platypus-js-forms

  1. private void hideColumn() {
  2. tempWidth = super.getWidth();
  3. tempMinWidth = super.getMinWidth();
  4. tempMaxWidth = super.getMaxWidth();
  5. tempResizable = super.getResizable();
  6. tempMoveable = moveable;
  7. setResizeable(false);
  8. setMoveable(false);
  9. setMinWidth(0);
  10. setWidth(0);
  11. setMaxWidth(0);
  12. }

代码示例来源:origin: mucommander/mucommander

  1. public void copyValues(TableColumn base) {
  2. modelIndex = base.getModelIndex();
  3. identifier = base.getIdentifier();
  4. width = base.getWidth();
  5. minWidth = base.getMinWidth();
  6. setPreferredWidth(base.getPreferredWidth());
  7. maxWidth = base.getMaxWidth();
  8. headerRenderer = base.getHeaderRenderer();
  9. headerValue = base.getHeaderValue();
  10. cellRenderer = base.getCellRenderer();
  11. cellEditor = base.getCellEditor();
  12. isResizable = base.getResizable();
  13. }
  14. }

相关文章