' '----------------- '----------------- '--- HECLEGEND --- '----------------- '----------------- ' '---------------------------- '--- creation information --- '---------------------------- ' 'Name: heclegend.ave 'Version: 4.0.av.na 'Date: 02/22/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' www.ce.utexas.edu/stu/ferdi/ ' '--------------------------- '--- purpose/description --- '--------------------------- ' 'This script creates/updates the legend for HECPREPRO themes. ' '----------------- '--- get theme --- '----------------- ' if ((self = nil) or (self.getclass.getclassname = "button")) then theview = av.getactivedoc theactivethemes = theview.getactivethemes if (theactivethemes.count = 0) then msgbox.error("No active themes found", "HECPREPRO") exit end if (theactivethemes.count > 1) then msgbox.error("Too many active themes found", "HECPREPRO") exit end thetheme = theactivethemes.get(0) else thetheme = self.get(0) end ' '------------------ '--- get legend --- '------------------ ' thelegend = thetheme.getlegend ' '----------------------- '--- set legend type --- '----------------------- ' thelegend.unique(thetheme, "hectype") ' '---------------------------------- '--- get legend classifications --- '---------------------------------- ' lcs = thelegend.getclassifications ' '---------------------------------- '--- set legend classifications --- '---------------------------------- ' darkgreen = color.make darkgreen.setrgblist({50, 155, 50}) ' for each lc in lcs lcv = lc.returnmaximum if (lcv = 0) then lc.setlabel("none") thelegend.getsymbol({lcv},false).setcolor(color.getblack) end if (lcv = 1) then lc.setlabel("outlet") thelegend.getsymbol({lcv},false).setcolor(color.getcyan) end if (lcv = 2) then lc.setlabel("error") thelegend.getsymbol({lcv},false).setcolor(color.getblack) end if (lcv = 3) then lc.setlabel("junction") thelegend.getsymbol({lcv},false).setcolor(darkgreen) end if (lcv = 4) then lc.setlabel("channel") thelegend.getsymbol({lcv},false).setcolor(color.getgreen) end if (lcv = 5) then lc.setlabel("subbasin") thelegend.getsymbol({lcv},false).setcolor(color.getgray) end if (lcv = 6) then lc.setlabel("sink") thelegend.getsymbol({lcv},false).setcolor(color.getred) end if (lcv = 7) then lc.setlabel("source") thelegend.getsymbol({lcv},false).setcolor(color.getgreen) end if (lcv = 8) then lc.setlabel("diversion") thelegend.getsymbol({lcv},false).setcolor(color.getmagenta) end if (lcv = 9) then lc.setlabel("error") thelegend.getsymbol({lcv},false).setcolor(color.getblack) end if (lcv >= 10) then lc.setlabel("lake") thelegend.getsymbol({lcv},false).setcolor(color.getblue) end end ' '--------------------- '--- update legend --- '--------------------- ' thetheme.updatelegend ' '----------- '--- end --- '----------- '