Method: draw
Constructs the elements that make up the popup.

Parameters:
px - {<OpenLayers.Pixel>} the position the popup in pixels.

Returns:
{DOMElement} Reference to a div that contains the drawn popup
348432
function(px) {
        if (px == null) {
            if ((this.lonlat != null) && (this.map != null)) {
                px = this.map.getLayerPxFromLonLat(this.lonlat);
            }
        }

        // this assumes that this.map already exists, which is okay because 
        // this.draw is only called once the popup has been added to the map.
        if (this.closeOnMove) {
            this.map.events.register("movestart", this, this.hide);
        }
        
        //listen to movestart, moveend to disable overflow (FF bug)
        if (!this.disableFirefoxOverflowHack && OpenLayers.BROWSER_NAME == 'firefox') {
            this.map.events.register("movestart", this, function() {
                var style = document.defaultView.getComputedStyle(
                    this.contentDiv, null
                );
                var currentOverflow = style.getPropertyValue("overflow");
                if (currentOverflow != "hidden") {
                    this.contentDiv._oldOverflow = currentOverflow;
                    this.contentDiv.style.overflow = "hidden";
                }
            });
            this.map.events.register("moveend", this, function() {
                var oldOverflow = this.contentDiv._oldOverflow;
                if (oldOverflow) {
                    this.contentDiv.style.overflow = oldOverflow;
                    this.contentDiv._oldOverflow = null;
                }
            });
        }

        this.moveTo(px);
        if (!this.autoSize && !this.size) {
            this.setSize(this.contentSize);
        }
        this.setBackgroundColor();
        this.setOpacity();
        this.setBorder();
        this.setContentHTML();
        
        if (this.panMapIfOutOfView) {
            this.panIntoView();
        }    

        return this.div;
    }
874998
function() {
        OpenLayers.Control.prototype.draw.apply(this, arguments);
        if (!this.element) {
            this.element = document.createElement("div");
            this.div.appendChild(this.element);
        }
        this.map.events.register( 'moveend', this, this.updateScale);
        this.updateScale();
        return this.div;
    }
1185840
def show_popup_menu(self, pos):
        ''''''
        self.popup_pos = self.image_coordinates(pos)
        self.frame.PopupMenu(self.wx_popup_menu, pos)
217018
function() {
        OpenLayers.Control.prototype.draw.apply(this, arguments);
          
        if (!this.element && !this.anchor) {
            this.element = document.createElement("a");
            this.element.innerHTML = OpenLayers.i18n("Permalink");
            this.element.href="";
            this.div.appendChild(this.element);
        }
        this.map.events.on({
            'moveend': this.updateLink,
            'changelayer': this.updateLink,
            'changebaselayer': this.updateLink,
            scope: this
        });
        
        // Make it so there is at least a link even though the map may not have
        // moved yet.
        this.updateLink();
        
        return this.div;
    }
957825
function(e) {
        if (!this._color) {
            return;
        }
        if (e.type === "DOM") {
            e.style.backgroundColor = this._color;
            e.style.lineHeight = 0;
        } else if (e.type === "canvas") {
            e.ctx.fillStyle = this._color;
            e.ctx.fillRect(e.pos._x, e.pos._y, e.pos._w, e.pos._h);
        } else if (e.type === "webgl") {
            e.program.draw(e, this);
        }
    }
60060
function() {
        var div = OpenLayers.Control.Panel.prototype.draw.apply(this, arguments);
        if (this.defaultControl === null) {
            this.defaultControl = this.controls[0];
        }
        return div;
    }
