public void widgetDefaultSelected(SelectionEvent e) {
}
};
PaintListener pl = new PaintListener() {
public void paintControl(PaintEvent e) {
int border = 4;
String colorStr = Settings.getSettings().getOutputColors()
.get(e.widget.getData());
e.gc.setBackground(customs.colors.get(colorStr));
e.gc.fillRectangle(border, border, e.width - 2 * border,
e.height - 2 * border);
}
};
for (Combo c : messageColorCombos) {
c.add("white");
c.add("black");
c.add("dark blue");
c.add("dark green");
c.add("red");
c.add("brown");
c.add("purple");
c.add("olive");
c.add("yellow");
c.add("green");
c.add("teal");
c.add("cyan");
c.add("blue");
c.add("magenta");
c.add("dark gray");
c.add("light gray");
String colorStr = Settings.getSettings().getOutputColors()
.get((Short) c.getData());
c.setText(colorStr);
c.addSelectionListener(IRCColorListener);
c.addPaintListener(pl);
}
List<Button> statusColorButtons = new ArrayList<Button>();
Group grpRoomStatusColors = new Group(this, SWT.NONE);
grpRoomStatusColors.setText("Room Status Colors");
grpRoomStatusColors.setBounds(218, 10, 202, 177);
Label lblNormal = new Label(grpRoomStatusColors, SWT.NONE);
lblNormal.setText("Normal");
lblNormal.setBounds(10, 23, 85, 15);
Button btnNormal = new Button(grpRoomStatusColors, SWT.NONE);
btnNormal.setBounds(117, 18, 75, 25);
btnNormal.setData(Room.NORMAL);
statusColorButtons.add(btnNormal);
Label lblNewIrcEvent = new Label(grpRoomStatusColors, SWT.NONE);
lblNewIrcEvent.setText("New IRC Event");
lblNewIrcEvent.setBounds(10, 56, 85, 15);
Button btnIRCEvent = new Button(grpRoomStatusColors, SWT.NONE);
btnIRCEvent.setBounds(117, 51, 75, 25);
btnIRCEvent.setData(Room.NEW_IRC_EVENT);
statusColorButtons.add(btnIRCEvent);
Label lblNewMessage = new Label(grpRoomStatusColors, SWT.NONE);
lblNewMessage.setText("New Message");
lblNewMessage.setBounds(10, 87, 85, 15);
Button btnNewMSG = new Button(grpRoomStatusColors, SWT.NONE);
btnNewMSG.setBounds(117, 82, 75, 25);
btnNewMSG.setData(Room.NEW_MESSAGE);
statusColorButtons.add(btnNewMSG);
Label lblNameCalled = new Label(grpRoomStatusColors, SWT.NONE);
lblNameCalled.setText("Name Called");
lblNameCalled.setBounds(10, 118, 85, 15);
Button btnNameCall = new Button(grpRoomStatusColors, SWT.NONE);
btnNameCall.setBounds(117, 113, 75, 25);
btnNameCall.setData(Room.NAME_CALLED);
statusColorButtons.add(btnNameCall);
PaintListener colorPainter = new PaintListener() {
public void paintControl(PaintEvent e) {
int border = 6;
RGB rgb = Settings.getSettings().getRoomStatusColors()
.get(e.widget.getData());
e.gc.setBackground(SWTResourceManager.getColor(rgb));