本文整理汇总了Java中com.github.lalyos.jfiglet.FigletFont类的典型用法代码示例。如果您正苦于以下问题:Java FigletFont类的具体用法?Java FigletFont怎么用?Java FigletFont使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FigletFont类属于com.github.lalyos.jfiglet包,在下文中一共展示了FigletFont类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
/**
* Run this app service
*/
public void run(){
// Print banner
try {
String banner = FigletFont.convertOneLine("lol52");
LOG.info("\n" + banner);
} catch (IOException e) {
e.printStackTrace();
}
// Initialize the Database Helper
mDb.init();
// Initialize the API
mApi.init();
// Initialize the Nexus
mNexus.init();
}
示例2: printAsciiArtWarning
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
/**
* Print ascii art.
*
* @param out the out
* @param asciiArt the ascii art
* @param additional the additional
*/
public static void printAsciiArtWarning(final Logger out, final String asciiArt, final String additional) {
try {
out.warn(ANSI_CYAN);
out.warn("\n\n".concat(FigletFont.convertOneLine(asciiArt)).concat(additional));
out.warn(ANSI_RESET);
} catch (final Exception e) {
throw Throwables.propagate(e);
}
}
示例3: printAsciiArtInfo
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
/**
* Print ascii art info.
*
* @param out the out
* @param asciiArt the ascii art
* @param additional the additional
*/
public static void printAsciiArtInfo(final Logger out, final String asciiArt, final String additional) {
try {
out.info(ANSI_CYAN);
out.info("\n\n".concat(FigletFont.convertOneLine(asciiArt)).concat(additional));
out.info(ANSI_RESET);
} catch (final Exception e) {
throw Throwables.propagate(e);
}
}
示例4: printAsciiArt
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
/**
* Print ascii art.
*
* @param out the out
* @param asciiArt the ascii art
* @param additional the additional
*/
public static void printAsciiArt(final PrintStream out, final String asciiArt, final String additional) {
try {
out.println(ANSI_CYAN);
if (StringUtils.isNotBlank(additional)) {
out.println(FigletFont.convertOneLine(asciiArt));
out.println(additional);
} else {
out.print(FigletFont.convertOneLine(asciiArt));
}
out.println(ANSI_RESET);
} catch (final Exception e) {
throw Throwables.propagate(e);
}
}
示例5: showJfigletMessage
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
/**
* show Jfiglet message
* @param message
* @return
*/
public static String showJfigletMessage(String message) {
try {
return LINE_BREAK + FigletFont.convertOneLine(message);
} catch (Throwable throwable) {
return "";
}
}
示例6: generateBanner
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
private String generateBanner() throws IOException {
final InputStream fontStream = GenerateMojo.class.getResourceAsStream("/condensed.flf");
final String rawBanner = FigletFont.convertOneLine(fontStream, text);
final String[] lines = rawBanner.split("\n");
final StringBuilder banner = new StringBuilder(32);
final boolean isDefaultColor = Color.DEFAULT.getTagValue().equals(color);
for (int i = 0; i < lines.length; i++) {
if (i > 0) {
banner.append('\n');
}
if (!isDefaultColor) {
Color.nameFromTagValue(color)
.ifPresent(name -> banner.append("${AnsiColor.").append(name).append('}'));
}
banner.append(StringUtils.stripEnd(lines[i], " "));
}
if (!isDefaultColor) {
banner.append("${AnsiColor.DEFAULT}");
}
if (includeInfo) {
info = info == null ? null : info.replaceAll("\\$\\{project\\.version\\}", project.getVersion());
banner.append('\n').append(info);
}
banner.append('\n');
getLog().debug('\n' + banner.toString());
return banner.toString();
}
示例7: figlet
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
public static void figlet(String text) {
String asciiArt1 = null;
try {
asciiArt1 = FigletFont.convertOneLine(text);
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(asciiArt1);
}
示例8: getBanner
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
@Override
public String getBanner() {
return FigletFont.convertOneLine("CloudUnit-CLI");
}
示例9: convertOnLine
import com.github.lalyos.jfiglet.FigletFont; //导入依赖的package包/类
private Block convertOnLine(final String app, final String font) {
return unit -> {
unit.mockStatic(FigletFont.class);
expect(FigletFont.convertOneLine("classpath:/flf/" + font + ".flf", app)).andReturn(app);
};
}