-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/remove font awesome2 #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Death111
merged 46 commits into
doubleSlashde:develop
from
DavidDamke:feature/removeFontAwesome2
Oct 17, 2022
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
eb7c54a
Merge pull request #30 from doubleSlashde/develop
Death111 5f45b9a
Merge pull request #31 from doubleSlashde/develop
Death111 e808a32
Merge pull request #83 from doubleSlashde/develop
JSchraff aad505c
Merge pull request #86 from doubleSlashde/develop
JSchraff 11f72c3
add method to get svgPath from XMl
008a2b0
add Icons to Button
1f84bcb
add path for RECOURSES in Resources.java
40a42f6
add svgs
2715495
remove FontAwesome Imports
7bfce3f
remove FontAwesome Imports in Fxml and Dependencys in pom
ec7dbf6
rollback pom to original from Develop remove Dependencys FontAwesome
c5c26c5
extract method in class
975befb
add new Svg Icons
e6892ad
remove getSvgPathWithXML and getNode and extract in own Class
d2ba4ea
add Icon path to Resources
a4f33b5
add new Icons to Buttons
ef9bb02
add new License for Fontawesome Icons
7dcfdbe
update Fontawesome License name
8c69489
change wrong url
c24337b
remove unused exception throws
d4983fa
add JavaDoc and Exception error message
1e5f339
add format fix
63a8ddd
add Icon and Description to Report Button
e7309fa
add configurable scale
1d606cc
remove unused import
520048e
Create maven.yml
DavidDamke 8f4b7e6
test github action
6930509
Update maven.yml
DavidDamke 3521871
test github action
0d10a85
Create maven2.yml
DavidDamke 6eef631
Update maven.yml
DavidDamke bae226a
Merge remote-tracking branch 'origin/master' into feature/removeFontA…
0db2c83
test github action
179b4fc
test github action
88dba8b
small changes
Death111 8c438a2
Update maven2.yml
DavidDamke b877358
Update maven2.yml
DavidDamke a77b24c
Merge remote-tracking branch 'origin/master' into feature/removeFontA…
1b885ec
format changes
9dee880
git hubaction test
b39bc8b
git hubaction test
25e5431
git hubaction test
52591df
delete mavenci and create extra branch for ci
c4fb99f
set svgPath instead of only using the PAthString
42671ee
test githubaction
8bf3422
delete testfile
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/de/doubleslash/keeptime/common/SvgNodeProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package de.doubleslash.keeptime.common; | ||
|
|
||
| import javafx.scene.Node; | ||
| import javafx.scene.shape.SVGPath; | ||
| import org.w3c.dom.Document; | ||
| import org.w3c.dom.NodeList; | ||
| import org.xml.sax.SAXException; | ||
|
|
||
| import javax.xml.parsers.DocumentBuilder; | ||
| import javax.xml.parsers.DocumentBuilderFactory; | ||
| import javax.xml.parsers.ParserConfigurationException; | ||
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
|
|
||
| /** | ||
| * Class loads SvgPath from a SvgFile because Java can not load the original svg file as it is. | ||
| * <p> | ||
| * To load the svg the class extracts the path as string and creates a new SvgPath and returns it. | ||
| */ | ||
|
|
||
| public class SvgNodeProvider { | ||
Death111 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public static String getSvgPathWithXMl(Resources.RESOURCE resource) { | ||
| String svgPath; | ||
| Document document; | ||
| DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | ||
| DocumentBuilder db; | ||
|
|
||
| try { | ||
| db = dbf.newDocumentBuilder(); | ||
| } catch (ParserConfigurationException e) { | ||
| throw new RuntimeException("Tried to build new document", e); | ||
| } | ||
|
|
||
| try (InputStream inputStream = Resources.getResource(resource).openStream()) { | ||
| document = db.parse(inputStream); | ||
| NodeList nodeList = document.getElementsByTagName("path"); | ||
| svgPath = nodeList.item(0).getAttributes().getNamedItem("d").getNodeValue(); | ||
| } catch (IOException | SAXException e) { | ||
| throw new RuntimeException("Could not extract SvgPath from resource " + resource, e); | ||
| } | ||
| return svgPath; | ||
| } | ||
|
|
||
| public static Node getSvgNodeWithScale(Resources.RESOURCE resource, Double scaleX, Double scaleY) { | ||
| SVGPath iconSvg = new SVGPath(); | ||
| iconSvg.setContent(getSvgPathWithXMl(resource)); | ||
| iconSvg.setScaleX(scaleX); | ||
| iconSvg.setScaleY(scaleY); | ||
| return iconSvg; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.