1294108
function drawRenderLayer (ctx, layer) {
  var customDrawFunc;

  // Performance: avoid drawing hidden layers.
  if (typeof layer.alpha === 'number' && layer.alpha <= 0) {
    return;
  }

  switch (layer.type) {
    case 'image':
      customDrawFunc = drawImageRenderLayer;
      break;

    case 'text':
      customDrawFunc = drawTextRenderLayer;
      break;

    case 'gradient':
      customDrawFunc = drawGradientRenderLayer;
      break;
  }

  // Establish drawing context for certain properties:
  // - alpha
  // - translate
  var saveContext = (layer.alpha !== null && layer.alpha < 1) ||
                    (layer.translateX || layer.translateY);

  if (saveContext) {
    ctx.save();

    // Alpha:
    if (layer.alpha !== null && layer.alpha < 1) {
      ctx.globalAlpha = layer.alpha;
    }

    // Translation:
    if (layer.translateX || layer.translateY) {
      ctx.translate(layer.translateX || 0, layer.translateY || 0);
    }
  }

  // If the layer is bitmap-cacheable, draw in a pooled off-screen canvas.
  // We disable backing stores on pad since we flip there.
  if (layer.backingStoreId) {
    drawCacheableRenderLayer(ctx, layer, customDrawFunc);
  } else {
    // Draw default properties, such as background color.
    ctx.save();
    drawBaseRenderLayer(ctx, layer);

    // Draw custom properties if needed.
    customDrawFunc && customDrawFunc(ctx, layer);
    ctx.restore();

    // Draw child layers, sorted by their z-index.
    if (layer.children) {
      layer.children.slice().sort(sortByZIndexAscending).forEach(function (childLayer) {
        drawRenderLayer(ctx, childLayer);
      });
    }
  }

  // Pop the context state if we established a new drawing context.
  if (saveContext) {
    ctx.restore();
  }
}
886831
function (e)
            {
                if (!RGraph.Resizing || !RGraph.Resizing.div || !RGraph.Resizing.mousedown) {
                    return;
                }

                if (RGraph.Resizing.div) {

                    var div    = RGraph.Resizing.div;
                    var canvas = div.__canvas__;
                    var coords = RGraph.getCanvasXY(div.__canvas__);

                    var parentNode = canvas.parentNode;

                    if (canvas.style.position != 'absolute') {
                        // Create a DIV to go in the canvases place
                        var placeHolderDIV = document.createElement('DIV');
                            placeHolderDIV.style.width = RGraph.Resizing.originalw + 'px';
                            placeHolderDIV.style.height = RGraph.Resizing.originalh + 'px';
                            //placeHolderDIV.style.backgroundColor = 'red';
                            placeHolderDIV.style.display = 'inline-block'; // Added 5th Nov 2010
                            placeHolderDIV.style.position = canvas.style.position;
                            placeHolderDIV.style.left     = canvas.style.left;
                            placeHolderDIV.style.top      = canvas.style.top;
                            placeHolderDIV.style.cssFloat = canvas.style.cssFloat;

                        parentNode.insertBefore(placeHolderDIV, canvas);
                    }


                    // Now set the canvas to be positioned absolutely
                    canvas.style.backgroundColor = 'white';
                    canvas.style.position        = 'absolute';
                    canvas.style.border = '1px dashed gray';
                    canvas.style.left            = (RGraph.Resizing.originalCanvasX  - 1) + 'px';
                    canvas.style.top             = (RGraph.Resizing.originalCanvasY - 1) + 'px';


                    /**
                    * Set the dimensions of the canvas using the HTML attributes
                    */
                    canvas.width  = parseInt(div.style.width);
                    canvas.height = parseInt(div.style.height);


                    /**
                    * Because resizing the canvas resets any tranformation - the antialias fix needs to be reapplied.
                    */
                    canvas.getContext('2d').translate(0.5,0.5);


                    /**
                    * Reset the gradient parsing status by setting all of the color values back to their original
                    * values before Draw was first called
                    */
                    var objects = RGraph.ObjectRegistry.getObjectsByCanvasID(canvas.id);
                    for (var i=0,len=objects.length; i<len; i+=1) {
                        
                        RGraph.resetColorsToOriginalValues(objects[i]);
                        if (typeof objects[i].reset === 'function') {
                            objects[i].reset();
                        }
                    }
                    
                    
                    
                    
                    /**
                    * Kill the background cache
                    */
                    RGraph.cache = [];
                

                    /**
                    * Fire the onresize event
                    */
                    RGraph.FireCustomEvent(canvas.__object__, 'onresizebeforedraw');

                    RGraph.RedrawCanvas(canvas);
                    

                    // Get rid of transparent semi-opaque DIV
                    RGraph.Resizing.mousedown = false;
                    div.style.display = 'none';
                    document.body.removeChild(div);
                }

                /**
                * If there is zoom enabled in thumbnail mode, lose the zoom image
                */
                if (RGraph.Registry.Get('chart.zoomed.div') || RGraph.Registry.Get('chart.zoomed.img')) {
                    RGraph.Registry.Set('chart.zoomed.div', null);
                    RGraph.Registry.Set('chart.zoomed.img', null);
                }

                /**
                * Fire the onresize event
                */
                RGraph.FireCustomEvent(canvas.__object__, 'onresizeend');
            }
