/** * Sets the preferred number of rows to show in a <code>JScrollPane</code>. * <p> * * This is a bound property. The default value is 20. * <p> * * PENDING: allow negative for use-all? Analogous to visColumnCount. * * @param visibleRowCount number of rows to show in a * <code>JScrollPane</code> * @throws IllegalArgumentException if given count is negative. * * @see #getVisibleRowCount() */ public void setVisibleRowCount(int visibleRowCount) { if (visibleRowCount < 0) throw new IllegalArgumentException( "visible row count must not be negative " + visibleRowCount); if (getVisibleRowCount() == visibleRowCount) return; int old = getVisibleRowCount(); this.visibleRowCount = visibleRowCount; resetCalculatedScrollableSize(false); firePropertyChange("visibleRowCount", old, getVisibleRowCount()); }
/** * Sets the preferred number of rows to show in a <code>JScrollPane</code>. * <p> * * This is a bound property. The default value is 20. * <p> * * PENDING: allow negative for use-all? Analogous to visColumnCount. * * @param visibleRowCount number of rows to show in a * <code>JScrollPane</code> * @throws IllegalArgumentException if given count is negative. * * @see #getVisibleRowCount() */ public void setVisibleRowCount(int visibleRowCount) { if (visibleRowCount < 0) throw new IllegalArgumentException( "visible row count must not be negative " + visibleRowCount); if (getVisibleRowCount() == visibleRowCount) return; int old = getVisibleRowCount(); this.visibleRowCount = visibleRowCount; resetCalculatedScrollableSize(false); firePropertyChange("visibleRowCount", old, getVisibleRowCount()); }
/** * Sets the preferred number of rows to show in a <code>JScrollPane</code>. * <p> * * This is a bound property. The default value is 20. * <p> * * PENDING: allow negative for use-all? Analogous to visColumnCount. * * @param visibleRowCount number of rows to show in a * <code>JScrollPane</code> * @throws IllegalArgumentException if given count is negative. * * @see #getVisibleRowCount() */ public void setVisibleRowCount(int visibleRowCount) { if (visibleRowCount < 0) throw new IllegalArgumentException( "visible row count must not be negative " + visibleRowCount); if (getVisibleRowCount() == visibleRowCount) return; int old = getVisibleRowCount(); this.visibleRowCount = visibleRowCount; resetCalculatedScrollableSize(false); firePropertyChange("visibleRowCount", old, getVisibleRowCount()); }
/** * Sets the preferred number of rows to show in a <code>JScrollPane</code>. * <p> * * This is a bound property. The default value is 20. * <p> * * PENDING: allow negative for use-all? Analogous to visColumnCount. * * @param visibleRowCount number of rows to show in a * <code>JScrollPane</code> * @throws IllegalArgumentException if given count is negative. * * @see #getVisibleRowCount() */ public void setVisibleRowCount(int visibleRowCount) { if (visibleRowCount < 0) throw new IllegalArgumentException( "visible row count must not be negative " + visibleRowCount); if (getVisibleRowCount() == visibleRowCount) return; int old = getVisibleRowCount(); this.visibleRowCount = visibleRowCount; resetCalculatedScrollableSize(false); firePropertyChange("visibleRowCount", old, getVisibleRowCount()); }
/** * Sets the preferred number of rows to show in a <code>JScrollPane</code>. * <p> * * This is a bound property. The default value is 20. * <p> * * PENDING: allow negative for use-all? Analogous to visColumnCount. * * @param visibleRowCount number of rows to show in a * <code>JScrollPane</code> * @throws IllegalArgumentException if given count is negative. * * @see #getVisibleRowCount() */ public void setVisibleRowCount(int visibleRowCount) { if (visibleRowCount < 0) throw new IllegalArgumentException( "visible row count must not be negative " + visibleRowCount); if (getVisibleRowCount() == visibleRowCount) return; int old = getVisibleRowCount(); this.visibleRowCount = visibleRowCount; resetCalculatedScrollableSize(false); firePropertyChange("visibleRowCount", old, getVisibleRowCount()); }
private void resizeSequences() { synchronized (lock) { int rc = jTable.getRowCount(); int vrc = jTable.getVisibleRowCount(); // System.out.println("Sequences Model row count: " + jTable.getModel().getRowCount() + " Table row count: " + rc + " Visible row count: " + vrc); if (vrc > rc || vrc < 3 && vrc != rc) { Util.setVisibleRowCount(jTable, Math.min(rc, 3), jSplitPane); // Util.setDividerLocation(jSplitPane, jTable); Util.packColumnsWidthFixedFirst(jTable, 9); } Util.packColumn(jTable, 0, 9, true); } }
calculatedPrefScrollableViewportSize.height = getVisibleRowCount()
calculatedPrefScrollableViewportSize.height = getVisibleRowCount()
calculatedPrefScrollableViewportSize.height = getVisibleRowCount()
calculatedPrefScrollableViewportSize.height = getVisibleRowCount()
calculatedPrefScrollableViewportSize.height = getVisibleRowCount()
public static int dividerChanged(JXTable jTable, JSplitPane jSplitPane) { if (jTable == null) { return 0; } if (jSplitPane.getBottomComponent() == null || !jSplitPane.getBottomComponent().isVisible()) { return jTable.getVisibleRowCount(); } if (jTable.getRowCount() == 0) { return 0; } int rc = jTable.getRowCount(); int pref = Util.getPref(jSplitPane); int vrc = jTable.getVisibleRowCount(); int hh = pref - vrc * jTable.getRowHeight(); int current = jSplitPane.getDividerLocation(); // System.out.println("hh:" + hh + " current:" + current); // int rc = (current - jScrollPaneTop.getInsets().top - hh + jTable.getRowHeight() / 3) / jTable.getRowHeight(); int cvrc = Math.min(rc, (current - hh + jTable.getRowHeight() / 3) / jTable.getRowHeight()); if (cvrc == 0) { cvrc = 1; } // System.out.println("current: " + current + " row count: " + rc + " current visible row count: " + vrc + " computed visible row count: " + cvrc + " preferred: " + pref); if (cvrc != vrc) { Util.setVisibleRowCount(jTable, cvrc, jSplitPane); } else { Util.setDividerLocation(jSplitPane, jTable); } return cvrc; }
hideBottom(); } else { if (rc <= 3 && rc != jTable.getVisibleRowCount()) { Util.setVisibleRowCount(jTable, rc, jSplitPane);
Util.setVisibleRowCount(jTable, Math.min(jTable.getRowCount(), jTable.getVisibleRowCount()), jSplitPane);