Changeset 5991 for branches/geomap/gui/scripts/geomaplayer.tcl
- Timestamp:
- Feb 9, 2016, 9:50:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/geomap/gui/scripts/geomaplayer.tcl
r5949 r5991 27 27 28 28 private variable _provider "" 29 private variable _placardstyle_default {fill: #B6B6B688; text-fill: #000000; text-size: 12.0;} 29 30 30 31 public variable label "" … … 33 34 public variable visibility "true" 34 35 public variable opacity "1.0" 36 public variable placardattributes "" 37 public variable placardstyle "" 38 public variable placardpadding 5 35 39 36 40 private method Provider { provider } … … 51 55 Provider $provider 52 56 57 set placardstyle ${_placardstyle_default} 58 53 59 eval configure $args 54 60 } … … 82 88 83 89 if {[string compare "" $label] == 0} { 84 error "bad value: \"$label\": should be a non-empty string"90 error "bad value: \"$label\": label should be a non-empty string" 85 91 } 86 92 } … … 93 99 94 100 if {[string compare "" $description] == 0} { 95 error "bad value: \"$description\": should be a non-empty string"101 error "bad value: \"$description\": description should be a non-empty string" 96 102 } 97 103 } … … 104 110 105 111 if {[string compare "" $attribution] == 0} { 106 error "bad value: \"$attribution\": should be a non-empty string"112 error "bad value: \"$attribution\": attribution should be a non-empty string" 107 113 } 108 114 } … … 115 121 116 122 if {[string is bool $visibility] == 0} { 117 error "bad value: \"$visibility\": should be a boolean"123 error "bad value: \"$visibility\": visibility should be a boolean" 118 124 } 119 125 } … … 126 132 127 133 if {[string is double $opacity] == 0} { 128 error "bad value: \"$opacity\": should be a double"134 error "bad value: \"$opacity\": opacity should be a double" 129 135 } 130 136 131 137 if {[expr {$opacity < 0.0}] == 1 || [expr {$opacity > 1.0}] == 1} { 132 error "bad value: \"$opacity\": should be in range \[0.0,1.0\]" 138 error "bad value: \"$opacity\": opacity should be in range \[0.0,1.0\]" 139 } 140 } 141 142 143 # ---------------------------------------------------------------------- 144 # placardattributes: key value list of attributes to show in the placard 145 # ---------------------------------------------------------------------- 146 itcl::configbody Rappture::GeoMapLayer::placardattributes { 147 148 if { [expr {[llength $placardattributes] % 2}] != 0 } { 149 error "bad value \"$placardattributes\": uneven number of placard attributes" 150 } 151 152 regsub -all "\[ \t\r\n\]+" [string trim $placardattributes] " " placardattributes 153 } 154 155 156 # ---------------------------------------------------------------------- 157 # placardstyle: CSS formatted style definition for text and background 158 # ---------------------------------------------------------------------- 159 itcl::configbody Rappture::GeoMapLayer::placardstyle { 160 161 if {[string equal $placardstyle ""]} { 162 # blank value sets style back to the default 163 set placardstyle ${_placardstyle_default} 164 } 165 166 regsub -all "\[ \t\r\n\]+" [string trim $placardstyle] " " placardstyle 167 } 168 169 170 # ---------------------------------------------------------------------- 171 # placardpadding: pixels between attribute labels and edge of the backing quad 172 # ---------------------------------------------------------------------- 173 itcl::configbody Rappture::GeoMapLayer::placardpadding { 174 175 if {[string is integer $placardpadding] == 0} { 176 error "bad value \"$placardpadding\": placardpadding should be a positive integer" 177 } 178 179 if {$placardpadding < 0} { 180 error "bad value \"$placardpadding\": placardpadding should be a positive integer" 133 181 } 134 182 } … … 213 261 visible $visibility \ 214 262 opacity $opacity \ 215 263 placard [list \ 264 attrlist $placardattributes\ 265 style $placardstyle\ 266 padding $placardpadding\ 267 ] 216 268 } 217 269 default {
Note: See TracChangeset
for help on using the changeset viewer.