rowForegroundColorComboBox.setToolTipText("Font color");
rowForegroundColorComboBox.setMaximumRowCount(5);
rowForegroundColorComboBox.setPreferredSize(new Dimension(50, 20));
rowForegroundColorComboBox.setSelectedIndex(0);
rowForegroundColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,
Object obj, int arg2, boolean arg3, boolean arg4) {
if (obj instanceof Color) {
myColorPanel.setColor((Color) obj);
return myColorPanel;
}
return new JPanel();
}
});
// Attach listener to show colors in combo box.
rowForegroundColorComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
controller.setRowHeaderFontColor(Color.class.cast(rowForegroundColorComboBox.getSelectedItem()));
}
});
columnForegroundColorComboBox = new JComboBox(TableFormattingConstants.ForegroundColors);
columnForegroundColorComboBox.setName("Column_colorComboBox");
setAccessibleName(columnForegroundColorComboBox,"COL_FONT_COLOR");
columnForegroundColorComboBox.setToolTipText("Font color");
columnForegroundColorComboBox.setMaximumRowCount(5);
columnForegroundColorComboBox.setPreferredSize(new Dimension(50, 20));
columnForegroundColorComboBox.setSelectedIndex(0);
columnForegroundColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,
Object obj, int arg2, boolean arg3, boolean arg4) {
if (obj instanceof Color) {
myColorPanel.setColor((Color) obj);
return myColorPanel;
}
return new JPanel();
}
});
// Attach listener to show border styles in combo box.
columnForegroundColorComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
controller.setColumnHeaderFontColor(Color.class.cast(columnForegroundColorComboBox.getSelectedItem()));
}
});
rowBackgroundColorComboBox = new JComboBox(TableFormattingConstants.ForegroundColors);
rowBackgroundColorComboBox.setName("Row_background_colorComboBox");
setAccessibleName(rowBackgroundColorComboBox,"ROW_BACKGROUND_COLOR");
rowBackgroundColorComboBox.setToolTipText("Background color");
rowBackgroundColorComboBox.setMaximumRowCount(5);
rowBackgroundColorComboBox.setPreferredSize(new Dimension(50, 20));
rowBackgroundColorComboBox.setSelectedIndex(0);
rowBackgroundColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,
Object obj, int arg2, boolean arg3, boolean arg4) {
if (obj instanceof Color) {
myColorPanel.setColor((Color) obj);
return myColorPanel;
}
return new JPanel();
}
});
// Attach listener to show colors in combo box.
rowBackgroundColorComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
controller.setRowHeaderBackgroundColor(Color.class.cast(rowBackgroundColorComboBox.getSelectedItem()));
}
});
rowHeaderBorderColorComboBox = new JComboBox(TableFormattingConstants.ForegroundColors);
rowHeaderBorderColorComboBox.setName("Row_header_border_colorComboBox");
setAccessibleName(rowHeaderBorderColorComboBox,"ROW_HEADER_BORDER_COLOR");
rowHeaderBorderColorComboBox.setToolTipText("Border color");
rowHeaderBorderColorComboBox.setMaximumRowCount(5);
rowHeaderBorderColorComboBox.setPreferredSize(new Dimension(50, 20));
rowHeaderBorderColorComboBox.setSelectedIndex(0);
rowHeaderBorderColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,
Object obj, int arg2, boolean arg3, boolean arg4) {
if (obj instanceof Color) {
myColorPanel.setColor((Color) obj);
return myColorPanel;
}
return new JPanel();
}
});
// Attach listener to show colors in combo box.
rowHeaderBorderColorComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
controller.setRowHeaderBorderColor(Color.class.cast(rowHeaderBorderColorComboBox.getSelectedItem()));
}
});
columnBackgroundColorComboBox = new JComboBox(TableFormattingConstants.ForegroundColors);
columnBackgroundColorComboBox.setName("Column_background_colorComboBox");
setAccessibleName(columnBackgroundColorComboBox,"COL_BACKGROUND_COLOR");
columnBackgroundColorComboBox.setToolTipText("Background color");
columnBackgroundColorComboBox.setMaximumRowCount(5);
columnBackgroundColorComboBox.setPreferredSize(new Dimension(50, 20));
columnBackgroundColorComboBox.setSelectedIndex(0);
columnBackgroundColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,
Object obj, int arg2, boolean arg3, boolean arg4) {
if (obj instanceof Color) {
myColorPanel.setColor((Color) obj);
return myColorPanel;
}
return new JPanel();
}
});
// Attach listener to show border styles in combo box.
columnBackgroundColorComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
controller.setColumnHeaderBackgroundColor(Color.class.cast(columnBackgroundColorComboBox.getSelectedItem()));
}
});
columnHeaderBorderColorComboBox = new JComboBox(TableFormattingConstants.ForegroundColors);
columnHeaderBorderColorComboBox.setName("Col_header_border_colorComboBox");
setAccessibleName(columnHeaderBorderColorComboBox,"COL_HEADER_BORDER_COLOR");
columnHeaderBorderColorComboBox.setToolTipText("Border color");
columnHeaderBorderColorComboBox.setMaximumRowCount(5);
columnHeaderBorderColorComboBox.setPreferredSize(new Dimension(50, 20));
columnHeaderBorderColorComboBox.setSelectedIndex(0);
columnHeaderBorderColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,
Object obj, int arg2, boolean arg3, boolean arg4) {
if (obj instanceof Color) {
myColorPanel.setColor((Color) obj);
return myColorPanel;
}
return new JPanel();
}
});
// Attach listener to show colors in combo box.
columnHeaderBorderColorComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
controller.setColumnHeaderBorderColor(Color.class.cast(columnHeaderBorderColorComboBox.getSelectedItem()));
}
});
cellFontColorComboBox = new JComboBox(TableFormattingConstants.ForegroundColors);
setAccessibleName(cellFontColorComboBox,"CELL_FONT_COLOR");
cellFontColorComboBox.setName("Cell_colorComboBox");
cellFontColorComboBox.setToolTipText("Font color");
cellFontColorComboBox.setMaximumRowCount(5);
cellFontColorComboBox.setPreferredSize(new Dimension(50, 20));
cellFontColorComboBox.setSelectedIndex(0);
cellFontColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,
Object obj, int arg2, boolean arg3, boolean arg4) {
if (obj instanceof Color) {
myColorPanel.setColor((Color) obj);
return myColorPanel;
}
return new JPanel();
}
});
// Attach listener to show border styles in combo box.
cellFontColorComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
controller.setCellFontColor(Color.class.cast(cellFontColorComboBox.getSelectedItem()));
}
});
cellBackgroundColorComboBox = new JComboBox(TableFormattingConstants.ForegroundColors);
setAccessibleName(cellBackgroundColorComboBox,"CELL_BACKGROUND_COLOR");
cellBackgroundColorComboBox.setName("Cell_BackgroundColorComboBox");
cellBackgroundColorComboBox.setToolTipText("Background color");
cellBackgroundColorComboBox.setMaximumRowCount(5);
cellBackgroundColorComboBox.setPreferredSize(new Dimension(50, 20));
cellBackgroundColorComboBox.setSelectedIndex(0);
cellBackgroundColorComboBox.setRenderer(new ListCellRenderer() {
private ColorPanel myColorPanel = new ColorPanel(new Color(0));
@Override
public Component getListCellRendererComponent(JList list,