Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 868 → Rev 869

/sun/xmleditor/trunk/src/plugins/regionEditorPlugin/ImagePanel.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.8 $
* @version $Revision: 1.9 $
*
* Last modification: $Date: 2003/07/24 13:34:43 $
* $Id: ImagePanel.java,v 1.8 2003/07/24 13:34:43 hjokusch Exp $
* Last modification: $Date: 2003/07/28 11:14:33 $
* $Id: ImagePanel.java,v 1.9 2003/07/28 11:14:33 cstollen Exp $
*/
 
package src.plugins.regionEditorPlugin;
26,7 → 26,7
*
* @author Yulia Klassen, Viktoriya Zudova
*
* @version $Revision: 1.8 $ Last modification: $Date: 2003/07/24 13:34:43 $
* @version $Revision: 1.9 $ Last modification: $Date: 2003/07/28 11:14:33 $
*/
class ImagePanel extends JPanel {
 
74,17 → 74,25
public void paintComponent(Graphics g) {
int w = getWidth();
int h = getHeight();
System.out.println("\n ImageWidth = " + w + " | ImageHeight = " + h);
 
/* Fill the background. */
g.setColor(getBackground());
g.fillRect(0, 0, w, h);
 
int iw;
int ih;
/* If there is an image ... */
if(image != null) {
 
/* Calculate the size and position of the image. */
int iw = image.getWidth(null);
int ih = image.getHeight(null);
iw = image.getWidth(null);
ih = image.getHeight(null);
}
else {
iw = w;
ih = h;
}
double kx = (double)iw/w;
double ky = (double)ih/h;
 
101,10 → 109,11
dy = (h-ih)/2;
imageWidth = iw;
imageHeight = ih;
 
/* Draw the image. */
if(image != null) {
g.drawImage(image, dx, dy, iw, ih, null);
 
}
/* Draw regions. */
g.setColor(Color.black);
g.setXORMode(Color.white);
140,7 → 149,7
(int)(rect.getX() / coef) + dx,
(int)(rect.getY() / coef) + dy);
}
}
//}
}
 
/**