本文整理汇总了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(" ", " ").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();
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例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
}
示例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
}
示例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();
}
}
示例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
}
示例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);
}
示例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;
}
示例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;
}
示例13: getPaintColor
import org.netbeans.swing.plaf.LFCustoms; //导入依赖的package包/类
Color getPaintColor() {
return LFCustoms.shiftColor(COLOR);
}
示例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;
}
}
示例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);
}