|
||||||||||
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.JViewport
edu.umd.cs.piccolox.swing.PViewport
public class PViewport
A subclass of JViewport that talks to the scroll director to negotiate the view positions and sizes.
Nested Class Summary | |
---|---|
static class |
PViewport.PViewportLayout
A simple layout manager to give the ZCanvas the same size as the Viewport. |
Nested classes/interfaces inherited from class javax.swing.JViewport |
---|
JViewport.AccessibleJViewport, JViewport.ViewListener |
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 | |
---|---|
(package private) PScrollDirector |
scrollDirector
Controls what happens when scrolling occurs. |
Fields inherited from class javax.swing.JViewport |
---|
backingStore, BACKINGSTORE_SCROLL_MODE, backingStoreImage, BLIT_SCROLL_MODE, isViewSizeSet, lastPaintPosition, scrollUnderway, SIMPLE_SCROLL_MODE |
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 | |
---|---|
PViewport()
Pass constructor info to super. |
Method Summary | |
---|---|
protected LayoutManager |
createLayoutManager()
Subclasses can override this to install a different layout manager (or null ) in the constructor. |
protected PScrollDirector |
createScrollDirector()
Subclasses can override this to install a different scroll director in the constructor. |
void |
fireStateChanged()
Notifies all ChangeListeners when the views size, position,
or the viewports extent size has changed. |
PScrollDirector |
getScrollDirector()
Returns the scroll director on this viewport. |
Point |
getViewPosition()
Gets the view position from the scroll director based on the current extent size. |
Dimension |
getViewSize()
Gets the view size from the scroll director based on the current extent size. |
Dimension |
getViewSize(Rectangle2D r)
Gets the view size from the scroll director based on the specified extent size. |
void |
setScrollDirector(PScrollDirector scrollDirector)
Set the scroll director on this viewport. |
void |
setView(Component view)
Overridden to throw an exception if the view is not a PCanvas. |
void |
setViewPosition(Point p)
Sets the view coordinates that appear in the upper left hand corner of the viewport, does nothing if there's no view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
PScrollDirector scrollDirector
Constructor Detail |
---|
public PViewport()
Method Detail |
---|
protected LayoutManager createLayoutManager()
null
) in the constructor. Returns a new
ViewportLayout
object.
createLayoutManager
in class JViewport
LayoutManager
protected PScrollDirector createScrollDirector()
PScrollDirector
object.
public void setScrollDirector(PScrollDirector scrollDirector)
scrollDirector
- The new scroll directorpublic PScrollDirector getScrollDirector()
public void setView(Component view)
setView
in class JViewport
view
- The new view - it better be a ZCanvas!public void fireStateChanged()
ChangeListeners
when the views size, position,
or the viewports extent size has changed.
PDefaultScrollDirector calls this so it needs to be public.
fireStateChanged
in class JViewport
public void setViewPosition(Point p)
setViewPosition
in class JViewport
p
- a Point object giving the upper left coordinatespublic Point getViewPosition()
getViewPosition
in class JViewport
public Dimension getViewSize()
getViewSize
in class JViewport
public Dimension getViewSize(Rectangle2D r)
r
- The extent size from which the view is computed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |