当前位置: 首页>>代码示例>>Java>>正文


Java LFCustoms类代码示例

本文整理汇总了Java中org.netbeans.swing.plaf.LFCustoms的典型用法代码示例。如果您正苦于以下问题:Java LFCustoms类的具体用法?Java LFCustoms怎么用?Java LFCustoms使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LFCustoms类属于org.netbeans.swing.plaf包,在下文中一共展示了LFCustoms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: color

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
private static String color(String string, AttributeSet set) {
    if (set == null) {
        return string;
    }
    if (string.trim().length() == 0) {
        return string.replace(" ", "&nbsp;").replace("\n", "<br>"); //NOI18N
    }
    StringBuffer buf = new StringBuffer(string);
    if (StyleConstants.isBold(set)) {
        buf.insert(0, "<b>"); //NOI18N
        buf.append("</b>"); //NOI18N
    }
    if (StyleConstants.isItalic(set)) {
        buf.insert(0, "<i>"); //NOI18N
        buf.append("</i>"); //NOI18N
    }
    if (StyleConstants.isStrikeThrough(set)) {
        buf.insert(0, "<s>"); // NOI18N
        buf.append("</s>"); // NOI18N
    }
    buf.insert(0, "<font color=" + getHTMLColor(LFCustoms.getForeground(set)) + ">"); //NOI18N
    buf.append("</font>"); //NOI18N
    return buf.toString();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:UIUtilities.java

示例2: getLeftHtmlText

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
@Override
protected String getLeftHtmlText() {
    if (leftText == null) {
        StringBuilder lText = new StringBuilder();
        lText.append(LFCustoms.getTextFgColorHTML());
        lText.append(BOLD);
        lText.append(name);
        lText.append(BOLD_END);
        lText.append(COLOR_END);
        lText.append('(');
        if (setter) {
            lText.append(escape(typeName));
            lText.append(' ');
            lText.append(PARAMETER_NAME_COLOR);
            lText.append(paramName);
            lText.append(COLOR_END);
        }
        lText.append(") - "); //NOI18N
        lText.append(GENERATE_TEXT);
        leftText = lText.toString();
    }
    return leftText;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:JavaCompletionItem.java

示例3: getLhsHtml

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
@Override
public String getLhsHtml(HtmlFormatter formatter) {
    switch (handle.getType()) {
        case VARIABLE_GLOBAL_DECLARATION:
        case MIXIN_DECLARATION:
            formatter.appendHtml("<font color=");
            formatter.appendHtml(WebUIUtils.toHexCode(LFCustoms.shiftColor(COLOR)));
            formatter.appendHtml("><b>"); //NOI18N
            break;
    }
    
    formatter.appendText(getName());
    
    switch (handle.getType()) {
        case MIXIN_DECLARATION:
        case VARIABLE_GLOBAL_DECLARATION:
            formatter.appendHtml("</b></font>"); //NOI18N);
            break;
    }
    
    return formatter.getText();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:CPCompletionItem.java

示例4: paintBorder

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
public void paintBorder(Component c, Graphics g, int x, int y,
int w, int h) {
    g.translate(x, y);
    Color borderC = UIManager.getColor (LFCustoms.SCROLLPANE_BORDER_COLOR);
    g.setColor(borderC);
    // top
    if ((type & TOP) != 0) {
        g.drawLine(0, 0, w - 1, 0);
    }
    // left side
    if ((type & LEFT) != 0) {
        g.drawLine(0, 0, 0, h - 1);
    }
    // right side
    if ((type & RIGHT) != 0) {
        g.drawLine(w - 1, 0, w - 1, h - 1);
    }

    g.translate(-x, -y);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:StatusLineBorder.java

示例5: render

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
@Override
public void render(Graphics g, Font defaultFont, Color defaultColor, Color backgroundColor, int width, int height, boolean selected) {
    CompletionUtilities.renderHtml(LOADING_ICON, getText(), 
            null, 
            g, 
            defaultFont, 
            LFCustoms.shiftColor(defaultColor),
            width, 
            height, 
            selected);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:CompletionQuery.java

示例6: getHTMLColor

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
private static String getHTMLColor(int r, int g, int b) {
    Color c = LFCustoms.shiftColor(new Color(r, g, b));
    return "<font color=#" //NOI18N
            + LFCustoms.getHexString(c.getRed())
            + LFCustoms.getHexString(c.getGreen())
            + LFCustoms.getHexString(c.getBlue())
            + ">"; //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:SpringXMLConfigCompletionItem.java

示例7: getHTMLColor

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
public static String getHTMLColor(int r, int g, int b) {
    Color c = LFCustoms.shiftColor(new Color(r, g, b));
    return "<font color=#" //NOI18N
            + LFCustoms.getHexString(c.getRed())
            + LFCustoms.getHexString(c.getGreen())
            + LFCustoms.getHexString(c.getBlue())
            + ">"; //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:Utilities.java

示例8: getRhsHtml

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
@Override
public String getRhsHtml(HtmlFormatter formatter) {
    if(origin == null) {
        return super.getRhsHtml(formatter);
    } else {
        formatter.appendHtml("<font color=");
        formatter.appendHtml(WebUIUtils.toHexCode(LFCustoms.shiftColor(ORIGIN_COLOR)));
        formatter.appendHtml(">");
        formatter.appendText(origin);
        formatter.appendHtml("</font>"); //NOI18N
        return formatter.getText();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CPCompletionItem.java

示例9: getHtmlColor

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
private static String getHtmlColor(int r, int g, int b) {
    Color c = LFCustoms.shiftColor(new Color(r, g, b));
    return "<font color=#" //NOI18N
            + LFCustoms.getHexString(c.getRed())
            + LFCustoms.getHexString(c.getGreen())
            + LFCustoms.getHexString(c.getBlue())
            + ">"; //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:SQLCompletionItem.java

示例10: ElementResultItem

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
/**
 * Create a start element result item.
 */
public ElementResultItem(int position, GrammarResult res){
    super(position, res.getNodeName());
    this.res = res;
    foreground = LFCustoms.shiftColor(COLOR);
    startElement = true;
    empty = res.isEmptyElement();
    icon = res.getIcon(BeanInfo.ICON_COLOR_16x16);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ElementResultItem.java

示例11: getDefaultColorError

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
static Color getDefaultColorError() {
    Color err = UIManager.getColor("nb.output.err.foreground");     //NOI18N
    if (err == null) {
        err = LFCustoms.shiftColor(Color.red);
    }
    return err;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:OutputOptions.java

示例12: getDefaultColorLink

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
static Color getDefaultColorLink() {
    Color hyperlink = UIManager.getColor(
            "nb.output.link.foreground");                           //NOI18N
    if (hyperlink == null) {
        hyperlink = LFCustoms.shiftColor(Color.blue);
    }
    return hyperlink;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:OutputOptions.java

示例13: getPaintColor

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
Color getPaintColor() { 
    return LFCustoms.shiftColor(COLOR);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:CompletionResultItem.java

示例14: MethodItem

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
private MethodItem(CompilationInfo info, ExecutableElement elem, ExecutableType type, TypeMirror castType, int substitutionOffset, ReferencesCount referencesCount, boolean isInherited, boolean isDeprecated, boolean inImport, boolean addSemicolon, boolean smartType, int assignToVarOffset, boolean memberRef, WhiteListQuery.WhiteList whiteList) {
    super(substitutionOffset, ElementHandle.create(elem), whiteList);
    Color c = LFCustoms.getTextFgColor();
    this.isInherited = isInherited;
    this.isDeprecated = isDeprecated;
    this.inImport = inImport;
    this.smartType = smartType;
    this.memberRef = memberRef;
    this.simpleName = elem.getSimpleName().toString();
    this.modifiers = elem.getModifiers();
    this.params = new ArrayList<ParamDesc>();
    Iterator<? extends VariableElement> it = elem.getParameters().iterator();
    Iterator<? extends TypeMirror> tIt = type.getParameterTypes().iterator();
    while(it.hasNext() && tIt.hasNext()) {
        TypeMirror tm = tIt.next();
        if (tm == null) {
            break;
        }
        this.params.add(new ParamDesc(tm.toString(), Utilities.getTypeName(info, tm, false, elem.isVarArgs() && !tIt.hasNext()).toString(), it.next().getSimpleName().toString()));
    }
    TypeMirror retType = type.getReturnType();
    this.typeName = Utilities.getTypeName(info, retType, false).toString();
    this.addSemicolon = addSemicolon && retType.getKind() == TypeKind.VOID;
    this.autoImportEnclosingType = referencesCount != null;
    if (this.autoImportEnclosingType) {
        this.enclSortText = new LazySortText(elem.getEnclosingElement().getSimpleName().toString(), null, ElementHandle.create((TypeElement)elem.getEnclosingElement()), referencesCount);
    } else {
        this.enclSortText = ""; //NOI18N
    }
    this.startOffset = type.getReturnType().getKind() == TypeKind.VOID ? -1 : assignToVarOffset;
    this.assignToVarText = this.startOffset < 0 ? null : createAssignToVarText(info, type.getReturnType(), this.simpleName);
    if (castType != null) {
        try {
            if (this.startOffset < 0) {
                TreePath tp = info.getTreeUtilities().pathFor(substitutionOffset);
                if (tp != null && tp.getLeaf().getKind() == Tree.Kind.MEMBER_SELECT) {
                    this.startOffset = (int)info.getTrees().getSourcePositions().getStartPosition(tp.getCompilationUnit(), tp.getLeaf());
                }
            }
            this.castText = "(" + Utilities.getTypeName(info, castType, false) + (CodeStyle.getDefault(info.getDocument()).spaceAfterTypeCast() ? ") " : ")"); //NOI18N
            this.castEndOffset = findCastEndPosition(info.getTokenHierarchy().tokenSequence(JavaTokenId.language()), startOffset, substitutionOffset);
        } catch (IOException ex) {
        }
    } else {
        this.castEndOffset = -1;
    }           
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:JavaCompletionItem.java

示例15: paintBorder

import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
    Color borderC = UIManager.getColor (LFCustoms.SCROLLPANE_BORDER_COLOR);
    g.setColor(borderC);
    g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:EditorToolbarBorder.java


注:本文中的org.netbeans.swing.plaf.LFCustoms类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。