[Schmitzm-commits] r2240 - trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 21 18:23:29 CET 2013


Author: mojays
Date: 2013-02-21 18:23:29 +0100 (Thu, 21 Feb 2013)
New Revision: 2240

Modified:
   trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionCategoryRenderer.java
   trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionXYRenderer.java
   trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionRenderer.java
   trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionXYLineAndShapeRenderer.java
Log:
SelectionRenderer: highlight shape can be set (if set, shape is used for all series)

Modified: trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionCategoryRenderer.java
===================================================================
--- trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionCategoryRenderer.java	2013-02-21 16:25:20 UTC (rev 2239)
+++ trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionCategoryRenderer.java	2013-02-21 17:23:29 UTC (rev 2240)
@@ -32,6 +32,7 @@
 import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.Paint;
+import java.awt.Shape;
 import java.awt.geom.Rectangle2D;
 
 import org.apache.log4j.Logger;
@@ -81,6 +82,9 @@
   /** Holds the outline paint for selected items (used for all series). */
   protected Paint selectionOutlinePaint;
   
+  /** Holds the shape for selected items (used for all series). */
+  protected Shape selectionShape = null;
+  
 //  /** Holds the selection {@link Stroke} (used for all series). */
 //  protected Stroke selectionStroke = null;
 
@@ -197,6 +201,22 @@
       selectionOutlinePaint = paint;
   }
 
+  /**
+   * Returns the shape, the selected data is rendered with.
+   */
+  public Shape getSelectionShape() {
+    return selectionShape;
+  }
+
+  /**
+   * Sets the shape, the selected data is rendered with. This shape is used
+   * for all series. Should only be set if the unselected items are also 
+   * rendered with the same shape!
+   */
+  public void setSelectionShape(Shape shape) {
+    selectionShape = shape;
+  }
+
 //  /**
 //   * Returns the {@link Stroke}, the selected data is rendered with.
 //   * @return {@code null} if no special stroke is set (the base stroke
@@ -259,6 +279,8 @@
           // Apply the selection outline color 
           if (getSelectionOutlinePaint() != null) 
         	  setSeriesOutlinePaint( row, getSelectionOutlinePaint(), false );
+          if (getSelectionShape() != null)
+            setSeriesShape(row, getSelectionShape(), false);
           
           super.drawItem(g, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column, pass);
         }

Modified: trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionXYRenderer.java
===================================================================
--- trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionXYRenderer.java	2013-02-21 16:25:20 UTC (rev 2239)
+++ trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/PointSelectionXYRenderer.java	2013-02-21 17:23:29 UTC (rev 2240)
@@ -32,6 +32,8 @@
 import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.Paint;
+import java.awt.Shape;
+import java.awt.geom.Ellipse2D;
 import java.awt.geom.Rectangle2D;
 
 import org.apache.log4j.Logger;
@@ -80,6 +82,9 @@
   /** Holds the outline paint for selected items (used for all series). */
   protected Paint selectionOutlinePaint = null;
 
+  /** Holds the shape for selected items (used for all series). */
+  protected Shape selectionShape = null;
+
 //  /** Holds the selection {@link Stroke} (used for all series). */
 //  protected Stroke selectionStroke = null;
 
@@ -201,6 +206,22 @@
       selectionOutlinePaint = paint;
   }
 
+  /**
+   * Returns the shape, the selected data is rendered with.
+   */
+  public Shape getSelectionShape() {
+    return selectionShape;
+  }
+
+  /**
+   * Sets the shape, the selected data is rendered with. This shape is used
+   * for all series. Should only be set if the unselected items are also 
+   * rendered with the same shape!
+   */
+  public void setSelectionShape(Shape shape) {
+    selectionShape = shape;
+  }
+  
 //  /**
 //   * Returns the {@link Stroke}, the selected data is rendered with.
 //   * @return {@code null} if no special stroke is set (the base stroke
@@ -282,7 +303,9 @@
           setSeriesPaint( series, selPaint, false );
          
           if (getSelectionOutlinePaint() != null)
-            setSeriesOutlinePaint(series, selectionOutlinePaint, false );
+            setSeriesOutlinePaint(series, selectionOutlinePaint, false);
+          if (getSelectionShape() != null)
+            setSeriesShape(series, selectionShape, false);
           
           super.drawItem(g, state, dataArea, info, plot, domainAxis, rangeAxis, dataset, series, item, crosshairState, pass);
         }

Modified: trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionRenderer.java
===================================================================
--- trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionRenderer.java	2013-02-21 16:25:20 UTC (rev 2239)
+++ trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionRenderer.java	2013-02-21 17:23:29 UTC (rev 2240)
@@ -30,6 +30,7 @@
 package de.schmitzm.jfree.chart.renderer;
 
 import java.awt.Paint;
+import java.awt.Shape;
 
 import de.schmitzm.jfree.chart.selection.DatasetSelectionModel;
 import de.schmitzm.jfree.chart.selection.DatasetSelectionModelProvider;
@@ -51,6 +52,11 @@
   public Paint getSelectionOutlinePaint();
 
   /**
+   * Returns the shape, the selected data is rendererd with.
+   */
+  public Shape getSelectionShape();
+
+  /**
    * Sets the color, the selected data is rendered with.
    * @param paint color for the selected data
    */
@@ -62,6 +68,13 @@
    */
   public void setSelectionOutlinePaint(Paint paint);
 
+  /**
+   * Sets the shape, the selected data is rendererd with. This shape is used
+   * for all series. Should only be set if the unselected items are also 
+   * rendered with the same shape!
+   */
+  public void setSelectionShape(Shape shape);
+  
 //  /**
 //   * Returns the {@link Stroke}, the selected data is rendered with.
 //   * @return {@code null} if no special stroke is set (the base stroke

Modified: trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionXYLineAndShapeRenderer.java
===================================================================
--- trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionXYLineAndShapeRenderer.java	2013-02-21 16:25:20 UTC (rev 2239)
+++ trunk/schmitzm-jfree/src/main/java/de/schmitzm/jfree/chart/renderer/SelectionXYLineAndShapeRenderer.java	2013-02-21 17:23:29 UTC (rev 2240)
@@ -32,6 +32,7 @@
 import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.Paint;
+import java.awt.Shape;
 import java.awt.geom.Rectangle2D;
 import java.util.HashMap;
 import java.util.Map;
@@ -203,6 +204,22 @@
     selectionOutlinePaint = paint;
   }
 
+  /**
+   * Returns the shape, the selected data is rendered with.
+   */
+  public Shape getSelectionShape() {
+    throw new UnsupportedOperationException("SelectionXYLineAndShapeRenderer.getSelectionShape(.) not yet supported");
+  }
+
+  /**
+   * Sets the shape, the selected data is rendered with. This shape is used
+   * for all series. Should only be set if the unselected items are also 
+   * rendered with the same shape!
+   */
+  public void setSelectionShape(Shape shape) {
+    throw new UnsupportedOperationException("SelectionXYLineAndShapeRenderer.setSelectionShape(.) not yet supported");
+  }
+
   // /**
   // * Returns the {@link Stroke}, the selected data is rendered with.
   // * @return {@code null} if no special stroke is set (the base stroke



More information about the Schmitzm-commits mailing list