br.usp.ime.klava.segmentit.gui
Class ZoomableImageIcon

java.lang.Object
  extended by javax.swing.ImageIcon
      extended by br.usp.ime.klava.segmentit.gui.ZoomableImageIcon
All Implemented Interfaces:
java.io.Serializable, javax.accessibility.Accessible, javax.swing.Icon
Direct Known Subclasses:
MarkersEditor

public class ZoomableImageIcon
extends javax.swing.ImageIcon

Extension of ImageIcon, with zoom and opacity support for visualization purposes.

Author:
Bruno Klava
See Also:
Serialized Form

Constructor Summary
ZoomableImageIcon()
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(byte[] arg0)
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(byte[] arg0, java.lang.String arg1)
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(java.awt.Image arg0)
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(java.awt.Image arg0, java.lang.String arg1)
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(java.lang.String arg0)
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(java.lang.String arg0, java.lang.String arg1)
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(java.net.URL arg0)
          Calls the ImageIcon constructor with the same signature.
ZoomableImageIcon(java.net.URL arg0, java.lang.String arg1)
          Calls the ImageIcon constructor with the same signature.
 
Method Summary
 double getZoomLevel()
          Getter of the zoomLevel property.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Paints this image given by the ImageIcon.getImage() method using the current zoomLevel and opacity.
 void setOpacity(float opacity)
          Setter of the opacity property.
 void setZoomLevel(double zoomLevel)
          Setter of the zoomLevel property.
 
Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, setDescription, setImage, setImageObserver, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZoomableImageIcon

public ZoomableImageIcon(java.lang.String arg0,
                         java.lang.String arg1)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -
arg1 -

ZoomableImageIcon

public ZoomableImageIcon(java.lang.String arg0)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -

ZoomableImageIcon

public ZoomableImageIcon(java.net.URL arg0,
                         java.lang.String arg1)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -
arg1 -

ZoomableImageIcon

public ZoomableImageIcon(java.net.URL arg0)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -

ZoomableImageIcon

public ZoomableImageIcon(java.awt.Image arg0,
                         java.lang.String arg1)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -
arg1 -

ZoomableImageIcon

public ZoomableImageIcon(java.awt.Image arg0)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -

ZoomableImageIcon

public ZoomableImageIcon(byte[] arg0,
                         java.lang.String arg1)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -
arg1 -

ZoomableImageIcon

public ZoomableImageIcon(byte[] arg0)
Calls the ImageIcon constructor with the same signature.

Parameters:
arg0 -

ZoomableImageIcon

public ZoomableImageIcon()
Calls the ImageIcon constructor with the same signature.

Method Detail

getZoomLevel

public double getZoomLevel()
Getter of the zoomLevel property.

Returns:
the zoomLevel

setZoomLevel

public void setZoomLevel(double zoomLevel)
Setter of the zoomLevel property.

Parameters:
zoomLevel - the value to be assigned to the zoomLevel property

setOpacity

public void setOpacity(float opacity)
Setter of the opacity property.

Parameters:
opacity - the value to be assigned to the opacity property

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Paints this image given by the ImageIcon.getImage() method using the current zoomLevel and opacity.

Specified by:
paintIcon in interface javax.swing.Icon
Overrides:
paintIcon in class javax.swing.ImageIcon