diff --git a/src/main/java/io/dashbase/clue/ClueApplication.java b/src/main/java/io/dashbase/clue/ClueApplication.java index 5fe0164..b077e3d 100644 --- a/src/main/java/io/dashbase/clue/ClueApplication.java +++ b/src/main/java/io/dashbase/clue/ClueApplication.java @@ -9,7 +9,6 @@ import java.util.function.Supplier; import io.dashbase.clue.client.CmdlineHelper; -import io.dashbase.clue.util.AsciiArt; import net.sourceforge.argparse4j.helper.HelpScreenException; import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.Namespace; @@ -120,7 +119,6 @@ public void shutdown() throws Exception { public static void main(String[] args) throws Exception { - AsciiArt.drawString("Clue", "$", System.out); if (args.length < 1){ System.out.println("usage: "); System.exit(1); diff --git a/src/main/java/io/dashbase/clue/client/ClueCommandClient.java b/src/main/java/io/dashbase/clue/client/ClueCommandClient.java index 1a8822a..ff638e0 100644 --- a/src/main/java/io/dashbase/clue/client/ClueCommandClient.java +++ b/src/main/java/io/dashbase/clue/client/ClueCommandClient.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import io.dashbase.clue.util.AsciiArt; import jline.console.ConsoleReader; import jline.console.completer.ArgumentCompleter; import jline.console.completer.Completer; @@ -173,7 +172,6 @@ public void run() throws Exception { public static void main(String[] args) throws Exception { - AsciiArt.drawString("Clue", "$", System.out); if (args.length != 1){ System.out.println("usage: "); System.exit(1); diff --git a/src/main/java/io/dashbase/clue/util/AsciiArt.java b/src/main/java/io/dashbase/clue/util/AsciiArt.java deleted file mode 100644 index 2adccfe..0000000 --- a/src/main/java/io/dashbase/clue/util/AsciiArt.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.dashbase.clue.util; - -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.PrintStream; - -public class AsciiArt { - - public static void drawString(String text, String artChar, PrintStream out) { - Settings settings = new Settings(new Font("SansSerif", Font.BOLD, 24), 100, 100); - drawString(text, artChar, settings, out); - } - public static void drawString(String text, String artChar, Settings settings, PrintStream out) { - BufferedImage image = getImageIntegerMode(settings.width, settings.height); - - Graphics2D graphics2D = getGraphics2D(image.getGraphics(), settings); - graphics2D.drawString(text, 6, ((int) (settings.height * 0.67))); - - for (int y = 0; y < settings.height; y++) { - StringBuilder stringBuilder = new StringBuilder(); - - for (int x = 0; x < settings.width; x++) { - stringBuilder.append(image.getRGB(x, y) == -16777216 ? " " : artChar); - } - - if (stringBuilder.toString() - .trim() - .isEmpty()) { - continue; - } - - out.println(stringBuilder); - } - - } - - private static BufferedImage getImageIntegerMode(int width, int height) { - return new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); - } - - private static Graphics2D getGraphics2D(Graphics graphics, Settings settings) { - graphics.setFont(settings.font); - - Graphics2D graphics2D = (Graphics2D) graphics; - graphics2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); - - return graphics2D; - } - - public static class Settings { - public final Font font; - public final int width; - public final int height; - - public Settings(Font font, int width, int height) { - this.font = font; - this.width = width; - this.height = height; - } - } -}