annotationFeaturesViewer = new AnnotationFeaturesViewer();
annotationFeaturesPanel.add(annotationFeaturesViewer, BorderLayout.CENTER);
JPanel iconPanel = new JPanel();
addTableEntryButton = new ImageButton(Images.FORWARD);
addTableEntryButton.setToolTipText("Create stylemap table entry");
addTableEntryButton.addActionListener(this);
iconPanel.add(addTableEntryButton);
annotationFeaturesPanel.add(iconPanel, BorderLayout.EAST);
JPanel tablePanel = new JPanel();
tablePanel.setLayout(new BorderLayout());
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true,
annotationFeaturesPanel, tablePanel);
Dimension screenDimension = getToolkit().getScreenSize();
splitPane.setDividerLocation((int) (screenDimension.width * 0.28));
okButton.setToolTipText("Save stylemap and exit");
cancelButton.setToolTipText("Exit without saving");
resetButton.setToolTipText("Reset stylemap to that auto-generated from metadata");
JPanel buttonsPanel = new JPanel();
buttonsPanel.add(okButton);
buttonsPanel.add(cancelButton);
buttonsPanel.add(resetButton);
getContentPane().add(splitPane, BorderLayout.CENTER);
getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
// creating a jtable to hold the styles
tableModel = new StyleMapTableModel(StyleConstants.columnNames);
med = new TableGUIMediator();
annotationsTable = new StyleMapTable(tableModel, annotationFeaturesViewer, this, med);
med.setTable(annotationsTable);
annotationsTable.setDefaultRenderer(Color.class, new ColorRenderer(annotationsTable));
setUpColorEditor(annotationsTable);
annotationsTable.setDefaultEditor(String.class, new LabelCellEditor());
final JScrollPane scrollPane = new JScrollPane();
scrollPane.getViewport().add(annotationsTable, null);
tablePanel.add(scrollPane, BorderLayout.CENTER);
JPanel tableButtonsPanel = new JPanel();
moveRowUpButton = new ImageButton(Images.UP);
moveRowUpButton.setToolTipText("Move Row Up");
moveRowUpButton.addActionListener(this);
tableButtonsPanel.add(moveRowUpButton);
moveRowDownButton = new ImageButton(Images.DOWN);
moveRowDownButton.setToolTipText("Move Row Down");
moveRowDownButton.addActionListener(this);
tableButtonsPanel.add(moveRowDownButton);
removeTableRowButton = new ImageButton(Images.ROW_DELETE);
removeTableRowButton.setToolTipText("Delete Row");
removeTableRowButton.addActionListener(this);
tableButtonsPanel.add(removeTableRowButton);
// pass all these to the mediator which turns them on and off