private void createGUI()
{
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(screenWidth, screenHeight - 30);
this.setLayout(border);
this.mainPanel.setLayout(border);
this.createSplitPane();
bildLabel.setIcon(createImageIcon(2, Zoom.vergroessern));
bildLabel.repaint();
}
private void createSplitPane()
{
this.createListScrollPane();
this.createPictureScrollPane();
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
listScrollPane, pictureScrollPane);
splitPane.setOneTouchExpandable(true);
splitPane.setDividerLocation(150);
Dimension minimumSize = new Dimension(100, 50);
listScrollPane.setMinimumSize(minimumSize);
pictureScrollPane.setMinimumSize(minimumSize);
this.add(this.splitPane);
this.createPictureScrollPane();
}
private void createListScrollPane()
{
list = new JList(this.getListItems());
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.setLayoutOrientation(JList.VERTICAL_WRAP);
list.setVisibleRowCount(-1);
this.listScrollPane = new JScrollPane(list);
this.listScrollPane.setPreferredSize(new Dimension(250, 80));
}
private void createPictureScrollPane()
{
this.pictureScrollPane = new JScrollPane(bildLabel);
this.pictureScrollPane.setPreferredSize(new Dimension(300,300));
}
private ImageIcon createImageIcon(int faktor, Zoom z)
{
this.loadImage();
if (faktor <= 0)
{
faktor = 1;
}
if (z == Zoom.verkleinern)
{
bimage = new BufferedImage(image.getWidth(null) / faktor, image.getHeight(null) / faktor, BufferedImage.TYPE_INT_RGB);
bimage.getGraphics().drawImage(image, 0, 0, image.getWidth(null) / faktor, image.getHeight(null) / faktor, null);
}
else
{
bimage = new BufferedImage(image.getWidth(null) * faktor, image.getHeight(null) * faktor, BufferedImage.TYPE_INT_RGB);
bimage.getGraphics().drawImage(image, 0, 0, image.getWidth(null) * faktor, image.getHeight(null) * faktor, null);
}
return new ImageIcon(bimage);
}