|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
com.jidesoft.swing.JideScrollPane
public class JideScrollPane
JideScrollPane is an enhanced version of JScrollPane. In JScrollPane, you can
have rowHeader and columnHeader. However you can't have rowFooter and columnFooter. However rowFooter and
columnFooter are very useful in table. For example they can be used to display "total" or "summary" type of
information.
setRowFooter(javax.swing.JViewport),
and setColumnFooter(javax.swing.JViewport) which will set the viewport to rowFooter and columnFooter area
respectively. The usage of those methods are exactly the same as JScrollPane.setRowHeader(javax.swing.JViewport).
To fully leverage the power of JideScrollPane, we also create a class called TableScrollPane which is
part of JIDE Grids package. It will allow you to easily create table with row header, row footer and column footer.
JideScrollPane also provides support for scrollbar corners. You can set them using setScrollBarCorner(String, java.awt.Component). Available key for scroll bar corner is defined at JideScrollPaneConstants which can be access from JideScrollPane.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JScrollPane |
|---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected JViewport |
_columnFooter
The column footer child. |
protected Component |
_hLeft
The component to the left of horizontal scroll bar. |
protected Component |
_hRight
The component to the right of horizontal scroll bar. |
protected JViewport |
_rowFooter
The row footer child. |
protected JViewport |
_subColumnHeader
The component under column header. |
protected Component |
_subUpperLeft
The component under upper left corner. |
protected Component |
_subUpperRight
The component under upper right corner. |
protected Component |
_vBottom
The component to the bottom of vertical scroll bar. |
protected Component |
_vTop
The component to the top of vertical scroll bar. |
static String |
CLIENT_PROPERTY_MASTER_VIEWPORT
|
static String |
CLIENT_PROPERTY_SLAVE_VIEWPORT
|
static String |
PROPERTY_COLUMN_FOOTERS_HEIGHT_UNIFIED
|
static String |
PROPERTY_COLUMN_HEADERS_HEIGHT_UNIFIED
|
static String |
PROPERTY_FLAT_LAYOUT
|
static String |
PROPERTY_HORIZONTAL_SCROLL_BAR_COVERS_WHOLE_WIDTH
|
static String |
PROPERTY_KEEP_CORNER_VISIBLE
|
static String |
PROPERTY_VERTICAL_SCROLL_BAR_COVERS_WHOLE_HEIGHT
|
| Fields inherited from class javax.swing.JScrollPane |
|---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface com.jidesoft.swing.JideScrollPaneConstants |
|---|
COLUMN_FOOTER, HORIZONTAL_LEADING, HORIZONTAL_LEFT, HORIZONTAL_RIGHT, HORIZONTAL_TRAILING, ROW_FOOTER, SUB_COLUMN_HEADER, SUB_UPPER_LEFT, SUB_UPPER_RIGHT, VERTICAL_BOTTOM, VERTICAL_TOP |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JideScrollPane()
Creates an empty (no viewport view) JideScrollPane where both horizontal and vertical scrollbars
appear when needed. |
|
JideScrollPane(Component view)
Creates a JideScrollPane that displays the contents of the specified component, where both
horizontal and vertical scrollbars appear whenever the component's contents are larger than the view. |
|
JideScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
Creates a JideScrollPane that displays the view component in a viewport whose view position can be
controlled with a pair of scrollbars. |
|
JideScrollPane(int vsbPolicy,
int hsbPolicy)
Creates an empty (no viewport view) JideScrollPane with specified scrollbar policies. |
|
| Method Summary | |
|---|---|
JViewport |
getColumnFooter()
Returns the column footer. |
Component |
getCorner(String key)
|
JViewport |
getRowFooter()
Returns the row footer. |
Component |
getScrollBarCorner(String key)
Returns the component at the specified scroll bar corner. |
JViewport |
getSubColumnHeader()
Returns the sub column header. |
boolean |
isColumnFootersHeightUnified()
If true, the bottom-right, bottom-left corners the column footer will have the same height. |
boolean |
isColumnHeadersHeightUnified()
If true, the top-right, top-left corners the column header will have the same height. |
boolean |
isFlatLayout()
Gets the flag indicating if the JideScrollPane will layout its view flat without scroll bars. |
boolean |
isHorizontalScrollBarCoversWholeWidth()
|
boolean |
isKeepCornerVisible()
Get the flag indicating if JideScrollPane should keep the corner visible when it has corner components defined even when the scroll bar is not visible. |
boolean |
isVerticalScrollBarCoversWholeHeight()
|
void |
setColumnFooter(JViewport columnFooter)
Removes the old columnFooter, if it exists. |
void |
setColumnFootersHeightUnified(boolean columnFootersHeightUnified)
Sets the flag if the bottom-right, bottom-left corner and the column footer will have the same height or different heights. |
void |
setColumnFooterView(Component view)
Creates a column-footer viewport if necessary, sets its view, and then adds the column-footer viewport to the scrollpane. |
void |
setColumnHeader(JViewport columnHeader)
Overrides to make column header viewport synchronizing with the main viewport. |
void |
setColumnHeadersHeightUnified(boolean columnHeadersHeightUnified)
Sets the flag if the top-right, top-left corner and the column header will have the same height or different heights. |
void |
setCorner(String key,
Component corner)
|
void |
setFlatLayout(boolean flatLayout)
Sets the flag indicating if the JideScrollPane will layout its view flat without scroll bars. |
void |
setHorizontalScrollBarCoversWholeWidth(boolean horizontalScrollBarCoversWholeWidth)
|
void |
setKeepCornerVisible(boolean keepCornerVisible)
Set the flag indicating if JideScrollPane should keep the corner visible when it has corner components defined even when the scroll bar is not visible. |
void |
setLayout(LayoutManager layout)
|
void |
setRowFooter(JViewport rowFooter)
Removes the old rowFooter, if it exists. |
void |
setRowFooterView(Component view)
Creates a row-footer viewport if necessary, sets its view and then adds the row-footer viewport to the scrollpane. |
void |
setRowHeader(JViewport rowHeader)
Override setRowHeader method in JScrollPane and synchronize the view with the main viewport. |
void |
setScrollBarCorner(String key,
Component corner)
Adds a child that will appear in one of the scroll bars corners. |
void |
setSubColumnHeader(JViewport subColumnHeader)
Removes the old sub column header, if it exists. |
void |
setSubColumnHeaderView(Component view)
Creates a sub-column-header viewport if necessary, sets its view, and then adds the sub-column-header viewport to the scrollpane. |
void |
setVerticalScrollBarCoversWholeHeight(boolean verticalScrollBarCoversWholeHeight)
|
void |
setViewport(JViewport viewport)
|
void |
updateUI()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected JViewport _rowFooter
null.
setRowFooter(javax.swing.JViewport)protected JViewport _subColumnHeader
null.
setSubColumnHeader(javax.swing.JViewport)protected Component _subUpperLeft
null.
setCorner(String, java.awt.Component)protected Component _subUpperRight
null.
setCorner(String, java.awt.Component)protected JViewport _columnFooter
null.
setColumnFooter(javax.swing.JViewport)protected Component _hLeft
protected Component _hRight
protected Component _vTop
protected Component _vBottom
public static final String PROPERTY_HORIZONTAL_SCROLL_BAR_COVERS_WHOLE_WIDTH
public static final String PROPERTY_VERTICAL_SCROLL_BAR_COVERS_WHOLE_HEIGHT
public static final String PROPERTY_KEEP_CORNER_VISIBLE
public static final String PROPERTY_FLAT_LAYOUT
public static final String PROPERTY_COLUMN_HEADERS_HEIGHT_UNIFIED
public static final String PROPERTY_COLUMN_FOOTERS_HEIGHT_UNIFIED
public static final String CLIENT_PROPERTY_SLAVE_VIEWPORT
public static final String CLIENT_PROPERTY_MASTER_VIEWPORT
| Constructor Detail |
|---|
public JideScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
JideScrollPane 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 vsbPolicy is VERTICAL_SCROLLBAR_AS_NEEDED then the vertical scrollbar only
appears if the view doesn't fit vertically. The available policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int) and JScrollPane.setHorizontalScrollBarPolicy(int).
view - the component to display in the scrollpanes viewportvsbPolicy - an integer that specifies the vertical scrollbar policyhsbPolicy - an integer that specifies the horizontal scrollbar policyJScrollPane.setViewportView(java.awt.Component)public JideScrollPane(Component view)
JideScrollPane that displays the contents of the specified component, where both
horizontal and vertical scrollbars appear whenever the component's contents are larger than the view.
view - the component to display in the scrollpane's viewportJScrollPane.setViewportView(java.awt.Component)
public JideScrollPane(int vsbPolicy,
int hsbPolicy)
JideScrollPane with specified scrollbar policies. The available
policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int) and JScrollPane.setHorizontalScrollBarPolicy(int).
vsbPolicy - an integer that specifies the vertical scrollbar policyhsbPolicy - an integer that specifies the horizontal scrollbar policyJScrollPane.setViewportView(java.awt.Component)public JideScrollPane()
JideScrollPane where both horizontal and vertical scrollbars
appear when needed.
| Method Detail |
|---|
public void setViewport(JViewport viewport)
setViewport in class JScrollPanepublic JViewport getRowFooter()
rowFooter propertysetRowFooter(javax.swing.JViewport)public void setRowFooter(JViewport rowFooter)
null, syncs the y coordinate of
its viewPosition with the viewport (if there is one) and then adds it to the scrollpane.
rowFooter - the new row footer to be used; if null the old row footer is still removed and the
new rowFooter is set to nullgetRowFooter(),
setRowFooterView(java.awt.Component)public void setRowHeader(JViewport rowHeader)
setRowHeader in class JScrollPanerowHeader - the new row headerpublic void setRowFooterView(Component view)
JScrollPane scrollpane = new JideScrollPane(); scrollpane.setViewportView(myBigComponentToScroll); scrollpane.setRowFooterView(myBigComponentsRowFooter);
view - the component to display as the row footersetRowFooter(javax.swing.JViewport),
JViewport.setView(java.awt.Component)public JViewport getColumnFooter()
columnFooter propertysetColumnFooter(javax.swing.JViewport)public void setColumnFooter(JViewport columnFooter)
null, sync the x
coordinate of the its viewPosition with the viewport (if there is one) and then add it to the scrollpane.
columnFooter - the new column footer to be used; if null the old column footer is still removed
and the new columnFooter is set to nullgetColumnFooter(),
setColumnFooterView(java.awt.Component)public void setColumnHeader(JViewport columnHeader)
setColumnHeader in class JScrollPanecolumnHeader - the column headerpublic JViewport getSubColumnHeader()
rowSubColumnHeader propertysetSubColumnHeader(javax.swing.JViewport)public void setSubColumnHeader(JViewport subColumnHeader)
null, sync the
x coordinate of the its viewPosition with the viewport (if there is one) and then add it to the scroll pane.
subColumnHeader - the new sub column header to be used; if null the old sub column header is
still removed and the new sub column header is set to nullgetSubColumnHeader()public void setColumnFooterView(Component view)
JScrollPane scrollpane = new JideScrollPane(); scrollpane.setViewportView(myBigComponentToScroll); scrollpane.setColumnFooterView(myBigComponentsColumnFooter);
view - the component to display as the column footersetColumnFooter(javax.swing.JViewport),
JViewport.setView(java.awt.Component)public void setSubColumnHeaderView(Component view)
view - the component to display as the sub column headersetSubColumnHeader(javax.swing.JViewport),
JViewport.setView(java.awt.Component)public Component getCorner(String key)
getCorner in class JScrollPane
public void setCorner(String key,
Component corner)
setCorner in class JScrollPanepublic Component getScrollBarCorner(String key)
key value specifying the corner is one
of: JideScrollPaneConstants.HORIZONTAL_LEFT JideScrollPaneConstants.HORIZONTAL_RIGHT JideScrollPaneConstants.VERTICAL_TOP JideScrollPaneConstants.VERTICAL_BOTTOM JideScrollPaneConstants.HORIZONTAL_LEADING JideScrollPaneConstants.HORIZONTAL_TRAILING
key - one of the values as shown above
null if key is invalid: setCorner(String, java.awt.Component)
public void setScrollBarCorner(String key,
Component corner)
JideScrollPaneConstants.HORIZONTAL_LEFT JideScrollPaneConstants.HORIZONTAL_RIGHT JideScrollPaneConstants.VERTICAL_TOP JideScrollPaneConstants.VERTICAL_BOTTOM JideScrollPaneConstants.HORIZONTAL_LEADING JideScrollPaneConstants.HORIZONTAL_TRAILING PropertyChange events are generated
with the property name set to the corner key.
key - identifies which corner the component will appear incorner - one of the following components: IllegalArgumentException - if corner key is invalidpublic void updateUI()
updateUI in class JScrollPanepublic void setLayout(LayoutManager layout)
setLayout in class JScrollPanepublic boolean isVerticalScrollBarCoversWholeHeight()
public void setHorizontalScrollBarCoversWholeWidth(boolean horizontalScrollBarCoversWholeWidth)
public boolean isHorizontalScrollBarCoversWholeWidth()
public void setVerticalScrollBarCoversWholeHeight(boolean verticalScrollBarCoversWholeHeight)
public boolean isColumnHeadersHeightUnified()
public void setColumnHeadersHeightUnified(boolean columnHeadersHeightUnified)
columnHeadersHeightUnified - true or false.public boolean isColumnFootersHeightUnified()
public void setColumnFootersHeightUnified(boolean columnFootersHeightUnified)
columnFootersHeightUnified - true or false.public boolean isKeepCornerVisible()
HORIZONTAL_SCROLLBAR_AS_NEEDED or
VERTICAL_SCROLLBAR_AS_NEEDED
The default value of this flag is false.
public void setKeepCornerVisible(boolean keepCornerVisible)
keepCornerVisible - the flagpublic boolean isFlatLayout()
setFlatLayout(boolean)public void setFlatLayout(boolean flatLayout)
flatLayout - the flag
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||