@@ -85,7 +85,7 @@ protected int setupShaderProgramForRenderingLayerUndirected(final GL2ES2 gl,
85
85
final RenderingLayer layer ,
86
86
final VizEngine engine ,
87
87
final float [] mvpFloats ) {
88
- final boolean someSelection = engine .getLookup ().lookup (GraphSelection .class ).getSelectedEdgesCount () > 0 ;
88
+ final boolean someSelection = engine .getLookup ().lookup (GraphSelection .class ).someNodesOrEdgesSelection () ;
89
89
final boolean renderingUnselectedEdges = layer .isBack ();
90
90
if (!someSelection && renderingUnselectedEdges ) {
91
91
return 0 ;
@@ -133,7 +133,7 @@ protected int setupShaderProgramForRenderingLayerUndirected(final GL2ES2 gl,
133
133
);
134
134
135
135
if (someSelection ) {
136
- if (someNodesSelection && edgeSelectionColor ) {
136
+ if (someSelection && edgeSelectionColor ) {
137
137
lineModelUndirected .useProgram (
138
138
gl ,
139
139
mvpFloats ,
@@ -175,7 +175,7 @@ protected int setupShaderProgramForRenderingLayerDirected(final GL2ES2 gl,
175
175
final RenderingLayer layer ,
176
176
final VizEngine engine ,
177
177
final float [] mvpFloats ) {
178
- final boolean someSelection = engine .getLookup ().lookup (GraphSelection .class ).getSelectedEdgesCount () > 0 ;
178
+ final boolean someSelection = engine .getLookup ().lookup (GraphSelection .class ).someNodesOrEdgesSelection () ;
179
179
final boolean renderingUnselectedEdges = layer .isBack ();
180
180
if (!someSelection && renderingUnselectedEdges ) {
181
181
return 0 ;
@@ -222,7 +222,7 @@ protected int setupShaderProgramForRenderingLayerDirected(final GL2ES2 gl,
222
222
);
223
223
224
224
if (someSelection ) {
225
- if (someNodesSelection && edgeSelectionColor ) {
225
+ if (someSelection && edgeSelectionColor ) {
226
226
lineModelDirected .useProgram (
227
227
gl ,
228
228
mvpFloats ,
@@ -262,15 +262,15 @@ protected int setupShaderProgramForRenderingLayerDirected(final GL2ES2 gl,
262
262
263
263
protected int updateDirectedData (
264
264
final Graph graph ,
265
- final boolean someEdgesSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean someNodesSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
265
+ final boolean someSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
266
266
final float [] attribs , int index
267
267
) {
268
- return updateDirectedData (graph , someEdgesSelection , hideNonSelected , visibleEdgesCount , visibleEdgesArray , graphSelection , someNodesSelection , edgeSelectionColor , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor , attribs , index , null );
268
+ return updateDirectedData (graph , someSelection , hideNonSelected , visibleEdgesCount , visibleEdgesArray , graphSelection , edgeSelectionColor , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor , attribs , index , null );
269
269
}
270
270
271
271
protected int updateDirectedData (
272
272
final Graph graph ,
273
- final boolean someEdgesSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean someNodesSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
273
+ final boolean someSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
274
274
final float [] attribs , int index , final FloatBuffer directBuffer
275
275
) {
276
276
checkBufferIndexing (directBuffer , attribs , index );
@@ -281,11 +281,11 @@ protected int updateDirectedData(
281
281
return index ;
282
282
}
283
283
284
- saveSelectionState (someNodesSelection , edgeSelectionColor , graphSelection , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor );
284
+ saveSelectionState (this . someSelection , edgeSelectionColor , graphSelection , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor );
285
285
286
286
int newEdgesCountUnselected = 0 ;
287
287
int newEdgesCountSelected = 0 ;
288
- if (someEdgesSelection ) {
288
+ if (someSelection ) {
289
289
if (hideNonSelected ) {
290
290
for (int j = 0 ; j < visibleEdgesCount ; j ++) {
291
291
final Edge edge = visibleEdgesArray [j ];
@@ -387,15 +387,15 @@ protected int updateDirectedData(
387
387
388
388
protected int updateUndirectedData (
389
389
final Graph graph ,
390
- final boolean someEdgesSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean someNodesSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
390
+ final boolean someSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
391
391
final float [] attribs , int index
392
392
) {
393
- return updateUndirectedData (graph , someEdgesSelection , hideNonSelected , visibleEdgesCount , visibleEdgesArray , graphSelection , someNodesSelection , edgeSelectionColor , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor , attribs , index , null );
393
+ return updateUndirectedData (graph , someSelection , hideNonSelected , visibleEdgesCount , visibleEdgesArray , graphSelection , edgeSelectionColor , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor , attribs , index , null );
394
394
}
395
395
396
396
protected int updateUndirectedData (
397
397
final Graph graph ,
398
- final boolean someEdgesSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean someNodesSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
398
+ final boolean someSelection , final boolean hideNonSelected , final int visibleEdgesCount , final Edge [] visibleEdgesArray , final GraphSelection graphSelection , final boolean edgeSelectionColor , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ,
399
399
final float [] attribs , int index , final FloatBuffer directBuffer
400
400
) {
401
401
checkBufferIndexing (directBuffer , attribs , index );
@@ -406,12 +406,12 @@ protected int updateUndirectedData(
406
406
return index ;
407
407
}
408
408
409
- saveSelectionState (someNodesSelection , edgeSelectionColor , graphSelection , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor );
409
+ saveSelectionState (someSelection , edgeSelectionColor , graphSelection , edgeBothSelectionColor , edgeOutSelectionColor , edgeInSelectionColor );
410
410
411
411
int newEdgesCountUnselected = 0 ;
412
412
int newEdgesCountSelected = 0 ;
413
413
//Undirected edges:
414
- if (someEdgesSelection ) {
414
+ if (someSelection ) {
415
415
if (hideNonSelected ) {
416
416
for (int j = 0 ; j < visibleEdgesCount ; j ++) {
417
417
final Edge edge = visibleEdgesArray [j ];
@@ -522,20 +522,20 @@ private void checkBufferIndexing(final FloatBuffer directBuffer, final float[] a
522
522
}
523
523
}
524
524
525
- private boolean someNodesSelection ;
525
+ private boolean someSelection ;
526
526
private boolean edgeSelectionColor ;
527
527
private GraphSelection graphSelection ;
528
528
private float edgeBothSelectionColor ;
529
529
private float edgeOutSelectionColor ;
530
530
private float edgeInSelectionColor ;
531
531
532
- private void saveSelectionState (final boolean someNodesSelection1 , final boolean edgeSelectionColor1 , final GraphSelection graphSelection1 , final float edgeBothSelectionColor1 , final float edgeOutSelectionColor1 , final float edgeInSelectionColor1 ) {
533
- this .someNodesSelection = someNodesSelection1 ;
534
- this .edgeSelectionColor = edgeSelectionColor1 ;
535
- this .graphSelection = graphSelection1 ;
536
- this .edgeBothSelectionColor = edgeBothSelectionColor1 ;
537
- this .edgeOutSelectionColor = edgeOutSelectionColor1 ;
538
- this .edgeInSelectionColor = edgeInSelectionColor1 ;
532
+ private void saveSelectionState (final boolean someSelection , final boolean edgeSelectionColor , final GraphSelection graphSelection , final float edgeBothSelectionColor , final float edgeOutSelectionColor , final float edgeInSelectionColor ) {
533
+ this .someSelection = someSelection ;
534
+ this .edgeSelectionColor = edgeSelectionColor ;
535
+ this .graphSelection = graphSelection ;
536
+ this .edgeBothSelectionColor = edgeBothSelectionColor ;
537
+ this .edgeOutSelectionColor = edgeOutSelectionColor ;
538
+ this .edgeInSelectionColor = edgeInSelectionColor ;
539
539
}
540
540
541
541
protected void fillUndirectedEdgeAttributesDataBase (final float [] buffer , final Edge edge , final int index ) {
@@ -579,7 +579,7 @@ protected void fillUndirectedEdgeAttributesDataWithSelection(final float[] buffe
579
579
580
580
//Color:
581
581
if (selected ) {
582
- if (someNodesSelection && edgeSelectionColor ) {
582
+ if (someSelection && edgeSelectionColor ) {
583
583
boolean sourceSelected = graphSelection .isNodeSelected (source );
584
584
boolean targetSelected = graphSelection .isNodeSelected (target );
585
585
@@ -593,7 +593,7 @@ protected void fillUndirectedEdgeAttributesDataWithSelection(final float[] buffe
593
593
buffer [index + 7 ] = Float .intBitsToFloat (edge .getRGBA ());//Color
594
594
}
595
595
} else {
596
- if (someNodesSelection && edge .alpha () <= 0 ) {
596
+ if (someSelection && edge .alpha () <= 0 ) {
597
597
if (graphSelection .isNodeSelected (source )) {
598
598
buffer [index + 7 ] = Float .intBitsToFloat (target .getRGBA ());//Color
599
599
} else {
@@ -650,7 +650,7 @@ protected void fillDirectedEdgeAttributesDataWithSelection(final float[] buffer,
650
650
651
651
//Color:
652
652
if (selected ) {
653
- if (someNodesSelection && edgeSelectionColor ) {
653
+ if (someSelection && edgeSelectionColor ) {
654
654
boolean sourceSelected = graphSelection .isNodeSelected (source );
655
655
boolean targetSelected = graphSelection .isNodeSelected (target );
656
656
@@ -664,7 +664,7 @@ protected void fillDirectedEdgeAttributesDataWithSelection(final float[] buffer,
664
664
buffer [index + 6 ] = Float .intBitsToFloat (edge .getRGBA ());//Color
665
665
}
666
666
} else {
667
- if (someNodesSelection && edge .alpha () <= 0 ) {
667
+ if (someSelection && edge .alpha () <= 0 ) {
668
668
if (graphSelection .isNodeSelected (source )) {
669
669
buffer [index + 6 ] = Float .intBitsToFloat (target .getRGBA ());//Color
670
670
} else {
0 commit comments