javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java
author Anton Epple <toni.epple@eppleton.de>
Wed, 22 May 2013 17:49:01 +0200
branchcanvas
changeset 1129 425c0c9ff88c
parent 1128 2dc980517b36
child 1130 6790eb381615
permissions -rw-r--r--
updated API
toni@1119
     1
/**
toni@1119
     2
 * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
toni@1119
     3
 * <jaroslav.tulach@apidesign.org>
toni@1119
     4
 *
toni@1119
     5
 * This program is free software: you can redistribute it and/or modify it under
toni@1119
     6
 * the terms of the GNU General Public License as published by the Free Software
toni@1119
     7
 * Foundation, version 2 of the License.
toni@1119
     8
 *
toni@1119
     9
 * This program is distributed in the hope that it will be useful, but WITHOUT
toni@1119
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
toni@1119
    11
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
toni@1119
    12
 * details.
toni@1119
    13
 *
toni@1119
    14
 * You should have received a copy of the GNU General Public License along with
toni@1119
    15
 * this program. Look for COPYING file in the top folder. If not, see
toni@1119
    16
 * http://opensource.org/licenses/GPL-2.0.
toni@1111
    17
 */
toni@1111
    18
package net.java.html.canvas;
toni@1111
    19
toni@1129
    20
import java.util.HashMap;
toni@1129
    21
toni@1111
    22
/**
toni@1111
    23
 *
toni@1111
    24
 * @author antonepple
toni@1111
    25
 */
toni@1129
    26
public class LinearGradient implements Style {
toni@1116
    27
toni@1129
    28
    HashMap<Double,String> stops;
toni@1129
    29
    
toni@1129
    30
    double x0, y0, x1, y1;
toni@1129
    31
toni@1129
    32
    void addColorStop(double position, String color){
toni@1129
    33
        if (stops == null) stops = new HashMap<>();
toni@1129
    34
        stops.put(position, color);
toni@1129
    35
    }
toni@1129
    36
toni@1129
    37
    public HashMap<Double, String> getStops() {
toni@1129
    38
        return stops;
toni@1129
    39
    }
toni@1129
    40
toni@1129
    41
    public void setStops(HashMap<Double, String> stops) {
toni@1129
    42
        this.stops = stops;
toni@1129
    43
    }
toni@1129
    44
toni@1129
    45
    public double getX0() {
toni@1129
    46
        return x0;
toni@1129
    47
    }
toni@1129
    48
toni@1129
    49
    public void setX0(double x0) {
toni@1129
    50
        this.x0 = x0;
toni@1129
    51
    }
toni@1129
    52
toni@1129
    53
    public double getY0() {
toni@1129
    54
        return y0;
toni@1129
    55
    }
toni@1129
    56
toni@1129
    57
    public void setY0(double y0) {
toni@1129
    58
        this.y0 = y0;
toni@1129
    59
    }
toni@1129
    60
toni@1129
    61
    public double getX1() {
toni@1129
    62
        return x1;
toni@1129
    63
    }
toni@1129
    64
toni@1129
    65
    public void setX1(double x1) {
toni@1129
    66
        this.x1 = x1;
toni@1129
    67
    }
toni@1129
    68
toni@1129
    69
    public double getY1() {
toni@1129
    70
        return y1;
toni@1129
    71
    }
toni@1129
    72
toni@1129
    73
    public void setY1(double y1) {
toni@1129
    74
        this.y1 = y1;
toni@1129
    75
    }
toni@1129
    76
    
toni@1129
    77
    
toni@1129
    78
    
toni@1111
    79
    
toni@1111
    80
}