|
|||||||||
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
edu.princeton.swing.PScrollablePanel
public class PScrollablePanel
PScrollablePanel is just like a JPanel except that it implements scrollable.
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static byte |
TRACKING_POLICY_ALWAYS
The tracking policy whereby this PScrollablePanel will never track JViewport's width/height. |
static byte |
TRACKING_POLICY_IF_WILL_EXPAND
The tracking policy whereby this PScrollablePanel will track JViewport's width/height only if will cause the panel to expand. |
static byte |
TRACKING_POLICY_NEVER
The tracking policy whereby this PScrollablePanel will always track JViewport's width/height. |
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 | |
---|---|
PScrollablePanel()
Creates a new PScrollablePanel. |
|
PScrollablePanel(boolean isDoubleBuffered)
Creates a new PScrollablePanel. |
|
PScrollablePanel(LayoutManager layout)
Creates a new PScrollablePanel. |
|
PScrollablePanel(LayoutManager layout,
boolean isDoubleBuffered)
Creates a new PScrollablePanel. |
Method Summary | |
---|---|
Dimension |
getActualPreferredScrollableViewportSize()
Returns the value passed to setPreferredScrollableViewportSize(). |
byte |
getHeightTrackingPolicy()
Returns the height-tracking policy of the PScrollablePanel. |
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. |
byte |
getWidthTrackingPolicy()
Returns the width-tracking policy of the PScrollablePanel. |
void |
setHeightTrackingPolicy(byte heightTrackingPolicy)
Sets the height-tracking policy of the PScrollablePanel. |
void |
setPreferredScrollableViewportSize(Dimension preferredScrollableViewportSize)
Allows the user to set what getPreferredScrollableViewportSize() will return. |
void |
setWidthTrackingPolicy(byte widthTrackingPolicy)
Sets the width-tracking policy of the PScrollablePanel. |
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 |
Field Detail |
---|
public static final byte TRACKING_POLICY_NEVER
setWidthTrackingPolicy(byte)
,
setHeightTrackingPolicy(byte)
,
Constant Field Valuespublic static final byte TRACKING_POLICY_IF_WILL_EXPAND
setWidthTrackingPolicy(byte)
,
setHeightTrackingPolicy(byte)
,
Constant Field Valuespublic static final byte TRACKING_POLICY_ALWAYS
setWidthTrackingPolicy(byte)
,
setHeightTrackingPolicy(byte)
,
Constant Field ValuesConstructor Detail |
---|
public PScrollablePanel()
public PScrollablePanel(boolean isDoubleBuffered)
public PScrollablePanel(LayoutManager layout)
public PScrollablePanel(LayoutManager layout, boolean isDoubleBuffered)
Method Detail |
---|
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
getActualPreferredScrollableViewportSize()
,
setPreferredScrollableViewportSize(Dimension)
public Dimension getActualPreferredScrollableViewportSize()
getPreferredScrollableViewportSize()
,
setPreferredScrollableViewportSize(Dimension)
public void setPreferredScrollableViewportSize(Dimension preferredScrollableViewportSize)
preferredScrollableViewportSize
- The new preferred size of the viewport. A null
value indicates that such calls will be passed to getPreferredSize().getPreferredScrollableViewportSize()
,
setPreferredScrollableViewportSize(Dimension)
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.
PScrollablePanel's implementation of this function attempts to see if the relevant child of the panel is a Scrollable. If not, it will default to a tenth of the visible screen.
getScrollableUnitIncrement
in interface Scrollable
visibleRect
- The view area visible within the viewport.orientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
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.
PScrollablePanel's implementation of this function attempts to see if the relevant child of the panel is a Scrollable. If not, it will default to a full visible screen.
getScrollableBlockIncrement
in interface Scrollable
visibleRect
- The view area visible within the viewport.orientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
public byte getWidthTrackingPolicy()
TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public void setWidthTrackingPolicy(byte widthTrackingPolicy)
widthTrackingPolicy
- The width-tracking policy of the PScrollablePanel. An
IllegalArgumentException will be thrown if this is not valid.TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public boolean getScrollableTracksViewportWidth()
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportWidth
in interface Scrollable
public byte getHeightTrackingPolicy()
TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public void setHeightTrackingPolicy(byte heightTrackingPolicy)
heightTrackingPolicy
- The height-tracking policy of the PScrollablePanel. An
IllegalArgumentException will be thrown if this is not valid.TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public boolean getScrollableTracksViewportHeight()
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportHeight
in interface Scrollable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |