setExtendedState(JFrame.MAXIMIZED_BOTH);
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
pagePreview.addMouseWheelListener(new MouseWheelZoomListener(pagePreview));
JMenuBar menuBar = new JMenuBar();
JMenu menuFile = new JMenu();
menuFile.setText(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(), "File"));
menuFile.setMnemonic(KeyEvent.VK_F);
JMenuItem saveAsItem = new JMenuItem();
saveAsItem.setAction(new SaveImageAction(pagePreview, this));
JMenuItem closeItem = new JMenuItem();
closeItem.setAction(new HideFrameAction(this));
JMenu menuImage = new JMenu();
menuImage.setText(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(), "Image"));
menuImage.setMnemonic(KeyEvent.VK_I);
// zoom
JMenuItem zoomInItem = new JMenuItem();
ZoomInImageAction zoomIn = new ZoomInImageAction(pagePreview);
ZoomOutImageAction zoomOut = new ZoomOutImageAction(pagePreview);
ZoomResetImageAction zoomReset = new ZoomResetImageAction(pagePreview);
zoomInItem.setAction(zoomIn);
JMenuItem zoomOutItem = new JMenuItem();
zoomOutItem.setAction(zoomOut);
JMenuItem zoomNone = new JMenuItem();
zoomNone.setAction(zoomReset);
// rotate
JMenuItem rotateRight = new JMenuItem();
RotateRightImageAction rotateRightAction = new RotateRightImageAction(pagePreview);
RotateLeftImageAction rotateLeftAction = new RotateLeftImageAction(pagePreview);
rotateRight.setAction(rotateRightAction);
JMenuItem rotateLeft = new JMenuItem();
rotateLeft.setAction(rotateLeftAction);
menuFile.add(saveAsItem);
menuFile.add(closeItem);
menuBar.add(menuFile);
menuImage.add(zoomInItem);
menuImage.add(zoomOutItem);
menuImage.add(zoomNone);
menuImage.addSeparator();
menuImage.add(rotateRight);
menuImage.add(rotateLeft);
menuBar.add(menuImage);
getRootPane().setJMenuBar(menuBar);
JToolBar toolBar = new JToolBar("Toolbar", JToolBar.HORIZONTAL);
toolBar.setFloatable(true);
toolBar.setRollover(true);