Class Utils

java.lang.Object
featurecat.lizzie.util.Utils

public class Utils extends Object
  • Field Details

  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • isBlank

      public static boolean isBlank(String str)
    • needsQuoting

      public static boolean needsQuoting(String s)
    • withQuote

      public static String withQuote(String s)
    • getPlayoutsString

      public static String getPlayoutsString(int playouts)
      Returns:
      a shorter, rounded string version of playouts. e.g. 345 -> 345, 1265 -> 1.3k, 44556 -> 45k, 133523 -> 134k, 1234567 -> 1.2m
    • truncateStringByWidth

      public static String truncateStringByWidth(String line, FontMetrics fm, int fitWidth)
      Truncate text that is too long for the given width
      Parameters:
      line -
      fm -
      fitWidth -
      Returns:
      fitted
    • lastWinrateDiff

      public static double lastWinrateDiff(BoardHistoryNode node)
    • getBlunderNodeColor

      public static Color getBlunderNodeColor(BoardHistoryNode node)
    • actualScoreMean

      public static double actualScoreMean(double scoreMean)
    • txtFieldValue

      public static Integer txtFieldValue(JTextField txt)
    • txtFieldDoubleValue

      public static Double txtFieldDoubleValue(JTextField txt)
    • intOfMap

      public static int intOfMap(Map map, String key)
    • stringOfMap

      public static String stringOfMap(Map map, String key)
    • toGif

      public static void toGif(String path, List<BufferedImage> frames, int delayTime, boolean override)
    • classExists

      public static boolean classExists(String className)
    • setDisplayedBranchLength

      public static void setDisplayedBranchLength(BoardRenderer board, int n)
    • doBranchSub

      public static void doBranchSub(BoardRenderer board, int moveTo)