📄 staxmonitortablecellrenderer.java
字号:
/*****************************************************************************//* Software Testing Automation Framework (STAF) *//* (C) Copyright IBM Corp. 2002 *//* *//* This software is licensed under the Common Public License (CPL) V1.0. *//*****************************************************************************/package com.ibm.staf.service.stax;import java.awt.*;import javax.swing.*;import javax.swing.table.*;import javax.swing.border.*;import java.util.*;import java.io.*;public class STAXMonitorTableCellRenderer extends JTextArea implements TableCellRenderer { public java.awt.Color foregroundColor; public boolean header = false; public Hashtable rowHeights = new Hashtable(); public static String fontName = "Dialog"; // Default font public Font tableFont = new Font(fontName, Font.PLAIN, 12); public JTable theTable; public boolean sizeUpdated = false; public STAXMonitorTableCellRenderer() { super(); } public STAXMonitorTableCellRenderer(java.awt.Color foreground) { this(foreground, false); } public STAXMonitorTableCellRenderer(java.awt.Color foreground, boolean header) { this(foreground, header, new Font(fontName, Font.PLAIN, 12)); } public STAXMonitorTableCellRenderer(java.awt.Color foreground, boolean header, Font font) { setOpaque(true); setFont(font); setBorder(BorderFactory.createRaisedBevelBorder()); foregroundColor = foreground; this.header = header; if (header) { setBackground(Color.lightGray); } else { setBackground(Color.white); } } public void clearRowHeights() { rowHeights.clear(); } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) { theTable = table; setText((value == null) ? "" : String.valueOf(value)); if (!header) { if (isSelected) { setBackground(UIManager.getColor("List.selectionBackground")); } else { setBackground(Color.white); } } return this; } public Color getForeground() { return foregroundColor; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -