toni@521: /** toni@521: * Back 2 Browser Bytecode Translator toni@521: * Copyright (C) 2012 Jaroslav Tulach toni@521: * toni@521: * This program is free software: you can redistribute it and/or modify toni@521: * it under the terms of the GNU General Public License as published by toni@521: * the Free Software Foundation, version 2 of the License. toni@521: * toni@521: * This program is distributed in the hope that it will be useful, toni@521: * but WITHOUT ANY WARRANTY; without even the implied warranty of toni@521: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the toni@521: * GNU General Public License for more details. toni@521: * toni@521: * You should have received a copy of the GNU General Public License toni@521: * along with this program. Look for COPYING file in the top folder. toni@521: * If not, see http://opensource.org/licenses/GPL-2.0. toni@521: */ toni@521: package org.apidesign.bck2brwsr.htmlpage.api; toni@521: toni@1112: import net.java.html.canvas.LinearGradient; toni@521: import org.apidesign.bck2brwsr.core.JavaScriptBody; toni@521: toni@521: /** toni@521: * toni@521: * @author Anton Epple toni@521: */ toni@1112: public class HTML5LinearGradient implements LinearGradient{ toni@521: toni@521: private final Object gradient; toni@521: toni@1112: HTML5LinearGradient(Object linearGradient) { toni@521: this.gradient = linearGradient; toni@521: } toni@521: toni@521: Object object() { toni@521: return gradient; toni@521: } toni@521: toni@1117: @Override toni@521: public void addColorStop(double position, String color) { toni@521: addColorStopImpl(gradient, position, color); toni@521: } toni@521: toni@521: @JavaScriptBody(args = {"gradient", "position", "color"}, body = toni@521: "gradient.addColorStop(position,color)") toni@521: private static native void addColorStopImpl(Object gradient, double position, String color); toni@521: }