1 42 43 package org.jfree.chart.axis; 44 45 import java.util.List ; 46 47 import org.jfree.ui.RectangleEdge; 48 49 56 public class AxisState { 57 58 59 private double cursor; 60 61 62 private List ticks; 63 64 65 private double max; 66 67 70 public AxisState() { 71 this(0.0); 72 } 73 74 79 public AxisState(double cursor) { 80 this.cursor = cursor; 81 this.ticks = new java.util.ArrayList (); 82 } 83 84 89 public double getCursor() { 90 return this.cursor; 91 } 92 93 98 public void setCursor(double cursor) { 99 this.cursor = cursor; 100 } 101 102 108 public void moveCursor(double units, RectangleEdge edge) { 109 if (edge == RectangleEdge.TOP) { 110 cursorUp(units); 111 } 112 else if (edge == RectangleEdge.BOTTOM) { 113 cursorDown(units); 114 } 115 else if (edge == RectangleEdge.LEFT) { 116 cursorLeft(units); 117 } 118 else if (edge == RectangleEdge.RIGHT) { 119 cursorRight(units); 120 } 121 } 122 123 128 public void cursorUp(double units) { 129 this.cursor = this.cursor - units; 130 } 131 132 137 public void cursorDown(double units) { 138 this.cursor = this.cursor + units; 139 } 140 141 146 public void cursorLeft(double units) { 147 this.cursor = this.cursor - units; 148 } 149 150 155 public void cursorRight(double units) { 156 this.cursor = this.cursor + units; 157 } 158 159 164 public List getTicks() { 165 return this.ticks; 166 } 167 168 173 public void setTicks(List ticks) { 174 this.ticks = ticks; 175 } 176 177 182 public double getMax() { 183 return this.max; 184 } 185 186 191 public void setMax(double max) { 192 this.max = max; 193 } 194 } 195 | Popular Tags |