@Override public void setCorner(String key, Component corner) { if (key == null) { return; } if (key.equals(SUB_UPPER_LEFT) || key.equals(SUB_UPPER_RIGHT)) { Component old; if (key.equals(SUB_UPPER_LEFT)) { old = _subUpperLeft; _subUpperLeft = corner; } else { old = _subUpperRight; _subUpperRight = corner; } if (old != null) { remove(old); } if (corner != null) { add(corner, key); } firePropertyChange(key, old, corner); revalidate(); repaint(); return; } super.setCorner(key, corner); }
add(corner, key);
/** * Removes the old sub column header, if it exists. If the new sub column header isn't <code>null</code>, sync the * x coordinate of the its viewPosition with the viewport (if there is one) and then add it to the scroll pane. * * @param subColumnHeader the new sub column header to be used; if <code>null</code> the old sub column header is * still removed and the new sub column header is set to <code>null</code> * @see #getSubColumnHeader() */ public void setSubColumnHeader(JViewport subColumnHeader) { JViewport old = getSubColumnHeader(); _subColumnHeader = subColumnHeader; if (null != subColumnHeader) { add(subColumnHeader, SUB_COLUMN_HEADER); } else if (null != old) { remove(old); } firePropertyChange("subColumnHeader", old, subColumnHeader); revalidate(); repaint(); if (old != null) { JideSwingUtilities.unsynchronizeView(old, getViewport()); JideSwingUtilities.unsynchronizeView(getViewport(), old); } if (_subColumnHeader != null) { JideSwingUtilities.synchronizeView(_subColumnHeader, getViewport(), SwingConstants.HORIZONTAL); JideSwingUtilities.synchronizeView(getViewport(), _subColumnHeader, SwingConstants.HORIZONTAL); } }
/** * Removes the old rowFooter, if it exists. If the new rowFooter isn't <code>null</code>, syncs the y coordinate of * its viewPosition with the viewport (if there is one) and then adds it to the scrollpane. * * @param rowFooter the new row footer to be used; if <code>null</code> the old row footer is still removed and the * new rowFooter is set to <code>null</code> * @see #getRowFooter * @see #setRowFooterView(java.awt.Component) */ public void setRowFooter(JViewport rowFooter) { JViewport old = getRowFooter(); _rowFooter = rowFooter; if (null != rowFooter) { add(rowFooter, ROW_FOOTER); } else if (null != old) { remove(old); } firePropertyChange("rowFooter", old, rowFooter); revalidate(); repaint(); if (old != null) { JideSwingUtilities.unsynchronizeView(old, getViewport()); JideSwingUtilities.unsynchronizeView(getViewport(), old); } if (rowFooter != null) { JideSwingUtilities.synchronizeView(rowFooter, getViewport(), SwingConstants.VERTICAL); JideSwingUtilities.synchronizeView(getViewport(), rowFooter, SwingConstants.VERTICAL); } }
/** * Removes the old columnFooter, if it exists. If the new columnFooter isn't <code>null</code>, sync the x * coordinate of the its viewPosition with the viewport (if there is one) and then add it to the scrollpane. * * @param columnFooter the new column footer to be used; if <code>null</code> the old column footer is still removed * and the new columnFooter is set to <code>null</code> * @see #getColumnFooter * @see #setColumnFooterView(java.awt.Component) */ public void setColumnFooter(JViewport columnFooter) { JViewport old = getColumnFooter(); _columnFooter = columnFooter; if (null != columnFooter) { add(columnFooter, COLUMN_FOOTER); } else if (null != old) { remove(old); } firePropertyChange("columnFooter", old, columnFooter); revalidate(); repaint(); if (old != null) { JideSwingUtilities.unsynchronizeView(old, getViewport()); JideSwingUtilities.unsynchronizeView(getViewport(), old); } if (_columnFooter != null) { JideSwingUtilities.synchronizeView(_columnFooter, getViewport(), SwingConstants.HORIZONTAL); JideSwingUtilities.synchronizeView(getViewport(), _columnFooter, SwingConstants.HORIZONTAL); } }