StrokesRestのstrokesにPOST,GETにコメント追加。 entitiesのStrokeにコード追加。 #142

Merged d-matsuura merged 1 commit into nitta-lab-2021:master from nitta-lab-2021:akagi on 29 May 2021
Showing 2 changed files
View
4
src/main/java/org/ntlab/acanthus_server/entities/Stroke.java
import org.ntlab.acanthus_server.resources.gallery.StrokesRest;
import org.ntlab.acanthus_server.entities.Position;
 
public class Stroke {
static int strokeNoCount; //strokeNoを数えるためだけ
private static int strokeNoCount; //strokeNoを数えるためだけ
private int strokeNo;
private int pen;
private int color;
private int thickness;
this.color = color;
this.thickness = thickness;
}
 
public void addPositions(ArrayList<Position> positions) {
public void addPosition(ArrayList<Position> positions) {
this.positions = positions;
}
 
}
View
16
src/main/java/org/ntlab/acanthus_server/resources/gallery/StrokesRest.java
var animation = gallery.getAnimationInformation(aid);
Stroke Test = new Stroke();
Test.addStrokes(pen, color, thick);
Test.addStrokeNo();//strokeNoを+1する
Test.addPositions(this.positions);
Test.addPosition(this.positions);
this.strokes.add(Test);
// if(animation != null) {
// this.Test.setStrokes(pen, color, thick);
// }else{
*/
@Path("/{aid}/pageMap/0/layers/0/strokes/{strokeNo}/position")
@POST
@Produces(MediaType.APPLICATION_JSON)
public void addPositions(@PathParam("aid") Integer aid, @FormParam("x") Float x, @FormParam("y") Float y) {
public void addPositions(@PathParam("aid") Integer aid, @PathParam("strokeNo") Integer strokeNo, @FormParam("x") Float x, @FormParam("y") Float y) {
var animation = gallery.getAnimationInformation(aid);
 
Position Position = new Position();
Position.setXY(x, y);
this.positions.add(Position);
// Stroke stroke = strokes.get(strokeNo);
 
Position position = new Position();
position.setXY(x, y);
// stroke.addPosition(Position);
this.positions.add(position);
// if(animation != null) {
// this.Position.setXY(x, y);
// this.positions.add(this.Position);
// }else{