本文整理汇总了Java中org.jline.utils.AttributedStyle.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java AttributedStyle.DEFAULT属性的具体用法?Java AttributedStyle.DEFAULT怎么用?Java AttributedStyle.DEFAULT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jline.utils.AttributedStyle
的用法示例。
在下文中一共展示了AttributedStyle.DEFAULT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendLines
@Override
public void appendLines(List<AttributedString> lines, int width, int height) {
int startLines = lines.size();
if (state == State.Goto) {
AttributedStringBuilder addrPromptLine = new AttributedStringBuilder();
addrPromptLine.append('│');
addrPromptLine.append(addressField.getAddressPrompt());
AttributedStyle style = AttributedStyle.DEFAULT;
if (!addressField.isCurrentInputValid()) {
style = style.foreground(AttributedStyle.RED);
}
addrPromptLine.append(addressField.getCurrentInput(), style);
View.padToLength(addrPromptLine, width - 1);
addrPromptLine.append('│');
lines.add(addrPromptLine.toAttributedString());
AttributedStringBuilder addrPromptBottomLine = new AttributedStringBuilder();
addrPromptBottomLine.append('└');
View.horizontalLine(addrPromptBottomLine, width - 2);
addrPromptBottomLine.append('┘');
lines.add(addrPromptBottomLine.toAttributedString());
AttributedStringBuilder actionsLine = new AttributedStringBuilder();
actionsLine.append(" └Abort(");
actionsLine.append("q", AttributedStyle.DEFAULT.underline());
actionsLine.append(")┘ └Go(");
actionsLine.append("⏎", addressField.isCurrentInputValid() ? AttributedStyle.DEFAULT.underline() : AttributedStyle.DEFAULT);
actionsLine.append(")┘");
lines.add(actionsLine.toAttributedString());
} else {
AttributedStringBuilder gotoLine = new AttributedStringBuilder();
gotoLine.append(" └");
gotoLine.append("G", AttributedStyle.DEFAULT.underline());
gotoLine.append("oto┘");
lines.add(gotoLine.toAttributedString());
}
int remainingHeight = height - (lines.size() - startLines);
verticalBoxes.appendLines(lines, width, remainingHeight);
}
示例2: cell
@Override
protected void cell(AttributedStringBuilder asb, VSUChannel channel) {
AttributedStyle style = channel.useDuration() ? AttributedStyle.DEFAULT : AttributedStyle.DEFAULT.faint();
double durationMS = (double) channel.getDurationCycles() * 1000.0 / CPU.CLOCK_HZ;
asb.append(String.format("%.1f", durationMS), style);
}
示例3: appendLines
@Override
public void appendLines(List<AttributedString> lines, int width, int height) {
int startLines = lines.size();
if (state == State.Adding) {
AttributedStringBuilder addrPromptLine = new AttributedStringBuilder();
addrPromptLine.append('│');
addrPromptLine.append(addressField.getAddressPrompt());
AttributedStyle style = AttributedStyle.DEFAULT;
if (!addressField.isCurrentInputValid()) {
style = style.foreground(AttributedStyle.RED);
}
addrPromptLine.append(addressField.getCurrentInput(), style);
View.padToLength(addrPromptLine, width - 1);
addrPromptLine.append('│');
lines.add(addrPromptLine.toAttributedString());
AttributedStringBuilder modeLine = new AttributedStringBuilder();
modeLine.append('│');
if (addingExec) {
modeLine.style(AttributedStyle.INVERSE);
}
modeLine.append('E');
modeLine.append("X", AttributedStyle.DEFAULT.underline());
modeLine.append("EC");
modeLine.style(AttributedStyle.INVERSE_OFF);
modeLine.append(' ');
if (addingRead) {
modeLine.style(AttributedStyle.INVERSE);
}
modeLine.append("R", AttributedStyle.DEFAULT.underline());
modeLine.append("EAD");
modeLine.style(AttributedStyle.INVERSE_OFF);
modeLine.append(' ');
if (addingWrite) {
modeLine.style(AttributedStyle.INVERSE);
}
modeLine.append("W", AttributedStyle.DEFAULT.underline());
modeLine.append("RITE");
modeLine.style(AttributedStyle.INVERSE_OFF);
View.padToLength(modeLine, width - 1);
modeLine.append('│');
lines.add(modeLine.toAttributedString());
AttributedStringBuilder addrPromptBottomLine = new AttributedStringBuilder();
addrPromptBottomLine.append('└');
View.horizontalLine(addrPromptBottomLine, width - 2);
addrPromptBottomLine.append('┘');
lines.add(addrPromptBottomLine.toAttributedString());
AttributedStringBuilder actionsLine = new AttributedStringBuilder();
actionsLine.append(" └Abort(");
actionsLine.append("q", AttributedStyle.DEFAULT.underline());
actionsLine.append(")┘ └Accept(");
actionsLine.append("⏎", addressField.isCurrentInputValid() ? AttributedStyle.DEFAULT.underline() : AttributedStyle.DEFAULT);
actionsLine.append(")┘");
lines.add(actionsLine.toAttributedString());
} else {
AttributedStringBuilder addLine = new AttributedStringBuilder();
addLine.append(" └");
addLine.append("A", AttributedStyle.DEFAULT.underline());
addLine.append("dd┘");
lines.add(addLine.toAttributedString());
}
int remainingHeight = height - (lines.size() - startLines);
verticalBoxes.appendLines(lines, width, remainingHeight);
}
示例4: getStyle
private AttributedStyle getStyle(ColorType color) {
// This check is done to allow for default contrasting color texts to be shown on black or white screens
return color == ColorType.BLACK || color == ColorType.WHITE ? AttributedStyle.DEFAULT
: AttributedStyle.DEFAULT.foreground(color.value);
}
示例5: makeStyle
public static AttributedStyle makeStyle(String... styles) {
AttributedStyle attributedStyle = AttributedStyle.DEFAULT;
return makeStyle(attributedStyle, styles);
}