javax.media.jai.widget
Class ScrollingImagePanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.ScrollPane
              extended byjavax.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.

This class has been deprecated. The source code has been moved to the samples/widget directory. These widgets are no longer supported.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.ScrollPane
ScrollPane.AccessibleAWTScrollPane
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
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, eventTypeEnabled, getAccessibleContext, getHAdjustable, getHScrollbarHeight, getScrollbarDisplayPolicy, getScrollPosition, getVAdjustable, getViewportSize, getVScrollbarWidth, isWheelScrollingEnabled, layout, paramString, printComponents, processMouseWheelEvent, setLayout, setScrollPosition, setScrollPosition, setWheelScrollingEnabled
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
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.


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.


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