return menuBar;
}
private synchronized void loadImage(AbstractFile file) throws IOException {
FileFrame frame = getFrame();
frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
int read;
byte buffer[] = new byte[1024];
ByteArrayOutputStream bout = new ByteArrayOutputStream();
InputStream in = file.getInputStream();
while ((read=in.read(buffer, 0, buffer.length))!=-1)
bout.write(buffer, 0, read);
byte imageBytes[] = bout.toByteArray();
bout.close();
in.close();
this.scaledImage = null;
this.image = imageViewerImpl.getToolkit().createImage(imageBytes);
waitForImage(image);
int width = image.getWidth(null);
int height = image.getHeight(null);
this.zoomFactor = 1.0;
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
while(width>d.width || height>d.height) {
width = width/2;
height = height/2;
zoomFactor = zoomFactor/2;
}
if(zoomFactor==1.0)
this.scaledImage = image;
else
zoom(zoomFactor);
checkZoom();
frame.setCursor(Cursor.getDefaultCursor());
}