Cell.js 805 B

123456789101112131415161718192021222324252627282930313233343536
  1. import VectorType from '../enum/VectorType.js'
  2. import Geometry from './Geometry.js'
  3. export default class Cell extends Geometry {
  4. constructor(parent,vectorId) {
  5. super()
  6. this.width = 60; //每个格子默认宽度是60像素
  7. this.height = 24; //每个格子默认高度是24像素
  8. this.value = "";
  9. this.colIndex = 0;
  10. this.rowIndex = 0;
  11. this.parent = parent;
  12. this.geoType = VectorType.Cell
  13. this.setId(vectorId)
  14. }
  15. setWidth(width){
  16. this.width = width;
  17. }
  18. setHeight(height){
  19. this.height = height;
  20. }
  21. setValue(value){
  22. this.value = value;
  23. }
  24. setColIndex(colIndex){
  25. this.colIndex = colIndex;
  26. }
  27. setRowIndex(rowIndex){
  28. this.rowIndex = rowIndex;
  29. }
  30. }