javax.media.jai.widget
Class ScrollingImagePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.ScrollPane
                    |
                    +--javax.media.jai.widget.ScrollingImagePanel
All Implemented Interfaces:
Accessible, AdjustmentListener, ComponentListener, EventListener, ImageObserver, MenuContainer, MouseListener, MouseMotionListener, Serializable

Deprecated. as of JAI 1.1

public class ScrollingImagePanel
extends ScrollPane
implements AdjustmentListener, ComponentListener, MouseListener, MouseMotionListener

An extension of java.awt.Panel that contains an ImageCanvas and vertical and horizontal scrollbars. The origin of the ImageCanvas is set according to the value of the scrollbars. Additionally, the origin may be changed by dragging the mouse. The window cursor will be changed to Cursor.MOVE_CURSOR for the duration of the drag.

Due to the limitations of BufferedImage, only TYPE_BYTE of band 1, 2, 3, 4, and TYPE_USHORT of band 1, 2, 3 images can be displayed using this widget.

See Also:
Serialized Form

Inner classes inherited from class java.awt.ScrollPane
ScrollPane.AccessibleAWTScrollPane
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent
 
Field Summary
protected  boolean beingDragged
          Deprecated. True if we are in the middle of a mouse drag.
protected  Cursor defaultCursor
          Deprecated. A place to save the cursor.
protected  ImageCanvas ic
          Deprecated. The ImageCanvas we are controlling.
protected  RenderedImage im
          Deprecated. The RenderedImage displayed by the ImageCanvas.
protected  Point moveSource
          Deprecated. The initial Point of a mouse drag.
protected  int panelHeight
          Deprecated. The height of the panel.
protected  int panelWidth
          Deprecated. The width of the panel.
protected  Vector viewportListeners
          Deprecated. Vector of ViewportListeners.
 
Fields inherited from class java.awt.ScrollPane
SCROLLBARS_ALWAYS, SCROLLBARS_AS_NEEDED, SCROLLBARS_NEVER
 
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
ScrollingImagePanel(RenderedImage im, int width, int height)
          Deprecated. Constructs a ScrollingImagePanel of a given size for a given RenderedImage.
 
Method Summary
 void addViewportListener(ViewportListener l)
          Deprecated. Adds the specified ViewportListener to the panel
 void adjustmentValueChanged(AdjustmentEvent e)
          Deprecated. Called by the AWT when either scrollbar changes.
 void componentHidden(ComponentEvent e)
          Deprecated. Ignored
 void componentMoved(ComponentEvent e)
          Deprecated. Ignored
 void componentResized(ComponentEvent e)
          Deprecated. Called when the ImagePanel is resized
 void componentShown(ComponentEvent e)
          Deprecated. Ignored
 ImageCanvas getImageCanvas()
          Deprecated. Returns the image canvas.
 Dimension getPreferredSize()
          Deprecated. Called by the AWT when instantiating the component.
 int getXCenter()
          Deprecated. Returns the X co-ordinate of the image center.
 int getXOrigin()
          Deprecated. Returns the XOrigin of the image
 int getYCenter()
          Deprecated. Returns the Y co-ordinate of the image center.
 int getYOrigin()
          Deprecated. Returns the YOrigin of the image
 void mouseClicked(MouseEvent me)
          Deprecated. Ignored.
 void mouseDragged(MouseEvent me)
          Deprecated. Called by the AWT as the mouse is dragged.
 void mouseEntered(MouseEvent me)
          Deprecated. Ignored.
 void mouseExited(MouseEvent me)
          Deprecated. Called by the AWT when the mouse leaves the component.
 void mouseMoved(MouseEvent me)
          Deprecated. Ignored.
 void mousePressed(MouseEvent me)
          Deprecated. Called by the AWT when the mouse button is pressed.
 void mouseReleased(MouseEvent me)
          Deprecated. Called by the AWT when the mouse button is released.
 void removeViewportListener(ViewportListener l)
          Deprecated. Removes the specified ViewportListener
 void set(RenderedImage im)
          Deprecated. Sets the panel to display the specified image
 void setBounds(int x, int y, int width, int height)
          Deprecated. Called by the AWT during instantiation and when events such as resize occur.
 void setCenter(int x, int y)
          Deprecated. Set the center of the image to the given coordinates of the scroll window.
 void setOrigin(int x, int y)
          Deprecated. Sets the image origin to a given (x, y) position.
protected  void updateDrag(Point moveTarget)
          Deprecated. Called for each point of a mouse drag.
 
