@ Override public String getLabel ( ) { String l = label ; if ( l != null ) return l ; String p = path ; if ( p != null ) { String filename = p . substring ( p . lastIndexOf ( ' ' ) + 1 ) ; if ( filename . endsWith ( DOT_EXTENSION ) ) filename = filename . substring ( 0 , filename . length ( ) - DOT_EXTENSION . length ( ) ) ; if ( filename . isEmpty ( ) ) throw new IllegalArgumentException ( "Invalid filename for diagram: " + p ) ; return filename ; } throw new IllegalStateException ( "Cannot get label, neither label nor path set" ) ; }
If not set defaults to the last path segment of path with any . dia extension stripped .