Class EDU.auburn.VGJ.gui.ScrolledPanel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.auburn.VGJ.gui.ScrolledPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----EDU.auburn.VGJ.gui.LPanel
                                   |
                                   +----EDU.auburn.VGJ.gui.ScrolledPanel

public class ScrolledPanel
extends LPanel
This is a panel that contains an OffsetCanvas, a Label, and two Scrollbars.
When the OffsetCanvas is resized, the Scrollars will adjust so that the image can be completely viewed, and no more (you can scroll just to the edge of the image). If the OffsetCanvas is larger than the image, the image gets centered inside it.
the Label displays the current cursor location in the OffsetCanvas, relative to the contents of the OffsetCanvas.

Here is the source.
See Also:
OffsetCanvas

Variable Index

 o OFFSET
Event id for offsetChange (scroll);
 o RESIZE
Event id for size changes.

Constructor Index

 o ScrolledPanel(OffsetCanvas)
Create a ScrolledPanel.

Method Index

 o center()
 o getContentSize()
 o getOffset()
 o getPortSize()
 o handleEvent(Event)
 o removeNotify()
 o scrollTo(double, double)
Scroll to any given location.
 o setPageFraction(double)
Set the amount of paging for the Scrollbars.

Variables

 o RESIZE
  public static int RESIZE
Event id for size changes.
 o OFFSET
  public static int OFFSET
Event id for offsetChange (scroll);

Constructors

 o ScrolledPanel
  public ScrolledPanel(OffsetCanvas offsetCanvas)
Create a ScrolledPanel.
Parameters:
offsetCanvas - the OffsetCanvas that will be scrolled within the created panel.

Methods

 o handleEvent
  public boolean handleEvent(Event e)
Overrides:
handleEvent in class Component
 o removeNotify
  public synchronized void removeNotify()
Overrides:
removeNotify in class Container
 o getPortSize
  public DDimension getPortSize()
 o getContentSize
  public DDimension getContentSize()
 o getOffset
  public DDimension getOffset()
 o scrollTo
  public void scrollTo(double x,
                       double y)
Scroll to any given location.
Parameters:
x - horizontal offset to scroll to
y - vertical offset to scroll to
 o setPageFraction
  public void setPageFraction(double fraction)
Set the amount of paging for the Scrollbars.
Parameters:
fraction - fraction of window size that the contents will move when "paged" - the default is 1/4
 o center
  public void center()

All Packages  Class Hierarchy  This Package  Previous  Next  Index