Methods inherited from class java.awt.ScrollPane
addImpl, addNotify, doLayout, getAccessibleContext, getHAdjustable, getHScrollbarHeight, getScrollbarDisplayPolicy, getScrollPosition, getVAdjustable, getViewportSize, getVScrollbarWidth, layout, paramString, printComponents, setLayout, setScrollPosition, setScrollPosition
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ic

protected ImageCanvas ic
Deprecated. 
The ImageCanvas we are controlling.

im

protected RenderedImage im
Deprecated. 
The RenderedImage displayed by the ImageCanvas.

panelWidth

protected int panelWidth
Deprecated. 
The width of the panel.

panelHeight

protected int panelHeight
Deprecated. 
The height of the panel.

viewportListeners

protected Vector viewportListeners
Deprecated. 
Vector of ViewportListeners.

moveSource

protected Point moveSource
Deprecated. 
The initial Point of a mouse drag.

beingDragged

protected boolean beingDragged
Deprecated. 
True if we are in the middle of a mouse drag.

defaultCursor

protected Cursor defaultCursor
Deprecated. 
A place to save the cursor.
Constructor Detail

ScrollingImagePanel

public ScrollingImagePanel(RenderedImage im,
                           int width,
                           int height)
Deprecated. 
Constructs a ScrollingImagePanel of a given size for a given RenderedImage.
Method Detail

addViewportListener

public void addViewportListener(ViewportListener l)
Deprecated. 
Adds the specified ViewportListener to the panel

removeViewportListener

public void removeViewportListener(ViewportListener l)
Deprecated. 
Removes the specified ViewportListener

getImageCanvas

public ImageCanvas getImageCanvas()
Deprecated. 
Returns the image canvas. Allows mouse listeners to be used on the image canvas.
Since:
JAI 1.1

getXOrigin

public int getXOrigin()
Deprecated. 
Returns the XOrigin of the image

getYOrigin

public int getYOrigin()
Deprecated. 
Returns the YOrigin of the image

setOrigin

public void setOrigin(int x,
                      int y)
Deprecated. 
Sets the image origin to a given (x, y) position. The scrollbars are updated appropriately.

setCenter

public void setCenter(int x,
                      int y)
Deprecated. 
Set the center of the image to the given coordinates of the scroll window.

set

public void set(RenderedImage im)
Deprecated. 
Sets the panel to display the specified image

getXCenter

public int getXCenter()
Deprecated. 
Returns the X co-ordinate of the image center.

getYCenter

public int getYCenter()
Deprecated. 
Returns the Y co-ordinate of the image center.

getPreferredSize

public Dimension getPreferredSize()
Deprecated. 
Called by the AWT when instantiating the component.
Overrides:
getPreferredSize in class Container

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Deprecated. 
Called by the AWT during instantiation and when events such as resize occur.
Overrides:
setBounds in class Component

adjustmentValueChanged

public void adjustmentValueChanged(AdjustmentEvent e)
Deprecated. 
Called by the AWT when either scrollbar changes.
Specified by:
adjustmentValueChanged in interface AdjustmentListener

componentResized

public void componentResized(ComponentEvent e)
Deprecated. 
Called when the ImagePanel is resized
Specified by:
componentResized in interface ComponentListener

componentHidden

public void componentHidden(ComponentEvent e)
Deprecated. 
Ignored
Specified by:
componentHidden in interface ComponentListener

componentMoved

public void componentMoved(ComponentEvent e)
Deprecated. 
Ignored
Specified by:
componentMoved in interface ComponentListener

componentShown

public void componentShown(ComponentEvent e)
Deprecated. 
Ignored
Specified by:
componentShown in interface ComponentListener

updateDrag

protected void updateDrag(Point moveTarget)
Deprecated. 
Called for each point of a mouse drag.

mousePressed

public void mousePressed(MouseEvent me)
Deprecated. 
Called by the AWT when the mouse button is pressed.
Specified by:
mousePressed in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent me)
Deprecated. 
Called by the AWT as the mouse is dragged.
Specified by:
mouseDragged in interface MouseMotionListener

mouseReleased

public void mouseReleased(MouseEvent me)
Deprecated. 
Called by the AWT when the mouse button is released.
Specified by:
mouseReleased in interface MouseListener

mouseExited

public void mouseExited(MouseEvent me)
Deprecated. 
Called by the AWT when the mouse leaves the component.
Specified by:
mouseExited in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent me)
Deprecated. 
Ignored.
Specified by:
mouseClicked in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent me)
Deprecated. 
Ignored.
Specified by:
mouseMoved in interface MouseMotionListener

mouseEntered

public void mouseEntered(MouseEvent me)
Deprecated. 
Ignored.
Specified by:
mouseEntered in interface MouseListener