gumpList.setCellRenderer(new GradientListCellRenderer(false));
gumpList.setFixedCellWidth(100);
gumpList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
AbstractGump drawnGump = previewCanvas.getGumpAt(0);
if (drawnGump != null) {
drawnGump.setImage(null);
}
drawnGump = (Gump) gumpList.getSelectedValue();
if (drawnGump != null) {
actionWrapper.exportAction.setEnabled(true);
} else {
actionWrapper.exportAction.setEnabled(false);
}
previewCanvas.setGumpAt(drawnGump, 0);
previewCanvas.repaint();
}
});
JScrollPane scrollPane = new JScrollPane(gumpList);
scrollPane.setBorder(null);
// set scroll pane and viewport transparent
scrollPane.setOpaque(false);
scrollPane.getViewport().setOpaque(false);
// make scroll bar transparent
scrollPane.getVerticalScrollBar().setBorder(null);
scrollPane.getVerticalScrollBar().setUI(new TransparentScrollBarUI());
scrollPane.getVerticalScrollBar().setOpaque(false);
scrollPane
.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
gumpListPanel.add(scrollPane, BorderLayout.CENTER);
JPanel filterPanel = new JPanel();
filterPanel.setOpaque(false);
filterGroup = new ButtonGroup();
JRadioButton allButton = new JRadioButton(resourceBundle
.getString("UOGumpViewer.Label.All"), true);
allButton.setOpaque(false);
allButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gumpList.setListData(gumpVector);
repaint();
}
});
filterGroup.add(allButton);
filterPanel.add(allButton);
newButton = new JRadioButton(resourceBundle
.getString("UOGumpViewer.Label.New"));
newButton.setOpaque(false);
newButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Vector<Gump> newGumpVector = filterOutOldGumps();
gumpList.setListData(newGumpVector);
repaint();
}
});
filterGroup.add(newButton);
filterPanel.add(newButton);
gumpListPanel.add(filterPanel, BorderLayout.NORTH);
JButton addButton = new JButton(actionWrapper.addAction);
addButton.setOpaque(false);
JToolBar gumpButtonBar = new JToolBar();
gumpButtonBar.setFloatable(false);
gumpButtonBar.setOpaque(false);
gumpButtonBar.setRollover(true);
gumpButtonBar.add(addButton);
gumpListPanel.add(gumpButtonBar, BorderLayout.SOUTH);
contentPane.add(gumpListPanel, BorderLayout.WEST);
// EAST: Gump preview and gumps to view list
JPanel gumpPreviewPanel = new JPanel();
gumpPreviewPanel.setOpaque(false);
gumpPreviewPanel.setLayout(new BorderLayout());
previewCanvas.setPreferredSize(new Dimension(200, 200));
gumpPreviewPanel.add(previewCanvas, BorderLayout.NORTH);
paperdollList.setBackground(Color.BLACK);
paperdollList.setCellRenderer(new GradientListCellRenderer(false));
paperdollList.setFixedCellWidth(100);
paperdollList.addListSelectionListener(this);
paperdollList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
AbstractGump drawnGump = (Gump) paperdollList.getSelectedValue();
if (drawnGump != null) {
actionWrapper.colorizeAction.setEnabled(true);
actionWrapper.decolorizeAction.setEnabled(true);
actionWrapper.visibleAction.setEnabled(true);
} else {