Class symantec.itools.multimedia.ImageViewer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.multimedia.ImageViewer

Object
   |
   +----Component
           |
           +----symantec.itools.multimedia.ImageViewer

public class ImageViewer
extends Component
implements Serializable
ImageViewer component. Provides a platform-independent display of an Image.

Version:
1.1, August 4, 1997
Author:
Symantec

Variable Index

 o IMAGE_CENTERED
A constant indicating the image is to be centered in the size of this component.
 o IMAGE_NORMAL
A constant indicating the image is to be drawn normally in the upper left corner.
 o IMAGE_SCALED_TO_FIT
A constant indicating the image is to be scaled to fit the size of this component.
 o IMAGE_TILED
A constant indicating the image is to be tiled in the size of this component.
 o errors
Error strings.
 o fileName
Name of file, if any, associated with this image.
 o image
Image that this viewer is displaying.
 o imageStyle
Determines how to draw the image.
 o url
URL of the image being displayed.

Constructor Index

 o symantec.itools.multimedia.ImageViewer()
Create default image viewer.
 o symantec.itools.multimedia.ImageViewer(String)
Crate image viewer with filename.
 o symantec.itools.multimedia.ImageViewer(URL)
Create image viewer with URL.
 o symantec.itools.multimedia.ImageViewer(Image)
Create image viewer with image.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o getCenterMode()
 o getFileName()
Obtain the filename associated with the current image.
 o getImage()
Obtain the image currently being displayed.
 o getImageURL()
Obtain the URL associated with the current image.
 o getStyle()
Gets the current panel image style.
 o getURL()
 o minimumSize()
Returns the minimum dimensions to properly display this component.
 o paint(Graphics)
Paints this component using the given graphics context.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o setCenterMode(boolean)
 o setFileName(String)
Specify or change the image filename.
 o setImage(Image)
Set or change the current image.
 o setImageURL(URL)
Specify or change the image URL.
 o setStyle(int)
Sets the new panel image style.
 o setURL(URL)

Variables

 o IMAGE_CENTERED
public static final int IMAGE_CENTERED
A constant indicating the image is to be centered in the size of this component.

 o IMAGE_NORMAL
public static final int IMAGE_NORMAL
A constant indicating the image is to be drawn normally in the upper left corner.

 o IMAGE_SCALED_TO_FIT
public static final int IMAGE_SCALED_TO_FIT
A constant indicating the image is to be scaled to fit the size of this component.

 o IMAGE_TILED
public static final int IMAGE_TILED
A constant indicating the image is to be tiled in the size of this component.

 o errors
protected transient java.util.ResourceBundle errors
Error strings.

 o fileName
protected java.lang.String fileName
Name of file, if any, associated with this image.

 o image
protected transient java.awt.Image image
Image that this viewer is displaying.

 o imageStyle
protected int imageStyle
Determines how to draw the image.

 o url
protected java.net.URL url
URL of the image being displayed.

Constructors

 o ImageViewer
public ImageViewer()
Create default image viewer.

 o ImageViewer
public ImageViewer(String str) throws MalformedURLException
Crate image viewer with filename. The specified filename is used as the image source.

Parameters:
str - name of file containing the image source
Throws: MalformedURLException
Thrown if URL cannot be generated from filename
 o ImageViewer
public ImageViewer(URL url)
Create image viewer with URL. The specified URL is used as the image source.

Parameters:
url - the URL of the image to be displayed
 o ImageViewer
public ImageViewer(Image img)
Create image viewer with image. The specified image is used as the image source

Parameters:
img - the image to be displayed

Methods

 o addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all event changes.

Parameters:
PropertyChangeListener - listener the listener to add.
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a vetoable listener for all event changes.

Parameters:
VetoableChangeListener - listener the listener to add.
See Also:
removeVetoableChangeListener
 o getCenterMode
public boolean getCenterMode()
Note: getCenterMode() is deprecated.

See Also:
getStyle
 o getFileName
public java.lang.String getFileName()
Obtain the filename associated with the current image.

Returns:
the name of the file, if any, associated with this image. If no file is associated with this image, returns null
 o getImage
public java.awt.Image getImage()
Obtain the image currently being displayed.

Returns:
the image currently displayed or null if no image
 o getImageURL
public java.net.URL getImageURL()
Obtain the URL associated with the current image. If the image was specified by file name, or URL, it will have a URL which indicates its source. Images created using the constructor with an Image parameter will have no associated URL.

Returns:
the name of the URL, if any, associated with this image. If no URL is associated with this image, returns null
 o getStyle
public int getStyle()
Gets the current panel image style.

Returns:
the current panel image style, one of IMAGE_TILED, IMAGE_CENTERED, or IMAGE_SCALED_TO_FIT
See Also:
setStyle, IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT
 o getURL
public java.net.URL getURL()
Note: getURL() is deprecated.

See Also:
getImageURL
 o minimumSize
public java.awt.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.

Returns:
If no image has been loaded, a dimension of 10 by 10 is returned. If an image has been loaded, the height and width of the image is returned.
Overrides:
minimumSize in class Component
See Also:
preferredSize
 o 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 Component
See Also:
repaint, update
 o preferredSize
public java.awt.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.

Returns:
If no image has been loaded, a dimension of 10 by 10 is returned. If an image has been loaded, the height and width of the image is returned.
Overrides:
preferredSize in class Component
See Also:
minimumSize
 o removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all event changes.

Parameters:
PropertyChangeListener - listener the listener to remove.
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable listener for all event changes.

Parameters:
VetoableChangeListener - listener the listener to remove.
See Also:
addVetoableChangeListener
 o setCenterMode
public void setCenterMode(boolean flag) throws PropertyVetoException
Note: setCenterMode() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setStyle
 o setFileName
public void setFileName(String str) throws PropertyVetoException
Specify or change the image filename.

Parameters:
str - name of file containing image source
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setImage
public void setImage(Image img) throws PropertyVetoException
Set or change the current image. Call this method if you want to specify directly the image to display.

Parameters:
img - the image to be displayed
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setImageURL
public void setImageURL(URL aUrl) throws PropertyVetoException
Specify or change the image URL.

Parameters:
aUrl - the URL of the image to be displayed
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setStyle
public void setStyle(int newStyle) throws PropertyVetoException
Sets the new panel image style.

Parameters:
newStyle - the new panel image style, one of IMAGE_TILED, IMAGE_CENTERED, or IMAGE_SCALED_TO_FIT
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getStyle, IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT, IMAGE_NORMAL
 o setURL
public void setURL(URL aUrl) throws PropertyVetoException
Note: setURL() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setImageURL

All Packages  Class Hierarchy  This Package  Previous  Next  Index