Skip to content

Commit 314b7ff

Browse files
committed
Remove style inline property (commented).
1 parent 1d1bd51 commit 314b7ff

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

src/main/java/com/brunomnsilva/smartgraph/graphview/SmartStyleProxy.java

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,37 @@ public boolean removeStyleClass(String cssClass) {
8383
* @param source the shape whose styles are to be copied
8484
* @param destination the shape that receives the copied styles
8585
*/
86-
public static void copyStyling(Shape source, Shape destination) {
86+
protected static void copyStyling(Shape source, Shape destination) {
8787
destination.setStyle(source.getStyle());
8888
destination.getStyleClass().addAll(source.getStyleClass());
8989
}
90+
91+
/*
92+
93+
// This may be used in the future.
94+
95+
public void removeStyleInlineProperty(String cssProperty) {
96+
// Get the current inline style
97+
String currentStyle = client.getStyle();
98+
99+
// Split the style into individual property declarations
100+
String[] styleProperties = currentStyle.split(";");
101+
102+
// Reconstruct the style without the -fx-fill property
103+
StringBuilder newStyle = new StringBuilder();
104+
for (String property : styleProperties) {
105+
// Split each property into key-value pair
106+
String[] keyValue = property.split(":");
107+
if (keyValue.length == 2) {
108+
// Check if the property is -fx-fill, if not, add it to the new style
109+
String key = keyValue[0].trim();
110+
if (!key.equals(cssProperty)) {
111+
newStyle.append(property).append(";");
112+
}
113+
}
114+
}
115+
116+
// Apply the modified inline style
117+
client.setStyle(newStyle.toString());
118+
}*/
90119
}

0 commit comments

Comments
 (0)