EventCellRenderer.java
2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package org.emercit.model;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.Image;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class EventCellRenderer implements TableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
MdlEvent event = (MdlEvent) value;
JPanel panel = new JPanel();
panel.setLayout(null);
// Row1
// DateTime
JLabel lblTitleDateTime = new JLabel();
lblTitleDateTime.setBounds(5, 0, 170, 17);
lblTitleDateTime.setForeground(Color.BLUE);
lblTitleDateTime.setIcon(event.getIconDateTimeSmall());
lblTitleDateTime.setText(event.getDateTime());
panel.add(lblTitleDateTime);
// Title Status
JLabel lblTitleStatus = new JLabel();
lblTitleStatus.setBounds(185, 0, 300, 17);
lblTitleStatus.setForeground(event.getColorStatus());
lblTitleStatus.setText(event.getTitleStatusForConfirm());
lblTitleStatus.setIcon(event.getIconStatusSmall());
panel.add(lblTitleStatus);
// TitleRiver
JLabel lblTitleRiver = new JLabel();
lblTitleRiver.setBounds(500, 0, 250, 17);
lblTitleRiver.setForeground(Color.BLUE);
lblTitleRiver.setText(event.getTitleRiver());
lblTitleRiver.setIcon(event.getIconRiverSmall());
panel.add(lblTitleRiver);
// Row2
// TitileAGK
JLabel lblTitleAgk = new JLabel();
lblTitleAgk.setBounds(5, 18, 80, 17);
lblTitleAgk.setForeground(Color.BLUE);
lblTitleAgk.setText(event.getTitleAgk());
lblTitleAgk.setFont(new Font(null, Font.ITALIC, 11));
panel.add(lblTitleAgk);
// Title Repair
JLabel lblTitleRepair = new JLabel();
lblTitleRepair.setBounds(100, 18, 170, 17);
lblTitleRepair.setForeground(Color.BLUE);
lblTitleRepair.setIcon(event.getIconRepairSmall());
lblTitleRepair.setText(event.getTitleRepair());
lblTitleRepair.setFont(new Font(null, Font.ITALIC, 11));
panel.add(lblTitleRepair);
// Title box
JLabel lblTitleBox = new JLabel();
lblTitleBox.setBounds(280, 18, 170, 17);
lblTitleBox.setForeground(Color.BLUE);
lblTitleBox.setIcon(event.getIconOpenDoorSmall());
lblTitleBox.setText(event.getTitleOpenDorr());
lblTitleBox.setFont(new Font(null, Font.ITALIC, 11));
panel.add(lblTitleBox);
// Title veracity
JLabel lblTitleVeracity = new JLabel();
lblTitleVeracity.setBounds(450, 18, 200, 17);
lblTitleVeracity.setForeground(Color.BLUE);
lblTitleVeracity.setIcon(event.getIconVeracitySmall());
lblTitleVeracity.setText(event.getTitleVeracity());
lblTitleVeracity.setFont(new Font(null, Font.ITALIC, 11));
panel.add(lblTitleVeracity);
panel.setBackground(event.getColorLogPanel());
return panel;
}
}