public static Style createDefaultPropertiesForTable ( ASpatialDb database , String spatialTableUniqueName , String spatialTableLabelField ) throws Exception { StringBuilder sbIn = new StringBuilder ( ) ; sbIn . append ( "insert into " ) . append ( PROPERTIESTABLE ) ; sbIn . append ( " ( " ) ; sbIn . append ( NAME ) . append ( " , " ) ; sbIn . append ( SIZE ) . append ( " , " ) ; sbIn . append ( FILLCOLOR ) . append ( " , " ) ; sbIn . append ( STROKECOLOR ) . append ( " , " ) ; sbIn . append ( FILLALPHA ) . append ( " , " ) ; sbIn . append ( STROKEALPHA ) . append ( " , " ) ; sbIn . append ( SHAPE ) . append ( " , " ) ; sbIn . append ( WIDTH ) . append ( " , " ) ; sbIn . append ( LABELSIZE ) . append ( " , " ) ; sbIn . append ( LABELFIELD ) . append ( " , " ) ; sbIn . append ( LABELVISIBLE ) . append ( " , " ) ; sbIn . append ( ENABLED ) . append ( " , " ) ; sbIn . append ( ORDER ) . append ( " , " ) ; sbIn . append ( DASH ) . append ( " ," ) ; sbIn . append ( MINZOOM ) . append ( " ," ) ; sbIn . append ( MAXZOOM ) . append ( " ," ) ; sbIn . append ( DECIMATION ) ; sbIn . append ( " ) " ) ; sbIn . append ( " values " ) ; sbIn . append ( " ( " ) ; Style style = new Style ( ) ; style . name = spatialTableUniqueName ; style . labelfield = spatialTableLabelField ; if ( spatialTableLabelField != null && spatialTableLabelField . trim ( ) . length ( ) > 0 ) { style . labelvisible = 1 ; } sbIn . append ( style . insertValuesString ( ) ) ; sbIn . append ( " );" ) ; if ( database != null ) { String insertQuery = sbIn . toString ( ) ; database . executeInsertUpdateDeleteSql ( insertQuery ) ; } return style ; }
Create a default properties table for a spatial table .