1197066
function() {
        OpenLayers.Control.prototype.draw.apply(this, arguments);
        
        this.map.events.on({
            'changebaselayer': this.updateAttribution,
            'changelayer': this.updateAttribution,
            'addlayer': this.updateAttribution,
            'removelayer': this.updateAttribution,
            scope: this
        });
        this.updateAttribution();
        
        return this.div;    
    }
456329
function (graphicModel, api) {
        var elOptions = graphicModel.option.elements;
        var rootGroup = this.group;
        var elMap = this._elMap;

        // Bottom-up tranvese all elements (consider ec resize) to locate elements.
        for (var i = elOptions.length - 1; i >= 0; i--) {
            var elOption = elOptions[i];
            var el = elMap.get(elOption.id);

            if (!el) {
                continue;
            }

            var parentEl = el.parent;
            var containerInfo = parentEl === rootGroup
                ? {
                    width: api.getWidth(),
                    height: api.getHeight()
                }
                : { // Like 'position:absolut' in css, default 0.
                    width: parentEl.__ecGraphicWidth || 0,
                    height: parentEl.__ecGraphicHeight || 0
                };

            layoutUtil.positionElement(
                el, elOption, containerInfo, null,
                {hv: elOption.hv, boundingMode: elOption.bounding}
            );
        }
    }
950965
function() {
        OpenLayers.Control.prototype.draw.apply(this);

        // create layout divs
        this.loadContents();

        // set mode to minimize
        if(!this.outsideViewport) {
            this.minimizeControl();
        }

        // populate div with current info
        this.redraw();

        return this.div;
    }
