toni@1119: /** toni@1119: * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach toni@1119: * toni@1119: * toni@1119: * This program is free software: you can redistribute it and/or modify it under toni@1119: * the terms of the GNU General Public License as published by the Free Software toni@1119: * Foundation, version 2 of the License. toni@1119: * toni@1119: * This program is distributed in the hope that it will be useful, but WITHOUT toni@1119: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS toni@1119: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more toni@1119: * details. toni@1119: * toni@1119: * You should have received a copy of the GNU General Public License along with toni@1119: * this program. Look for COPYING file in the top folder. If not, see toni@1119: * http://opensource.org/licenses/GPL-2.0. toni@1111: */ toni@1111: package net.java.html.canvas; toni@1111: toni@1129: import java.util.HashMap; toni@1129: toni@1111: /** toni@1111: * toni@1111: * @author antonepple toni@1111: */ toni@1129: public class LinearGradient implements Style { toni@1116: toni@1129: HashMap stops; toni@1129: toni@1129: double x0, y0, x1, y1; toni@1129: toni@1129: void addColorStop(double position, String color){ toni@1129: if (stops == null) stops = new HashMap<>(); toni@1129: stops.put(position, color); toni@1129: } toni@1129: toni@1129: public HashMap getStops() { toni@1129: return stops; toni@1129: } toni@1129: toni@1129: public void setStops(HashMap stops) { toni@1129: this.stops = stops; toni@1129: } toni@1129: toni@1129: public double getX0() { toni@1129: return x0; toni@1129: } toni@1129: toni@1129: public void setX0(double x0) { toni@1129: this.x0 = x0; toni@1129: } toni@1129: toni@1129: public double getY0() { toni@1129: return y0; toni@1129: } toni@1129: toni@1129: public void setY0(double y0) { toni@1129: this.y0 = y0; toni@1129: } toni@1129: toni@1129: public double getX1() { toni@1129: return x1; toni@1129: } toni@1129: toni@1129: public void setX1(double x1) { toni@1129: this.x1 = x1; toni@1129: } toni@1129: toni@1129: public double getY1() { toni@1129: return y1; toni@1129: } toni@1129: toni@1129: public void setY1(double y1) { toni@1129: this.y1 = y1; toni@1129: } toni@1129: toni@1129: toni@1129: toni@1111: toni@1111: }