1 package com.explosion.datastream.exql.gui.table.editandrender;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import java.awt.Color;
24 import java.awt.Graphics;
25 import java.awt.font.TextAttribute;
26 import java.util.HashMap;
27 import java.util.Map;
28
29 import javax.swing.JTable;
30
31 import com.explosion.datastream.exql.EXQLConstants;
32 import com.explosion.datastream.exql.EXQLModuleManager;
33 import com.explosion.expfmodules.rdbmsconn.dbom.DBEntityColumn;
34
35
36 /***
37 * @author Steve.Cowx
38 * Used for rendering cells in rows that are scheduled for deletion
39 */
40 public class DeletedValueCellRenderer extends DisplayValueCellRenderer {
41
42 public DeletedValueCellRenderer(DBEntityColumn dbColumn, JTable table) {
43 super(dbColumn, table);
44 this.setFont(table.getFont());
45
46 fore = (Color) EXQLModuleManager.instance().getPreference(
47 EXQLConstants.TABLE_EDIT_DELETED_COLORS_FOREGROUND).getValue();
48 back = (Color) EXQLModuleManager.instance().getPreference(
49 EXQLConstants.TABLE_EDIT_DELETED_COLORS_BACKGROUND).getValue();
50 Map map = new HashMap();
51 map.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
52
53 this.setFont(this.getFont().deriveFont(map));
54 this.setBackground(back);
55 this.setForeground(fore);
56 }
57
58 public void paint(Graphics g) {
59 super.paint(g);
60 Color fore = (Color) EXQLModuleManager.instance().getPreference(
61 EXQLConstants.TABLE_EDIT_DELETED_COLORS_FOREGROUND).getValue();
62 g.setColor(fore);
63 g.drawLine(0, this.getHeight() / 2, this.getWidth(),
64 this.getHeight() / 2);
65 }
66 }