785218
function(evt) {
		if (!started) {return;}
		if (evt.button === 1 || canvas.spaceKey) {return;}

		var i, xya, c, cx, cy, dx, dy, len, angle, box,
			selected = selectedElements[0],
			pt = svgedit.math.transformPoint( evt.pageX, evt.pageY, root_sctm ),
			mouse_x = pt.x * current_zoom,
			mouse_y = pt.y * current_zoom,
			shape = svgedit.utilities.getElem(getId());

		var real_x = mouse_x / current_zoom;
		x = real_x;
		var real_y = mouse_y / current_zoom;
		y = real_y;
	
		if (curConfig.gridSnapping){
			x = svgedit.utilities.snapToGrid(x);
			y = svgedit.utilities.snapToGrid(y);
		}

		evt.preventDefault();
		var tlist;
		switch (current_mode) {
			case "select":
				// we temporarily use a translate on the element(s) being dragged
				// this transform is removed upon mousing up and the element is 
				// relocated to the new location
				if (selectedElements[0] !== null) {
					dx = x - start_x;
					dy = y - start_y;
					
					if (curConfig.gridSnapping){
						dx = svgedit.utilities.snapToGrid(dx);
						dy = svgedit.utilities.snapToGrid(dy);
					}

					if (evt.shiftKey) { 
						xya = svgedit.math.snapToAngle(start_x, start_y, x, y);
						x = xya.x;
						y = xya.y; 
					}

					if (dx != 0 || dy != 0) {
						len = selectedElements.length;
						for (i = 0; i < len; ++i) {
							selected = selectedElements[i];
							if (selected == null) {break;}
//							if (i==0) {
//								var box = svgedit.utilities.getBBox(selected);
//									selectedBBoxes[i].x = box.x + dx;
//									selectedBBoxes[i].y = box.y + dy;
//							}

							// update the dummy transform in our transform list
							// to be a translate
							var xform = svgroot.createSVGTransform();
							tlist = svgedit.transformlist.getTransformList(selected);
							// Note that if Webkit and there's no ID for this
							// element, the dummy transform may have gotten lost.
							// This results in unexpected behaviour
							
							xform.setTranslate(dx, dy);
							if (tlist.numberOfItems) {
								tlist.replaceItem(xform, 0);
							} else {
								tlist.appendItem(xform);
							}
							
							// update our internal bbox that we're tracking while dragging
							selectorManager.requestSelector(selected).resize();
						}
						
						call("transition", selectedElements);
					}
				}
				break;
			case "multiselect":
				real_x *= current_zoom;
				real_y *= current_zoom;
				svgedit.utilities.assignAttributes(rubberBox, {
					'x': Math.min(r_start_x, real_x),
					'y': Math.min(r_start_y, real_y),
					'width': Math.abs(real_x - r_start_x),
					'height': Math.abs(real_y - r_start_y)
				}, 100);

				// for each selected:
				// - if newList contains selected, do nothing
				// - if newList doesn't contain selected, remove it from selected
				// - for any newList that was not in selectedElements, add it to selected
				var elemsToRemove = [], elemsToAdd = [],
					newList = getIntersectionList();
				len = selectedElements.length;
				
				for (i = 0; i < len; ++i) {
					var ind = newList.indexOf(selectedElements[i]);
					if (ind == -1) {
						elemsToRemove.push(selectedElements[i]);
					} else {
						newList[ind] = null;
					}
				}
				
				len = newList.length;
				for (i = 0; i < len; ++i) {
					if (newList[i]) {elemsToAdd.push(newList[i]);}
				}
				
				if (elemsToRemove.length > 0) {
					canvas.removeFromSelection(elemsToRemove);
				}
				
				if (elemsToAdd.length > 0) {
					addToSelection(elemsToAdd);
				}
					
				break;
			case "resize":
				// we track the resize bounding box and translate/scale the selected element
				// while the mouse is down, when mouse goes up, we use this to recalculate
				// the shape's coordinates
				tlist = svgedit.transformlist.getTransformList(selected);
				var hasMatrix = svgedit.math.hasMatrixTransform(tlist);
				box = hasMatrix ? init_bbox : svgedit.utilities.getBBox(selected);
				var left = box.x, top = box.y, width = box.width,
					height = box.height;
					dx = (x-start_x);
					dy = (y-start_y);
				
				if (curConfig.gridSnapping) {
					dx = svgedit.utilities.snapToGrid(dx);
					dy = svgedit.utilities.snapToGrid(dy);
					height = svgedit.utilities.snapToGrid(height);
					width = svgedit.utilities.snapToGrid(width);
				}

				// if rotated, adjust the dx,dy values
				angle = svgedit.utilities.getRotationAngle(selected);
				if (angle) {
					var r = Math.sqrt( dx*dx + dy*dy ),
						theta = Math.atan2(dy, dx) - angle * Math.PI / 180.0;
					dx = r * Math.cos(theta);
					dy = r * Math.sin(theta);
				}

				// if not stretching in y direction, set dy to 0
				// if not stretching in x direction, set dx to 0
				if (current_resize_mode.indexOf("n")==-1 && current_resize_mode.indexOf("s")==-1) {
					dy = 0;
				}
				if (current_resize_mode.indexOf("e")==-1 && current_resize_mode.indexOf("w")==-1) {
					dx = 0;
				}				
				
				var ts = null,
					tx = 0, ty = 0,
					sy = height ? (height+dy)/height : 1, 
					sx = width ? (width+dx)/width : 1;
				// if we are dragging on the north side, then adjust the scale factor and ty
				if (current_resize_mode.indexOf("n") >= 0) {
					sy = height ? (height-dy)/height : 1;
					ty = height;
				}
				
				// if we dragging on the east side, then adjust the scale factor and tx
				if (current_resize_mode.indexOf("w") >= 0) {
					sx = width ? (width-dx)/width : 1;
					tx = width;
				}
				
				// update the transform list with translate,scale,translate
				var translateOrigin = svgroot.createSVGTransform(),
					scale = svgroot.createSVGTransform(),
					translateBack = svgroot.createSVGTransform();

				if (curConfig.gridSnapping) {
					left = svgedit.utilities.snapToGrid(left);
					tx = svgedit.utilities.snapToGrid(tx);
					top = svgedit.utilities.snapToGrid(top);
					ty = svgedit.utilities.snapToGrid(ty);
				}

				translateOrigin.setTranslate(-(left+tx), -(top+ty));
				if (evt.shiftKey) {
					if (sx == 1) {sx = sy;}
					else {sy = sx;}
				}
				scale.setScale(sx, sy);
				
				translateBack.setTranslate(left+tx, top+ty);
				if (hasMatrix) {
					var diff = angle ? 1 : 0;
					tlist.replaceItem(translateOrigin, 2+diff);
					tlist.replaceItem(scale, 1+diff);
					tlist.replaceItem(translateBack, Number(diff));
				} else {
					var N = tlist.numberOfItems;
					tlist.replaceItem(translateBack, N-3);
					tlist.replaceItem(scale, N-2);
					tlist.replaceItem(translateOrigin, N-1);
				}

				selectorManager.requestSelector(selected).resize();
				
				call("transition", selectedElements);
				
				break;
			case "zoom":
				real_x *= current_zoom;
				real_y *= current_zoom;
				svgedit.utilities.assignAttributes(rubberBox, {
					'x': Math.min(r_start_x*current_zoom, real_x),
					'y': Math.min(r_start_y*current_zoom, real_y),
					'width': Math.abs(real_x - r_start_x*current_zoom),
					'height': Math.abs(real_y - r_start_y*current_zoom)
				}, 100);			
				break;
			case "text":
				svgedit.utilities.assignAttributes(shape,{
					'x': x,
					'y': y
				}, 1000);
				break;
			case "line":
				// Opera has a problem with suspendRedraw() apparently
				var handle = null;
				if (!window.opera) {svgroot.suspendRedraw(1000);}

				if (curConfig.gridSnapping) {
					x = svgedit.utilities.snapToGrid(x);
					y = svgedit.utilities.snapToGrid(y);
				}

				var x2 = x;
				var y2 = y;					

				if (evt.shiftKey) {
					xya = svgedit.math.snapToAngle(start_x, start_y, x2, y2);
					x2 = xya.x;
					y2 = xya.y;
				}
				
				shape.setAttributeNS(null, "x2", x2);
				shape.setAttributeNS(null, "y2", y2);
				if (!window.opera) {svgroot.unsuspendRedraw(handle);}
				break;
			case "foreignObject":
				// fall through
			case "square":
				// fall through
			case "rect":
				// fall through
			case "image":
				var square = (current_mode == 'square') || evt.shiftKey,
					w = Math.abs(x - start_x),
					h = Math.abs(y - start_y),
					new_x, new_y;
				if (square) {
					w = h = Math.max(w, h);
					new_x = start_x < x ? start_x : start_x - w;
					new_y = start_y < y ? start_y : start_y - h;
				} else {
					new_x = Math.min(start_x, x);
					new_y = Math.min(start_y, y);
				}
	
				if (curConfig.gridSnapping) {
					w = svgedit.utilities.snapToGrid(w);
					h = svgedit.utilities.snapToGrid(h);
					new_x = svgedit.utilities.snapToGrid(new_x);
					new_y = svgedit.utilities.snapToGrid(new_y);
				}

				svgedit.utilities.assignAttributes(shape,{
					'width': w,
					'height': h,
					'x': new_x,
					'y': new_y
				},1000);
				
				break;
			case "circle":
				c = $(shape).attr(["cx", "cy"]);
				cx = c.cx;
				cy = c.cy;
				var rad = Math.sqrt( (x-cx)*(x-cx) + (y-cy)*(y-cy) );
				if (curConfig.gridSnapping) {
					rad = svgedit.utilities.snapToGrid(rad);
				}
				shape.setAttributeNS(null, "r", rad);
				break;
			case "ellipse":
				c = $(shape).attr(["cx", "cy"]);
				cx = c.cx;
				cy = c.cy;
				// Opera has a problem with suspendRedraw() apparently
					handle = null;
				if (!window.opera) {svgroot.suspendRedraw(1000);}
				if (curConfig.gridSnapping) {
					x = svgedit.utilities.snapToGrid(x);
					cx = svgedit.utilities.snapToGrid(cx);
					y = svgedit.utilities.snapToGrid(y);
					cy = svgedit.utilities.snapToGrid(cy);
				}
				shape.setAttributeNS(null, "rx", Math.abs(x - cx) );
				var ry = Math.abs(evt.shiftKey?(x - cx):(y - cy));
				shape.setAttributeNS(null, "ry", ry );
				if (!window.opera) {svgroot.unsuspendRedraw(handle);}
				break;
			case "fhellipse":
			case "fhrect":
				freehand.minx = Math.min(real_x, freehand.minx);
				freehand.maxx = Math.max(real_x, freehand.maxx);
				freehand.miny = Math.min(real_y, freehand.miny);
				freehand.maxy = Math.max(real_y, freehand.maxy);
			// break; missing on purpose
			case "fhpath":
//				d_attr += + real_x + "," + real_y + " ";
//				shape.setAttributeNS(null, "points", d_attr);
				end.x = real_x; end.y = real_y;
				if (controllPoint2.x && controllPoint2.y) {
					for (i = 0; i < STEP_COUNT - 1; i++) {
						parameter = i / STEP_COUNT;
						nextParameter = (i + 1) / STEP_COUNT;
						bSpline = getBsplinePoint(nextParameter);
						nextPos = bSpline;
						bSpline = getBsplinePoint(parameter);
						sumDistance += Math.sqrt((nextPos.x - bSpline.x) * (nextPos.x - bSpline.x) + (nextPos.y - bSpline.y) * (nextPos.y - bSpline.y));
						if (sumDistance > THRESHOLD_DIST) {
							d_attr += + bSpline.x + "," + bSpline.y + " ";
							shape.setAttributeNS(null, "points", d_attr);
							sumDistance -= THRESHOLD_DIST;
						}
					}
				}
				controllPoint2 = {x:controllPoint1.x, y:controllPoint1.y};
				controllPoint1 = {x:start.x, y:start.y};
				start = {x:end.x, y:end.y};
				break;
			// update path stretch line coordinates
			case "path":
				// fall through
			case "pathedit":
				x *= current_zoom;
				y *= current_zoom;
				
				if (curConfig.gridSnapping) {
					x = svgedit.utilities.snapToGrid(x);
					y = svgedit.utilities.snapToGrid(y);
					start_x = svgedit.utilities.snapToGrid(start_x);
					start_y = svgedit.utilities.snapToGrid(start_y);
				}
				if (evt.shiftKey) {
					var path = svgedit.path.path;
					var x1, y1;
					if (path) {
						x1 = path.dragging?path.dragging[0]:start_x;
						y1 = path.dragging?path.dragging[1]:start_y;
					} else {
						x1 = start_x;
						y1 = start_y;
					}
					xya = svgedit.math.snapToAngle(x1, y1, x, y);
					x = xya.x;
					y = xya.y;
				}
				
				if (rubberBox && rubberBox.getAttribute('display') !== 'none') {
					real_x *= current_zoom;
					real_y *= current_zoom;
					svgedit.utilities.assignAttributes(rubberBox, {
						'x': Math.min(r_start_x*current_zoom, real_x),
						'y': Math.min(r_start_y*current_zoom, real_y),
						'width': Math.abs(real_x - r_start_x*current_zoom),
						'height': Math.abs(real_y - r_start_y*current_zoom)
					},100);	
				}
				pathActions.mouseMove(x, y);
				
				break;
			case "textedit":
				x *= current_zoom;
				y *= current_zoom;
//					if (rubberBox && rubberBox.getAttribute('display') != 'none') {
//						svgedit.utilities.assignAttributes(rubberBox, {
//							'x': Math.min(start_x,x),
//							'y': Math.min(start_y,y),
//							'width': Math.abs(x-start_x),
//							'height': Math.abs(y-start_y)
//						},100);
//					}
				
				textActions.mouseMove(mouse_x, mouse_y);
				
				break;
			case "rotate":
				box = svgedit.utilities.getBBox(selected);
				cx = box.x + box.width/2;
				cy = box.y + box.height/2;
				var m = svgedit.math.getMatrix(selected),
					center = svgedit.math.transformPoint(cx, cy, m);
				cx = center.x;
				cy = center.y;
				angle = ((Math.atan2(cy-y, cx-x) * (180/Math.PI))-90) % 360;
				if (curConfig.gridSnapping) {
					angle = svgedit.utilities.snapToGrid(angle);
				}
				if (evt.shiftKey) { // restrict rotations to nice angles (WRS)
					var snap = 45;
					angle= Math.round(angle/snap)*snap;
				}

				canvas.setRotationAngle(angle<-180?(360+angle):angle, true);
				call("transition", selectedElements);
				break;
			default:
				break;
		}
		
		runExtensions("mouseMove", {
			event: evt,
			mouse_x: mouse_x,
			mouse_y: mouse_y,
			selected: selected
		});

	}
