old projects
This commit is contained in:
34
linenSicht/Shape.java
Normal file
34
linenSicht/Shape.java
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
|
||||
public class Shape {
|
||||
|
||||
ArrayList<Integer> x = new ArrayList<Integer>();
|
||||
ArrayList<Integer> y = new ArrayList<Integer>();
|
||||
int len = 0;
|
||||
|
||||
public Shape() {
|
||||
|
||||
}
|
||||
|
||||
public void addPoint(int posX, int posY) {
|
||||
x.add(posX);
|
||||
y.add(posY);
|
||||
len++;
|
||||
|
||||
}
|
||||
|
||||
public int getX(int index) {
|
||||
return x.get(index);
|
||||
}
|
||||
|
||||
public int getY(int index) {
|
||||
return y.get(index);
|
||||
}
|
||||
|
||||
public int getLength() {
|
||||
return len;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user