/** * Sets the rowHeight for all rows to the given value. Keeps the flag * <code>isXTableRowHeight</code> unchanged. This enables the distinction * between setting the height for internal reasons from doing so by client * code. * * @param rowHeight new height in pixel. * @see #setRowHeight(int) * @see #isXTableRowHeightSet */ protected void adminSetRowHeight(int rowHeight) { boolean heightSet = isXTableRowHeightSet; setRowHeight(rowHeight); isXTableRowHeightSet = heightSet; }
/** * Sets the rowHeight for all rows to the given value. Keeps the flag * <code>isXTableRowHeight</code> unchanged. This enables the distinction * between setting the height for internal reasons from doing so by client * code. * * @param rowHeight new height in pixel. * @see #setRowHeight(int) * @see #isXTableRowHeightSet */ protected void adminSetRowHeight(int rowHeight) { boolean heightSet = isXTableRowHeightSet; setRowHeight(rowHeight); isXTableRowHeightSet = heightSet; }
/** * Sets the rowHeight for all rows to the given value. Keeps the flag * <code>isXTableRowHeight</code> unchanged. This enables the distinction * between setting the height for internal reasons from doing so by client * code. * * @param rowHeight new height in pixel. * @see #setRowHeight(int) * @see #isXTableRowHeightSet */ protected void adminSetRowHeight(int rowHeight) { boolean heightSet = isXTableRowHeightSet; setRowHeight(rowHeight); isXTableRowHeightSet = heightSet; }
/** * Sets the rowHeight for all rows to the given value. Keeps the flag * <code>isXTableRowHeight</code> unchanged. This enables the distinction * between setting the height for internal reasons from doing so by client * code. * * @param rowHeight new height in pixel. * @see #setRowHeight(int) * @see #isXTableRowHeightSet */ protected void adminSetRowHeight(int rowHeight) { boolean heightSet = isXTableRowHeightSet; setRowHeight(rowHeight); isXTableRowHeightSet = heightSet; }
/** * Sets the rowHeight for all rows to the given value. Keeps the flag * <code>isXTableRowHeight</code> unchanged. This enables the distinction * between setting the height for internal reasons from doing so by client * code. * * @param rowHeight new height in pixel. * @see #setRowHeight(int) * @see #isXTableRowHeightSet */ protected void adminSetRowHeight(int rowHeight) { boolean heightSet = isXTableRowHeightSet; setRowHeight(rowHeight); isXTableRowHeightSet = heightSet; }
/** * Sets the row height for this JXTreeTable and forwards the * row height to the renderering tree. * * @param rowHeight height of a row. */ @Override public void setRowHeight(int rowHeight) { super.setRowHeight(rowHeight); adjustTreeRowHeight(getRowHeight()); }
/** * Sets the row height for this JXTreeTable and forwards the * row height to the renderering tree. * * @param rowHeight height of a row. */ @Override public void setRowHeight(int rowHeight) { super.setRowHeight(rowHeight); adjustTreeRowHeight(getRowHeight()); }
/** * Sets the row height for this JXTreeTable and forwards the * row height to the renderering tree. * * @param rowHeight height of a row. */ @Override public void setRowHeight(int rowHeight) { super.setRowHeight(rowHeight); adjustTreeRowHeight(getRowHeight()); }
/** * Sets the row height for this JXTreeTable and forwards the * row height to the renderering tree. * * @param rowHeight height of a row. */ @Override public void setRowHeight(int rowHeight) { super.setRowHeight(rowHeight); adjustTreeRowHeight(getRowHeight()); }
/** * Sets the row height for this JXTreeTable and forwards the * row height to the renderering tree. * * @param rowHeight height of a row. */ @Override public void setRowHeight(int rowHeight) { super.setRowHeight(rowHeight); adjustTreeRowHeight(getRowHeight()); }
/** * Auto-adjusts rowHeight to something more pleasing then the default. This * method is called after instantiation and after updating the UI. Does * nothing if the given parameter is <code>true</code> and the rowHeight had * been already set by client code. The underlying problem is that raw types * can't implement UIResource. * <p> * This implementation asks the UIManager for a default value (stored with * key "JXTable.rowHeight"). If none is available, calculates a "reasonable" * height from the table's fontMetrics, assuming that most renderers/editors * will have a border with top/bottom of 1. * <p> * * @param respectRowSetFlag a boolean to indicate whether client-code flag * should be respected. * @see #isXTableRowHeightSet */ protected void updateRowHeightUI(boolean respectRowSetFlag) { if (respectRowSetFlag && isXTableRowHeightSet) return; int uiHeight = UIManager.getInt(UIPREFIX + "rowHeight"); if (uiHeight > 0) { setRowHeight(uiHeight); } else { int fontBasedHeight = getFontMetrics(getFont()).getHeight() + 2; int magicMinimum = 18; setRowHeight(Math.max(fontBasedHeight, magicMinimum)); } isXTableRowHeightSet = false; }
/** * Auto-adjusts rowHeight to something more pleasing then the default. This * method is called after instantiation and after updating the UI. Does * nothing if the given parameter is <code>true</code> and the rowHeight had * been already set by client code. The underlying problem is that raw types * can't implement UIResource. * <p> * This implementation asks the UIManager for a default value (stored with * key "JXTable.rowHeight"). If none is available, calculates a "reasonable" * height from the table's fontMetrics, assuming that most renderers/editors * will have a border with top/bottom of 1. * <p> * * @param respectRowSetFlag a boolean to indicate whether client-code flag * should be respected. * @see #isXTableRowHeightSet */ protected void updateRowHeightUI(boolean respectRowSetFlag) { if (respectRowSetFlag && isXTableRowHeightSet) return; int uiHeight = UIManager.getInt(UIPREFIX + "rowHeight"); if (uiHeight > 0) { setRowHeight(uiHeight); } else { int fontBasedHeight = getFontMetrics(getFont()).getHeight() + 2; int magicMinimum = 18; setRowHeight(Math.max(fontBasedHeight, magicMinimum)); } isXTableRowHeightSet = false; }
/** * Auto-adjusts rowHeight to something more pleasing then the default. This * method is called after instantiation and after updating the UI. Does * nothing if the given parameter is <code>true</code> and the rowHeight had * been already set by client code. The underlying problem is that raw types * can't implement UIResource. * <p> * This implementation asks the UIManager for a default value (stored with * key "JXTable.rowHeight"). If none is available, calculates a "reasonable" * height from the table's fontMetrics, assuming that most renderers/editors * will have a border with top/bottom of 1. * <p> * * @param respectRowSetFlag a boolean to indicate whether client-code flag * should be respected. * @see #isXTableRowHeightSet */ protected void updateRowHeightUI(boolean respectRowSetFlag) { if (respectRowSetFlag && isXTableRowHeightSet) return; int uiHeight = UIManager.getInt(UIPREFIX + "rowHeight"); if (uiHeight > 0) { setRowHeight(uiHeight); } else { int fontBasedHeight = getFontMetrics(getFont()).getHeight() + 2; int magicMinimum = 18; setRowHeight(Math.max(fontBasedHeight, magicMinimum)); } isXTableRowHeightSet = false; }
/** * Auto-adjusts rowHeight to something more pleasing then the default. This * method is called after instantiation and after updating the UI. Does * nothing if the given parameter is <code>true</code> and the rowHeight had * been already set by client code. The underlying problem is that raw types * can't implement UIResource. * <p> * This implementation asks the UIManager for a default value (stored with * key "JXTable.rowHeight"). If none is available, calculates a "reasonable" * height from the table's fontMetrics, assuming that most renderers/editors * will have a border with top/bottom of 1. * <p> * * @param respectRowSetFlag a boolean to indicate whether client-code flag * should be respected. * @see #isXTableRowHeightSet */ protected void updateRowHeightUI(boolean respectRowSetFlag) { if (respectRowSetFlag && isXTableRowHeightSet) return; int uiHeight = UIManager.getInt(UIPREFIX + "rowHeight"); if (uiHeight > 0) { setRowHeight(uiHeight); } else { int fontBasedHeight = getFontMetrics(getFont()).getHeight() + 2; int magicMinimum = 18; setRowHeight(Math.max(fontBasedHeight, magicMinimum)); } isXTableRowHeightSet = false; }
/** * Auto-adjusts rowHeight to something more pleasing then the default. This * method is called after instantiation and after updating the UI. Does * nothing if the given parameter is <code>true</code> and the rowHeight had * been already set by client code. The underlying problem is that raw types * can't implement UIResource. * <p> * This implementation asks the UIManager for a default value (stored with * key "JXTable.rowHeight"). If none is available, calculates a "reasonable" * height from the table's fontMetrics, assuming that most renderers/editors * will have a border with top/bottom of 1. * <p> * * @param respectRowSetFlag a boolean to indicate whether client-code flag * should be respected. * @see #isXTableRowHeightSet */ protected void updateRowHeightUI(boolean respectRowSetFlag) { if (respectRowSetFlag && isXTableRowHeightSet) return; int uiHeight = UIManager.getInt(UIPREFIX + "rowHeight"); if (uiHeight > 0) { setRowHeight(uiHeight); } else { int fontBasedHeight = getFontMetrics(getFont()).getHeight() + 2; int magicMinimum = 18; setRowHeight(Math.max(fontBasedHeight, magicMinimum)); } isXTableRowHeightSet = false; }
private void fixCellSize() { this.heatmap.setRowHeight(0, getMaxColumnNameLength()); range(1, getVisibleRowNames().size() + 1).forEach(row -> { this.heatmap.setRowHeight(row, this.cellSize); }); for (int i = 0; i < this.heatmap.getColumnModel().getColumnCount(); i++) { TableColumn c = this.heatmap.getColumnModel().getColumn(i); c.setMinWidth(this.cellSize); c.setMaxWidth(this.cellSize); c.setPreferredWidth(this.cellSize); } int maxRowWidth = getMaxRowNameLength(); TableColumn rowNamesColumn = this.heatmap.getColumnModel().getColumn(0); rowNamesColumn.setMinWidth(maxRowWidth); rowNamesColumn.setMaxWidth(maxRowWidth); rowNamesColumn.setPreferredWidth(maxRowWidth); }
protected void createTable() { $objectMap.put("table", table = new JXTable(tableModel)); table.setName("table"); table.setRowSelectionAllowed(false); table.setAutoCreateRowSorter(true); table.setRowHeight(25); table.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mousePressed", this, "doMousePressed__on__table")); }
protected void createTable() { $objectMap.put("table", table = new JXTable(tableModel)); table.setName("table"); table.setRowSelectionAllowed(false); table.setAutoCreateRowSorter(true); table.setRowHeight(25); table.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mousePressed", this, "doMousePressed__on__table")); }
protected void createTable() { $objectMap.put("table", table = new JXTable(tableModel)); table.setName("table"); table.setRowSelectionAllowed(false); table.setAutoCreateRowSorter(true); table.setRowHeight(25); table.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mousePressed", this, "doMousePressed__on__table")); }
private JXTable getTableTest() { if (tableTest == null) { tableTest = new JXTable(); tableTest.setModel(getPassiveScanTableModel()); tableTest.setRowHeight(DisplayUtils.getScaledSize(18)); tableTest.setIntercellSpacing(new java.awt.Dimension(1, 1)); tableTest.setAutoCreateRowSorter(true); //Default sort by name (column 0) List <RowSorter.SortKey> sortKeys = new ArrayList<RowSorter.SortKey>(1); sortKeys.add(new RowSorter.SortKey(0, SortOrder.ASCENDING)); tableTest.getRowSorter().setSortKeys(sortKeys); for (int i = 0; i < tableTest.getColumnCount()-1; i++) { TableColumn column = tableTest.getColumnModel().getColumn(i); column.setPreferredWidth(width[i]); } JComboBox<String> jcb1 = new JComboBox<>(); for (AlertThreshold level : AlertThreshold.values()) { jcb1.addItem(Constant.messages.getString("ascan.policy.level." + level.name().toLowerCase())); } tableTest.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(jcb1)); } return tableTest; }