LinePoint.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Created by Daniel Nadeau
  3. * daniel.nadeau01@gmail.com
  4. * danielnadeau.blogspot.com
  5. *
  6. * Licensed to the Apache Software Foundation (ASF) under one
  7. or more contributor license agreements. See the NOTICE file
  8. distributed with this work for additional information
  9. regarding copyright ownership. The ASF licenses this file
  10. to you under the Apache License, Version 2.0 (the
  11. "License"); you may not use this file except in compliance
  12. with the License. You may obtain a copy of the License at
  13. http://www.apache.org/licenses/LICENSE-2.0
  14. Unless required by applicable law or agreed to in writing,
  15. software distributed under the License is distributed on an
  16. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17. KIND, either express or implied. See the License for the
  18. specific language governing permissions and limitations
  19. under the License.
  20. */
  21. package com.echo.holographlibrary;
  22. import android.graphics.Color;
  23. import android.graphics.Path;
  24. import android.graphics.Region;
  25. public class LinePoint {
  26. private double x = 0;
  27. private double y = 0;
  28. private Path path;
  29. private Region region;
  30. private Integer color;
  31. public LinePoint(){
  32. }
  33. public LinePoint(double x, double y){
  34. this.x = x;
  35. this.y = y;
  36. }
  37. public LinePoint(float x, float y){
  38. this.x = x;
  39. this.y = y;
  40. }
  41. public double getX() {
  42. return x;
  43. }
  44. public void setX(float x) {
  45. this.x = x;
  46. }
  47. public double getY() {
  48. return y;
  49. }
  50. public void setY(float y) {
  51. this.y = y;
  52. }
  53. public void setX(double x){
  54. this.x = x;
  55. }
  56. public void setY(double y){
  57. this.y = y;
  58. }
  59. public Region getRegion() {
  60. return region;
  61. }
  62. public void setRegion(Region region) {
  63. this.region = region;
  64. }
  65. public Path getPath() {
  66. return path;
  67. }
  68. public void setPath(Path path) {
  69. this.path = path;
  70. }
  71. @Override
  72. public String toString(){
  73. return "x= " + x + ", y= " + y;
  74. }
  75. public Integer getColor() {
  76. return color != null ? color : Color.parseColor("#33B5E5");
  77. }
  78. public void setColor(Integer color) {
  79. this.color = color;
  80. }
  81. }