ScreenCoordsBase.as 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package {
  2. import flash.geom.Point;
  3. public class ScreenCoordsBase
  4. {
  5. public var top:Number;
  6. public var left:Number;
  7. public var right:Number;
  8. public var bottom:Number;
  9. public var width:Number;
  10. public var height:Number;
  11. public function ScreenCoordsBase( top:Number, left:Number, right:Number, bottom:Number ) {
  12. this.top = top;
  13. this.left = left;
  14. this.right = right;
  15. this.bottom = bottom;
  16. this.width = this.right-this.left;
  17. this.height = bottom-top;
  18. }
  19. //
  20. // used by the PIE slices so the pie chart is
  21. // centered in the screen
  22. //
  23. public function get_center_x():Number {
  24. return (this.width / 2)+this.left;
  25. }
  26. public function get_center_y():Number {
  27. return (this.height / 2)+this.top;
  28. }
  29. public function get_y_from_val( i:Number, right_axis:Boolean = false ):Number { return -1; }
  30. public function get_x_from_val( i:Number ):Number { return -1; }
  31. public function get_get_x_from_pos_and_y_from_val( index:Number, y:Number, right_axis:Boolean = false ):flash.geom.Point {
  32. return null;
  33. }
  34. public function get_y_bottom( right_axis:Boolean = false ):Number {
  35. return -1;
  36. }
  37. public function get_x_from_pos( i:Number ):Number { return -1; }
  38. }
  39. }