All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.ScrollingPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----symantec.itools.awt.KeyPressManagerPanel
|
+----symantec.itools.awt.ScrollingPanel
- public class ScrollingPanel
- extends KeyPressManagerPanel
The ScrollingPanel is a panel with automatic scroll bars.
It may contain only one component/container/panel/etc.
It automatically tracks the size of this (usually large) component and
provides scroll bars so the entire component may be viewed within a
panel of limited size.
Typically, the added component would be a panel (or some other container)
which would then contain a variety of other components.
-
bSun1_1
- True if running under Sun Java 1.1, false otherwise.
-
ScrollingPanel()
- Constructs a default ScrollingPanel.
-
ScrollingPanel(Component, int, int)
- Constructs a new ScrollingPanel initialized with the
specified component, minimum height and minimum width.
-
add(Component)
- Adds a component to the end of this container.
-
add(Component, int)
- Adds a component to the end of this container.
-
add(String, Component)
- Adds a component to the end of this container.
-
getComponent()
- Gets the current component in the ScrollingPanel.
-
getHorizontalGap()
- Gets the current size of the gap between the contained component (panel)
in this ScrollingPanel and the horizontal scroll bar.
-
getMinimumHeight()
- Gets the value used for the minimumSize() height
of the ScrollingPanel.
-
getMinimumWidth()
- Gets the current value used for the minimumSize()
width of the ScrollingPanel.
-
getScrollLineIncrement()
- Gets the number of pixels to scroll for every scrollbar arrow press.
-
getShowHorizontalScroll()
- Gets the current horizontal scrollbar visibility flag.
-
getShowVerticalScroll()
- Gets the current vertical scrollbar visibility flag.
-
getVerticalGap()
- Gets the current size of the gap between the contained component (panel)
in this ScrollingPanel and the vertical scroll bar.
-
handleEvent(Event)
- Processes events for this component.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
remove(Component)
- Removes the specified component from this container.
-
removeAll()
- Removes all the components from this container.
-
reshape(int, int, int, int)
- Moves and/or resizes this component.
-
scrollDown()
- Scrolls down by the number of pixels specified in the method setScrollLineIncrement().
-
scrollHorizontalAbsolute(int)
- Scrolls to an absolute horizontal position.
-
scrollLeft()
- Scrolls left by the number of pixels specified in the method setScrollLineIncrement().
-
scrollPageDown()
- Scrolls one "page" down.
-
scrollPageLeft()
- Scrolls one "page" left.
-
scrollPageRight()
- Scrolls one "page" right.
-
scrollPageUp()
- Scrolls one "page" up.
-
scrollRight()
- Scrolls right by the number of pixels specified in the method setScrollLineIncrement().
-
scrollUp()
- Scrolls up by the number of pixels specified in the method setScrollLineIncrement().
-
scrollVerticalAbsolute(int)
- Scrolls to an absolute vertical position.
-
setComponent(Component)
- Sets the component in this ScrollingPanel.
-
setHorizontalGap(int)
- Sets the size of the gap between the contained component (panel)
in this ScrollingPanel and the horziontal scroll bar.
-
setLayout(LayoutManager)
- Takes no action.
-
setMinimumHeight(int)
- Sets the value to be used for the minimumSize()
height of the ScrollingPanel.
-
setMinimumWidth(int)
- Sets the value to be used for the minimumSize() width
of the ScrollingPanel.
-
setScrollLineIncrement(int)
- Sets the number of pixels to scroll for every scrollbar arrow press.
-
setShowHorizontalScroll(boolean)
- Sets whether the horizontal scrollbar should be
made visible when necessary or should never be made
visible.
-
setShowVerticalScroll(boolean)
- Sets whether the vertical scrollbar should be
made visible when necessary or should never be made
visible.
-
setVerticalGap(int)
- Sets the size of the gap between the contained component (panel)
in this ScrollingPanel and the vertical scroll bar.
-
update(Graphics)
- Handles redrawing of this component on the screen.
bSun1_1
protected boolean bSun1_1
- True if running under Sun Java 1.1, false otherwise.
ScrollingPanel
public ScrollingPanel()
- Constructs a default ScrollingPanel.
The panel is initialized with a null component, zero
minimum height and zero minimum width.
ScrollingPanel
public ScrollingPanel(Component component,
int minWidth,
int minHeight)
- Constructs a new ScrollingPanel initialized with the
specified component, minimum height and minimum width.
- Parameters:
- component - the component (usually a Panel) to be
scrolled
- minWidth - the value to be used for the minimumSize()
width of the ScrollingPanel
- minHeight - the value to be used for the minimumSize()
height of the ScrollingPanel
setMinimumWidth
public void setMinimumWidth(int minWidth)
- Sets the value to be used for the minimumSize() width
of the ScrollingPanel.
- Parameters:
- minWidth - the value to be used for the minimumSize()
width of the ScrollingPanel
- See Also:
- getMinimumWidth
getMinimumWidth
public int getMinimumWidth()
- Gets the current value used for the minimumSize()
width of the ScrollingPanel.
- Returns:
- the current minimum width value
setMinimumHeight
public void setMinimumHeight(int minHeight)
- Sets the value to be used for the minimumSize()
height of the ScrollingPanel.
- Parameters:
- minHeight - the value to be used for the minimumSize()
height of the ScrollingPanel
- See Also:
- getMinimumHeight
getMinimumHeight
public int getMinimumHeight()
- Gets the value used for the minimumSize() height
of the ScrollingPanel.
- Returns:
- current minimum height value
- See Also:
- setMinimumHeight
setVerticalGap
public void setVerticalGap(int gapPixels)
- Sets the size of the gap between the contained component (panel)
in this ScrollingPanel and the vertical scroll bar.
This gap is along the horziontal axis and increases the maximum
horizontal scroll value.
The default value is 6.
- Parameters:
- gapPixels - the size of the gap in pixels
- See Also:
- getVerticalGap, setHorizontalGap
getVerticalGap
public int getVerticalGap()
- Gets the current size of the gap between the contained component (panel)
in this ScrollingPanel and the vertical scroll bar.
This gap is along the horziontal axis and increases the maximum
horizontal scroll value.
The default value is 6.
- Returns:
- the current size of the gap in pixels
- See Also:
- setVerticalGap, getHorizontalGap
setHorizontalGap
public void setHorizontalGap(int gapPixels)
- Sets the size of the gap between the contained component (panel)
in this ScrollingPanel and the horziontal scroll bar.
This gap is along the vertical axis and increases the maximum
vertical scroll value.
The default value is 6.
- Parameters:
- gapPixels - the size of the gap in pixels
- See Also:
- getHorizontalGap, setVerticalGap
getHorizontalGap
public int getHorizontalGap()
- Gets the current size of the gap between the contained component (panel)
in this ScrollingPanel and the horizontal scroll bar.
This gap is along the vertical axis and increases the maximum
vertical scroll value.
The default value is 6.
- Returns:
- the current size of the gap in pixels
- See Also:
- setHorizontalGap, getVerticalGap
setShowVerticalScroll
public void setShowVerticalScroll(boolean cond)
- Sets whether the vertical scrollbar should be
made visible when necessary or should never be made
visible.
- Parameters:
- cond - if true, show the scrollbar when necessary;
if false, never show the scrollbar
- See Also:
- getShowVerticalScroll, setShowHorizontalScroll
getShowVerticalScroll
public boolean getShowVerticalScroll()
- Gets the current vertical scrollbar visibility flag.
- Returns:
- true if the scroll bar is shown when necessary,
false if it is never shown
- See Also:
- setShowVerticalScroll, getShowHorizontalScroll
setShowHorizontalScroll
public void setShowHorizontalScroll(boolean cond)
- Sets whether the horizontal scrollbar should be
made visible when necessary or should never be made
visible.
- Parameters:
- cond - if true, show the scrollbar when necessary;
if false, never show the scrollbar
- See Also:
- getShowHorizontalScroll, setShowVerticalScroll
getShowHorizontalScroll
public boolean getShowHorizontalScroll()
- Gets the current horizontal scrollbar visibility flag.
- Returns:
- true if the scroll bar is shown when necessary,
false if it is never shown
- See Also:
- setShowHorizontalScroll, getShowVerticalScroll
setScrollLineIncrement
public void setScrollLineIncrement(int scrollLineIncrement)
- Sets the number of pixels to scroll for every scrollbar arrow press.
The default is one pixel.
- Parameters:
- scrollLineIncrement - the number of pixels to scroll per arrow press
- See Also:
- getScrollLineIncrement
getScrollLineIncrement
public int getScrollLineIncrement()
- Gets the number of pixels to scroll for every scrollbar arrow press.
- Returns:
- the current number of pixels to scroll per arrow press
- See Also:
- setScrollLineIncrement
setComponent
public void setComponent(Component comp)
- Sets the component in this ScrollingPanel. This is the component
that gets scrolled. The ScrollingPanel can only contain one component.
Any previous component will be removed before the new one is added.
- Parameters:
- comp - the component to add
- See Also:
- getComponent
getComponent
public Component getComponent()
- Gets the current component in the ScrollingPanel.
This is the component that gets scrolled.
- Returns:
- the current component in the ScrollingPanel
- See Also:
- setComponent
handleEvent
public boolean handleEvent(Event evt)
- Processes events for this component.
This is a standard Java AWT method which gets called by the AWT
to handle this component's events. The default handler for
components dispatches to one of the following methods as needed:
action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(),
mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp().
It is overridden here to handle scrolling events (SCROLL_...).
- Parameters:
- evt - the event to handle
- Returns:
- true if the event was handled and no further action is needed,
false to pass the event to this component's parent
- Overrides:
- handleEvent in class KeyPressManagerPanel
- See Also:
- action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp
update
public void update(Graphics g)
- Handles redrawing of this component on the screen.
This is a standard Java AWT method which gets called by the Java
AWT (repaint()) to handle repainting this component on the screen.
The graphics context clipping region is set to the bounding rectangle
of this component and its <0,0> coordinate is this component's
top-left corner.
Typically this method paints the background color to clear the
component's drawing space, sets graphics context to be the foreground
color, and then calls paint() to draw the component.
It is overridden here to prevent the flicker associated with the standard
update() method's repainting of the background before painting the component
itself.
- Parameters:
- g - the graphics context
- Overrides:
- update in class Component
- See Also:
- repaint, paint
paint
public void paint(Graphics g)
- Paints this component using the given graphics context.
This is a standard Java AWT method which typically gets called
by the AWT to handle painting this component. It paints this component
using the given graphics context. The graphics context clipping region
is set to the bounding rectangle of this component and its <0,0>
coordinate is this component's top-left corner.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Container
- See Also:
- repaint, update
scrollUp
public void scrollUp()
- Scrolls up by the number of pixels specified in the method setScrollLineIncrement().
The default is one pixel.
- See Also:
- scrollDown, scrollLeft, scrollRight, setScrollLineIncrement, getScrollLineIncrement
scrollLeft
public void scrollLeft()
- Scrolls left by the number of pixels specified in the method setScrollLineIncrement().
The default is one pixel.
- See Also:
- scrollRight, scrollUp, scrollDown, setScrollLineIncrement, getScrollLineIncrement
scrollDown
public void scrollDown()
- Scrolls down by the number of pixels specified in the method setScrollLineIncrement().
The default is one pixel.
- See Also:
- scrollUp, scrollLeft, scrollRight, setScrollLineIncrement, getScrollLineIncrement
scrollRight
public void scrollRight()
- Scrolls right by the number of pixels specified in the method setScrollLineIncrement().
The default is one pixel.
- See Also:
- scrollLeft, scrollUp, scrollDown, setScrollLineIncrement, getScrollLineIncrement
scrollPageUp
public void scrollPageUp()
- Scrolls one "page" up.
The page size is the size of this ScrollingPanel not including the
scroll bar, if present.
- See Also:
- scrollPageDown, scrollPageLeft, scrollPageRight
scrollPageLeft
public void scrollPageLeft()
- Scrolls one "page" left.
The page size is the size of this ScrollingPanel not including the
scroll bar, if present.
- See Also:
- scrollPageRight, scrollPageUp, scrollPageDown
scrollPageDown
public void scrollPageDown()
- Scrolls one "page" down.
The page size is the size of this ScrollingPanel not including the
scroll bar, if present.
- See Also:
- scrollPageUp, scrollPageLeft, scrollPageRight
scrollPageRight
public void scrollPageRight()
- Scrolls one "page" right.
The page size is the size of this ScrollingPanel not including the
scroll bar, if present.
- See Also:
- scrollPageLeft, scrollPageUp, scrollPageDown
scrollVerticalAbsolute
public void scrollVerticalAbsolute(int position)
- Scrolls to an absolute vertical position.
The contained component's given pixel position will be scrolled to the
top line of the scrolling panel. The provided position is constrained to the range
[0, component's height - vertical page size].
- Parameters:
- position - the pixel position to scroll to
- See Also:
- scrollHorizontalAbsolute
scrollHorizontalAbsolute
public void scrollHorizontalAbsolute(int position)
- Scrolls to an absolute horizontal position.
The contained component's given pixel position will be scrolled to the
leftmost part of the scrolling panel. The provided position is constrained to the range
[0, component's width - horizontal page size].
- Parameters:
- position - the pixel position to scroll to
- See Also:
- scrollVerticalAbsolute
preferredSize
public Dimension preferredSize()
- Returns the recommended dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the recommended size of this component.
For each axis, it returns the larger of the current size or the
minimum size.
- Overrides:
- preferredSize in class Container
- See Also:
- minimumSize
minimumSize
public Dimension minimumSize()
- Returns the minimum dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the minimum size of this component.
The value returned is set using the setMinimumHeight() and
setMinimumWidth() methods or when this ScrollingPanel is constructed.
- Overrides:
- minimumSize in class Container
- See Also:
- preferredSize, setMinimumHeight, setMinimumWidth
add
public Component add(Component comp)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. Typically, the specified component is added to
the end of this container.
It is overridden here to set the only
component in this ScrollingPanel. This is the component
that gets scrolled. The ScrollingPanel can only contain one component.
Any previous component will be removed before the new one is added.
- Parameters:
- comp - the component to add
- Returns:
- the added component
- Overrides:
- add in class KeyPressManagerPanel
- See Also:
- remove, setComponent
add
public synchronized Component add(Component comp,
int pos)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. Typically, the specified component is added to
this container at the given zero-relative position index. A
position index of -1 would append the component to the end.
It is overridden here to set the only
component in this ScrollingPanel. This is the component
that gets scrolled. The ScrollingPanel can only contain one component.
Any previous component will be removed before the new one is added.
- Parameters:
- comp - the component to add
- pos - the zero-relative index at which to add the component or -1
for end (IGNORED)
- Returns:
- the added component
- Overrides:
- add in class Container
- See Also:
- remove, setComponent
add
public synchronized Component add(String name,
Component comp)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. Typically, the specified component is added to
the end of this container, and also added to this container's
layout manager with the given name.
It is overridden here to set the only
component in this ScrollingPanel. This is the component
that gets scrolled. The ScrollingPanel can only contain one component.
Any previous component will be removed before the new one is added.
- Parameters:
- name - the positioning directive for the layout manager (IGNORED)
- comp - the component to add
- Returns:
- the added component
- Overrides:
- add in class Container
- See Also:
- remove, setComponent
remove
public synchronized void remove(Component comp)
- Removes the specified component from this container.
This is a standard Java AWT method which gets called to remove a
component from a container. When this happens the component's
removeNotify() will also get called to indicate component removal.
- Parameters:
- comp - the component to remove
- Overrides:
- remove in class Container
- See Also:
- removeAll, add
removeAll
public synchronized void removeAll()
- Removes all the components from this container.
This is a standard Java AWT method which gets called to remove all
the components from a container. When this happens each component's
removeNotify() will also get called to indicate component removal.
- Overrides:
- removeAll in class Container
- See Also:
- remove, add
setLayout
public void setLayout(LayoutManager mgr)
- Takes no action.
This is a standard Java AWT method which gets called to specify
which layout manager should be used to layout the components in
standard containers.
Since layout managers CANNOT BE USED with this container the standard
setLayout has been OVERRIDDEN for this container and does nothing.
- Parameters:
- l - the layout manager to use to layout this container's components
(IGNORED)
- Overrides:
- setLayout in class Container
- See Also:
- getLayout
reshape
public synchronized void reshape(int x,
int y,
int width,
int height)
- Moves and/or resizes this component.
This is a standard Java AWT method which gets called to move and/or
resize this component. Components that are in containers with layout
managers should not call this method, but rely on the layout manager
instead.
- Parameters:
- x - horizontal position in the parent's coordinate space
- y - vertical position in the parent's coordinate space
- width - the new width
- height - the new height
- Overrides:
- reshape in class Component
All Packages Class Hierarchy This Package Previous Next Index