File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
modules/ImportAPI/src/main
java/org/gephi/io/importer/impl
resources/org/gephi/io/importer/impl Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -766,6 +766,10 @@ public boolean verify() {
766766 .getMessage (ImportContainerImpl .class , "ImportContainerLog.MultiGraphCount" , edgeTypeMap .size () - 1 ));
767767 }
768768
769+ //Check that not all alpha are zeros
770+ checkColorAlpha (nodeList , "Node" );
771+ checkColorAlpha (edgeList , "Edge" );
772+
769773 return true ;
770774 }
771775
@@ -1085,6 +1089,25 @@ private EdgeDraftImpl getOpposite(EdgeDraftImpl edge) {
10851089 return null ;
10861090 }
10871091
1092+ private void checkColorAlpha (ObjectList <? extends ElementDraft > objectList , String elementType ) {
1093+ if (!objectList .isEmpty ()) {
1094+ int validElement = 0 ;
1095+ int withAlphaZero = 0 ;
1096+ for (ElementDraft element : objectList ) {
1097+ if (element .getColor () != null ) {
1098+ validElement ++;
1099+ withAlphaZero += element .getColor ().getAlpha () == 0 ? 1 : 0 ;
1100+ }
1101+ }
1102+ if (validElement > 0 && validElement == withAlphaZero ) {
1103+ report .logIssue (new Issue (
1104+ NbBundle .getMessage (ImportContainerImpl .class ,
1105+ "ImportContainerException_" + elementType + "_Color_Alpha_AllZero" ),
1106+ Level .WARNING ));
1107+ }
1108+ }
1109+ }
1110+
10881111 private void checkElementDraftImpl (ElementDraft elmt ) {
10891112 if (elmt == null ) {
10901113 throw new NullPointerException ();
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ ImportContainerException_Negative_Weight = Edge id=''{0}'' has a negative weight
3232ImportContainerException_Column_Type_Mismatch = A column ' ' {0}' ' already exists but with a different type=' ' {1}' '
3333ImportContainerException_Timestamp_Parse_Error = The graph timestamp ' ' {0}' ' could not be parsed
3434ImportContainerException_Interval_Parse_Error = The graph interval ' ' {0}' ' could not be parsed
35+ ImportContainerException_Node_Color_Alpha_AllZero = All nodes color opacity is set as transparent
36+ ImportContainerException_Edge_Color_Alpha_AllZero = All edges color opacity is set as transparent
3537
3638ElementFactoryException_NullNodeId = Node id can' t be null
3739ElementFactoryException_NullEdgeId = Edge id can' t be null
You can’t perform that action at this time.
0 commit comments