$("body").on("click",".new_layer", function() { dialog("Create new layer", "Enter your layer name", "_input", { OK: function() { // There must be a way to get the input from here using this, if it is a standard library. If you wrote your own, make the value retrievable using something other than a class selector (horrible performance + scoping +multiple instance issues) // This is where the view comes into play. Instead of cloning, bind the rendering into a JS prototype, and instantiate it. It means that you only have to modify stuff in one place, you don't risk cloning events with it, and you can test your Layer stand-alone var newLayer = new Layer(); newLayer .setName(name) .bindToGroup(parent); } }); });
var foo, test; test = new Layer ({ height:40, width:40 }); foo = test; console.log(foo.height)
foo = new Layer ({ height:40, width:40 }) console.log(foo.height)
//add image to project as background // ... your code here ... var secondLayer = new Layer();
myLayers = Framer.Importer.load("import/some-psd") layer = new Layer() superLayer: myLayers
var firstLayer = paper.project.activeLayer; //This one is used to erase var shapesLayer = new Layer(); // We don't want to erase on this one
Layer = function Layer(){ this.figures = []; }; Layer.prototype.addFigure = function addFigure(arg){ arg = arg || {}; arg.layer = this; this.figures.push(new Figure(arg)); return this;//now you can stack functions } Figure = function Figure(arg){ arg = arg || {}; //layer is not optional this.layer = arg.layer || (function(){ throw new Error('Cannot create figure without layer'); }()); this.shape = arg.shape || 'square'; } var l = new Layer(); l.addFigure({shape:'round'})//stacking next addFigure on next line .addFigure();//defaults to square console.log(l.figures);
layers = [new Layer, new Layer(x:150)] layers[1].on Events.Click, (e, layer) -> index = layers.indexOf layer prev = layers[index-1] if ~index print prev
import Layer from './layer' import Element from './element' class App { constructor() { this.layer = new Layer(this); this.element = new Element(this); } addLayer() { this.layer.addLayer(); } addElement() { this.element.addElement(); } } module.exports = App;
var dashboard = new Layer("dashboard").addText("deneme").addChilds([ {id:"somelayer",text:"somelayer text",tagName:"div"}, {id:"somelayer2",text:"somelayer2 text",tagName:"div"}
Layer global = new Layer("Global"); Style style = new Style(); style.setBackColor(col); style.setColor(col); style.setStroke(new BasicStroke(0)); MapPolygon poly = new MapPolygonImpl(global,"",coords,style); return poly;
public void insert(Project entity) { Project pr = new Project(); pr.setName("pr1"); //-Create a Layer- Layer testLayer = new Layer(); testLayer.setIdLayer(1); testLayer.setLayerName("Layer 1"); //Add that layer to your Project's list by first getting it and then calling add method on it. pr.getLayer().add(testLayer); try { JAXBContext jc = JAXBContext.newInstance(Project.class); javax.xml.bind.Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); File XMLfile = new File("Projects" + "//" + pr.getName() + "//" +"ProjectDataBase.xml"); marshaller.marshal(pr, XMLfile); } catch (JAXBException e) { e.printStackTrace(); } }
Layer ret = new Layer(); ret.set_abstract((String)node.getChildValue("Abstract"));
Layer layer = new Layer();
Layer layer = new Layer();
/** * Test for GEOS-6362: getFinalURL had side effects and gave different results if called * multiple times. */ @Test public void testNoSideEffectsOnGetFinalUrl() throws Exception { GetMapRequest request = new org.geotools.data.wms.WMS1_0_0().createGetMapRequest(new URL("http://test?")); SecuredGetMapRequest securedRequest = new SecuredGetMapRequest(request); Layer wmsLayer = new Layer(); wmsLayer.setName("layer1"); Layer layer = new SecuredWMSLayer(wmsLayer, WrapperPolicy.hide(null)); securedRequest.addLayer(layer); String firstCallURL = securedRequest.getFinalURL().toExternalForm(); String secondCallURL = securedRequest.getFinalURL().toExternalForm(); assertEquals(firstCallURL, secondCallURL); } }
final Layer layer = new Layer(); layer.setLayoutManager(new XYLayout()); pane.add(layer);