GUI -- Created new glyphs (with unit tests) for toolbar.
Change-Id: I4a118f5efdbaa41d3ef657de2adb4ad360b1c4f4
Showing
3 changed files
with
93 additions
and
6 deletions
... | @@ -107,7 +107,71 @@ | ... | @@ -107,7 +107,71 @@ |
107 | "-1.5,2-2.1c-0.6-0.9-1-2-1-3.1c0-3,2.3-5.4,5.1-5.4C97.2,16.2," + | 107 | "-1.5,2-2.1c-0.6-0.9-1-2-1-3.1c0-3,2.3-5.4,5.1-5.4C97.2,16.2," + |
108 | "99.5,18.6,99.5,21.6zM92,87.9c0,2.2-1.7,4.1-3.8,4.1H22.4c" + | 108 | "99.5,18.6,99.5,21.6zM92,87.9c0,2.2-1.7,4.1-3.8,4.1H22.4c" + |
109 | "-2.1,0-4.4-1.9-4.4-4.1v-3.3c0-2.2,2.3-4.5,4.4-4.5h65.8c2.1," + | 109 | "-2.1,0-4.4-1.9-4.4-4.1v-3.3c0-2.2,2.3-4.5,4.4-4.5h65.8c2.1," + |
110 | - "0,3.8,2.3,3.8,4.5V87.9z" | 110 | + "0,3.8,2.3,3.8,4.5V87.9z", |
111 | + | ||
112 | + // --- Topology toolbar specific glyphs ---------------------- | ||
113 | + | ||
114 | + summary: "M95.8,9.2H14.2c-2.8,0-5,2.2-5,5v81.5c0,2.8,2.2,5,5," + | ||
115 | + "5h81.5c2.8,0,5-2.2,5-5V14.2C100.8,11.5,98.5,9.2,95.8,9.2z " + | ||
116 | + "M16.7,22.2c0-1.1,0.9-2,2-2h20.1c1.1,0,2,0.9,2,2v20.1c0,1.1-0.9," + | ||
117 | + "2-2,2H18.7c-1.1,0-2-0.9-2-2V22.2z M93,87c0,1.1-0.9,2-2,2H18.9" + | ||
118 | + "c-1.1,0-2-0.9-2-2v-7c0-1.1,0.9-2,2-2H91c1.1,0,2,0.9,2,2V87z " + | ||
119 | + "M93,65c0,1.1-0.9,2-2,2H18.9c-1.1,0-2-0.9-2-2v-7c0-1.1,0.9-2," + | ||
120 | + "2-2H91c1.1,0,2,0.9,2,2V65z", | ||
121 | + | ||
122 | + details: "M95.8,9.2H14.2c-2.8,0-5,2.2-5,5v81.5c0,2.8,2.2,5,5," + | ||
123 | + "5h81.5c2.8,0,5-2.2,5-5V14.2C100.8,11.5,98.5,9.2,95.8,9.2z M16.9," + | ||
124 | + "22.2c0-1.1,0.9-2,2-2H91c1.1,0,2,0.9,2,2v7c0,1.1-0.9,2-2,2H18.9c" + | ||
125 | + "-1.1,0-2-0.9-2-2V22.2z M93,87.8c0,1.1-0.9,2-2,2H18.9c-1.1," + | ||
126 | + "0-2-0.9-2-2v-7c0-1.1,0.9-2,2-2H91c1.1,0,2,0.9,2,2V87.8z M93,68.2" + | ||
127 | + "c0,1.1-0.9,2-2,2H18.9c-1.1,0-2-0.9-2-2v-7c0-1.1,0.9-2,2-2H91" + | ||
128 | + "c1.1,0,2,0.9,2,2V68.2z M93,48.8c0,1.1-0.9,2-2,2H19c-1.1,0-2-" + | ||
129 | + "0.9-2-2v-7c0-1.1,0.9-2,2-2H91c1.1,0,2,0.9,2,2V48.8z", | ||
130 | + | ||
131 | + ports: "M98,9.2H79.6c-1.1,0-2.1,0.9-2.1,2.1v17.6l-5.4,5.4c-1.7" + | ||
132 | + "-1.1-3.8-1.8-6-1.8c-6,0-10.9,4.9-10.9,10.9c0,2.2,0.7,4.3,1.8,6" + | ||
133 | + "l-7.5,7.5c-1.8-1.2-3.9-1.9-6.2-1.9c-6,0-10.9,4.9-10.9,10.9c0," + | ||
134 | + "2.3,0.7,4.4,1.9,6.2l-6.2,6.2H11.3c-1.1,0-2.1,0.9-2.1,2.1v18.4" + | ||
135 | + "c0,1.1,0.9,2.1,2.1,2.1h18.4c1.1,0,2.1-0.9,2.1-2.1v-16l7-6.9" + | ||
136 | + "c1.4,0.7,3,1.1,4.7,1.1c6,0,10.9-4.9,10.9-10.9c0-1.7-0.4-3.3-" + | ||
137 | + "1.1-4.7l8-8c1.5,0.7,3.1,1.1,4.8,1.1c6,0,10.9-4.9,10.9-10.9c0" + | ||
138 | + "-1.7-0.4-3.4-1.1-4.8l6.9-6.9H98c1.1,0,2.1-0.9,2.1-2.1V11.3" + | ||
139 | + "C100.1,10.2,99.2,9.2,98,9.2z M43.4,72c-3.3,0-6-2.7-6-6s2.7-6," + | ||
140 | + "6-6s6,2.7,6,6S46.7,72,43.4,72z M66.1,49.5c-3.3,0-6-2.7-6-6" + | ||
141 | + "c0-3.3,2.7-6,6-6s6,2.7,6,6C72.2,46.8,69.5,49.5,66.1,49.5z", | ||
142 | + | ||
143 | + map: "M95.8,9.2H14.2c-2.8,0-5,2.2-5,5v66c0.3-1.4,0.7-2.8," + | ||
144 | + "1.1-4.1l1.6,0.5c-0.9,2.4-1.6,4.8-2.2,7.3l-0.5-0.1v12c0,2.8,2.2," + | ||
145 | + "5,5,5h81.5c2.8,0,5-2.2,5-5V14.2C100.8,11.5,98.5,9.2,95.8,9.2z " + | ||
146 | + "M16.5,67.5c-0.4,0.5-0.7,1-1,1.5c-0.3,0.5-0.6,1-0.9,1.6l-1.9-0.9" + | ||
147 | + "c0.3-0.6,0.6-1.2,0.9-1.8c0.3-0.6,0.6-1.2,1-1.7c0.7-1.1,1.5-2.2," + | ||
148 | + "2.5-3.2l1.8,1.8C18,65.6,17.2,66.5,16.5,67.5z M29.7,64.1" + | ||
149 | + "c-0.4-0.4-0.8-0.8-1.2-1.1c-0.1-0.1-0.2-0.1-0.2-0.1c0,0-0.1," + | ||
150 | + "0-0.1-0.1l-0.1,0l0,0l-0.1,0c-0.3-0.1-0.5-0.2-0.8-0.2c-0.5-0.1" + | ||
151 | + "-1.1-0.2-1.6-0.3c-0.6,0-1.1,0-1.6,0l-0.4-2.8c0.7-0.1,1.5-0.2,2.2" + | ||
152 | + "-0.1c0.7,0,1.4,0.1,2.2,0.3c0.4,0.1,0.7,0.2,1,0.3l0.1,0l0,0l0.1," + | ||
153 | + "0l0.1,0c0.1,0,0.1,0,0.3,0.1c0.3,0.1,0.5,0.2,0.7,0.4c0.7,0.5," + | ||
154 | + "1.2,0.9,1.7,1.4L29.7,64.1z M39.4,74.7c-1.8-1.8-3.6-3.8-5.3-5.7" + | ||
155 | + "l2.6-2.4c0.9,0.9,1.8,1.8,2.7,2.7c0.9,0.9,1.8,1.7,2.7,2.6L39.4," + | ||
156 | + "74.7z M50.8,84.2c-1.1-0.7-2.2-1.5-3.3-2.3c-0.5-0.4-1.1-0.8-1.6" + | ||
157 | + "-1.2c-0.5-0.4-1-0.8-1.5-1.2l2.7-3.4c0.5,0.4,1,0.8,1.5,1.1c0.5," + | ||
158 | + "0.3,1,0.7,1.5,1c1,0.7,2.1,1.3,3.1,1.9L50.8,84.2z M61.3," + | ||
159 | + "88.7c-0.7-0.1-1.4-0.3-2.1-0.5c-0.7-0.2-1.4-0.5-2-0.7l1.8" + | ||
160 | + "-4.8c0.6,0.2,1.1,0.4,1.6,0.5c0.5,0.2,1.1,0.3,1.6,0.4c1,0.2,2.1," + | ||
161 | + "0.2,3,0.1l0.7,5.1C64.3,89.1,62.7,88.9,61.3,88.7z M75.1,80.4c" + | ||
162 | + "-0.2,0.7-0.5,1.4-0.9,2c-0.2,0.3-0.3,0.7-0.5,1l-0.3,0.5l-0.3," + | ||
163 | + "0.4l-3.9-2.8l0.3-0.4l0.2-0.3c0.1-0.2,0.3-0.4,0.4-0.7c0.3-0.5," + | ||
164 | + "0.5-0.9,0.7-1.5c0.4-1,0.8-2.1,1.1-3.3l4.2,0.9C75.9,77.7,75.6," + | ||
165 | + "79,75.1,80.4z M73,69.2l0.2-1.9l0.1-1.9c0.1-1.2,0.1-2.5,0.1-" + | ||
166 | + "3.8l2.5-0.2c0.2,1.3,0.4,2.6,0.5,3.9l0.1,2l0.1,2L73,69.2z " + | ||
167 | + "M73,51l0.5-0.1c0.4,1.3,0.8,2.6,1.1,3.9L73.2,55C73.1,53.7,73.1," + | ||
168 | + "52.3,73,51z M91.9,20.4c-0.7,1.4-3.6,3.6-4.2,3.9c-1.5,0.8-5," + | ||
169 | + "2.8-10.1,7.7c3,2.9,5.8,5.4,7.3,6.4c2.6,1.8,3.4,4.3,3.6,6.1c0.1," + | ||
170 | + "1.1-0.1,2.5-0.4,3c-0.5,0.9-1.6,2-3,1.4c-2-0.8-11.5-9.6-13-11c" + | ||
171 | + "-3.5,3.9-7.4,8.9-11.7,15.1c0,0-3.1,3.4-5.2,0.9C52.9,51.5,61," + | ||
172 | + "39.3,61,39.3s2.2-3.1,5.6-7c-2.9-3-5.9-6.3-6.6-7.3c0,0-3.7-5-1.3" + | ||
173 | + "-6.6c3.2-2.1,6.3,0.8,6.3,0.8s3.1,3.3,7,7.2c4.7-4.7,10.1-9.2," + | ||
174 | + "14.7-10c0,0,3.3-1,5.2,1.7C92.5,18.8,92.4,19.6,91.9,20.4z" | ||
111 | }, | 175 | }, |
112 | 176 | ||
113 | badgeViewBox = '0 0 10 10', | 177 | badgeViewBox = '0 0 10 10', | ... | ... |
... | @@ -29,14 +29,14 @@ | ... | @@ -29,14 +29,14 @@ |
29 | 29 | ||
30 | // key to button mapping data | 30 | // key to button mapping data |
31 | var k2b = { | 31 | var k2b = { |
32 | - O: { id: 'summary-tog', gid: 'unknown', isel: true}, | 32 | + O: { id: 'summary-tog', gid: 'summary', isel: true}, |
33 | I: { id: 'instance-tog', gid: 'uiAttached', isel: true }, | 33 | I: { id: 'instance-tog', gid: 'uiAttached', isel: true }, |
34 | - D: { id: 'details-tog', gid: 'unknown', isel: true }, | 34 | + D: { id: 'details-tog', gid: 'details', isel: true }, |
35 | 35 | ||
36 | H: { id: 'hosts-tog', gid: 'endstation', isel: false }, | 36 | H: { id: 'hosts-tog', gid: 'endstation', isel: false }, |
37 | M: { id: 'offline-tog', gid: 'switch', isel: true }, | 37 | M: { id: 'offline-tog', gid: 'switch', isel: true }, |
38 | - P: { id: 'ports-tog', gid: 'unknown', isel: true }, | 38 | + P: { id: 'ports-tog', gid: 'ports', isel: true }, |
39 | - B: { id: 'bkgrnd-tog', gid: 'unknown', isel: true } | 39 | + B: { id: 'bkgrnd-tog', gid: 'map', isel: true } |
40 | }; | 40 | }; |
41 | 41 | ||
42 | function init(_api_) { | 42 | function init(_api_) { | ... | ... |
... | @@ -20,10 +20,12 @@ | ... | @@ -20,10 +20,12 @@ |
20 | describe('factory: fw/svg/glyph.js', function() { | 20 | describe('factory: fw/svg/glyph.js', function() { |
21 | var $log, fs, gs, d3Elem, svg; | 21 | var $log, fs, gs, d3Elem, svg; |
22 | 22 | ||
23 | - var numBaseGlyphs = 15, | 23 | + var numBaseGlyphs = 19, |
24 | vbBird = '352 224 113 112', | 24 | vbBird = '352 224 113 112', |
25 | vbGlyph = '0 0 110 110', | 25 | vbGlyph = '0 0 110 110', |
26 | vbBadge = '0 0 10 10', | 26 | vbBadge = '0 0 10 10', |
27 | + longPrefix = 'M95.8,9.2H14.2c-2.8,0-5,2.2-5,5v81.5c0,2.8,2.2,5,5,' + | ||
28 | + '5h81.5c2.8,0,5-2.2,5-5V14.2C100.8,11.5,98.5,9.2,95.8,9.2z ', | ||
27 | prefixLookup = { | 29 | prefixLookup = { |
28 | bird: 'M427.7,300.4', | 30 | bird: 'M427.7,300.4', |
29 | unknown: 'M35,40a5', | 31 | unknown: 'M35,40a5', |
... | @@ -35,6 +37,11 @@ describe('factory: fw/svg/glyph.js', function() { | ... | @@ -35,6 +37,11 @@ describe('factory: fw/svg/glyph.js', function() { |
35 | bgpSpeaker: 'M10,40a45,35', | 37 | bgpSpeaker: 'M10,40a45,35', |
36 | chain: 'M60.4,77.6c-', | 38 | chain: 'M60.4,77.6c-', |
37 | crown: 'M99.5,21.6c0,', | 39 | crown: 'M99.5,21.6c0,', |
40 | + summary: longPrefix + 'M16.7', | ||
41 | + details: longPrefix + 'M16.9', | ||
42 | + ports: 'M98,9.2H79.6c', | ||
43 | + map: 'M95.8,9.2H14.2c-2.8,0-5,2.2-5,5v66', | ||
44 | + | ||
38 | uiAttached: 'M2,2.5a.5,.5', | 45 | uiAttached: 'M2,2.5a.5,.5', |
39 | checkMark: 'M2.6,4.5c0', | 46 | checkMark: 'M2.6,4.5c0', |
40 | xMark: 'M9.0,7.2C8.2', | 47 | xMark: 'M9.0,7.2C8.2', |
... | @@ -141,6 +148,22 @@ describe('factory: fw/svg/glyph.js', function() { | ... | @@ -141,6 +148,22 @@ describe('factory: fw/svg/glyph.js', function() { |
141 | gs.init(); | 148 | gs.init(); |
142 | verifyGlyphLoadedInCache('crown', vbGlyph); | 149 | verifyGlyphLoadedInCache('crown', vbGlyph); |
143 | }); | 150 | }); |
151 | + it('should load the summary glyph', function () { | ||
152 | + gs.init(); | ||
153 | + verifyGlyphLoadedInCache('summary', vbGlyph); | ||
154 | + }); | ||
155 | + it('should load the details glyph', function () { | ||
156 | + gs.init(); | ||
157 | + verifyGlyphLoadedInCache('details', vbGlyph); | ||
158 | + }); | ||
159 | + it('should load the ports glyph', function () { | ||
160 | + gs.init(); | ||
161 | + verifyGlyphLoadedInCache('ports', vbGlyph); | ||
162 | + }); | ||
163 | + it('should load the map glyph', function () { | ||
164 | + gs.init(); | ||
165 | + verifyGlyphLoadedInCache('map', vbGlyph); | ||
166 | + }); | ||
144 | it('should load the uiAttached glyph', function() { | 167 | it('should load the uiAttached glyph', function() { |
145 | gs.init(); | 168 | gs.init(); |
146 | verifyGlyphLoadedInCache('uiAttached', vbBadge); | 169 | verifyGlyphLoadedInCache('uiAttached', vbBadge); | ... | ... |
-
Please register or login to post a comment