function SVGLayerView(element, view) { this.__superCtor__ = eval("SVGTitledView") this.__superCtor__(element) this.__superCtor__ = null this.view = view } SVGLayerView.prototype = new SVGTitledView SVGLayerView.prototype.toSVG = function() { var value = this.getTitleHeight() for (var i = 0; i < this.view.getLayersCount(); i++) { var layer = this.view.getLayer(i) checkbox = new SVGCheckBox(this.svg, layer.getName()) var layerItem = checkbox.toSVG() checkbox.setChecked(layer.isVisible()) checkbox.setEnabled(!layer.isFiltered()) checkbox.userObj = layer checkbox.addStateChangedListener(this) checkbox.visibilityChanged = function(layer) { this.setChecked(layer.isVisible()) this.setEnabled(!layer.isFiltered()) } layer.addVisibilityChangedListener(checkbox) value = value + 20 layerItem.setAttribute("transform", "translate(15, "+value+")") } return this } SVGLayerView.prototype.stateChanged = function(checkbox) { checkbox.userObj.setVisible(checkbox.isChecked()) }