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
-
OFFSET
- Event id for offsetChange (scroll);
-
RESIZE
- Event id for size changes.
-
ScrolledPanel(OffsetCanvas)
- Create a ScrolledPanel.
-
center()
-
-
getContentSize()
-
-
getOffset()
-
-
getPortSize()
-
-
handleEvent(Event)
-
-
removeNotify()
-
-
scrollTo(double, double)
- Scroll to any given location.
-
setPageFraction(double)
- Set the amount of paging for the Scrollbars.
RESIZE
public static int RESIZE
- Event id for size changes.
OFFSET
public static int OFFSET
- Event id for offsetChange (scroll);
ScrolledPanel
public ScrolledPanel(OffsetCanvas offsetCanvas)
- Create a ScrolledPanel.
- Parameters:
- offsetCanvas - the OffsetCanvas that will be scrolled within the created panel.
handleEvent
public boolean handleEvent(Event e)
- Overrides:
- handleEvent in class Component
removeNotify
public synchronized void removeNotify()
- Overrides:
- removeNotify in class Container
getPortSize
public DDimension getPortSize()
getContentSize
public DDimension getContentSize()
getOffset
public DDimension getOffset()
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
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
center
public void center()
All Packages Class Hierarchy This Package Previous Next Index