Sets the JViewport's one lightweight child,
which can be null.
(Since there is only one child which occupies the entire viewport,
the constraints and index
arguments are ignored.)
child | the lightweight child of the viewport | |
constraints | the constraints to be respected | |
index | the index |
setView
Notifies listeners of a property change. This is subclassed to update
the windowBlit property.
(The putClientProperty property is final).
propertyName | a string containing the property name | |
oldValue | the old value of the property | |
newValue | the new value of the property |
Gets the AccessibleContext associated with this JViewport. For viewports, the AccessibleContext takes the form of an AccessibleJViewport. A new AccessibleJViewport instance is created if necessary.
Returns the insets (border) dimensions as (0,0,0,0), since borders
are not supported on a JViewport.
Rectangle of zero dimension and zero origin
setBorder
Returns an Insets object containing this
JViewports inset values. The passed-in
Insets object will be reinitialized, and
all existing values within this object are overwritten.
insets | the Insets object which can be reused |
getInsets
Returns a string that specifies the name of the L&F class that renders this component.
JComponent.getUIClassID, UIDefaults.getUI
The JViewport overrides the default implementation of
this method (in JComponent) to return false.
This ensures
that the drawing machinery will call the Viewport's
paint
implementation rather than messaging the JViewport's
children directly.
Returns true if scroll mode is a BACKINGSTORE_SCROLL_MODE to cause
painting to originate from JViewport, or one of its
ancestors. Otherwise returns false.
BACKINGSTORE_SCROLL_MODE.
JComponent.isPaintingOrigin()
Depending on whether the backingStore is enabled,
either paint the image through the backing store or paint
just the recently exposed part, using the backing store
to "blit" the remainder.
The term "blit" is the pronounced version of the PDP-10 BLT (BLock Transfer) instruction, which copied a block of bits. (In case you were curious.)
g | the Graphics context within which to paint |
Returns a string representation of this JViewport.
This method
is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not
be null.
JViewport
Removes the Viewports one lightweight child.
child | the component to be removed |
setView
Always repaint in the parents coordinate system to make sure
only one paint is performed by the RepaintManager.
tm | maximum time in milliseconds before update | |
x | the x coordinate (pixels over from left) | |
y | the y coordinate (pixels down from top) | |
w | the width | |
h | the height |
Sets the bounds of this viewport. If the viewport's width
or height has changed, fire a StateChanged event.
x | left edge of the origin | |
y | top edge of the origin | |
w | width in pixels | |
h | height in pixels |
JComponent.reshape(int, int, int, int)
Scrolls the view so that Rectangle
within the view becomes visible.
This attempts to validate the view before scrolling if the
view is currently not valid - isValid returns false.
To avoid excessive validation when the containment hierarchy is
being created this will not validate if one of the ancestors does not
have a peer, or there is no validate root ancestor, or one of the
ancestors is not a Window or Applet.
Note that this method will not scroll outside of the
valid viewport; for example, if contentRect is larger
than the viewport, scrolling will be confined to the viewport's
bounds.
contentRect | the Rectangle to display |
JComponent.isValidateRoot, java.awt.Component.isValid
The viewport "scrolls" its child (called the "view") by the
normal parent/child clipping (typically the view is moved in
the opposite direction of the scroll). A non-null border,
or non-zero insets, isn't supported, to prevent the geometry
of this component from becoming complex enough to inhibit
subclassing. To create a JViewport with a border,
add it to a JPanel that has a border.
Note: If border is non-null, this
method will throw an exception as borders are not supported on
a JViewPort.
border | the Border to set |
Resets the UI property to a value from the current look and feel.
JComponent.updateUI
Diagram: Scrolling