Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JViewport
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
JViewport.AccessibleJViewport
The class used to obtain the accessible role for this object. |
|
JViewport.ViewListener
A listener for the view. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Field Summary | |
java.awt.Image | backingStoreImage
The view image used for a backing store. |
boolean | backingStore
True when this viewport is maintaining an offscreen image of its contents, so that some scrolling can take place using fast "bit-blit" operations instead of by accessing the view object to construct the display. |
boolean | isViewSizeSet
True when the viewport dimensions have been determined. |
java.awt.Point | lastPaintPosition
The last viewPosition that we've painted, so we know how much of the backing store image is valid. |
boolean | scrollUnderway
The scrollUnderway flag is used for components like JList. |
Fields inherited from class com.sun.java.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 |
Constructor Summary | |
JViewport()
Create a JViewPort |
Method Summary | |
void | addChangeListener(ChangeListener l)
Add a ChangeListener to the list that's notified each time the view's size, position, or the viewport's extent size has changed. |
void | addImpl(java.awt.Component child,
java.lang.Object constraints,
int index)
Sets the Viewport's one lightweight child, which can be null. |
boolean | computeBlit(int dx,
int dy,
java.awt.Point blitFrom,
java.awt.Point blitTo,
java.awt.Dimension blitSize,
java.awt.Rectangle blitPaint)
Computes the parameters for a blit where the backing store image currently contains oldLoc in the upper left hand corner and we're scrolling to newLoc. |
java.awt.LayoutManager | createLayoutManager()
Subclassers can override this to install a different layout manager (or null) in the constructor. |
JViewport.ViewListener | createViewListener()
Create a listener for the view. |
void | fireStateChanged()
|
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JComponent |
java.awt.Dimension | getExtentSize()
Returns the size of the visible part of the view in view coordinates. |
java.awt.Insets | getInsets()
Returns the insets (border) dimensions as (0,0,0,0) |
java.awt.Component | getView()
Returns the Viewport's one child or null. |
java.awt.Point | getViewPosition()
Returns the view coordinates that appear in the upper left hand corner of the viewport, 0,0 if there's no view. |
java.awt.Rectangle | getViewRect()
Return a rectangle whose origin is getViewPosition and size is getExtentSize(). |
java.awt.Dimension | getViewSize()
If the view's size hasn't been explicitly set, return the preferred size, otherwise return the view's current size. |
boolean | isBackingStoreEnabled()
Returns true if this viewport is maintaining an offscreen image of its contents. |
boolean | isOptimizedDrawingEnabled()
The JViewport overrides the default implementation of this method (in JComponent) to return false. |
void | paint(java.awt.Graphics g)
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. |
void | removeChangeListener(ChangeListener l)
Remove a ChangeListener from the list that's notified each time the views size, position, or the viewports extent size has changed. |
void | remove(java.awt.Component child)
Removes the Viewport's one lightweight child. |
void | repaint(long tm,
int x,
int y,
int w,
int h)
We always repaint in our parent coordinate system to make sure only one paint is performed by the RepaintManager. |
void | scrollRectToVisible(java.awt.Rectangle contentRect)
Overridden to scroll the view so that Rectangle within the view becomes visible. |
void | setBackingStoreEnabled(boolean x)
If true if this viewport will maintain an offscreen image of its contents. |
void | setBorder(Border border)
The viewport "scrolls" it's child (called the "view") by the normal parent/child clipping (typically the view is moved in the opposite direction of the scroll). |
void | setBounds(int x,
int y,
int w,
int h)
Sets the bounds of this viewport. |
void | setExtentSize(java.awt.Dimension newExtent)
Set the size of the visible part of the view using view coordinates. |
void | setView(java.awt.Component view)
Sets the Viewport's one lightweight child ( view ),
which can be null. |
void | setViewPosition(java.awt.Point p)
Sets the view coordinates that appear in the upper left hand corner of the viewport, null if there's no view. |
void | setViewSize(java.awt.Dimension newSize)
Sets the view coordinates that appear in the upper left hand corner of the viewport, and the size of the view. |
java.awt.Dimension | toViewCoordinates(java.awt.Dimension size)
Convert a size in pixel coordinates to view coordinates. |
java.awt.Point | toViewCoordinates(java.awt.Point p)
Convert a point in pixel coordinates to view coordinates. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected boolean isViewSizeSet
protected java.awt.Point lastPaintPosition
protected boolean backingStore
protected transient java.awt.Image backingStoreImage
protected boolean scrollUnderway
Constructor Detail |
public JViewport()
Method Detail |
protected void addImpl(java.awt.Component child, java.lang.Object constraints, int index)
child
- the Component ______________
constraints
- the Object ______________
index
- the int ______________public void remove(java.awt.Component child)
public void scrollRectToVisible(java.awt.Rectangle contentRect)
contentRect
- the Rectangle to displaypublic final void setBorder(Border border)
border
- the Border to setpublic final java.awt.Insets getInsets()
public boolean isOptimizedDrawingEnabled()
public void paint(java.awt.Graphics g)
The term "blit" is the pronounced version of the PDP-10 BLT (BLock Transfer) instruction, which copied a bunch of bits. (In case you were curious.)
g
- the Graphics context within which to paintpublic void setBounds(int x, int y, int w, int h)
x
- an int giving distance from left in pixels
y
- an int giving distance from top in pixels
w
- an int giving width in pixels
h
- an int giving height in pixelspublic boolean isBackingStoreEnabled()
public void setBackingStoreEnabled(boolean x)
public java.awt.Component getView()
public void setView(java.awt.Component view)
view
),
which can be null.public java.awt.Dimension getViewSize()
public void setViewSize(java.awt.Dimension newSize)
newSize
- a Dimension object specifying the size and
location of the new view coordinates, or null if there
is no viewpublic java.awt.Point getViewPosition()
public void setViewPosition(java.awt.Point p)
p
- a Point object giving the upper left coordinatespublic java.awt.Rectangle getViewRect()
protected boolean computeBlit(int dx, int dy, java.awt.Point blitFrom, java.awt.Point blitTo, java.awt.Dimension blitSize, java.awt.Rectangle blitPaint)
public java.awt.Dimension getExtentSize()
public java.awt.Dimension toViewCoordinates(java.awt.Dimension size)
size
- a Dimension object using pixel coordinatespublic java.awt.Point toViewCoordinates(java.awt.Point p)
p
- a Point object using pixel coordinatespublic void setExtentSize(java.awt.Dimension newExtent)
newExtent
- a Dimension object specifying the size of the viewprotected JViewport.ViewListener createViewListener()
protected java.awt.LayoutManager createLayoutManager()
public void addChangeListener(ChangeListener l)
l
- the ChangeListener to addpublic void removeChangeListener(ChangeListener l)
l
- the ChangeListener to removeprotected void fireStateChanged()
public void repaint(long tm, int x, int y, int w, int h)
tm
- maximum time in milliseconds before update
x
- the x coordinate (pixels over from left)
y
- the y coordinate (pixels down from top)
width
- the width
height
- the heightpublic AccessibleContext getAccessibleContext()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |