📄 xyplot.java
字号:
*
* @param paint the paint (<code>null</code> permitted).
*/
public void setRangeGridlinePaint(Paint paint) {
this.rangeGridlinePaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns a flag that controls whether or not a zero baseline is
* displayed for the range axis.
*
* @return A boolean.
*/
public boolean isRangeZeroBaselineVisible() {
return this.rangeZeroBaselineVisible;
}
/**
* Sets the flag that controls whether or not the zero baseline is
* displayed for the range axis, and sends a {@link PlotChangeEvent} to
* all registered listeners.
*
* @param visible the flag.
*/
public void setRangeZeroBaselineVisible(boolean visible) {
this.rangeZeroBaselineVisible = visible;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the stroke used for the zero baseline against the range axis.
*
* @return The stroke (never <code>null</code>).
*/
public Stroke getRangeZeroBaselineStroke() {
return this.rangeZeroBaselineStroke;
}
/**
* Sets the stroke for the zero baseline for the range axis,
* and sends a {@link PlotChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> not permitted).
*/
public void setRangeZeroBaselineStroke(Stroke stroke) {
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
this.rangeZeroBaselineStroke = stroke;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the paint for the zero baseline (if any) plotted against the
* range axis.
*
* @return The paint (never <code>null</code>).
*/
public Paint getRangeZeroBaselinePaint() {
return this.rangeZeroBaselinePaint;
}
/**
* Sets the paint for the zero baseline plotted against the range axis and
* sends a {@link PlotChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> permitted).
*/
public void setRangeZeroBaselinePaint(Paint paint) {
this.rangeZeroBaselinePaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the paint used for the domain tick bands. If this is
* <code>null</code>, no tick bands will be drawn.
*
* @return The paint (possibly <code>null</code>).
*/
public Paint getDomainTickBandPaint() {
return this.domainTickBandPaint;
}
/**
* Sets the paint for the domain tick bands.
*
* @param paint the paint (<code>null</code> permitted).
*/
public void setDomainTickBandPaint(Paint paint) {
this.domainTickBandPaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the paint used for the range tick bands. If this is
* <code>null</code>, no tick bands will be drawn.
*
* @return The paint (possibly <code>null</code>).
*/
public Paint getRangeTickBandPaint() {
return this.rangeTickBandPaint;
}
/**
* Sets the paint for the range tick bands.
*
* @param paint the paint (<code>null</code> permitted).
*/
public void setRangeTickBandPaint(Paint paint) {
this.rangeTickBandPaint = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the origin for the quadrants that can be displayed on the plot.
* This defaults to (0, 0).
*
* @return The origin point (never <code>null</code>).
*/
public Point2D getQuadrantOrigin() {
return this.quadrantOrigin;
}
/**
* Sets the quadrant origin and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param origin the origin (<code>null</code> not permitted).
*/
public void setQuadrantOrigin(Point2D origin) {
if (origin == null) {
throw new IllegalArgumentException("Null 'origin' argument.");
}
this.quadrantOrigin = origin;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Returns the paint used for the specified quadrant.
*
* @param index the quadrant index (0-3).
*
* @return The paint (possibly <code>null</code>).
*/
public Paint getQuadrantPaint(int index) {
if (index < 0 || index > 3) {
throw new IllegalArgumentException(
"The index should be in the range 0 to 3."
);
}
return this.quadrantPaint[index];
}
/**
* Sets the paint used for the specified quadrant and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param index the quadrant index (0-3).
* @param paint the paint (<code>null</code> permitted).
*/
public void setQuadrantPaint(int index, Paint paint) {
if (index < 0 || index > 3) {
throw new IllegalArgumentException(
"The index should be in the range 0 to 3."
);
}
this.quadrantPaint[index] = paint;
notifyListeners(new PlotChangeEvent(this));
}
/**
* Adds a marker for the domain axis and sends a {@link PlotChangeEvent}
* to all registered listeners.
* <P>
* Typically a marker will be drawn by the renderer as a line perpendicular
* to the range axis, however this is entirely up to the renderer.
*
* @param marker the marker (<code>null</code> not permitted).
*/
public void addDomainMarker(Marker marker) {
// defer argument checking...
addDomainMarker(marker, Layer.FOREGROUND);
}
/**
* Adds a marker for the domain axis in the specified layer and sends a
* {@link PlotChangeEvent} to all registered listeners.
* <P>
* Typically a marker will be drawn by the renderer as a line perpendicular
* to the range axis, however this is entirely up to the renderer.
*
* @param marker the marker (<code>null</code> not permitted).
* @param layer the layer (foreground or background).
*/
public void addDomainMarker(Marker marker, Layer layer) {
addDomainMarker(0, marker, layer);
}
/**
* Clears all the (foreground and background) domain markers and sends a
* {@link PlotChangeEvent} to all registered listeners.
*/
public void clearDomainMarkers() {
if (this.foregroundDomainMarkers != null) {
this.foregroundDomainMarkers.clear();
}
if (this.backgroundDomainMarkers != null) {
this.backgroundDomainMarkers.clear();
}
notifyListeners(new PlotChangeEvent(this));
}
/**
* Clears the (foreground and background) domain markers for a particular
* renderer.
*
* @param index the renderer index.
*/
public void clearDomainMarkers(int index) {
Integer key = new Integer(index);
if (this.backgroundDomainMarkers != null) {
Collection markers
= (Collection) this.backgroundDomainMarkers.get(key);
if (markers != null) {
markers.clear();
}
}
if (this.foregroundRangeMarkers != null) {
Collection markers
= (Collection) this.foregroundDomainMarkers.get(key);
if (markers != null) {
markers.clear();
}
}
notifyListeners(new PlotChangeEvent(this));
}
/**
* Adds a marker for a renderer and sends a {@link PlotChangeEvent} to
* all registered listeners.
* <P>
* Typically a marker will be drawn by the renderer as a line perpendicular
* to the domain axis (that the renderer is mapped to), however this is
* entirely up to the renderer.
*
* @param index the renderer index.
* @param marker the marker.
* @param layer the layer (foreground or background).
*/
public void addDomainMarker(int index, Marker marker, Layer layer) {
Collection markers;
if (layer == Layer.FOREGROUND) {
markers = (Collection) this.foregroundDomainMarkers.get(
new Integer(index)
);
if (markers == null) {
markers = new java.util.ArrayList();
this.foregroundDomainMarkers.put(new Integer(index), markers);
}
markers.add(marker);
}
else if (layer == Layer.BACKGROUND) {
markers = (Collection) this.backgroundDomainMarkers.get(
new Integer(index)
);
if (markers == null) {
markers = new java.util.ArrayList();
this.backgroundDomainMarkers.put(new Integer(index), markers);
}
markers.add(marker);
}
notifyListeners(new PlotChangeEvent(this));
}
/**
* Adds a marker for the range axis and sends a {@link PlotChangeEvent} to
* all registered listeners.
* <P>
* Typically a marker will be drawn by the renderer as a line perpendicular
* to the range axis, however this is entirely up to the renderer.
*
* @param marker the marker (<code>null</code> not permitted).
*/
public void addRangeMarker(Marker marker) {
addRangeMarker(marker, Layer.FOREGROUND);
}
/**
* Adds a marker for the range axis in the specified layer and sends a
* {@link PlotChangeEvent} to all registered listeners.
* <P>
* Typically a marker will be drawn by the renderer as a line perpendicular
* to the range axis, however this is entirely up to the renderer.
*
* @param marker the marker (<code>null</code> not permitted).
* @param layer the layer (foreground or background).
*/
public void addRangeMarker(Marker marker, Layer layer) {
addRangeMarker(0, marker, layer);
}
/**
* Clears all the range markers and sends a {@link PlotChangeEvent} to all
* registered listeners.
*/
public void clearRangeMarkers() {
if (this.foregroundRangeMarkers != null) {
this.foregroundRangeMarkers.clear();
}
if (this.backgroundRangeMarkers != null) {
this.backgroundRangeMarkers.clear();
}
notifyListeners(new PlotChangeEvent(this));
}
/**
* Adds a marker for a renderer and sends a {@link PlotChangeEvent} to
* all registered listeners.
* <P>
* Typically a marker will be drawn by the renderer as a line perpendicular
* to the range axis, however this is entirely up to the renderer.
*
* @param index the renderer index.
* @param marker the marker.
* @param layer the layer (foreground or background).
*/
public void addRangeMarker(int index, Marker marker, Layer layer) {
Collection markers;
if (layer == Layer.FOREGROUND) {
markers = (Collection) this.foregroundRangeMarkers.get(
new Integer(index)
);
if (markers == null) {
markers = new java.util.ArrayList();
this.foregroundRangeMarkers.put(new Integer(index), markers);
}
markers.add(marker);
}
else if (layer == Layer.BACKGROUND) {
markers = (Collection) this.backgroundRangeMarkers.get(
new Integer(index)
);
if (markers == null) {
markers = new java.util.ArrayList();
this.backgroundRangeMarkers.put(new Integer(index), markers);
}
markers.add(marker);
}
notifyListeners(new PlotChangeEvent(this));
}
/**
* Clears the (foreground and background) range markers for a particular
* renderer.
*
* @param index the renderer index.
*/
public void clearRangeMarkers(int index) {
Integer key = new Integer(index);
if (this.backgroundRangeMarkers != null) {
Collection markers
= (Collection) this.backgroundRangeMarkers.get(key);
if (markers != null) {
markers.clear();
}
}
if (this.foregroundRangeMarkers != null) {
Collection markers
= (Collection) this.foregroundRangeMarkers.get(key);
if (markers != null) {
markers.clear();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -