本文整理汇总了Java中edu.umd.cs.findbugs.gui2.Debug类的典型用法代码示例。如果您正苦于以下问题:Java Debug类的具体用法?Java Debug怎么用?Java Debug使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Debug类属于edu.umd.cs.findbugs.gui2包,在下文中一共展示了Debug类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setJComponentBGandFG
import edu.umd.cs.findbugs.gui2.Debug; //导入依赖的package包/类
public static void setJComponentBGandFG(Container jc) {
try {
applyColorSchemaTo (jc);
for (Component childComponent : jc.getComponents()) {
applyColorSchemaTo (childComponent);
if (childComponent instanceof Container) {
setJComponentBGandFG ((Container)childComponent);
}
}
}
catch (Exception e) {
Debug.println("something went wrong when applying theme");
Debug.println(e);
}
}
示例2: JavaSourceDocument
import edu.umd.cs.findbugs.gui2.Debug; //导入依赖的package包/类
public JavaSourceDocument(String title, Reader in, SourceFile theSource) throws IOException {
doc = new DefaultStyledDocument();
this.title = title;
this.sourceFile = theSource;
Debug.println("Created JavaSourceDocument for " + title);
try {
dek.read(in, doc, 0);
} catch (BadLocationException e) {
throw new RuntimeException(e);
}
in.close();
doc.putProperty(Document.TitleProperty, title);
root = doc.getDefaultRootElement();
Toolkit toolkit = Toolkit.getDefaultToolkit();
FontMetrics fontMetrics = toolkit.getFontMetrics(sourceFont);
TabStop[] tabs = new TabStop[50];
float width = fontMetrics.stringWidth(" ");
int tabSize = GUISaveState.getInstance().getTabSize();
for (int i = 0; i < tabs.length; i++)
tabs[i] = new TabStop(width * (tabSize + tabSize * i));
TAB_SET = new TabSet(tabs);
StyleConstants.setTabSet(commentAttributes, TAB_SET);
StyleConstants.setTabSet(javadocAttributes, TAB_SET);
StyleConstants.setTabSet(quotesAttributes, TAB_SET);
StyleConstants.setTabSet(keywordsAttributes, TAB_SET);
StyleConstants.setTabSet(commentAttributes, TAB_SET);
StyleConstants.setTabSet(whiteAttributes, TAB_SET);
StyleConstants.setFontFamily(whiteAttributes, sourceFont.getFamily());
StyleConstants.setFontSize(whiteAttributes, sourceFont.getSize());
StyleConstants.setLeftIndent(whiteAttributes, NumberedParagraphView.NUMBERS_WIDTH);
doc.setParagraphAttributes(0, doc.getLength(), whiteAttributes, true);
JavaScanner parser = new JavaScanner(new DocumentCharacterIterator(doc));
while (parser.next() != JavaScanner.EOF) {
int kind = parser.getKind();
switch (kind) {
case JavaScanner.COMMENT:
doc.setCharacterAttributes(parser.getStartPosition(), parser.getLength(), commentAttributes, true);
break;
case JavaScanner.KEYWORD:
doc.setCharacterAttributes(parser.getStartPosition(), parser.getLength(), keywordsAttributes, true);
break;
case JavaScanner.JAVADOC:
doc.setCharacterAttributes(parser.getStartPosition(), parser.getLength(), javadocAttributes, true);
break;
case JavaScanner.QUOTE:
doc.setCharacterAttributes(parser.getStartPosition(), parser.getLength(), quotesAttributes, true);
break;
}
}
}