本文整理了Java中javax.swing.table.TableColumn.getResizable()
方法的一些代码示例,展示了TableColumn.getResizable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.getResizable()
方法的具体详情如下:
包路径:javax.swing.table.TableColumn
类名称:TableColumn
方法名:getResizable
暂无
代码示例来源:origin: ron190/jsql-injection
/**
* Adjust the width of the specified column in the table
*/
public void adjustColumn(final int column) {
TableColumn tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
if (! tableColumn.getResizable()) {
return;
}
int columnHeaderWidth = this.getColumnHeaderWidth( column );
int columnDataWidth = this.getColumnDataWidth( column );
int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
this.updateTableColumn(column, preferredWidth);
}
代码示例来源:origin: ron190/jsql-injection
/**
* Update the TableColumn with the newly calculated width
*/
private void updateTableColumn(int column, int width) {
final TableColumn tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
if (! tableColumn.getResizable()) {
return;
}
int calculatedWidth = width;
calculatedWidth += this.spacing;
// Don't shrink the column width
if (this.isOnlyAdjustLarger) {
calculatedWidth = Math.max(calculatedWidth, tableColumn.getPreferredWidth());
}
this.columnSizes.put(tableColumn, Integer.valueOf(tableColumn.getWidth()));
this.tableAdjust.getTableHeader().setResizingColumn(tableColumn);
tableColumn.setWidth(calculatedWidth);
}
代码示例来源:origin: ron190/jsql-injection
/**
* Implement the TableModelListener
*/
@Override
public void tableChanged(TableModelEvent e) {
if (! this.isColumnDataIncluded) {
return;
}
// A cell has been updated
if (e.getType() == TableModelEvent.UPDATE) {
int column = this.tableAdjust.convertColumnIndexToView(e.getColumn());
// Only need to worry about an increase in width for this cell
if (this.isOnlyAdjustLarger) {
int row = e.getFirstRow();
TableColumn tableColumn = this.tableAdjust.getColumnModel().getColumn(column);
if (tableColumn.getResizable()) {
int width = this.getCellDataWidth(row, column);
this.updateTableColumn(column, width);
}
// Could be an increase of decrease so check all rows
} else {
this.adjustColumn( column );
}
// The update affected more than one column so adjust all columns
} else {
this.adjustColumns();
}
}
代码示例来源:origin: xyz.cofe/gui.swing
public boolean getResizable() {
return tableColumn.getResizable();
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
public void setResizeable(boolean aValue) {
if (super.getResizable() != aValue) {
boolean oldValue = super.getResizable();
super.isResizable = aValue;
changeSupport.firePropertyChange("resizable", oldValue, aValue);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
private boolean canResize(TableColumn column)
{
return (column!=null) && header.getResizingAllowed()
&& column.getResizable();
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-common
private boolean canResize(final TableColumn _column){
return _column != null
&& table_.getTableHeader().getResizingAllowed()
&& _column.getResizable();
}
代码示例来源:origin: org.activecomponents.jadex/jadex-commons-gui
/**
* Returns true, if resizing for the tableheader is allowed and
* if the column is resizable.
* @param column The column to check
* @return True, if the column is resizeable, otherwise false.
*/
private boolean canResize(TableColumn column)
{
return (column!=null) && getResizingAllowed() && column.getResizable();
}
代码示例来源:origin: SKCraft/Launcher
public void adjustColumn(final int column) {
TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable()) return;
int columnHeaderWidth = getColumnHeaderWidth(column);
int columnDataWidth = getColumnDataWidth(column);
int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
updateTableColumn(column, preferredWidth);
}
代码示例来源:origin: kaikramer/keystore-explorer
public void adjustColumn(final int column) {
TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable()) {
return;
}
int columnHeaderWidth = getColumnHeaderWidth(column);
int columnDataWidth = getColumnDataWidth(column);
int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
updateTableColumn(column, preferredWidth);
}
代码示例来源:origin: SKCraft/Launcher
private void updateTableColumn(int column, int width) {
final TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable()) return;
width += spacing;
// Don't shrink the column width
if (isOnlyAdjustLarger) {
width = Math.max(width, tableColumn.getPreferredWidth());
}
columnSizes.put(tableColumn, tableColumn.getWidth());
table.getTableHeader().setResizingColumn(tableColumn);
tableColumn.setWidth(width);
}
代码示例来源:origin: kaikramer/keystore-explorer
private void updateTableColumn(int column, int width) {
final TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable()) {
return;
}
width += spacing;
// Don't shrink the column width
if (isOnlyAdjustLarger) {
width = Math.max(width, tableColumn.getPreferredWidth());
}
columnSizes.put(tableColumn, Integer.valueOf(tableColumn.getWidth()));
table.getTableHeader().setResizingColumn(tableColumn);
tableColumn.setWidth(width);
}
代码示例来源:origin: bspkrs/MCPMappingViewer
public void adjustColumn(final int column)
{
TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable())
return;
int columnHeaderWidth = getColumnHeaderWidth(column);
int columnDataWidth = getColumnDataWidth(column);
int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
updateTableColumn(column, preferredWidth);
}
代码示例来源:origin: net.sf.kerner-utils/kerner-utils
public void adjustColumn(final int column) {
final TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable())
return;
final int columnHeaderWidth = getColumnHeaderWidth(column);
final int columnDataWidth = getColumnDataWidth(column);
final int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth);
updateTableColumn(column, preferredWidth);
}
代码示例来源:origin: net.sf.kerner-utils/kerner-utils
private void updateTableColumn(final int column, int width) {
final TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable())
return;
width += spacing;
// Don't shrink the column width
if (isOnlyAdjustLarger) {
width = Math.max(width, tableColumn.getPreferredWidth());
}
columnSizes.put(tableColumn, new Integer(tableColumn.getWidth()));
table.getTableHeader().setResizingColumn(tableColumn);
tableColumn.setWidth(width);
}
}
代码示例来源:origin: bspkrs/MCPMappingViewer
private void updateTableColumn(int column, int width)
{
final TableColumn tableColumn = table.getColumnModel().getColumn(column);
if (!tableColumn.getResizable())
return;
width += spacing;
// Don't shrink the column width
if (isOnlyAdjustLarger)
{
width = Math.max(width, tableColumn.getPreferredWidth());
}
columnSizes.put(tableColumn, new Integer(tableColumn.getWidth()));
table.getTableHeader().setResizingColumn(tableColumn);
tableColumn.setWidth(width);
}
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
/**
* Returns true if the user <i>can</i> resize the TableColumn's width,
* false otherwise. This is a usability override: it takes into account
* the case where it's principally <i>allowed</i> to resize the column
* but not possible because the column has fixed size.
*
* @return a boolean indicating whether the user can resize this column.
*/
@Override
public boolean getResizable() {
// TODO JW: resizable is a bound property, so to be strict
// we'll need to override setMin/MaxWidth to fire resizable
// property change.
return super.getResizable() && (getMinWidth() < getMaxWidth());
}
代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core
/**
* Returns true if the user <i>can</i> resize the TableColumn's width,
* false otherwise. This is a usability override: it takes into account
* the case where it's principally <i>allowed</i> to resize the column
* but not possible because the column has fixed size.
*
* @return a boolean indicating whether the user can resize this column.
*/
@Override
public boolean getResizable() {
// TODO JW: resizable is a bound property, so to be strict
// we'll need to override setMin/MaxWidth to fire resizable
// property change.
return super.getResizable() && (getMinWidth() < getMaxWidth());
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
private void hideColumn() {
tempWidth = super.getWidth();
tempMinWidth = super.getMinWidth();
tempMaxWidth = super.getMaxWidth();
tempResizable = super.getResizable();
tempMoveable = moveable;
setResizeable(false);
setMoveable(false);
setMinWidth(0);
setWidth(0);
setMaxWidth(0);
}
代码示例来源:origin: mucommander/mucommander
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();
}
}
内容来源于网络,如有侵权,请联系作者删除!