📄 axis.java
字号:
*/
public void setLabelInsets(RectangleInsets insets) {
if (insets == null) {
throw new IllegalArgumentException("Null 'insets' argument.");
}
if (!insets.equals(this.labelInsets)) {
this.labelInsets = insets;
notifyListeners(new AxisChangeEvent(this));
}
}
/**
* Returns the angle of the axis label.
*
* @return The angle (in radians).
*
* @see #setLabelAngle(double)
*/
public double getLabelAngle() {
return this.labelAngle;
}
/**
* Sets the angle for the label and sends an {@link AxisChangeEvent} to all
* registered listeners.
*
* @param angle the angle (in radians).
*
* @see #getLabelAngle()
*/
public void setLabelAngle(double angle) {
this.labelAngle = angle;
notifyListeners(new AxisChangeEvent(this));
}
/**
* A flag that controls whether or not the axis line is drawn.
*
* @return A boolean.
*
* @see #getAxisLinePaint()
* @see #getAxisLineStroke()
* @see #setAxisLineVisible(boolean)
*/
public boolean isAxisLineVisible() {
return this.axisLineVisible;
}
/**
* Sets a flag that controls whether or not the axis line is visible and
* sends an {@link AxisChangeEvent} to all registered listeners.
*
* @param visible the flag.
*
* @see #isAxisLineVisible()
* @see #setAxisLinePaint(Paint)
* @see #setAxisLineStroke(Stroke)
*/
public void setAxisLineVisible(boolean visible) {
this.axisLineVisible = visible;
notifyListeners(new AxisChangeEvent(this));
}
/**
* Returns the paint used to draw the axis line.
*
* @return The paint (never <code>null</code>).
*
* @see #setAxisLinePaint(Paint)
*/
public Paint getAxisLinePaint() {
return this.axisLinePaint;
}
/**
* Sets the paint used to draw the axis line and sends an
* {@link AxisChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getAxisLinePaint()
*/
public void setAxisLinePaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.axisLinePaint = paint;
notifyListeners(new AxisChangeEvent(this));
}
/**
* Returns the stroke used to draw the axis line.
*
* @return The stroke (never <code>null</code>).
*
* @see #setAxisLineStroke(Stroke)
*/
public Stroke getAxisLineStroke() {
return this.axisLineStroke;
}
/**
* Sets the stroke used to draw the axis line and sends an
* {@link AxisChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> not permitted).
*
* @see #getAxisLineStroke()
*/
public void setAxisLineStroke(Stroke stroke) {
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
this.axisLineStroke = stroke;
notifyListeners(new AxisChangeEvent(this));
}
/**
* Returns a flag indicating whether or not the tick labels are visible.
*
* @return The flag.
*
* @see #getTickLabelFont()
* @see #getTickLabelPaint()
* @see #setTickLabelsVisible(boolean)
*/
public boolean isTickLabelsVisible() {
return this.tickLabelsVisible;
}
/**
* Sets the flag that determines whether or not the tick labels are
* visible and sends an {@link AxisChangeEvent} to all registered
* listeners.
*
* @param flag the flag.
*
* @see #isTickLabelsVisible()
* @see #setTickLabelFont(Font)
* @see #setTickLabelPaint(Paint)
*/
public void setTickLabelsVisible(boolean flag) {
if (flag != this.tickLabelsVisible) {
this.tickLabelsVisible = flag;
notifyListeners(new AxisChangeEvent(this));
}
}
/**
* Returns the font used for the tick labels (if showing).
*
* @return The font (never <code>null</code>).
*
* @see #setTickLabelFont(Font)
*/
public Font getTickLabelFont() {
return this.tickLabelFont;
}
/**
* Sets the font for the tick labels and sends an {@link AxisChangeEvent}
* to all registered listeners.
*
* @param font the font (<code>null</code> not allowed).
*
* @see #getTickLabelFont()
*/
public void setTickLabelFont(Font font) {
if (font == null) {
throw new IllegalArgumentException("Null 'font' argument.");
}
if (!this.tickLabelFont.equals(font)) {
this.tickLabelFont = font;
notifyListeners(new AxisChangeEvent(this));
}
}
/**
* Returns the color/shade used for the tick labels.
*
* @return The paint used for the tick labels.
*
* @see #setTickLabelPaint(Paint)
*/
public Paint getTickLabelPaint() {
return this.tickLabelPaint;
}
/**
* Sets the paint used to draw tick labels (if they are showing) and
* sends an {@link AxisChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getTickLabelPaint()
*/
public void setTickLabelPaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.tickLabelPaint = paint;
notifyListeners(new AxisChangeEvent(this));
}
/**
* Returns the insets for the tick labels.
*
* @return The insets (never <code>null</code>).
*
* @see #setTickLabelInsets(RectangleInsets)
*/
public RectangleInsets getTickLabelInsets() {
return this.tickLabelInsets;
}
/**
* Sets the insets for the tick labels and sends an {@link AxisChangeEvent}
* to all registered listeners.
*
* @param insets the insets (<code>null</code> not permitted).
*
* @see #getTickLabelInsets()
*/
public void setTickLabelInsets(RectangleInsets insets) {
if (insets == null) {
throw new IllegalArgumentException("Null 'insets' argument.");
}
if (!this.tickLabelInsets.equals(insets)) {
this.tickLabelInsets = insets;
notifyListeners(new AxisChangeEvent(this));
}
}
/**
* Returns the flag that indicates whether or not the tick marks are
* showing.
*
* @return The flag that indicates whether or not the tick marks are
* showing.
*
* @see #setTickMarksVisible(boolean)
*/
public boolean isTickMarksVisible() {
return this.tickMarksVisible;
}
/**
* Sets the flag that indicates whether or not the tick marks are showing
* and sends an {@link AxisChangeEvent} to all registered listeners.
*
* @param flag the flag.
*
* @see #isTickMarksVisible()
*/
public void setTickMarksVisible(boolean flag) {
if (flag != this.tickMarksVisible) {
this.tickMarksVisible = flag;
notifyListeners(new AxisChangeEvent(this));
}
}
/**
* Returns the inside length of the tick marks.
*
* @return The length.
*
* @see #getTickMarkOutsideLength()
* @see #setTickMarkInsideLength(float)
*/
public float getTickMarkInsideLength() {
return this.tickMarkInsideLength;
}
/**
* Sets the inside length of the tick marks and sends
* an {@link AxisChangeEvent} to all registered listeners.
*
* @param length the new length.
*
* @see #getTickMarkInsideLength()
*/
public void setTickMarkInsideLength(float length) {
this.tickMarkInsideLength = length;
notifyListeners(new AxisChangeEvent(this));
}
/**
* Returns the outside length of the tick marks.
*
* @return The length.
*
* @see #getTickMarkInsideLength()
* @see #setTickMarkOutsideLength(float)
*/
public float getTickMarkOutsideLength() {
return this.tickMarkOutsideLength;
}
/**
* Sets the outside length of the tick marks and sends
* an {@link AxisChangeEvent} to all registered listeners.
*
* @param length the new length.
*
* @see #getTickMarkInsideLength()
*/
public void setTickMarkOutsideLength(float length) {
this.tickMarkOutsideLength = length;
notifyListeners(new AxisChangeEvent(this));
}
/**
* Returns the stroke used to draw tick marks.
*
* @return The stroke (never <code>null</code>).
*
* @see #setTickMarkStroke(Stroke)
*/
public Stroke getTickMarkStroke() {
return this.tickMarkStroke;
}
/**
* Sets the stroke used to draw tick marks and sends
* an {@link AxisChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> not permitted).
*
* @see #getTickMarkStroke()
*/
public void setTickMarkStroke(Stroke stroke) {
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
if (!this.tickMarkStroke.equals(stroke)) {
this.tickMarkStroke = stroke;
notifyListeners(new AxisChangeEvent(this));
}
}
/**
* Returns the paint used to draw tick marks (if they are showing).
*
* @return The paint (never <code>null</code>).
*
* @see #setTickMarkPaint(Paint)
*/
public Paint getTickMarkPaint() {
return this.tickMarkPaint;
}
/**
* Sets the paint used to draw tick marks and sends an
* {@link AxisChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getTickMarkPaint()
*/
public void setTickMarkPaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.tickMarkPaint = paint;
notifyListeners(new AxisChangeEvent(this));
}
/**
* Returns the plot that the axis is assigned to. This method will return
* <code>null</code> if the axis is not currently assigned to a plot.
*
* @return The plot that the axis is assigned to (possibly
* <code>null</code>).
*
* @see #setPlot(Plot)
*/
public Plot getPlot() {
return this.plot;
}
/**
* Sets a reference to the plot that the axis is assigned to.
* <P>
* This method is used internally, you shouldn't need to call it yourself.
*
* @param plot the plot.
*
* @see #getPlot()
*/
public void setPlot(Plot plot) {
this.plot = plot;
configure();
}
/**
* Returns the fixed dimension for the axis.
*
* @return The fixed dimension.
*
* @see #setFixedDimension(double)
*/
public double getFixedDimension() {
return this.fixedDimension;
}
/**
* Sets the fixed dimension for the axis.
* <P>
* This is used when combining more than one plot on a chart. In this case,
* there may be several axes that need to have the same height or width so
* that they are aligned. This method is used to fix a dimension for the
* axis (the context determines whether the dimension is horizontal or
* vertical).
*
* @param dimension the fixed dimension.
*
* @see #getFixedDimension()
*/
public void setFixedDimension(double dimension) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -