{"id":18078068,"url":"https://github.com/vittoriopiotti/pathgraph-javafx","last_synced_at":"2025-05-08T20:57:23.577Z","repository":{"id":257877825,"uuid":"865654135","full_name":"vittorioPiotti/PathGraph-JavaFX","owner":"vittorioPiotti","description":"Path Graph is a library with all the tools necessary to create and work both path and walk graphs in a stable and simple way.","archived":false,"fork":false,"pushed_at":"2024-10-21T08:16:11.000Z","size":19556,"stargazers_count":62,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T02:02:40.573Z","etag":null,"topics":["graph","graphs","interactive","java","javafx","library","path","smartgraph","ui","user-experience","user-interface","visualization","walk-paths"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/io.github.vittoriopiotti/PathGraph-JavaFX","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vittorioPiotti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-JavaFXSmartGraph.txt","code_of_conduct":"CODE_OF_CONDUCT.txt","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-30T22:26:53.000Z","updated_at":"2025-02-06T12:41:34.000Z","dependencies_parsed_at":"2024-10-31T12:21:46.012Z","dependency_job_id":null,"html_url":"https://github.com/vittorioPiotti/PathGraph-JavaFX","commit_stats":null,"previous_names":["vittoriopiotti/pathgraph-javafx"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioPiotti%2FPathGraph-JavaFX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioPiotti%2FPathGraph-JavaFX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioPiotti%2FPathGraph-JavaFX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioPiotti%2FPathGraph-JavaFX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vittorioPiotti","download_url":"https://codeload.github.com/vittorioPiotti/PathGraph-JavaFX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238044093,"owners_count":19407128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph","graphs","interactive","java","javafx","library","path","smartgraph","ui","user-experience","user-interface","visualization","walk-paths"],"created_at":"2024-10-31T12:11:29.487Z","updated_at":"2025-02-10T02:03:39.677Z","avatar_url":"https://github.com/vittorioPiotti.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (Java FX) PathGraph\n\n\n\n\n\n\n\n\u003cimg src=\"https://github.com/vittorioPiotti/PathGraph-ForkBased/blob/master/github/sp.gif\" alt=\"Icona\" width=\"400\"/\u003e\n\n\n**What is PathGraph**\n\nPath Graph is a library with all the tools necessary to create and work both path and walk graphs in a stable and simple way.\n\n**Why PathGraph**\n\nIf you need a ready-to-use library for user-side representing path graphs in which there are nodes, edges, and associated costs, which offers a user-friendly  to represent, manage, and interact graphs, then this it's the right solution. \n\n\n**Fork-Based Project**\n\nThis library is a fork based on the source code of the [SmartGraph](https://github.com/brunomnsilva/JavaFXSmartGraph) [v2.0.0](https://github.com/brunomnsilva/JavaFXSmartGraph/releases/tag/v2.0.0). It is modified to suite in specific path graphs features in a stable interface.\n\n---\n\n\n\u003e [!NOTE]\n\u003e Read the **Javadoc** for more details: [`PathGraph-JavaFX-1.0.9-javadoc`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/spring-core)\n\n\n\u003e [!NOTE]\n\u003e Library available on **Maven Central:** [`PathGraph-JavaFX-1.0.9`](https://central.sonatype.com/artifact/io.github.vittoriopiotti/PathGraph-JavaFX/1.0.9/overview)\n\u003e ```xml\n\u003e \u003cdependency\u003e\n\u003e   \u003cgroupId\u003eio.github.vittoriopiotti\u003c/groupId\u003e\n\u003e   \u003cartifactId\u003ePathGraph-JavaFX\u003c/artifactId\u003e\n\u003e   \u003cversion\u003e1.0.9\u003c/version\u003e\n\u003e \u003c/dependency\u003e\n\u003e ```\n\n## Index\n\n 1. [Features](#features)\n 2. [Graph Logic](#graph-logic)\n 3. [Get Started](#get-started)\n 4. [Ready to Code](#ready-to-code)\n 5. [Examples](#examples)\n 6. [Callbacks](#callbacks)\n 7. [DTO · Data Transfer Object](#data-transfer-object)\n 8. [JSON · Data Management](#json-data-management)\n 9. [Configuration and Styling](#configurations-and-styling)\n 10. [Licenses](#licenses)\n\n[_Fork-Based On SmartGraph_](#fork-based-on-smartgraph)\n\n\n\n---\n\n\n\n\n\n\n\n## 1. Features \u003cdiv id=\"features\"/\u003e\n\n\n\n| \u003cimg src=\"https://github.com/vittorioPiotti/PathGraph-ForkBased/blob/master/github/clickBackground.gif\" alt=\"Icona\" width=\"100%\"/\u003e | \u003cimg src=\"https://github.com/vittorioPiotti/PathGraph-ForkBased/blob/master/github/test7ui.gif\" alt=\"Icona\" width=\"100%\"/\u003e | \u003cimg src=\"https://github.com/vittorioPiotti/PathGraph-ForkBased/blob/master/github/test8ui.gif\" alt=\"Icona\" width=\"100%\"/\u003e|\n| ------------ | ------------ | ------------ |\n| \u003cimg src=\"https://github.com/vittorioPiotti/PathGraph-ForkBased/blob/master/github/test5ui.gif\" alt=\"Icona\" width=\"100%\"/\u003e | \u003cimg src=\"https://github.com/vittorioPiotti/PathGraph-ForkBased/blob/master/github/test1ui.gif\" alt=\"Icona\" width=\"100%\"/\u003e | \u003cimg src=\"https://github.com/vittorioPiotti/PathGraph-ForkBased/blob/master/github/test4ui.gif\" alt=\"Icona\" width=\"100%\"/\u003e|\n\n * **Nodes:** [`New Node`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#newNode()), [`Rename Node`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#renameNode(char,char)), [`Delete Node`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#deleteNode(char))\n   \n * **Edges:** [`New Edge`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#newEdge()), [`Delete Edge`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#deleteEdge(char)), [`Rotate Edge`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#rotateEdge(char,char)), [`Split Edge`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#splitEdge(char,char)), [`Set Cost`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#setCost(char,char,int))\n   \n * **Graph:** [`Upload JSON`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#uploadJSON(java.io.File)), [`Download JSON`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#downloadJSON(java.io.File)), [`Clear Graph`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#clearGraph()), [`Show Path`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#showPath(java.util.List)), [`Take Screenshot`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#takeScreenshot()), [`Drag`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#doDrag()), [`Zoom`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#doZoom()), [`Adjust Position`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#adjustPosition(double))\n\n * **UI:** [`Hide UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#hideUI()), [`Show UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#showUI()), [`Toggle UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#toggleUI()), [`Set UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#setUI(boolean,boolean,boolean,boolean,boolean,boolean))\n\n \n\n\n\n\n\n\n\n\n\n## 2. Graph Logic \u003cdiv id=\"graph-logic\"/\u003e\n\n* Limit of 26 Nodes nameable only with uppercase characters\n* Limit of two edges with opposite directions beetween two nodes\n* Loop creation is not allowed\n* Edge cost is an integer number\n* Edge directions can be: [`Bidirectional`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/Constants.html#BIDIRECTIONAL), [`Natural Direction`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/Constants.html#BIDIRECTIONAL), [`Opposite Direction`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/Constants.html#BIDIRECTIONAL)\n\n\n\n\n\n\n\n\n\n## 3. Get Started \u003cdiv id=\"get-started\"/\u003e\n\n### Requirements\n\n\n[`Java-21`](https://www.oracle.com/java/technologies/downloads/#java21), [`JavaFX-22`](https://gluonhq.com/products/javafx/)\n\n_Forward-compatible_\n\n### Dependencies\n\n**Import External Dependencies**\n\n[`JavaFX-Swing-22`](https://mvnrepository.com/artifact/org.openjfx/javafx-swing/22), ​[`JavaFX-Controls-22`](https://mvnrepository.com/artifact/org.openjfx/javafx-controls/22), ​ [`JavaFX-FXML-22`](https://mvnrepository.com/artifact/org.openjfx/javafx-fxml/22)\n\n**Import Library**\n\n[`PathGraph-JavaFX-1.0.9`](https://central.sonatype.com/artifact/io.github.vittoriopiotti/PathGraph-JavaFX/1.0.9/overview)\n\n\n_Able to:_\n\n * POM configuration:\n\n   ```xml\n   \u003cdependency\u003e\n       \u003cgroupId\u003eio.github.vittoriopiotti\u003c/groupId\u003e\n       \u003cartifactId\u003ePathGraph-JavaFX\u003c/artifactId\u003e\n       \u003cversion\u003e1.0.9\u003c/version\u003e\n   \u003c/dependency\u003e\n   ```\n\n        \n * Manual configuration:\n   \n   Download and import jar in your module dependencies: [`PathGraph-JavaFX-1.0.9.jar`](https://github.com/vittorioPiotti/PathGraph-JavaFX/releases/tag/1.0.9)\n\n\n\n\u003cdetails\u003e\n  \n\u003csummary\u003e\n   \u003cstrong\u003eShow POM.xml dependencies\u003c/strong\u003e\n\u003c/summary\u003e\n\n\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.vittoriopiotti\u003c/groupId\u003e\n    \u003cartifactId\u003ePathGraph-JavaFX\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.9\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n    \u003cartifactId\u003ejavafx-swing\u003c/artifactId\u003e\n    \u003cversion\u003e22\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n    \u003cartifactId\u003ejavafx-controls\u003c/artifactId\u003e\n    \u003cversion\u003e22\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n    \u003cartifactId\u003ejavafx-fxml\u003c/artifactId\u003e\n    \u003cversion\u003e22\u003c/version\u003e\n\u003c/dependency\u003e\n\n\n```\n\n\n\n\n\u003c/details\u003e\n\n\n## 4. Ready to Code \u003cdiv id=\"ready-to-code\"/\u003e\n\n### Import Component\n\n ```java\n import com.vittoriopiotti.pathgraph.app.*;\n ```\n\n### Instance Object\n\n\u003e [!NOTE]\n\u003e  * `PathGraph` to create your custom interface\n\u003e  * `PathGraphUI`for ready-to-use interface\n\n**PathGraph**\n\n\nVanilla configurations to use in your project in which create your custom UI.\n\n\nHandles the graph's display and logic independently of the user interface, acting as a standalone component without any user interface restrictions, provifind all necessary features.\n\n```java\nPathGraph pg = new PathGraph();\n```\n\n\u003e Empty callbacks\n\n_or_\n\n\n\n```java\nPathGraph pg = new PathGraph(\n    (ContextMenuCallback) ()-\u003e{},\n    (EdgeCallback) (MouseEvent e, Character c1, Character c2)-\u003e{},\n    (NodeCallback) (MouseEvent e, Character c1, Character c2)-\u003e{},\n    (BackgroundCallback) (MouseEvent e)-\u003e{}, \n    (ZoomCallback) (Double n)-\u003e{},\n    (AdjustPositionCallback) ()-\u003e{}\n);\n```\n\n\u003e With callbacks\n\n\n\n\n\n**PathGraphUI**\n\nReady-to-use configuration with default UI.\n\nExtends PathGraph to provide a layer on top of the graph management functionalities. It allows for the interaction with the graph through a visual interface over the underlying graph logic.\n\n\n```java\nPathGraphUI pg = new PathGraphUI(\n    (Stage) stage,\n    (Scene) scene\n);\n```\n\n\u003e With default UI\n\n\n_or_\n\n\n\n```java\nPathGraphUI pg = new PathGraphUI(\n    (Stage) stage,\n    (Scene) scene,\n    \n    /* is enabled top-left menu */\n    true,\n    \n    /* is enabled bot-left menu */\n    true,\n    \n    /* is enabled bot-mid menu */\n    true,\n    \n    /* is enabled right-mid menu */\n    true,\n    \n    /* is enabled top-right menu */\n    true,\n    \n    /* is hide UI */\n    false\n\n);\n```\n\n\u003e With custom UI\n\n\n\nIn both cases are customizable the visibility of the UI and its components only with an instance of `PathGraphUI`:\n\n[`Hide UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#hideUI()), [`Show UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#showUI()), [`Toggle UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#toggleUI()), [`Set UI`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraphUI.html#setUI(boolean,boolean,boolean,boolean,boolean,boolean))\n\n\n### Setup  \u003cdiv id=\"setup\"/\u003e\n\n\n\u003e [!NOTE]\n\u003e **To enable the use of library** `setup` must be called **only one time after making stage visible** with `(Stage) stage.show()`\n\u003e\n\u003e _Before calling setup, no operations of any kind can be performed on the graph_\n\n\n```java\npg.setup();\n```\n\n\n\n_or_\n\n\n\n```java\npg.setup().thenRun(() -\u003e {\n\n  /* actions to perform on first load */\n  /* e.g. put here components, callbacks setting, graph configurations */\n\n});\n```\n\nGraph operations are limited to these contexts:\n\n * **Setup:** ensures execution post-initialization in `pg.setup().thenRun(()-\u003e{})`.\n * **Event Handlers:** Safe within JavaFX event actions.\n * **JavaFX Timers:** Use for delayed, thread-safe execution.\n\n\n## 5. Examples \u003cdiv id=\"examples\"/\u003e\n\n\n### PathGraph\n\nVanilla configurations to use in your project in which create your custom UI.\n\n\n\n```java\nimport javafx.application.Application;\nimport javafx.scene.Scene;\nimport javafx.stage.Stage;\nimport javafx.scene.layout.BorderPane;\nimport com.vittoriopiotti.pathgraph.app.PathGraph;\n\npublic class ExampleOfPathGraph extends Application {\n\n    @Override\n    public void start(Stage primaryStage) {\n\n        /* 1. Create javafx window */\n        BorderPane root = new BorderPane();\n        Scene scene = new Scene(root,500,300);\n        primaryStage.setScene(scene);\n\n        /* 2. Show primary stage */\n        primaryStage.show();\n\n        /* 3. Instance object */\n        PathGraph pg = new PathGraph();\n\n        /* 4. Add PathGraph in a container */\n        root.setCenter(pg);\n\n        /* 6. Setup */\n        pg.setup().thenRun(() -\u003e {\n\n            /* 5. Custom configurations  */\n            pg.enableListenersGraph(true);\n            pg.enableListenersPane(true);\n            pg.setAutomaticLayout(true);\n\n            /* Set callbacks */\n            pg.setBackgroundCallback(event -\u003e {\n                pg.newNode();\n                event.consume();\n            });\n            pg.setNodeCallback((event,label) -\u003e {\n                pg.newEdge(label);\n                event.consume();\n            });\n            pg.setEdgeCallback((event,start,end) -\u003e {\n                pg.deleteEdge(start,end);\n                event.consume();\n            });\n            \n            /* 7. Make Graphs */\n            pg.newNode('A');\n            pg.newNode('B');\n            pg.newNode('C');\n            pg.newEdge('A', 'B', 1);\n            pg.newEdge('C', 'A', 2, false);\n\n        });\n\n    }\n\n    public static void main(String[] args) {\n        launch();\n    }\n\n}\n\n```\n\n\n### PathGraphUI\n\nReady-to-use configuration with default UI.\n\n\n```java\nimport javafx.application.Application;\nimport javafx.scene.Scene;\nimport javafx.stage.Stage;\nimport javafx.scene.layout.BorderPane;\nimport com.vittoriopiotti.pathgraph.app.PathGraphUI;\n\npublic class ExampleOfPathGraphUI extends Application {\n\n    @Override\n    public void start(Stage primaryStage) {\n\n        /* 1. Create javafx window */\n        BorderPane root = new BorderPane();\n        Scene scene = new Scene(root,500,300);\n        primaryStage.setScene(scene);\n\n        /* 2. Show primary stage */\n        primaryStage.show();\n\n        /* 3. Instance object */\n        PathGraphUI pg = new PathGraphUI(primaryStage,scene);\n\n        /* 4. Add PathGraph in a container */\n        root.setCenter(pg);\n\n        /* 5. Setup */\n        pg.setup().thenRun(() -\u003e {\n\n            /* 6. Make Graphs */\n            pg.newNode('A');\n            pg.newNode('B');\n            pg.newNode('C');\n            pg.newEdge('A', 'B', 1);\n            pg.newEdge('C', 'A', 2, false);\n\n        });\n\n    }\n\n    public static void main(String[] args) {\n        launch();\n    }\n\n}\n\n```\n\n\n## 6. Callbacks \u003cdiv id=\"callbacks\"/\u003e\n\n\u003e[!NOTE]\n\u003e Customizable callbacks only with an instance of `PathGraph` _(`PathGraphUI`is a ready-to-use configuration)._\n\n**Usage:**\n\n1. Import package to use callback objects:\n\n      ```java\n      import com.vittoriopiotti.pathgraph.callbacks.*;\n      ```\n      \n2. Call setter methods to apply new callbacks passing callback objects:\n   \n     [`Set All Callbacks`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#setAllCallbacks(com.vittoriopiotti.pathgraph.callbacks.ContextMenuCallback,com.vittoriopiotti.pathgraph.callbacks.EdgeCallback,com.vittoriopiotti.pathgraph.callbacks.NodeCallback,com.vittoriopiotti.pathgraph.callbacks.BackgroundCallback,com.vittoriopiotti.pathgraph.callbacks.ZoomCallback,com.vittoriopiotti.pathgraph.callbacks.AdjustPositionCallback)), [`Set Context Menu Callback`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#setContextMenuCallback(com.vittoriopiotti.pathgraph.callbacks.ContextMenuCallback)), [`Set Edge Callback`](), [`Set Node Callback`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#setNodeCallback(com.vittoriopiotti.pathgraph.callbacks.NodeCallback)), [`Set Background Callback`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#setBackgroundCallback(com.vittoriopiotti.pathgraph.callbacks.BackgroundCallback)), [`Set Zoom Callback`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#setZoomCallback(com.vittoriopiotti.pathgraph.callbacks.ZoomCallback)), [`Set Adjust Position Callback`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#setAdjustPositionCallback(com.vittoriopiotti.pathgraph.callbacks.AdjustPositionCallback))\n\n**Snippet:**\n\n```java\nEdgeCallback ec = (event,start,end) -\u003e{\n    if (event.getButton() == MouseButton.SECONDARY) {\n        System.out.println(\n                pg.rotateEdge(start,end) ?\n                        \"rotate edge successfully\" :\n                        \"rotate edge  error\"\n        );\n    }else if (event.getButton() == MouseButton.PRIMARY) {\n        System.out.println(\n                pg.deleteEdge(start,end) ?\n                        \"delete edge successfully\" :\n                        \"delete edge error\"\n        );\n    }\n    event.consume();\n};\n\n(PathGraph) pg.setEdgeCallback(ec);\n```\n\n\n\n\u003e[!TIP]\n\u003e * Use of a `ContextMenu` with custom `MenuItem` or `Button` to perform the actions\n\u003e    \n\u003e * Use `event.consume()` to prevent the propagation of the event\n\u003e\n\u003e * Use the `return status` to feedback errors with a `Modal Dialog` \n\n\n\n\n\n\n## 7. DTO · Data Transfer Objects \u003cdiv id=\"data-transfer-object\"/\u003e\n \n\u003e [!NOTE]\n\u003e Read the **Javadoc** for more details: [(see)](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/dto/package-summary.html)\n\n\nProviding to rappresent graph components in a simple and serializable structure.\n\n**Import package:**\n\n```java\nimport com.vittoriopiotti.pathgraph.dto.*;\n```\n\n**Usage:**\n\n * Converting graph data into JSON format\n * Reconstructing graph data from JSON\n * Support structure for graph operations\n\n\n\n\n\n## 8. JSON · Data Management \u003cdiv id=\"json-data-management\"/\u003e\n\n### Methods\n\n[`Get Nodes Json`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#getNodesJson()), [`Get Edges Json`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#getEdgesJson()), [`Get Connections Json`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#getConnectionsJson()), [`Get Graph Json`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#getGraphJson()), [`Upload Json`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#uploadJSON(java.io.File)), [`Download Json`](https://javadoc.io/doc/io.github.vittoriopiotti/PathGraph-JavaFX/latest/com.vittoriopiotti.pathgraph/com/vittoriopiotti/pathgraph/app/PathGraph.html#downloadJSON(java.io.File))\n\n### Structure\n\n**Graph**\n\n```json\n{\n  \"nodes\": [\"A\", \"B\",\"C\"],\n  \"edges\": [\n    {\n      \"from\": \"A\",\n      \"to\": \"B\",\n      \"cost\": 1,\n      \"isArrowed\": true\n    },\n    {\n      \"from\": \"B\",\n      \"to\": \"A\",\n      \"cost\": 10,\n      \"isArrowed\": true\n    },\n    {\n      \"from\": \"B\",\n      \"to\": \"C\",\n      \"cost\": 2,\n      \"isArrowed\": false\n    }\n  ]\n}\n```\n\n\u003cdetails\u003e\n  \n\u003csummary\u003e\n   \u003cstrong\u003eNodes\u003c/strong\u003e\n\u003c/summary\u003e\n\n```json\n{\n  \"nodes\": [\n    \"A\",\n    \"C\",\n    \"B\"\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \n\u003csummary\u003e\n   \u003cstrong\u003eEdges\u003c/strong\u003e\n\u003c/summary\u003e\n\n```json\n{\n  \"edges\": [\n    {\n      \"from\": \"A\",\n      \"to\": \"B\",\n      \"cost\": 1,\n      \"isArrowed\": true\n    },\n    {\n      \"from\": \"C\",\n      \"to\": \"A\",\n      \"cost\": 2,\n      \"isArrowed\": false\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \n\u003csummary\u003e\n   \u003cstrong\u003eConnections\u003c/strong\u003e\n\u003c/summary\u003e\n\n```json\n{\n  \"connections\": [\n    {\n      \"node\": \"B\",\n      \"edges\": [\n      ]\n    },\n    {\n      \"node\": \"A\",\n      \"edges\": [\n        {\n          \"to\": \"B\",\n          \"cost\": 1\n        },\n        {\n          \"to\": \"C\",\n          \"cost\": 2\n        }\n      ]\n    },\n    {\n      \"node\": \"C\",\n      \"edges\": [\n        {\n          \"to\": \"A\",\n          \"cost\": 2\n        }\n      ]\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\n\n\n## 9. Configuration and Styling \u003cdiv id=\"configurations-and-styling\"/\u003e\n\n\nIn future versions will be optimized the management of configurations and styles similar to the original project of the fork [(see)](https://github.com/brunomnsilva/JavaFXSmartGraph#configuration-and-styling).\n\nCurrently, the styles and configurations are preset and cannot be modified.\n\n\n\n## 10. Licenses \u003cdiv id=\"licenses\"/\u003e\n\n\n\u003e [!NOTE]\n\u003e  SVG icons from **Bootstrap**\n\n\n\n\n\n\n\n---\n\n### PathGraph\n\n\n**Copyright** 2024 Vittorio Piotti [(GitHub page)](https://github.com/vittorioPiotti) [(Personal page)](https://vittoriopiotti.altervista.org/) \n\n**Version** [v1.0.4](https://github.com/vittorioPiotti/PathGraph-JavaFX/releases/tag/1.0.4)\n\n**License** [GPL-3.0](https://github.com/vittorioPiotti/JavaFXPathGraph/blob/master/LICENSE.txt)\n\n\n\n\n\n---\n\n### SmartGraph\n\n**Copyright** 2019 - 2024 Bruno Silva [(GitHub page)](https://github.com/brunomnsilva) [(Personal page)](https://www.brunomnsilva.com/) \n\n**Version** [v2.0.0](https://github.com/brunomnsilva/JavaFXSmartGraph/releases/tag/v2.0.0)\n\n**License** [MIT](https://github.com/brunomnsilva/JavaFXSmartGraph/blob/master/LICENSE.txt)\n\n\n\n---\n\n### Bootstrap Icons\n\n**Copyright** 2011-2018 The Bootstrap Authors \n\n**Version** [v1.11.0](https://blog.getbootstrap.com/2023/09/12/bootstrap-icons-1-11-0/)\n\n**License** [MIT](https://github.com/twbs/icons/blob/main/LICENSE)\n\n\n\n---\n\n\n## Fork-Based On SmartGraph \u003cdiv id=\"fork-based-on-smartgraph\"/\u003e\n\n\nThis library is a fork based on the source code of the [SmartGraph](https://github.com/brunomnsilva/JavaFXSmartGraph) [v2.0.0](https://github.com/brunomnsilva/JavaFXSmartGraph/releases/tag/v2.0.0) library on which existing classes have been modified and new ones have been added. PathGraph is therefore the adaptation of SmartGraph to specific path graphs features in a stable user interface.\n\n[_See SmartGraph_](https://github.com/brunomnsilva/JavaFXSmartGraph)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvittoriopiotti%2Fpathgraph-javafx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvittoriopiotti%2Fpathgraph-javafx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvittoriopiotti%2Fpathgraph-javafx/lists"}