371733
function _drawBound (side, dist) {
        dist += 'px';
        switch (side) {
            case 'top':
                $('.boundary-top').css({
                    top: dist,
                    height: dist,
                    marginTop: '-' + dist
                });
                break;

            case 'right':
                $('.boundary-right').css({
                    right: dist,
                    width: dist,
                    marginRight: '-' + dist
                });
                break;

            case 'bottom':
                $('.boundary-bottom').css({
                    bottom: dist,
                    height: dist,
                    marginBottom: '-' + dist
                });
                break;

            case 'left':
                $('.boundary-left').css({
                    left: dist,
                    width: dist,
                    marginLeft: '-' + dist
                });
                break;

            default:
                break;
        }
    }
1192062
private boolean drawPoint(BoundingBox boundingBox,
			ProjectionTransform transform, FeatureTileGraphics graphics,
			Point point, FeatureStyle featureStyle) {

		boolean drawn = false;

		Point projectedPoint = transform.transform(point);

		float x = TileBoundingBoxUtils.getXPixel(tileWidth, boundingBox,
				projectedPoint.getX());
		float y = TileBoundingBoxUtils.getYPixel(tileHeight, boundingBox,
				projectedPoint.getY());

		if (featureStyle != null && featureStyle.hasIcon()) {

			IconRow iconRow = featureStyle.getIcon();
			BufferedImage icon = getIcon(iconRow);

			int width = icon.getWidth();
			int height = icon.getHeight();

			if (x >= 0 - width && x <= tileWidth + width && y >= 0 - height
					&& y <= tileHeight + height) {

				float anchorU = (float) iconRow.getAnchorUOrDefault();
				float anchorV = (float) iconRow.getAnchorVOrDefault();

				int iconX = Math.round(x - (anchorU * width));
				int iconY = Math.round(y - (anchorV * height));

				Graphics2D iconGraphics = graphics.getIconGraphics();
				iconGraphics.drawImage(icon, iconX, iconY, null);
				drawn = true;
			}

		} else if (pointIcon != null) {

			int width = Math.round(this.scale * pointIcon.getWidth());
			int height = Math.round(this.scale * pointIcon.getHeight());
			if (x >= 0 - width && x <= tileWidth + width && y >= 0 - height
					&& y <= tileHeight + height) {
				int iconX = Math.round(x - this.scale * pointIcon.getXOffset());
				int iconY = Math.round(y - this.scale * pointIcon.getYOffset());
				Graphics2D iconGraphics = graphics.getIconGraphics();
				iconGraphics.drawImage(pointIcon.getIcon(), iconX, iconY,
						width, height, null);
				drawn = true;
			}

		} else {

			Float radius = null;
			if (featureStyle != null) {
				StyleRow styleRow = featureStyle.getStyle();
				if (styleRow != null) {
					radius = this.scale
							* (float) (styleRow.getWidthOrDefault() / 2.0f);
				}
			}
			if (radius == null) {
				radius = this.scale * pointRadius;
			}
			if (x >= 0 - radius && x <= tileWidth + radius && y >= 0 - radius
					&& y <= tileHeight + radius) {

				Graphics2D pointGraphics = graphics.getPointGraphics();
				Paint pointPaint = getPointPaint(featureStyle);
				pointGraphics.setColor(pointPaint.getColor());

				int circleX = Math.round(x - radius);
				int circleY = Math.round(y - radius);
				int diameter = Math.round(radius * 2);
				pointGraphics.fillOval(circleX, circleY, diameter, diameter);
				drawn = true;
			}

		}

		return drawn;
	}
