A little tool that converts SVG paths to JavaFX paths

Related tags

GUI SVGPathConverter
Overview

SVGPathConverter

The SVGPathConverter is a little tool that helps you converting SVG paths to JavaFX paths.

It has two methods, one to format a SVG path string and the other to convert it to a list of JavaFX PathElements.

e.g.

String            svgString = "M 54.1,12.5 12.9,54.7 C -2.7,70.3 23,69 32.3,74.9 36.6,77.7 18.5,81.3 22.2,85 c 3.6,3.7 21.7,7.1 25.3,10.7 3.6,3.7 -7.3,7.6 -3.7,11.3 3.5,3.7 11.9,0.2 13.4,8.6 1.1,6.2 15.4,3.1 21.8,-2.2 4,-3.4 -6.9,-3.4 -3.3,-7.1 9,-9.1 17,-4.1 20.3,-12.5 1.8,-4.5 -13.6,-7.7 -9.5,-10.6 9.8,-6.9 45.8,-10.4 29.2,-27 L 73,12.5 c -5.3,-5 -14,-5 -18.9,0 z m -9.9,64.7 c 0.9,0 30.8,4 19.3,7.1 -4.4,1.2 -24.6,-7.1 -19.3,-7.1 z m 57.2,16.6 c 0,2.1 16.3,3.3 15.4,-0.5 -1.3,-6.4 -13.6,-5.9 -15.4,0.5 z m -69.5,11.1 c 3.7,3.2 9.3,-0.7 11.1,-5.2 -3.6,-4.7 -16.9,0.3 -11.1,5.2 z m 67.5,-6.7 c -4.6,4.2 0.8,8.6 5.3,5.7 1.2,-0.8 -0.1,-4.7 -5.3,-5.7 z";
List<PathElement> elements  = SVGPathConverter.INSTANCE.convert(SVGPathConverter.INSTANCE.format(svgString));
Path              path      = new Path(elements);

The path can then be used in a JavaFX scenegraph.

You might also like...

Docking framework for JavaFX platform

Docking framework for JavaFX platform

Docking framework for JavaFX platform AnchorFX is a gratis and open source library for JavaFX to create graphical interfaces with docking features Anc

Oct 15, 2022

A library of +70 ready-to-use animations for JavaFX

AnimateFX A library of ready-to-use animations for JavaFX Features: Custom animations Custom interpolators Play/Stop animation Play an animation after

Jan 5, 2023

BootstrapFX: Bootstrap for JavaFX

BootstrapFX: Bootstrap for JavaFX

BootstrapFX BootstrapFX is a partial port of Twitter Bootstrap for JavaFX. It mainly provides a CSS stylesheet that closely resembles the original whi

Dec 28, 2022

A Java framework for creating sophisticated calendar views (JavaFX 8, 9, 10, and 11)

A Java framework for creating sophisticated calendar views (JavaFX 8, 9, 10, and 11)

CalendarFX A Java framework for creating sophisticated calendar views based on JavaFX. A detailed developer manual can be found online: CalendarFX 8 D

Jan 6, 2023

Allow runtime modification of JavaFX CSS

Allow runtime modification of JavaFX CSS

cssfx ⚠ WARNING ⚠ In version 11.3.0 we have relocated & refactored the project. maven groupId has been changed to fr.brouillard.oss java module name h

Jan 2, 2023

A JavaFX UI framework to create fully customized undecorated windows

A JavaFX UI framework to create fully customized undecorated windows

CustomStage A JavaFX undecorated stage which can fully be customized Donations If this project is helpful to you and love my work and feel like showin

Jan 6, 2023

MDI components for JavaFX

MDI components for JavaFX

DesktopPaneFX DesktopPaneFX is a JavaFX version of Swing’s JDesktopPane which can be used as a container for individual "child" similar to JInternalFr

Sep 23, 2022

Efficient VirtualFlow for JavaFX

Flowless Efficient VirtualFlow for JavaFX. VirtualFlow is a layout container that lays out cells in a vertical or horizontal flow. The main feature of

Nov 24, 2022

A framework for easily creating forms for a JavaFX UI.

A framework for easily creating forms for a JavaFX UI.

FormsFX Forms for business application made easy. Creating forms in Java has never been this easy! Maven To use this framework as part of your Maven b

Dec 30, 2022
Comments
  • Simplify converter

    Simplify converter

    The converter could be simplified by directly using the relative and absolute settings of path elements like this.

        MoveTo mt = new MoveTo(10, 20);
        mt.setAbsolute(false);
    

    This would allow for a more direct mapping of the original SVG and you only would have to maintain one implementation for relative and absolute placement of elements.

    enhancement 
    opened by mipastgt 1
Owner
Gerrit Grunwald
❤️ coding in general, esp. Java(FX), Swift and if needed JavaScript. UI has my love...
Gerrit Grunwald
A low intrusive, configurable android library that converts layout XML files into Java code to improve performance

qxml English 一个低侵入,可配置的 Android 库,用于将 layout xml 文件转换为 Java 代码以提高性能。 与X2C的对比 X2C: 使用注解处理器生成View类,使用时需要在类中添加注解,并替换setContentView方法,侵入性较强; 对于布局属性的支持不够完美

null 74 Oct 6, 2022
Just a fun little word game! 🍄

Wordagam A fun & interactive word game. Check out the screenshots and the gameplay video. Download & Play Download the latest artefacts here. You can

Sandeep 61 Dec 24, 2022
A maven plugin to include features from jmeter-plugins.org for JMeterPluginsCMD Command Line Tool to create graphs, export csv files from jmeter result files and Filter Result tool.

jmeter-graph-tool-maven-plugin A maven plugin to create graphs using the JMeter Plugins CMDRunner from JMeter result files (*.jtl or *.csv) or using F

Vincent DABURON 6 Nov 3, 2022
Tray Icon implementation for JavaFX applications. Say goodbye to using AWT's SystemTray icon, instead use a JavaFX Tray Icon.

FXTrayIcon Library intended for use in JavaFX applications that makes adding a System Tray icon easier. The FXTrayIcon class handles all the messy AWT

Dustin Redmond 248 Dec 30, 2022
Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

Lib-Tile Intention Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE and provides the functionalities to use and handle easily Tile

Peter Rogge 13 Apr 13, 2022
DataFX - is a JavaFX frameworks that provides additional features to create MVC based applications in JavaFX by providing routing and a context for CDI.

What you’ve stumbled upon here is a project that intends to make retrieving, massaging, populating, viewing, and editing data in JavaFX UI controls ea

Guigarage 110 Dec 29, 2022
A tool to make dumpy among us GIFS

Among Us Dumpy Gif Maker Made by ThatOneCalculator & Pixer415 With help from twistCMYK, karl-police, and auguwu! Please credit this repository when yo

Kainoa Kanter 535 Jan 7, 2023
Tool for creating custom GUIs using packets.

Tool for creating custom GUIs using packets.

Geo3gamer 0 Feb 14, 2022
JStackFX, a tool for analyzing thread dumps.

Context It is not an easy task to analyse thread dumps as files generated by the jstack tool provides raw text files.

Thierry Wasylczenko 84 Jan 4, 2022
Collection of Binding helpers for JavaFX(8)

Advanced-Bindings for JavaFX (8) advanced-bindings is a collection of useful helpers and custom binding implementations to simplify the development of

Manuel Mauky 63 Nov 19, 2022