|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
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.JPanel
com.citra.table.JScrollablePanel
public class JScrollablePanel
JScrollablePanel is a scrollable JPanel that can be used inside a JScrollPane.
The size of the panel in the scrollpane is set with setPreferredSize
.
NOTE: If JScrollablePanel is added as the rowheader, its size is automatically changed
to match the size of the central component. If you do not want this behaviour,
override getScrollableTracksViewportHeight
to return false.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
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.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JScrollablePanel()
Create a new JScrollablePanel with a double buffer and a flow layout. |
|
JScrollablePanel(boolean isDoubleBuffered)
Create a new JScrollablePanel with FlowLayout and the specified buffering strategy. |
|
JScrollablePanel(LayoutManager layout)
Create a new buffered JScrollablePanel with the specified layout manager. |
|
JScrollablePanel(LayoutManager layout,
boolean isDoubleBuffered)
Creates a new JScrollablePanel with the specified layout manager and buffering strategy. |
Method Summary | |
---|---|
Dimension |
getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for a view component. |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Components that display logical rows or columns should compute the scroll increment that will completely expose one block of rows or columns, depending on the value of orientation. |
boolean |
getScrollableTracksViewportHeight()
Return true if a viewport should always force the height of this Scrollable to match the height of the viewport. |
boolean |
getScrollableTracksViewportWidth()
Return true if a viewport should always force the width of this Scrollable to match the width of the viewport. |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation. |
void |
setPreferredScrollableViewportSize(Dimension preferredViewportSize)
Sets the preferred size of the viewport for this panel. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JScrollablePanel()
public JScrollablePanel(LayoutManager layout)
layout
- the LayoutManager to usepublic JScrollablePanel(LayoutManager layout, boolean isDoubleBuffered)
layout
- the LayoutManager to useisDoubleBuffered
- a boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updatespublic JScrollablePanel(boolean isDoubleBuffered)
isDoubleBuffered
is true, the ScrollablePanel
will use a double buffer.
isDoubleBuffered
- a boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updatesMethod Detail |
---|
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
JComponent.getPreferredSize()
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a block scroll.
getScrollableBlockIncrement
in interface Scrollable
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
JScrollBar.setBlockIncrement(int)
public boolean getScrollableTracksViewportHeight()
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportHeight
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
Scrollable
to match the width of the viewport.
For example a normal
text view that supported line wrapping would return true here, since it
would be undesirable for wrapped lines to disappear beyond the right
edge of the viewport. Note that returning true for a Scrollable
whose ancestor is a JScrollPane effectively disables horizontal
scrolling.
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportWidth
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a unit scroll.
getScrollableUnitIncrement
in interface Scrollable
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
JScrollBar.setUnitIncrement(int)
public void setPreferredScrollableViewportSize(Dimension preferredViewportSize)
preferredViewportSize
- the preferred size of a JViewport whose view is this panel
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |