Class NTxUtils

java.lang.Object
net.thevpc.ntexup.api.util.NTxUtils

public class NTxUtils extends Object
  • Field Details

  • Constructor Details

    • NTxUtils

      public NTxUtils()
  • Method Details

    • isOneIndexed

      public static boolean isOneIndexed(net.thevpc.nuts.elem.NElement element)
    • hasCompilerDeclarationPath

      public static boolean hasCompilerDeclarationPath(net.thevpc.nuts.elem.NElement element)
    • getCompilerDeclarationPath

      public static String getCompilerDeclarationPath(net.thevpc.nuts.elem.NElement element)
    • findCompilerDeclarationPath

      public static net.thevpc.nuts.util.NOptional<String> findCompilerDeclarationPath(net.thevpc.nuts.elem.NElement element)
    • point2DasRelative

      public static NTxPoint2D point2DasRelative(NTxPoint2D a, NTxSizeRef sr)
    • createArc

      public static List<NTxPoint2D> createArc(double minX, double minY, double maxX, double maxY, double startDeg, double endDeg, int steps)
      Generates points along an elliptical arc.
      Parameters:
      minX - bounding box left
      minY - bounding box top
      maxX - bounding box right
      maxY - bounding box bottom
      startDeg - start angle in degrees (0° = right, increasing counterclockwise)
      endDeg - end angle in degrees
      steps - number of points along the curve
      Returns:
      list of points along the arc
    • createArc2

      public static List<NTxPoint2D> createArc2(double cx, double cy, double rx, double ry, double startDeg, double endDeg, int steps)
    • addCompilerDeclarationPath

      public static net.thevpc.nuts.elem.NElement addCompilerDeclarationPath(net.thevpc.nuts.elem.NElement elem, NTxSource resource)
    • addCompilerDeclarationPathDummy

      public static net.thevpc.nuts.elem.NElement addCompilerDeclarationPathDummy(net.thevpc.nuts.elem.NElement element)
    • addCompilerDeclarationPath

      public static net.thevpc.nuts.elem.NElement addCompilerDeclarationPath(net.thevpc.nuts.elem.NElement element, String path)
    • nodePath

      public static List<NTxNode> nodePath(NTxNode node)
    • firstNodeUp

      public static NTxNode firstNodeUp(NTxItem item)
    • dtimes

      public static final double[] dtimes(double min, double max, int times)
    • resolvePath

      public static net.thevpc.nuts.io.NPath resolvePath(net.thevpc.nuts.elem.NElement path, Object source)
    • shortName

      public static String shortName(NTxSource a)
    • strSnapshot

      public static String strSnapshot(Object a)
    • min

      public static Double min(Double a, Double b)
    • max

      public static Double max(Double a, Double b)
    • distance

      public static Double distance(Double a, Double b)
    • distanceDouble

      public static Double distanceDouble(Number a, Number b)
    • center

      public static Double center(Double a, Double b)
    • addDouble

      public static Double addDouble(Number a, Number b)
    • doubleOf

      public static double doubleOf(Number n)
    • intOf

      public static int intOf(Number n)
    • toElement

      public static net.thevpc.nuts.elem.NElement toElement(Object o)
    • fromElement

      public static Object fromElement(net.thevpc.nuts.elem.NElement v)
    • uids

      public static String[] uids(String[]... ids)
    • uid

      public static String uid(net.thevpc.nuts.elem.NElement id)
    • uid

      public static String uid(String id)
    • paintAsColor

      public static Color paintAsColor(Paint paint)
    • resolveForegroundColor

      public static Paint resolveForegroundColor(NTxTextOptions options, NTxRendererContext ctx)
    • asBoolean

      public static boolean asBoolean(net.thevpc.nuts.elem.NElement e)
    • asListOfObjects

      public static List<Object> asListOfObjects(Object anyVal)
    • sourceOf

      public static NTxSource sourceOf(NTxItem node)
    • removeCompilerDeclarationPathAnnotations

      public static net.thevpc.nuts.elem.NElement removeCompilerDeclarationPathAnnotations(net.thevpc.nuts.elem.NElement yy)
    • addCompilerDeclarationPathAnnotations

      public static net.thevpc.nuts.elem.NElement addCompilerDeclarationPathAnnotations(net.thevpc.nuts.elem.NElement yy, String source)
    • snippet

      public static String snippet(net.thevpc.nuts.elem.NElement yy)
    • setNodeParent

      public static void setNodeParent(NTxItem item, NTxNode parent)
    • snippet

      public static String snippet(NTxNode node)
    • checkNode

      public static void checkNode(NTxNode node)
    • checkNode

      public static void checkNode(NTxNode node, boolean recursive)
    • checkNode

      public static void checkNode(NTxNode node, NTxNode expectedRoot)
    • checkNode

      public static void checkNode(NTxNode node, NTxNode expectedRoot, boolean recursive)
    • isComponentSlot

      public static boolean isComponentSlot(String name)
    • findRootNode

      public static NTxNode findRootNode(NTxItem bullet)