示例#1
0
 public void newValue(
     final WDataSeries series,
     double x,
     double y,
     double stackY,
     int xRow,
     int xColumn,
     int yRow,
     int yColumn) {
   if (!Double.isNaN(x) && !Double.isNaN(y)) {
     WPointF p =
         this.chart_.map(
             x, y, series.getAxis(), this.getCurrentXSegment(), this.getCurrentYSegment());
     if (!this.marker_.isEmpty()) {
       WPen pen = series.getMarkerPen().clone();
       SeriesIterator.setPenColor(
           pen, series, xRow, xColumn, yRow, yColumn, ItemDataRole.MarkerPenColorRole);
       if (this.chart_.isSeriesSelectionEnabled()
           && this.chart_.getSelectedSeries() != null
           && this.chart_.getSelectedSeries() != series) {
         pen.setColor(WCartesianChart.lightenColor(pen.getColor()));
       }
       WBrush brush = series.getMarkerBrush().clone();
       SeriesIterator.setBrushColor(
           brush, series, xRow, xColumn, yRow, yColumn, ItemDataRole.MarkerBrushColorRole);
       double scale =
           this.calculateMarkerScale(series, xRow, xColumn, yRow, yColumn, series.getMarkerSize());
       if (this.chart_.isSeriesSelectionEnabled()
           && this.chart_.getSelectedSeries() != null
           && this.chart_.getSelectedSeries() != series) {
         brush.setColor(WCartesianChart.lightenColor(brush.getColor()));
       }
       if (!(this.series_ != null)
           || !brush.equals(this.currentBrush_)
           || !pen.equals(this.currentPen_)
           || scale != this.currentScale_) {
         if (this.series_ != null) {
           this.finishPathFragment(this.series_);
         }
         this.series_ = series;
         this.currentBrush_ = brush;
         this.currentPen_ = pen;
         this.currentScale_ = scale;
       }
       this.pathFragment_.moveTo(this.hv(p));
     }
     if (series.getType() != SeriesType.BarSeries) {
       WString toolTip = series.getModel().getToolTip(yRow, yColumn);
       if (!(toolTip.length() == 0)) {
         if (!(!EnumUtils.mask(
                     series.getModel().flags(yRow, yColumn), ItemFlag.ItemHasDeferredTooltip)
                 .isEmpty()
             || !EnumUtils.mask(series.getModel().flags(yRow, yColumn), ItemFlag.ItemIsXHTMLText)
                 .isEmpty())) {
           WTransform t = this.painter_.getWorldTransform();
           p = t.map(this.hv(p));
           WCircleArea circleArea = new WCircleArea();
           circleArea.setCenter(new WPointF(p.getX(), p.getY()));
           circleArea.setRadius(5);
           circleArea.setToolTip(toolTip);
           this.chart_.addDataPointArea(series, xRow, xColumn, circleArea);
         } else {
           this.chart_.hasDeferredToolTips_ = true;
         }
       }
     }
   }
 }
示例#2
0
 /** Set the background brush. */
 public void setBackground(final WBrush brush) {
   if (!brush.equals(this.background_)) {
     this.background_ = brush;
     this.update();
   }
 }
示例#3
0
 /** Set the brush for the selected area. */
 public void setSelectedAreaBrush(final WBrush brush) {
   if (!brush.equals(this.selectedAreaBrush_)) {
     this.selectedAreaBrush_ = brush;
     this.update();
   }
 }
示例#4
0
 /** Set the brush to draw the handles left and right of the selected area with. */
 public void setHandleBrush(final WBrush brush) {
   if (!brush.equals(this.handleBrush_)) {
     this.handleBrush_ = brush;
     this.update();
   }
 }