{"id":18985387,"url":"https://github.com/traunin/debug-graphics-2d","last_synced_at":"2026-02-23T21:46:55.058Z","repository":{"id":256816846,"uuid":"856520024","full_name":"Traunin/debug-graphics-2d","owner":"Traunin","description":"Graphics2D debugger","archived":false,"fork":false,"pushed_at":"2024-09-29T19:05:06.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T19:23:35.671Z","etag":null,"topics":["debugging","graphics2d","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Traunin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-12T18:00:02.000Z","updated_at":"2024-10-19T09:39:24.000Z","dependencies_parsed_at":"2024-11-08T16:34:05.534Z","dependency_job_id":"5edd40fe-d114-4b9d-a686-dfce53226ab2","html_url":"https://github.com/Traunin/debug-graphics-2d","commit_stats":null,"previous_names":["traunin/debuggraphics2d"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traunin%2Fdebug-graphics-2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traunin%2Fdebug-graphics-2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traunin%2Fdebug-graphics-2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traunin%2Fdebug-graphics-2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Traunin","download_url":"https://codeload.github.com/Traunin/debug-graphics-2d/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249793957,"owners_count":21326638,"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":["debugging","graphics2d","java"],"created_at":"2024-11-08T16:26:16.596Z","updated_at":"2026-02-23T21:46:50.028Z","avatar_url":"https://github.com/Traunin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DebugGraphics2D\n\nThe following library is a superset of Java's Graphics2D class which allows users to display markers at primitives' control points for debugging purposes.\n\n## Download\n\nIf you don't want to build the library yourself, you can download the jar file from the releases tab.\n\n## Building\n\n### Manually\n\nPrerequisites:\n\n- JDK (preferably 21 or newer)\n- `javac` and `jar` in PATH\n- `git` (to clone the repository, not necessary)\n\nClone the repository:\n\n```sh\ngit clone https://github.com/traunin/debug-graphics-2d\n```\n\nOr download the code manually and extract it in the current folder.\n\nGo into the folder:\n\n```sh\ncd debug-graphics-2d\n```\n\nRun:\n\n```sh\njavac -d bin src/com/github/traunin/debug_graphics_2d/*.java\njar cf DebugGraphics2D.jar -C bin .\n```\n\nThe jar file is generated in the root folder of the repository.\n\n### IntelliJ IDEA\n\nAlternatively, if you are using IntelliJ IDEA: \n\n1. Go to \"File \u003e Project Structure \u003e Artifacts\".\n2. Click on the plus icon.\n3. Select \"JAR \u003e From modules with dependencies\".\n4. Go to \"Build \u003e Build Artifacts\".\n5. Your jar file is now in the out/artifacts directory.\n\n## Importing\n\n### Gradle\n\nIn the `app` directory create the `lib` folder (or name as you wish) at the same level as the build file and the `src` folder. Place the jar file in that directory.\n\nThen, modify the corresponding build file:\n\n`build.gradle`:\n\n```groovy\ndependencies {\n    # other dependencies above\n    implementation files('lib/DebugGraphics2D.jar')\n}\n```\n\n`build.gradle.kts`:\n\n```kts\ndependencies {\n    // other dependencies above\n    implementation(files(\"lib/DebugGraphics2D.jar\"))\n}\n```\n\nAnd rebuild the project. The package should be available for import.\n\n## Usage\n\n```java\n// get the object\n\n// import the library\nimport com.github.traunin.debug_graphics_2d.DebugGraphics2D;\n\n// get any graphics instance from JFrame, JPanel, etc.\nfinal Graphics g;\n\n// create from graphics2d instance\nfinal DebugGraphics2D g2d = new DebugGraphics2D((Graphics2D) g);\n\n\n// debug parameters\n\n// enable or disable debugging (no new markers will be recorded if disabled)\n// enabled by default\ng2d.enableDebugging();\ng2d.disableDebugging();\n \n// set marker color and/or size\ng2d.setDebugColor(Color.YELLOW);\ng2d.setDebugMarkerSize(4); // prefer even size\n\n\n// draw\n\n// works the same as standard graphics2d instance\n// but will draw the corners of the drawn primitives\ng2d.fillOval(50, 50, 100, 100);\n\n// works with transforms\ng2d.translate(50, 50);\n\n// works with general path\ng2d.fill(somePath);\n\n\n// deferring markers\n\n// start drawing markers on the top layer\ng2d.startDeferringMarkers();\n\n// draw something\ng2d.fillRect(10, 10, 20, 20);\n\n// draw all of the deferred markers on the top layer\n// (if debugging was enabled)\ng2d.drawDeferredMarkers();\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraunin%2Fdebug-graphics-2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraunin%2Fdebug-graphics-2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraunin%2Fdebug-graphics-2d/lists"}