/** * Creates a sub-column-header viewport if necessary, sets its view, and then adds the sub-column-header viewport to * the scrollpane. * * @param view the component to display as the sub column header * @see #setSubColumnHeader(javax.swing.JViewport) * @see JViewport#setView(java.awt.Component) */ public void setSubColumnHeaderView(Component view) { if (null == getSubColumnHeader()) { setSubColumnHeader(createViewport()); } getSubColumnHeader().setView(view); }
/** * Creates a row-footer viewport if necessary, sets its view and then adds the row-footer viewport to the * scrollpane. For example: * <pre> * JScrollPane scrollpane = new JideScrollPane(); * scrollpane.setViewportView(myBigComponentToScroll); * scrollpane.setRowFooterView(myBigComponentsRowFooter); * </pre> * * @param view the component to display as the row footer * @see #setRowFooter(javax.swing.JViewport) * @see JViewport#setView(java.awt.Component) */ public void setRowFooterView(Component view) { if (null == getRowFooter()) { setRowFooter(createViewport()); } getRowFooter().setView(view); }
/** * Creates a column-footer viewport if necessary, sets its view, and then adds the column-footer viewport to the * scrollpane. For example: * <pre> * JScrollPane scrollpane = new JideScrollPane(); * scrollpane.setViewportView(myBigComponentToScroll); * scrollpane.setColumnFooterView(myBigComponentsColumnFooter); * </pre> * * @param view the component to display as the column footer * @see #setColumnFooter(javax.swing.JViewport) * @see JViewport#setView(java.awt.Component) */ public void setColumnFooterView(Component view) { if (null == getColumnFooter()) { setColumnFooter(createViewport()); } getColumnFooter().setView(view); }
/** * Creates a <code>JideScrollPane</code> that displays the view component in a viewport whose view position can be * controlled with a pair of scrollbars. The scrollbar policies specify when the scrollbars are displayed, For * example, if <code>vsbPolicy</code> is <code>VERTICAL_SCROLLBAR_AS_NEEDED</code> then the vertical scrollbar only * appears if the view doesn't fit vertically. The available policy settings are listed at {@link * #setVerticalScrollBarPolicy(int)} and {@link #setHorizontalScrollBarPolicy(int)}. * * @param view the component to display in the scrollpanes viewport * @param vsbPolicy an integer that specifies the vertical scrollbar policy * @param hsbPolicy an integer that specifies the horizontal scrollbar policy * @see #setViewportView(java.awt.Component) */ public JideScrollPane(Component view, int vsbPolicy, int hsbPolicy) { setLayout(new JideScrollPaneLayout.UIResource()); setVerticalScrollBarPolicy(vsbPolicy); setHorizontalScrollBarPolicy(hsbPolicy); setViewport(createViewport()); setVerticalScrollBar(createVerticalScrollBar()); setHorizontalScrollBar(createHorizontalScrollBar()); if (null != view) { setViewportView(view); } setOpaque(true); updateUI(); if (!getComponentOrientation().isLeftToRight()) { viewport.setViewPosition(new Point(Integer.MAX_VALUE, 0)); } }