22
33import com .application .controller .ControllerLoader ;
44import com .application .fxgraph .graph .Cell ;
5+ import com .application .fxgraph .graph .ColorProp ;
56import com .application .fxgraph .graph .CustomColors ;
67import javafx .geometry .Pos ;
78import javafx .scene .Node ;
@@ -43,45 +44,11 @@ public class CircleCell extends Cell {
4344
4445 public CircleCell (String id ) {
4546 super (id );
46-
47-
48- }
49-
50- private void setUpBookmark () {
51- bookmarkBar = new Rectangle (rectWidth - 2 , 30 );
52- bookmarkBar .relocate (1 , -3 );
53- bookmarkBar .setFill (Color .TRANSPARENT );
54- bookmarkBar .setStroke (Color .TRANSPARENT );
55- bookmarkBar .setStrokeWidth (0.1 );
56- bookmarkBar .setArcWidth (20 );
57- bookmarkBar .setArcHeight (20 );
58- }
59-
60- private void setUpButtons () {
61- setUpMinMaxButton ();
62- setUpInfoButton ();
63- }
64-
65- private void setUpMinMaxButton () {
66- setMinMaxIcon ();
67-
68- minMaxStackPane = new StackPane (minMaxGlyph );
69- minMaxStackPane .relocate (rectWidth - 6 , -8 );
70- minMaxStackPane .setVisible (false );
7147 }
7248
73- private void setUpInfoButton () {
74- Glyph infoGlyph = new Glyph ("FontAwesome" , FontAwesome .Glyph .INFO_CIRCLE );
75- infoGlyph .setColor (infoButtonColor );
76-
77- infoStackPane = new StackPane (infoGlyph );
78- infoStackPane .relocate (rectWidth - 6 , (rectHeight - 8 ));
79- infoStackPane .setVisible (false );
80- }
81-
82-
8349 public CircleCell (String id , float xCoordinate , float yCoordinate , int collapsed ) {
8450 this (id );
51+ boolean isLite = ControllerLoader .menuController .isLiteModeEnabled ;
8552
8653 // Uncomment to see a colored background on the whole circle cell stack pane.
8754 // setStyle("-fx-background-smallButtonsColor: mediumslateblue");
@@ -91,11 +58,11 @@ public CircleCell (String id, float xCoordinate, float yCoordinate, int collapse
9158 this .collapsed = collapsed != 0 ;
9259 label = new Label ("" );
9360
94- setUpDropShadow ();
95- setUpIdLabel (id );
61+ setUpDropShadow (isLite );
62+ setUpIdLabel (id , isLite );
9663 setUpMethodName ();
9764 setUpButtons ();
98- setFill ();
65+ setFill (isLite );
9966 setUpBookmark ();
10067
10168 getChildren ().addAll (nodeShape , methodNameLabel , idBubble , minMaxStackPane , infoStackPane , bookmarkBar );
@@ -123,6 +90,39 @@ public CircleCell (String id, float xCoordinate, float yCoordinate, int collapse
12390 this .relocate (xCoordinate , yCoordinate );
12491 }
12592
93+ private void setUpBookmark () {
94+ bookmarkBar = new Rectangle (rectWidth - 2 , 30 );
95+ bookmarkBar .relocate (1 , -3 );
96+ bookmarkBar .setFill (Color .TRANSPARENT );
97+ bookmarkBar .setStroke (Color .TRANSPARENT );
98+ bookmarkBar .setStrokeWidth (0.1 );
99+ bookmarkBar .setArcWidth (20 );
100+ bookmarkBar .setArcHeight (20 );
101+ }
102+
103+ private void setUpButtons () {
104+ setUpMinMaxButton ();
105+ setUpInfoButton ();
106+ }
107+
108+ private void setUpMinMaxButton () {
109+ setMinMaxIcon ();
110+
111+ minMaxStackPane = new StackPane (minMaxGlyph );
112+ minMaxStackPane .relocate (rectWidth - 6 , -8 );
113+ minMaxStackPane .setVisible (false );
114+ }
115+
116+ private void setUpInfoButton () {
117+ Glyph infoGlyph = new Glyph ("FontAwesome" , FontAwesome .Glyph .INFO_CIRCLE );
118+ infoGlyph .setColor (infoButtonColor );
119+
120+ infoStackPane = new StackPane (infoGlyph );
121+ infoStackPane .relocate (rectWidth - 6 , (rectHeight - 8 ));
122+ infoStackPane .setVisible (false );
123+ }
124+
125+
126126 public CircleCell (String id , float xCoordinate , float yCoordinate , String methodName , int collapsed ) {
127127 this (id , xCoordinate , yCoordinate , collapsed );
128128 this .methodNameLabel .setText (methodName );
@@ -222,13 +222,20 @@ private Shape createRectangle() {
222222 return rect ;
223223 }
224224
225- private void setFill () {
226- Stop [] stops = new Stop [] { new Stop (0 , cell1Color ), new Stop (1 , cell2Color )};
227- LinearGradient linearGradient = new LinearGradient (0 , 0 , 1 , 0 , true , CycleMethod .NO_CYCLE , stops );
228- nodeShape .setFill (linearGradient );
225+ private void setFill (boolean isLite ) {
226+ if (isLite ) {
227+ nodeShape .setFill (Color .WHITE );
228+ nodeShape .setStroke (Color .GREY );
229+ nodeShape .setStrokeWidth (0.5 );
230+ } else {
231+ Stop [] stops = new Stop [] { new Stop (0 , cell1Color ), new Stop (1 , cell2Color )};
232+ LinearGradient linearGradient = new LinearGradient (0 , 0 , 1 , 0 , true , CycleMethod .NO_CYCLE , stops );
233+ nodeShape .setFill (linearGradient );
234+ }
235+
229236 }
230237
231- private void setUpIdLabel (String id ) {
238+ private void setUpIdLabel (String id , boolean isLite ) {
232239 double x = 0 , y = 0 ;
233240 Label idLabel = new Label (id );
234241 idLabel .setFont (Font .font (10 ));
@@ -242,17 +249,22 @@ private void setUpIdLabel(String id) {
242249 ((Rectangle ) background ).setHeight (height );
243250 ((Rectangle ) background ).setArcHeight (10 );
244251 ((Rectangle ) background ).setArcWidth (10 );
245- background .setFill (idBubbleBackgroundColor );
246-
247- DropShadow dropShadow = new DropShadow ();
248- dropShadow .setWidth (width );
249- dropShadow .setHeight (width );
250- dropShadow .setOffsetX (2 );
251- dropShadow .setOffsetY (2 );
252- dropShadow .setRadius (5 );
253- dropShadow .setColor (idBubbleShadowColor );
254- background .setEffect (dropShadow );
252+ background .setFill (idBubbleBackgroundColor );
255253
254+ if (isLite ) {
255+ // background.setFill(Color.WHITE);
256+ // background.setStroke(ColorProp.GREY);
257+ // background.setStrokeWidth(.5);
258+ } else {
259+ DropShadow dropShadow = new DropShadow ();
260+ dropShadow .setWidth (width );
261+ dropShadow .setHeight (width );
262+ dropShadow .setOffsetX (2 );
263+ dropShadow .setOffsetY (2 );
264+ dropShadow .setRadius (5 );
265+ dropShadow .setColor (idBubbleShadowColor );
266+ background .setEffect (dropShadow );
267+ }
256268
257269 // background.setStroke(CustomColors.DARK_GREY.getPaint());
258270
@@ -261,15 +273,17 @@ private void setUpIdLabel(String id) {
261273 idBubble .relocate (-((Rectangle ) background ).getWidth () * 0.5 , -((Rectangle ) background ).getHeight () * 0.5 );
262274 }
263275
264- private void setUpDropShadow () {
265- DropShadow dropShadow = new DropShadow ();
266- dropShadow .setWidth (rectWidth );
267- dropShadow .setHeight (rectHeight );
268- dropShadow .setOffsetX (12 );
269- dropShadow .setOffsetY (12 );
270- dropShadow .setRadius (40 );
271- dropShadow .setColor (cellShadowColor );
272- this .setEffect (dropShadow );
276+ private void setUpDropShadow (boolean isLite ) {
277+ if (!isLite ) {
278+ DropShadow dropShadow = new DropShadow ();
279+ dropShadow .setWidth (rectWidth );
280+ dropShadow .setHeight (rectHeight );
281+ dropShadow .setOffsetX (12 );
282+ dropShadow .setOffsetY (12 );
283+ dropShadow .setRadius (40 );
284+ dropShadow .setColor (cellShadowColor );
285+ this .setEffect (dropShadow );
286+ }
273287 }
274288
275289 // Color smallButtonsColor = Color.valueOf("#e5a2d0");
0 commit comments