use of java.awt.Color in project cogtool by cogtool.
the class AbstractAcceptListener method signalViolation.
protected void signalViolation(String msg) {
final Color bg = _field.getBackground();
_field.setBackground(Binding.INVALID_COLOR);
MainFrame.getInstance().warn(msg);
_field.setBackground(bg);
_field.requestFocusInWindow();
}
use of java.awt.Color in project checkstyle by checkstyle.
the class InputSemantic method otherInstantiations.
void otherInstantiations() {
// instantiation of classes in the same package
Object o1 = new InputBraces();
Object o2 = new InputModifier();
// classes in another package with .* import
ByteArrayOutputStream s = new ByteArrayOutputStream();
File f = new File("/tmp");
// classes in another package with explicit import
Dimension dim = new Dimension();
Color col = new Color(0, 0, 0);
}
use of java.awt.Color in project checkstyle by checkstyle.
the class InputSemantic method otherInstantiations.
void otherInstantiations() {
// instantiation of classes in the same package
Object o1 = new InputBraces();
Object o2 = new InputModifier();
// classes in another package with .* import
ByteArrayOutputStream s = new ByteArrayOutputStream();
File f = new File("/tmp");
// classes in another package with explicit import
Dimension dim = new Dimension();
Color col = new Color(0, 0, 0);
}
use of java.awt.Color in project jersey by jersey.
the class MainWindow method createRequestStatusLabel.
private JLabel createRequestStatusLabel() {
final JLabel label = new JLabel(" ");
invokeAndWait(new Runnable() {
@Override
public void run() {
label.setBackground(PROGRESS_COLOR);
label.setToolTipText("Running...");
label.setBorder(javax.swing.BorderFactory.createLineBorder(new Color(0, 0, 0)));
label.setOpaque(true);
messagePanel.add(label);
messagePanel.revalidate();
}
});
return label;
}
use of java.awt.Color in project Openfire by igniterealtime.
the class ConversationUtils method buildPDFContent.
private ByteArrayOutputStream buildPDFContent(Conversation conversation, Map<String, Font> colorMap) {
Font roomEvent = FontFactory.getFont(FontFactory.HELVETICA, 12f, Font.ITALIC, new Color(0xFF, 0x00, 0xFF));
try {
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter writer = PdfWriter.getInstance(document, baos);
writer.setPageEvent(new PDFEventListener());
document.open();
Paragraph p = new Paragraph(LocaleUtils.getLocalizedString("archive.search.pdf.title", MonitoringConstants.NAME), FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD));
document.add(p);
document.add(Chunk.NEWLINE);
ConversationInfo coninfo = new ConversationUtils().getConversationInfo(conversation.getConversationID(), false);
String participantsDetail;
if (coninfo.getAllParticipants() == null) {
participantsDetail = coninfo.getParticipant1() + ", " + coninfo.getParticipant2();
} else {
participantsDetail = String.valueOf(coninfo.getAllParticipants().length);
}
Paragraph chapterTitle = new Paragraph(LocaleUtils.getLocalizedString("archive.search.pdf.participants", MonitoringConstants.NAME) + " " + participantsDetail, FontFactory.getFont(FontFactory.HELVETICA, 12, Font.BOLD));
document.add(chapterTitle);
Paragraph startDate = new Paragraph(LocaleUtils.getLocalizedString("archive.search.pdf.startdate", MonitoringConstants.NAME) + " " + coninfo.getDate(), FontFactory.getFont(FontFactory.HELVETICA, 12, Font.BOLD));
document.add(startDate);
Paragraph duration = new Paragraph(LocaleUtils.getLocalizedString("archive.search.pdf.duration", MonitoringConstants.NAME) + " " + coninfo.getDuration(), FontFactory.getFont(FontFactory.HELVETICA, 12, Font.BOLD));
document.add(duration);
Paragraph messageCount = new Paragraph(LocaleUtils.getLocalizedString("archive.search.pdf.messagecount", MonitoringConstants.NAME) + " " + conversation.getMessageCount(), FontFactory.getFont(FontFactory.HELVETICA, 12, Font.BOLD));
document.add(messageCount);
document.add(Chunk.NEWLINE);
Paragraph messageParagraph;
for (ArchivedMessage message : conversation.getMessages()) {
String time = JiveGlobals.formatTime(message.getSentDate());
String from = message.getFromJID().getNode();
if (conversation.getRoom() != null) {
from = message.getToJID().getResource();
}
String body = message.getBody();
String prefix;
if (!message.isRoomEvent()) {
prefix = "[" + time + "] " + from + ": ";
Font font = colorMap.get(message.getFromJID().toString());
if (font == null) {
font = colorMap.get(message.getFromJID().toBareJID());
}
if (font == null) {
font = FontFactory.getFont(FontFactory.HELVETICA, 12f, Font.BOLD, Color.BLACK);
}
messageParagraph = new Paragraph(new Chunk(prefix, font));
} else {
prefix = "[" + time + "] ";
messageParagraph = new Paragraph(new Chunk(prefix, roomEvent));
}
messageParagraph.add(body);
messageParagraph.add(" ");
document.add(messageParagraph);
}
document.close();
return baos;
} catch (DocumentException e) {
Log.error("error creating PDF document: " + e.getMessage(), e);
return null;
}
}
Aggregations