LinePoint.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.Path;
  23. import android.graphics.Region;
  24. public class LinePoint {
  25. private float x = 0;
  26. private float y = 0;
  27. private Path path;
  28. private Region region;
  29. private String color;
  30. public LinePoint(){
  31. }
  32. public LinePoint(double x, double y){
  33. this.x = (float)x;
  34. this.y = (float)y;
  35. }
  36. public LinePoint(float x, float y){
  37. this.x = x;
  38. this.y = y;
  39. }
  40. public float getX() {
  41. return x;
  42. }
  43. public void setX(float x) {
  44. this.x = x;
  45. }
  46. public float getY() {
  47. return y;
  48. }
  49. public void setY(float y) {
  50. this.y = y;
  51. }
  52. public void setX(double x){
  53. this.x = (float) x;
  54. }
  55. public void setY(double y){
  56. this.y = (float) y;
  57. }
  58. public Region getRegion() {
  59. return region;
  60. }
  61. public void setRegion(Region region) {
  62. this.region = region;
  63. }
  64. public Path getPath() {
  65. return path;
  66. }
  67. public void setPath(Path path) {
  68. this.path = path;
  69. }
  70. @Override
  71. public String toString(){
  72. return "x= " + x + ", y= " + y;
  73. }
  74. public String getColor() {
  75. return color != null ? color : "#33B5E5";
  76. }
  77. public void setColor(String color) {
  78. this.color = color;
  79. }
  80. }