847717
def draw(self, parent, box):
        ''''''
        import wx
        from MAVProxy.modules.lib import mp_widgets
        if self.imgpanel is None:
            self.imgpanel = mp_widgets.ImagePanel(parent, self.img())
            box.Add(self.imgpanel, flag=wx.LEFT, border=0)
            box.Layout()
934283
function (popup) {
                var curZIndex = popup.getZIndex();
                var newBaseZIndex = this.currentZIndex;
                if (curZIndex === newBaseZIndex) {
                    // already top most, nothing to do in any case!
                    return;
                }
                // gets all popups supposed to be in front of this one, including this one
                var openedPopups = this.openedPopups;
                var popupsToKeepInFront = [];
                var i, l;
                for (i = openedPopups.length - 1; i >= 0; i--) {
                    var curPopup = openedPopups[i];
                    if (curPopup === popup || curPopup.conf.zIndexKeepOpenOrder) {
                        popupsToKeepInFront.unshift(curPopup);
                        if (curPopup.getZIndex() === newBaseZIndex) {
                            newBaseZIndex -= 10;
                        }
                        if (curPopup === popup) {
                            break;
                        }
                    }
                }
                if (i < 0 || newBaseZIndex + 10 === curZIndex) {
                    // either the popup is not in openedPopups (i < 0)
                    // or it is already correctly positioned (newBaseZIndex + 10 === curZIndex)
                    return;
                }
                var eventObject = {
                    name : "beforeBringingPopupsToFront",
                    popups : popupsToKeepInFront,
                    cancel : false
                };
                this.$raiseEvent(eventObject);
                if (eventObject.cancel) {
                    return;
                }
                this.currentZIndex = newBaseZIndex;
                for (i = 0, l = popupsToKeepInFront.length; i < l; i++) {
                    var curPopup = popupsToKeepInFront[i];
                    curPopup.setZIndex(this.getZIndexForPopup(curPopup));
                }
            }
631676
function (element, overlay) {
            var overlayStyle = overlay.style;
            overlayStyle.position = "absolute";
            overlayStyle.top = element.offsetTop + "px";
            overlayStyle.left = element.offsetLeft + "px";
            overlayStyle.display = "block";
        }