From 1ea792e007ef52b594d0f9c4f5f527d39d25572c Mon Sep 17 00:00:00 2001 From: Qventeen Date: Fri, 6 Nov 2020 17:11:58 +0200 Subject: [PATCH] Fix Fillable.java When I started demo from gs-algo/src-test/org/graphstream/algorithm/measure/demo/* I got that Exception: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Float (java.lang.Double and java.lang.Float are in module java.base of loader 'bootstrap') at org.graphstream.ui.swing.renderer.shape.swing.shapePart.Fillable.configureFillableForElement(Fillable.java:106) --- .../ui/swing/renderer/shape/swing/shapePart/Fillable.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/graphstream/ui/swing/renderer/shape/swing/shapePart/Fillable.java b/src/org/graphstream/ui/swing/renderer/shape/swing/shapePart/Fillable.java index 680f037..2a5fb63 100644 --- a/src/org/graphstream/ui/swing/renderer/shape/swing/shapePart/Fillable.java +++ b/src/org/graphstream/ui/swing/renderer/shape/swing/shapePart/Fillable.java @@ -103,7 +103,7 @@ public void configureFillableForGroup(Backend bck, Style style, DefaultCamera2D public void configureFillableForElement( Style style, DefaultCamera2D camera, GraphicElement element ) { if( style.getFillMode() == StyleConstants.FillMode.DYN_PLAIN && element != null ) { if ( element.getAttribute( "ui.color" ) instanceof Number ) { - theFillPercent = (float)((Number)element.getAttribute( "ui.color" )); + theFillPercent = ((Number)element.getAttribute( "ui.color" )).floatValue(); theFillColor = null; } else if ( element.getAttribute( "ui.color" ) instanceof Color ) { @@ -119,4 +119,4 @@ else if ( element.getAttribute( "ui.color" ) instanceof Color ) { theFillPercent = 0; } } -} \ No newline at end of file +}