Horus Doc || Java GUI Reference || Doxygen's quick Index  

DisplayComponent Class Reference

List of all members.

Public Methods

void showImage (HxCorba.ImageRep newImg)
void clear ()
void paint (Graphics g)

Member Function Documentation

void DisplayComponent::showImage HxCorba.ImageRep    newImg [inline]
 

00018 {
00019     if(newImg == null) _image = null;
00020     else {
00021         int w = newImg.dimensionSize(1);
00022         int h = newImg.dimensionSize(2);
00023         double s = Math.min(getSize().width / (double)w,
00024                             getSize().height / (double)h);
00025         _imageW = (int)(s * w);
00026         _imageH = (int)(s * h);
00027         HxCorba.ImageRep smallImg = newImg.scale(s,s, HxCorba.GeoIntType.LINEAR);
00028         _image = Images.imageFromStub(smallImg);
00029     }
00030     repaint();
00031 }

void DisplayComponent::clear   [inline]
 

00034 {
00035     _image = null;
00036     repaint();
00037 }

void DisplayComponent::paint Graphics    g [inline]
 

00040 {
00041     if(_image != null)
00042         g.drawImage(_image, (getSize().width - _imageW) / 2,
00043             (getSize().height - _imageH) / 2, this);
00044 }


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:19 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001