diff --git a/app/src/main/java/org/ntlab/acanthus_client/entities/Pen.java b/app/src/main/java/org/ntlab/acanthus_client/entities/Pen.java index 17e335e..c10e7e6 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/entities/Pen.java +++ b/app/src/main/java/org/ntlab/acanthus_client/entities/Pen.java @@ -3,34 +3,91 @@ //----------------------------------------------------------------- // public class Pen { - private Integer penType; + //private Integer penType; private Integer color; + private Integer red; + private Integer green; + private Integer blue; + private Integer alpha; private Integer thickness; //----------------------------------------------------------------- //----------------------------------------------------------------- // - public Pen(Integer penType, Integer color, Integer thickness) { - this.penType = penType; + //色を直接指定したいとき + public Pen(/*Integer penType,*/ Integer color, Integer thickness) { + //this.penType = penType; this.color = color; this.thickness = thickness; } - //----------------------------------------------------------------- - // getter - public Integer getPenType() { - return this.penType; + //色をRGBで指定したいとき alphaはアルファ値で透明度(0から255で、0の時に完全な透明になる) + public Pen(Integer alpha, Integer red,Integer green,Integer blue, Integer thickness) { + this.alpha = alpha; + this.red = red; + this.green = green; + this.blue = blue; + this.thickness = thickness; } + //----------------------------------------------------------------- + // getter +// public Integer getPenType() { +// return this.penType; +// } + public Integer getColor() { - return this.getColor(); + return this.color; } + + public Integer getAlpha(){ + return this.alpha; + } + + public Integer getRed(){ + return this.red; + } + + + public Integer getGreen(){ + return this.green; + } + + public Integer getBlue(){ + return this.blue; + } + + public Integer getThickness() { return this.thickness; } //----------------------------------------------------------------- // setter + public void setColor(Integer color ){ + this.color = color; + } + + public void setAlpha(Integer alpha){ + this.alpha = alpha; + } + + public void setRed(Integer red){ + this.red = red; + } + + public void setGreen(Integer green){ + this.green = green; + } + + public void setBlue(Integer blue){ + this.blue = blue; + } + + + public void setThickness(Integer thickness){ + this.thickness = thickness; + } //----------------------------------------------------------------- }