var myDrawableSurface = new Surface(); // Returns true InterfaceHelper.ensureImplements(myDrawableSurface, Drawable); // Returns false (Error thrown) InterfaceHelper.ensureImplements(myDrawableSurface, Array);
public Display() { Surface surface = new Surface(); add(surface); setTitle("salami"); setSize(400, 300); }
for (var i = 0; i < this.options.data.length; i++) { var surface = new Surface({ content: this.options.data[i].name, size: [undefined, 40], properties: { borderBottom: '1px solid #000', padding: '10px 15px' } }); surface.pipe(sc); // Pipe the Surface events to the ScrollContainer sequence.push(surface); };
new Surface({ content: content, size: [100, 100], properties: { backgroundColor: "rgb(183, 232, 183)", color: "rgb(51, 51, 51)", fontSize:'10pt', textAlign: 'center', paddingTop:'2pt', border: '1pt solid rgb(135, 192, 140)' } });
var contentSurface = new Surface({ size:[undefined,undefined], content: scrollContent, properties: { overflow:'scroll' } });
var surface = new Surface({ content: '<h1>Famous in JSFiddle</h1>', size: [window.innerWidth / 2, 100], border: [10], properties: { background: 'red', border: '10px solid', borderColor: 'blue' } });
new Surface({ content: content, size: [100, 100], classes:['select-button'] });
var suspiciousSurface = new Surface({ size:[200,200], classes: ['my-debug-class'] });
for (var i = 0; i < 40; i++) { var surface = new Surface({ content: "Surface: " + (i + 1), size: [undefined, 200], properties: { backgroundColor: "hsl(" + (i * 360 / 40) + ", 100%, 50%)", lineHeight: "200px", textAlign: "center" } }); surface.pipe(scrollcontainer.container); surfaces.push(surface); } scrollcontainer.container.on('click', function (e) { console.log('click ' + e.target.innerText); });
function _createHover(){ var hover = new Surface({ // undefined size will inherit size from parent modifier properties: { //backgroundColor: '#FFFFF5', zIndex: 3, boxShadow: '20px 20px 20px -5px rgba(0, 0, 255, 0.5)', cursor: 'none', // makes the surface invisible to clicks pointerEvents: 'none' } }); var modifierObj = { origin: [0.5, 0], align: [0.5, 0], //transform: Transform.translate(0, this.options.filmBorder + this.options.photoBorder, 2), opacity: 0.0 }; this.hoverModifier = new StateModifier(modifierObj); this.mainNode.add(this.hoverModifier).add(hover); }
var surface = new Surface({ content: "Surface: " + (i + 1), size: [undefined, 200],
this.gymNameSurface = new Surface({ size: [true, gymDetailItemHeight], classes: ["gym_name_details"],
for (var i = 0; i < 40; i++) { var surface = new Surface({ content: "Surface: " + (i + 1), size: [undefined, 200], properties: { backgroundColor: "hsl(" + (i * 360 / 40) + ", 100%, 50%)", lineHeight: "200px", textAlign: "center" } }); surface.pipe(scrollcontainer.container); surfaces.push(surface); } var mainview = new View({size: [500, 500]}); mainview.on('click', function (e) { console.log('click ' + e.target.innerText); }); scrollcontainer.sequenceFrom(surfaces); scrollcontainer.container.pipe(mainview._eventOutput); context.add(scrollcontainer).add(mainview);
Surface s = new Surface(); JFrame jf = new JFrame(); jf.setTitle("Tutorial"); jf.setSize(600, 400); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.add(s); //s.repaint(); // not needed anymore, because "jf" will repaint everything during the 'setVisible' call jf.setVisible(true); // should almost always be the last thing you do
public void gui(){ .... Surface s = new Surface(); s.setPreferredSize(new Dimension(200, 200)); panel.add(new Surface()); ... }
String str = "{[(1;1;2),(5;1;2),(5;1;1)],[(1;3;2),(5;3;2),(5;1;2)]}"; Pattern pattern = Pattern.compile("(\\(\\d;\\d;\\d\\),?){3}"); Matcher matcher = pattern.matcher(str); while (matcher.find()) { int i = 1; System.out.println("Polygon Coordinates: "); String[] coordinates = matcher.group(0).split(","); for (String point: coordinates) { System.out.println("Coordinate " + (i++) + ": " + point); point = point.replace("\\(", "").replace("\\)", ""); String[] s3 = point.split(";"); tp.add(new Point(Double.valueOf(s3[0]), Double.valueOf(s3[1]), Double.valueOf(s3[2]))); } sf.add(new Surface((Point[]) tp.toArray())); System.out.println(); }
Matcher matcher1 = Pattern.compile("(?<=\\{).*?(?<=\\})").matcher(yourInput); while(mather1.find()) { Matcher matcher2 = Pattern.compile("(?<=\\[).*?(?=\\])").matcher(matcher1.Group()); while (matcher2.find()) { Matcher matcher3 = Pattern.compile("(\\d+);(\\d+);(\\d+)").matcher(matcher2.Group()); while (matcher3.find()) { tp.add(new Point(Double.valueOf(matcher3.Group(1),Double.valueOf(matcher3.Group(2)),Double.valueOf(matcher3.Group(3)))); } sf.add(new Surface((Point[]) tp.toArray())); } convShape.add(new Body((Surface[])sf.toArray())); }
surface = new Surface({ content: "Surface: " + (i + 1), size: [window.innerWidth, window.innerHeight],
public SceneGame (Platform plat, int updateRate) { super(plat, updateRate); GL20 gl = plat.graphics().gl; gl.glDisable(GL20.GL_CULL_FACE); gl.glEnable(GL20.GL_BLEND); gl.glBlendFunc(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA); defaultBatch = createDefaultBatch(gl); viewSurf = new Surface(plat.graphics(), plat.graphics().defaultRenderTarget, defaultBatch); rootLayer = new RootLayer(); paint.connect(new Slot<Clock>() { public void onEmit (Clock clock) { paintScene(); } }).atPrio(scenePaintPrio()); }