|
[Jfreechart-commit] jfreechart/source/org/jfree/chart/plot SpiderWebPlot.java,1.11.2.5,1.11.2.6
From: David Gilbert <mungady@us...> - 2005-12-21 15:23
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/plot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20532/source/org/jfree/chart/plot
Modified Files:
Tag: STABLE_1-0-0
SpiderWebPlot.java
Log Message:
2005-12-21 David Gilbert <david.gilbert@...>
* source/org/jfree/chart/plot/SpiderWebPlot.java
(SpiderWebPlot(CategoryDataset)): Delegate to another constructor,
(SpiderWebPlot(CategoryDataset, TableOrder)): Copied code from previous
constructor,
(getPlotType): Updated description,
(setInteriorGap): Reformatted,
(draw): Likewise,
(drawRadarPoly): Likewise,
(drawLabel): Likewise.
----------------------------------------------------------------------
Index: SpiderWebPlot.java
===================================================================
RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/plot/SpiderWebPlot.java,v
retrieving revision 1.11.2.5
retrieving revision 1.11.2.6
diff -C2 -d -r1.11.2.5 -r1.11.2.6
*** SpiderWebPlot.java 28 Nov 2005 12:06:35 -0000 1.11.2.5
--- SpiderWebPlot.java 21 Dec 2005 15:23:08 -0000 1.11.2.6
***************
*** 28,32 ****
* SpiderWebPlot.java
* ------------------
! * (C) Copyright 2005, by Heaps of Flavour Pty Ltd.
*
* Company Info: http://www.i4-talent.com
--- 28,32 ----
* SpiderWebPlot.java
* ------------------
! * (C) Copyright 2005, by Heaps of Flavour Pty Ltd and Contributors.
*
* Company Info: http://www.i4-talent.com
***************
*** 124,130 ****
/** The default series label font. */
! public static final Font DEFAULT_LABEL_FONT = new Font(
! "SansSerif", Font.PLAIN, 10
! );
/** The default series label paint. */
--- 124,129 ----
/** The default series label font. */
! public static final Font DEFAULT_LABEL_FONT = new Font("SansSerif",
! Font.PLAIN, 10);
/** The default series label paint. */
***************
*** 230,239 ****
/**
! * Creates a new radar plot with default attributes.
*
* @param dataset the dataset (<code>null</code> permitted).
*/
public SpiderWebPlot(CategoryDataset dataset) {
super();
this.dataset = dataset;
if (dataset != null) {
--- 229,253 ----
/**
! * Creates a new spider web plot with the given dataset, with each row
! * representing a series.
*
* @param dataset the dataset (<code>null</code> permitted).
*/
public SpiderWebPlot(CategoryDataset dataset) {
+ this(dataset, TableOrder.BY_ROW);
+ }
+
+ /**
+ * Creates a new spider web plot with the given dataset.
+ *
+ * @param dataset the dataset.
+ * @param extract controls how data is extracted ({@link TableOrder#BY_ROW}
+ * or {@link TableOrder#BY_COLUMN}).
+ */
+ public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
super();
+ if (extract == null) {
+ throw new IllegalArgumentException("Null 'extract' argument.");
+ }
this.dataset = dataset;
if (dataset != null) {
***************
*** 241,245 ****
}
! this.dataExtractOrder = TableOrder.BY_ROW;
this.headPercent = DEFAULT_HEAD;
this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
--- 255,259 ----
}
! this.dataExtractOrder = extract;
this.headPercent = DEFAULT_HEAD;
this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
***************
*** 270,284 ****
/**
- * Creates a new radar plot overriding the data extraction order.
- *
- * @param data the data.
- * @param type controls how radar data is extracted (BY_ROW or BY_COLUMN).
- */
- public SpiderWebPlot(CategoryDataset data, TableOrder type) {
- this(data);
- this.dataExtractOrder = type;
- }
-
- /**
* Returns a short string describing the type of plot.
*
--- 284,287 ----
***************
*** 287,291 ****
public String getPlotType() {
// return localizationResources.getString("Radar_Plot");
! return ("Radar Plot");
}
--- 290,294 ----
public String getPlotType() {
// return localizationResources.getString("Radar_Plot");
! return ("Spider Web Plot");
}
***************
*** 477,482 ****
if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) {
throw new IllegalArgumentException(
! "Percentage outside valid range."
! );
}
if (this.interiorGap != percent) {
--- 480,484 ----
if ((percent < 0.0) || (percent > MAX_INTERIOR_GAP)) {
throw new IllegalArgumentException(
! "Percentage outside valid range.");
}
if (this.interiorGap != percent) {
***************
*** 899,906 ****
double y = -Math.sin(angrad) * length * bounds.getHeight() / 2;
! return new Point2D.Double(
! bounds.getX() + x + bounds.getWidth() / 2,
! bounds.getY() + y + bounds.getHeight() / 2
! );
}
--- 901,906 ----
double y = -Math.sin(angrad) * length * bounds.getHeight() / 2;
! return new Point2D.Double(bounds.getX() + x + bounds.getWidth() / 2,
! bounds.getY() + y + bounds.getHeight() / 2);
}
***************
*** 935,943 ****
g2.clip(area);
Composite originalComposite = g2.getComposite();
! g2.setComposite(
! AlphaComposite.getInstance(
! AlphaComposite.SRC_OVER, getForegroundAlpha()
! )
! );
if (!DatasetUtilities.isEmptyOrNull(this.dataset)) {
--- 935,940 ----
g2.clip(area);
Composite originalComposite = g2.getComposite();
! g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
! getForegroundAlpha()));
if (!DatasetUtilities.isEmptyOrNull(this.dataset)) {
***************
*** 985,991 ****
for (int series = 0; series < seriesCount; series++) {
! drawRadarPoly(
! g2, radarArea, centre, info, series, catCount, headH, headW
! );
}
}
--- 982,987 ----
for (int series = 0; series < seriesCount; series++) {
! drawRadarPoly(g2, radarArea, centre, info, series, catCount,
! headH, headW);
}
}
***************
*** 1068,1074 ****
// polygon
! Point2D point = getWebPoint(
! plotArea, angle, value / this.maxValue
! );
polygon.addPoint((int) point.getX(), (int) point.getY());
--- 1064,1069 ----
// polygon
! Point2D point = getWebPoint(plotArea, angle,
! value / this.maxValue);
polygon.addPoint((int) point.getX(), (int) point.getY());
***************
*** 1081,1089 ****
Stroke outlineStroke = getSeriesOutlineStroke(series);
! Ellipse2D head = new Ellipse2D.Double(
! point.getX() - headW / 2,
! point.getY() - headH / 2,
! headW, headH
! );
g2.setPaint(paint);
g2.fill(head);
--- 1076,1082 ----
Stroke outlineStroke = getSeriesOutlineStroke(series);
! Ellipse2D head = new Ellipse2D.Double(point.getX()
! - headW / 2, point.getY() - headH / 2, headW,
! headH);
g2.setPaint(paint);
g2.fill(head);
***************
*** 1100,1106 ****
Line2D line = new Line2D.Double(centre, endPoint);
g2.draw(line);
! drawLabel(
! g2, plotArea, value, cat, angle, 360.0 / catCount
! );
}
}
--- 1093,1098 ----
Line2D line = new Line2D.Double(centre, endPoint);
g2.draw(line);
! drawLabel(g2, plotArea, value, cat, angle,
! 360.0 / catCount);
}
}
***************
*** 1116,1128 ****
if (this.webFilled) {
! g2.setComposite(
! AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f)
! );
g2.fill(polygon);
! g2.setComposite(
! AlphaComposite.getInstance(
! AlphaComposite.SRC_OVER, getForegroundAlpha()
! )
! );
}
}
--- 1108,1116 ----
if (this.webFilled) {
! g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
! 0.1f));
g2.fill(polygon);
! g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
! getForegroundAlpha()));
}
}
***************
*** 1178,1195 ****
double ascent = lm.getAscent();
! Point2D labelLocation = calculateLabelLocation(
! labelBounds, ascent, plotArea, startAngle
! );
Composite saveComposite = g2.getComposite();
! g2.setComposite(
! AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f)
! );
g2.setPaint(getLabelPaint());
g2.setFont(getLabelFont());
! g2.drawString(
! label, (float) labelLocation.getX(), (float) labelLocation.getY()
! );
g2.setComposite(saveComposite);
}
--- 1166,1180 ----
double ascent = lm.getAscent();
! Point2D labelLocation = calculateLabelLocation(labelBounds, ascent,
! plotArea, startAngle);
Composite saveComposite = g2.getComposite();
! g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
! 1.0f));
g2.setPaint(getLabelPaint());
g2.setFont(getLabelFont());
! g2.drawString(label, (float) labelLocation.getX(),
! (float) labelLocation.getY());
g2.setComposite(saveComposite);
}
***************
*** 1325,1333 ****
* Provides serialization support.
*
! * @param stream
! * the output stream.
*
! * @throws IOException
! * if there is an I/O error.
*/
private void writeObject(ObjectOutputStream stream) throws IOException {
--- 1310,1316 ----
* Provides serialization support.
*
! * @param stream the output stream.
*
! * @throws IOException if there is an I/O error.
*/
private void writeObject(ObjectOutputStream stream) throws IOException {
***************
*** 1347,1357 ****
* Provides serialization support.
*
! * @param stream
! * the input stream.
*
! * @throws IOException
! * if there is an I/O error.
! * @throws ClassNotFoundException
! * if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException,
--- 1330,1337 ----
* Provides serialization support.
*
! * @param stream the input stream.
*
! * @throws IOException if there is an I/O error.
! * @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException,
|
| Thread | Author | Date |
|---|---|---|
| [Jfreechart-commit] jfreechart/source/org/jfree/chart/plot SpiderWebPlot.java,1.11.2.5,1.11.2.6 | David Gilbert <mungady@us...> |