All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.dnd.ImageWindow

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----com.ibm.dnd.ImageWindow

public class ImageWindow
extends Window
implements Runnable
The class represents a window with an image in the center. This class has method trackMouse() which relocates window to follow mouse movements For example:
        ImageWindow iw = new ImageWindow( parent, image ); // parent - java.awt.Frame; image - image;
        iw.trackMouse(windowEvent);
 
It runs separate thread with the lowest priority that actually moves the window.


Constructor Index

 o ImageWindow()
Constructor.
 o ImageWindow(Frame, ImageGlyph)
Constructor.
 o ImageWindow(ImageGlyph)
Constructor.

Method Index

 o getImage()
Returns the current image.
 o getPreferredSize()
Returns the preferred size.
 o isActive()
Returns the value of active flag.
 o isScalable()
Returns the scalable flag.
 o paint(Graphics)
Paints the ImageWindow.
 o repaint(long, int, int, int, int)
Repaints the ImageWindow
 o run()
This method implements corresponding method from Runnable interface.
 o setActive(boolean)
Sets the value of active flag
 o setImage(ImageGlyph)
Set the current image.
 o setScalable(boolean)
Set scalable flag.
 o trackMouse(Component, Point)
This method changes window location to follow the mouse movements.
 o trackMouse(MouseEvent)
This method changes window location to follow the mouse movements Shortcut for trackMouse( e.getComponent(),e.getPoint() )
 o trackMouse(Point)
This method changes window location to follow the mouse movements It does not change the window position immediately.
 o update(Graphics)
Repaints the window

Constructors

 o ImageWindow
 public ImageWindow()
Constructor. Creates an ImageWindow with the default non-visible parent frame, no image and false scalable flag.

 o ImageWindow
 public ImageWindow(ImageGlyph image)
Constructor. Creates an ImageWindow with the default non-visible parent frame and false scalable flag.

Parameters:
image - ImageGlyph
 o ImageWindow
 public ImageWindow(Frame parent,
                    ImageGlyph image)
Constructor. Creates an ImageWindow with the false scalable flag.

Parameters:
parent - java.awt.Frame parent frame
image - ImageGlyph

Methods

 o getImage
 public ImageGlyph getImage()
Returns the current image.

Returns:
com.ibm.uicontrols.ImageGlyph the current image
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size.

Returns:
java.awt.Dimension
Overrides:
getPreferredSize in class Container
 o isActive
 public boolean isActive()
Returns the value of active flag.

Returns:
boolean
Overrides:
isActive in class Window
 o isScalable
 public boolean isScalable()
Returns the scalable flag. If the value of the scalable flag is true, the image is streched accordind to the window size.

Returns:
boolean
 o paint
 public void paint(Graphics gr)
Paints the ImageWindow.

Parameters:
gr - java.awt.Graphics
Overrides:
paint in class Container
 o repaint
 public void repaint(long tm,
                     int x,
                     int y,
                     int width,
                     int height)
Repaints the ImageWindow

Overrides:
repaint in class Component
 o run
 public void run()
This method implements corresponding method from Runnable interface. It updates the ImageWindow position when it changes. The thread running this method has the lowest priority.

 o setActive
 public void setActive(boolean value)
Sets the value of active flag

Parameters:
value - boolean
 o setImage
 public void setImage(ImageGlyph img)
Set the current image.

Parameters:
img - new current image to display
 o setScalable
 public void setScalable(boolean flag)
Set scalable flag. If the value of the scalable flag is true, the image is streched accordind to the window size.

Parameters:
flag - boolean
 o trackMouse
 public void trackMouse(Component component,
                        Point componentPoint)
This method changes window location to follow the mouse movements. A shortcut for trackMouse(screenPoint)

Parameters:
component - a component
componentPoint - point in the comoponent's coordinates
 o trackMouse
 public void trackMouse(MouseEvent e)
This method changes window location to follow the mouse movements Shortcut for trackMouse( e.getComponent(),e.getPoint() )

Parameters:
e - java.awt.event.MouseEvent
 o trackMouse
 public synchronized void trackMouse(Point screenPoint)
This method changes window location to follow the mouse movements It does not change the window position immediately. It saves the new window location and notify the updating thread it can change the window position. The updating thread actually moves the window when it gets control. This allows not to make unnecessary window move when it moves fast enough or the system is busy with another task.

Parameters:
screenPoint - new window location
 o update
 public void update(Graphics g)
Repaints the window

Parameters:
gr - java.awt.Graphics
Overrides:
update in class Container

All Packages  Class Hierarchy  This Package  Previous  Next  Index