Пример #1
0
 public ImageTitle(Image image, int height, int width, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, RectangleInsets padding)
   : base(position, horizontalAlignment, verticalAlignment, padding)
 {
   ImageTitle imageTitle = this;
   if (image == null)
   {
     string str = "Null 'image' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new NullPointerException(str);
   }
   else
   {
     this.image = image;
     this.setHeight((double) height);
     this.setWidth((double) width);
   }
 }
Пример #2
0
 public virtual void moveCursor(double units, RectangleEdge edge)
 {
   if (edge == RectangleEdge.__\u003C\u003ETOP)
     this.cursorUp(units);
   else if (edge == RectangleEdge.__\u003C\u003EBOTTOM)
     this.cursorDown(units);
   else if (edge == RectangleEdge.__\u003C\u003ELEFT)
   {
     this.cursorLeft(units);
   }
   else
   {
     if (edge != RectangleEdge.__\u003C\u003ERIGHT)
       return;
     this.cursorRight(units);
   }
 }
Пример #3
0
 public override double valueToJava2D(double value, Rectangle2D dataArea, RectangleEdge edge)
 {
   Range range = this.getRange();
   double lowerBound = range.getLowerBound();
   double upperBound = range.getUpperBound();
   double cycleBound = this.getCycleBound();
   if (value < lowerBound || value > upperBound)
     return double.NaN;
   double num1 = 0.0;
   double num2 = 0.0;
   if (RectangleEdge.isTopOrBottom(edge))
   {
     num1 = ((RectangularShape) dataArea).getMinX();
     num2 = ((RectangularShape) dataArea).getMaxX();
   }
   else if (RectangleEdge.isLeftOrRight(edge))
   {
     num2 = ((RectangularShape) dataArea).getMinY();
     num1 = ((RectangularShape) dataArea).getMaxY();
   }
   if (this.isInverted())
   {
     if (value == cycleBound)
     {
       if (this.boundMappedToLastCycle)
         return num1;
       else
         return num2;
     }
     else if (value > cycleBound)
       return num2 - (value - cycleBound) * (num2 - num1) / this.period;
     else
       return num1 + (cycleBound - value) * (num2 - num1) / this.period;
   }
   else if (value == cycleBound)
   {
     if (this.boundMappedToLastCycle)
       return num2;
     else
       return num1;
   }
   else if (value >= cycleBound)
     return num1 + (value - cycleBound) * (num2 - num1) / this.period;
   else
     return num2 - (cycleBound - value) * (num2 - num1) / this.period;
 }
Пример #4
0
 public override double java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge)
 {
   double num = 0.0;
   if (this.displayStart < this.displayEnd)
     num = base.java2DToValue(java2DValue, area, edge);
   return num;
 }
Пример #5
0
 public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar)
 {
   ContourPlot contourPlot = this;
   this.colorBar = (ColorBar) null;
   this.domainCrosshairLockedOnData = true;
   this.rangeCrosshairLockedOnData = true;
   this.dataAreaRatio = 0.0;
   this.renderAsPoints = false;
   this.ptSizePct = 0.05;
   this.clipPath = (ClipPath) null;
   this.missingPaint = (Paint) null;
   this.dataset = dataset;
   if (dataset != null)
     dataset.addChangeListener((DatasetChangeListener) this);
   this.domainAxis = domainAxis;
   if (domainAxis != null)
   {
     domainAxis.setPlot((Plot) this);
     domainAxis.addChangeListener((AxisChangeListener) this);
   }
   this.rangeAxis = rangeAxis;
   if (rangeAxis != null)
   {
     rangeAxis.setPlot((Plot) this);
     rangeAxis.addChangeListener((AxisChangeListener) this);
   }
   this.colorBar = colorBar;
   if (colorBar != null)
   {
     colorBar.getAxis().setPlot((Plot) this);
     colorBar.getAxis().addChangeListener((AxisChangeListener) this);
     colorBar.configure(this);
   }
   this.colorBarLocation = RectangleEdge.__\u003C\u003ELEFT;
   this.toolTipGenerator = (ContourToolTipGenerator) new StandardContourToolTipGenerator();
 }
Пример #6
0
 public override double java2DToValue(double java2DValue, Rectangle2D plotArea, RectangleEdge edge)
 {
   Range range = this.getRange();
   double num1 = this.switchedLog10(range.getLowerBound());
   double num2 = this.switchedLog10(range.getUpperBound());
   double num3 = 0.0;
   double num4 = 0.0;
   if (RectangleEdge.isTopOrBottom(edge))
   {
     num3 = ((RectangularShape) plotArea).getX();
     num4 = ((RectangularShape) plotArea).getMaxX();
   }
   else if (RectangleEdge.isLeftOrRight(edge))
   {
     num3 = ((RectangularShape) plotArea).getMaxY();
     num4 = ((RectangularShape) plotArea).getMinY();
   }
   if (this.isInverted())
     return this.switchedPow10(num2 - (java2DValue - num3) / (num4 - num3) * (num2 - num1));
   else
     return this.switchedPow10(num1 + (java2DValue - num3) / (num4 - num3) * (num2 - num1));
 }
Пример #7
0
 protected internal override List refreshTicksVertical(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   ArrayList arrayList = new ArrayList();
   double val = this.getRange().getLowerBound();
   if (this.smallLogFlag && val < 1E-100)
     val = 1E-100;
   double upperBound = this.getRange().getUpperBound();
   int num1 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(val)));
   int num2 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(upperBound)));
   if (num1 == num2 && num1 > 0 && Math.pow(10.0, (double) num1) > val)
     num1 += -1;
   int num3 = 0;
   for (int index1 = num1; index1 <= num2; ++index1)
   {
     int num4 = 10;
     if (index1 == num2)
       num4 = 1;
     for (int index2 = 0; index2 < num4; ++index2)
     {
       double num5;
       string label;
       if (this.smallLogFlag)
       {
         num5 = Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (index2 == 0)
         {
           if (this.log10TickLabelsFlag)
             label = new StringBuffer().append("10^").append(index1).toString();
           else if (this.expTickLabelsFlag)
             label = new StringBuffer().append("1e").append(index1).toString();
           else if (index1 >= 0)
           {
             NumberFormat numberFormatOverride = this.getNumberFormatOverride();
             label = numberFormatOverride == null ? Long.toString(ByteCodeHelper.d2l(Math.rint(num5))) : numberFormatOverride.format(num5);
           }
           else
           {
             this.__\u003C\u003EnumberFormatterObj.setMaximumFractionDigits(-index1);
             label = this.__\u003C\u003EnumberFormatterObj.format(num5);
           }
         }
         else
           label = "";
       }
       else
       {
         if (num3 != 0)
           index2 += -1;
         num5 = index1 < 0 ? -(Math.pow(10.0, (double) -index1) - Math.pow(10.0, (double) (-index1 - 1)) * (double) index2) : Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (index2 == 0)
         {
           if (num3 == 0)
           {
             if (index1 > num1 && index1 < num2 && Math.abs(num5 - 1.0) < 0.0001)
             {
               num5 = 0.0;
               num3 = 1;
               label = "0";
             }
             else if (this.log10TickLabelsFlag)
               label = new StringBuffer().append(index1 >= 0 ? "" : "-").append("10^").append(Math.abs(index1)).toString();
             else if (this.expTickLabelsFlag)
             {
               label = new StringBuffer().append(index1 >= 0 ? "" : "-").append("1e").append(Math.abs(index1)).toString();
             }
             else
             {
               NumberFormat numberFormatOverride = this.getNumberFormatOverride();
               label = numberFormatOverride == null ? Long.toString(ByteCodeHelper.d2l(Math.rint(num5))) : numberFormatOverride.format(num5);
             }
           }
           else
           {
             label = "";
             num3 = 0;
           }
         }
         else
         {
           label = "";
           num3 = 0;
         }
       }
       if (num5 > upperBound)
         return (List) arrayList;
       if (num5 >= val - 1E-100)
       {
         double angle = 0.0;
         TextAnchor textAnchor;
         TextAnchor rotationAnchor;
         if (this.isVerticalTickLabels())
         {
           if (edge == RectangleEdge.__\u003C\u003ELEFT)
           {
             textAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             rotationAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             angle = -1.0 * Math.PI / 2.0;
           }
           else
           {
             textAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             rotationAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             angle = Math.PI / 2.0;
           }
         }
         else if (edge == RectangleEdge.__\u003C\u003ELEFT)
         {
           textAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
           rotationAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
         }
         else
         {
           textAnchor = TextAnchor.__\u003C\u003ECENTER_LEFT;
           rotationAnchor = TextAnchor.__\u003C\u003ECENTER_LEFT;
         }
         ((List) arrayList).add((object) new NumberTick((Number) new Double(num5), label, textAnchor, rotationAnchor, angle));
       }
     }
   }
   return (List) arrayList;
 }
Пример #8
0
 public override List refreshTicks(Graphics2D g2, AxisState state, Rectangle2D dataArea, RectangleEdge edge)
 {
   object obj1 = (object) new ArrayList();
   if (RectangleEdge.isTopOrBottom(edge))
     obj1 = (object) this.refreshTicksHorizontal(g2, dataArea, edge);
   else if (RectangleEdge.isLeftOrRight(edge))
     obj1 = (object) this.refreshTicksVertical(g2, dataArea, edge);
   object obj2 = obj1;
   if (obj2 == null)
     return (List) null;
   List list = obj2 as List;
   if (list != null)
     return list;
   else
     throw new IncompatibleClassChangeError();
 }
Пример #9
0
 public override AxisSpace reserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, RectangleEdge edge, AxisSpace space)
 {
   this.internalMarkerCycleBoundTick = (Tick) null;
   AxisSpace axisSpace = base.reserveSpace(g2, plot, plotArea, edge, space);
   if (this.internalMarkerCycleBoundTick == null)
     return axisSpace;
   FontMetrics fontMetrics = ((Graphics) g2).getFontMetrics(this.getTickLabelFont());
   Rectangle2D textBounds = TextUtilities.getTextBounds(this.internalMarkerCycleBoundTick.getText(), g2, fontMetrics);
   if (RectangleEdge.isTopOrBottom(edge))
   {
     if (this.isVerticalTickLabels())
       space.add(((RectangularShape) textBounds).getHeight() / 2.0, RectangleEdge.__\u003C\u003ERIGHT);
     else
       space.add(((RectangularShape) textBounds).getWidth() / 2.0, RectangleEdge.__\u003C\u003ERIGHT);
   }
   else if (RectangleEdge.isLeftOrRight(edge))
   {
     if (this.isVerticalTickLabels())
       space.add(((RectangularShape) textBounds).getWidth() / 2.0, RectangleEdge.__\u003C\u003ETOP);
     else
       space.add(((RectangularShape) textBounds).getHeight() / 2.0, RectangleEdge.__\u003C\u003ETOP);
   }
   return axisSpace;
 }
Пример #10
0
 public override AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState)
 {
   if (!this.isVisible())
   {
     AxisState state = new AxisState(cursor);
     List ticks = this.refreshTicks(g2, state, dataArea, edge);
     state.setTicks(ticks);
     return state;
   }
   else
   {
     AxisState state1 = this.drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);
     AxisState state2 = this.drawLabel(this.getLabel(), g2, plotArea, dataArea, edge, state1);
     this.createAndAddEntity(cursor, state2, dataArea, edge, plotState);
     return state2;
   }
 }
Пример #11
0
 protected internal virtual List refreshVerticalTicks(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   ArrayList arrayList = new ArrayList();
   ((List) arrayList).clear();
   Font tickLabelFont = this.getTickLabelFont();
   ((Graphics) g2).setFont(tickLabelFont);
   if (this.isAutoTickUnitSelection())
     this.selectAutoTickUnit(g2, dataArea, edge);
   double size = this.getTickUnit().getSize();
   double cycleBound = this.getCycleBound();
   double num1 = Math.ceil(cycleBound / size) * size;
   double num2 = this.getRange().getUpperBound();
   int num3 = 0;
   int num4 = this.boundMappedToLastCycle ? 1 : 0;
   this.boundMappedToLastCycle = true;
   CyclicNumberAxis.CycleBoundTick cycleBoundTick1 = (CyclicNumberAxis.CycleBoundTick) null;
   float num5 = 0.0f;
   if (num2 == cycleBound)
   {
     num1 = this.calculateLowestVisibleTickValue();
     num3 = 1;
     this.boundMappedToLastCycle = true;
   }
   while (num1 <= num2)
   {
     int num6 = 0;
     if (num1 + size > num2 && num3 == 0)
       num6 = 1;
     double num7 = this.valueToJava2D(num1, dataArea, edge);
     NumberFormat numberFormatOverride = this.getNumberFormatOverride();
     string label = numberFormatOverride == null ? this.getTickUnit().valueToString(num1) : numberFormatOverride.format(num1);
     float num8 = (float) num7;
     double angle = 0.0;
     TextAnchor textAnchor1;
     TextAnchor rotationAnchor;
     if (this.isVerticalTickLabels())
     {
       if (edge == RectangleEdge.__\u003C\u003ELEFT)
       {
         textAnchor1 = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
         if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
         {
           TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_RIGHT : TextAnchor.__\u003C\u003EBOTTOM_LEFT;
           ((List) arrayList).remove(((List) arrayList).size() - 1);
           ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
           this.internalMarkerWhenTicksOverlap = true;
           textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_LEFT : TextAnchor.__\u003C\u003EBOTTOM_RIGHT;
         }
         rotationAnchor = textAnchor1;
         angle = -1.0 * Math.PI / 2.0;
       }
       else
       {
         textAnchor1 = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
         if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
         {
           TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_LEFT : TextAnchor.__\u003C\u003EBOTTOM_RIGHT;
           ((List) arrayList).remove(((List) arrayList).size() - 1);
           ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
           this.internalMarkerWhenTicksOverlap = true;
           textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_RIGHT : TextAnchor.__\u003C\u003EBOTTOM_LEFT;
         }
         rotationAnchor = textAnchor1;
         angle = Math.PI / 2.0;
       }
     }
     else if (edge == RectangleEdge.__\u003C\u003ELEFT)
     {
       textAnchor1 = TextAnchor.__\u003C\u003ECENTER_RIGHT;
       if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
       {
         TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003ETOP_RIGHT : TextAnchor.__\u003C\u003EBOTTOM_RIGHT;
         ((List) arrayList).remove(((List) arrayList).size() - 1);
         ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
         this.internalMarkerWhenTicksOverlap = true;
         textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_RIGHT : TextAnchor.__\u003C\u003ETOP_RIGHT;
       }
       rotationAnchor = textAnchor1;
     }
     else
     {
       textAnchor1 = TextAnchor.__\u003C\u003ECENTER_LEFT;
       if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
       {
         TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003ETOP_LEFT : TextAnchor.__\u003C\u003EBOTTOM_LEFT;
         ((List) arrayList).remove(((List) arrayList).size() - 1);
         ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
         this.internalMarkerWhenTicksOverlap = true;
         textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_LEFT : TextAnchor.__\u003C\u003ETOP_LEFT;
       }
       rotationAnchor = textAnchor1;
     }
     CyclicNumberAxis.CycleBoundTick cycleBoundTick2 = new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, (Number) new Double(num1), label, textAnchor1, rotationAnchor, angle);
     if (num1 == cycleBound)
       this.internalMarkerCycleBoundTick = (Tick) cycleBoundTick2;
     ((List) arrayList).add((object) cycleBoundTick2);
     cycleBoundTick1 = cycleBoundTick2;
     num5 = num8;
     if (num1 == cycleBound)
       this.internalMarkerCycleBoundTick = (Tick) cycleBoundTick2;
     num1 += size;
     if (num6 != 0)
     {
       num1 = this.calculateLowestVisibleTickValue();
       num2 = cycleBound;
       num3 = 1;
       this.boundMappedToLastCycle = false;
     }
   }
   this.boundMappedToLastCycle = num4 != 0;
   return (List) arrayList;
 }
Пример #12
0
 public virtual double exponentLengthToJava2D(double length, Rectangle2D area, RectangleEdge edge)
 {
   double num = this.valueToJava2D(this.calculateValue(1.0), area, edge);
   return Math.abs(this.valueToJava2D(this.calculateValue(length + 1.0), area, edge) - num);
 }
Пример #13
0
 public override double java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge)
 {
   Range range = this.getRange();
   double num1 = this.calculateLog(range.getLowerBound());
   double num2 = this.calculateLog(range.getUpperBound());
   double num3 = 0.0;
   double num4 = 0.0;
   if (RectangleEdge.isTopOrBottom(edge))
   {
     num3 = ((RectangularShape) area).getX();
     num4 = ((RectangularShape) area).getMaxX();
   }
   else if (RectangleEdge.isLeftOrRight(edge))
   {
     num3 = ((RectangularShape) area).getMaxY();
     num4 = ((RectangularShape) area).getY();
   }
   return this.calculateValue(!this.isInverted() ? num1 + (java2DValue - num3) / (num4 - num3) * (num2 - num1) : num2 - (java2DValue - num3) / (num4 - num3) * (num2 - num1));
 }
Пример #14
0
 protected internal virtual void selectVerticalAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   double num1 = this.estimateMaximumTickLabelHeight(g2);
   TickUnitSource standardTickUnits = this.getStandardTickUnits();
   TickUnit ceilingTickUnit = standardTickUnits.getCeilingTickUnit((TickUnit) this.getTickUnit());
   double num2 = this.exponentLengthToJava2D(ceilingTickUnit.getSize(), dataArea, edge);
   double d = num1 / num2 * ceilingTickUnit.getSize();
   NumberTickUnit unit = (NumberTickUnit) standardTickUnits.getCeilingTickUnit(d);
   double num3 = this.exponentLengthToJava2D(unit.getSize(), dataArea, edge);
   if (this.estimateMaximumTickLabelHeight(g2) > num3)
     unit = (NumberTickUnit) standardTickUnits.getLargerTickUnit((TickUnit) unit);
   this.setTickUnit(unit, false, false);
 }
Пример #15
0
 protected internal virtual void selectAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   if (RectangleEdge.isTopOrBottom(edge))
   {
     this.selectHorizontalAutoTickUnit(g2, dataArea, edge);
   }
   else
   {
     if (!RectangleEdge.isLeftOrRight(edge))
       return;
     this.selectVerticalAutoTickUnit(g2, dataArea, edge);
   }
 }
Пример #16
0
 protected internal virtual List refreshTicksVertical(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   Range range = this.getRange();
   ArrayList arrayList = new ArrayList();
   Font tickLabelFont = this.getTickLabelFont();
   ((Graphics) g2).setFont(tickLabelFont);
   TextAnchor textAnchor = edge != RectangleEdge.__\u003C\u003ERIGHT ? TextAnchor.__\u003C\u003ECENTER_RIGHT : TextAnchor.__\u003C\u003ECENTER_LEFT;
   if (this.isAutoTickUnitSelection())
     this.selectAutoTickUnit(g2, dataArea, edge);
   int minorTickCount = this.tickUnit.getMinorTickCount();
   double num1 = Math.floor(this.calculateLog(this.getLowerBound()));
   double num2 = Math.ceil(this.calculateLog(this.getUpperBound()));
   double log = num1;
   while (log <= num2)
   {
     double num3 = this.calculateValue(log);
     if (range.contains(num3))
       ((List) arrayList).add((object) new NumberTick(TickType.__\u003C\u003EMAJOR, num3, this.createTickLabel(num3), textAnchor, TextAnchor.__\u003C\u003ECENTER, 0.0));
     double num4 = Math.pow(this.@base, log + this.tickUnit.getSize());
     for (int index = 1; index < minorTickCount; ++index)
     {
       double num5 = num3 + (double) index * ((num4 - num3) / (double) minorTickCount);
       if (range.contains(num5))
         ((List) arrayList).add((object) new NumberTick(TickType.__\u003C\u003EMINOR, num5, "", textAnchor, TextAnchor.__\u003C\u003ECENTER, 0.0));
     }
     log += this.tickUnit.getSize();
   }
   return (List) arrayList;
 }
Пример #17
0
 protected internal virtual void selectVerticalAutoTickUnit(Graphics2D g2, Rectangle2D drawArea, Rectangle2D dataArea, RectangleEdge edge)
 {
   this.setTickUnit((NumberTickUnit) this.getStandardTickUnits().getCeilingTickUnit(this.getRange().getLength() * this.estimateMaximumTickLabelWidth(g2, (TickUnit) this.getTickUnit()) / ((RectangularShape) dataArea).getHeight()), false, false);
 }
Пример #18
0
 protected internal override AxisState drawTickMarksAndLabels(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge)
 {
   this.internalMarkerWhenTicksOverlap = false;
   AxisState axisState = base.drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);
   if (!this.internalMarkerWhenTicksOverlap)
     return axisState;
   double num1 = (double) this.getTickMarkOutsideLength();
   FontMetrics fontMetrics = ((Graphics) g2).getFontMetrics(this.getTickLabelFont());
   double num2 = !this.isVerticalTickLabels() ? (double) fontMetrics.getHeight() : (double) fontMetrics.getMaxAdvance();
   double num3 = 0.0;
   if (this.isTickMarksVisible())
   {
     float num4 = (float) this.valueToJava2D(this.getRange().getUpperBound(), dataArea, edge);
     Line2D.Double @double = (Line2D.Double) null;
     g2.setStroke(this.getTickMarkStroke());
     g2.setPaint(this.getTickMarkPaint());
     if (edge == RectangleEdge.__\u003C\u003ELEFT)
       @double = new Line2D.Double(cursor - num2, (double) num4, cursor + num3, (double) num4);
     else if (edge == RectangleEdge.__\u003C\u003ERIGHT)
       @double = new Line2D.Double(cursor + num2, (double) num4, cursor - num3, (double) num4);
     else if (edge == RectangleEdge.__\u003C\u003ETOP)
       @double = new Line2D.Double((double) num4, cursor - num2, (double) num4, cursor + num3);
     else if (edge == RectangleEdge.__\u003C\u003EBOTTOM)
       @double = new Line2D.Double((double) num4, cursor + num2, (double) num4, cursor - num3);
     g2.draw((Shape) @double);
   }
   return axisState;
 }
Пример #19
0
 protected internal override float[] calculateAnchorPoint(ValueTick tick, double cursor, Rectangle2D dataArea, RectangleEdge edge)
 {
   if (tick is CyclicNumberAxis.CycleBoundTick)
   {
     int num = this.boundMappedToLastCycle ? 1 : 0;
     this.boundMappedToLastCycle = ((CyclicNumberAxis.CycleBoundTick) tick).mapToLastCycle;
     float[] numArray = base.calculateAnchorPoint(tick, cursor, dataArea, edge);
     this.boundMappedToLastCycle = num != 0;
     return numArray;
   }
   else
     return base.calculateAnchorPoint(tick, cursor, dataArea, edge);
 }
Пример #20
0
 public override double lengthToJava2D(double length, Rectangle2D area, RectangleEdge edge)
 {
   double num1 = this.displayEnd <= this.displayStart ? this.fixedRange.getUpperBound() - this.displayStart + (this.displayEnd - this.fixedRange.getLowerBound()) : this.displayEnd - this.displayStart;
   double num2 = !RectangleEdge.isLeftOrRight(edge) ? ((RectangularShape) area).getWidth() : ((RectangularShape) area).getHeight();
   return length / num1 * num2;
 }
Пример #21
0
 public override double java2DToValue(double java2DValue, Rectangle2D dataArea, RectangleEdge edge)
 {
   double upperBound = this.getRange().getUpperBound();
   double cycleBound = this.getCycleBound();
   double num1 = 0.0;
   double num2 = 0.0;
   if (RectangleEdge.isTopOrBottom(edge))
   {
     num1 = ((RectangularShape) dataArea).getMinX();
     num2 = ((RectangularShape) dataArea).getMaxX();
   }
   else if (RectangleEdge.isLeftOrRight(edge))
   {
     num1 = ((RectangularShape) dataArea).getMaxY();
     num2 = ((RectangularShape) dataArea).getMinY();
   }
   if (this.isInverted())
   {
     double num3 = num2 - (upperBound - cycleBound) * (num2 - num1) / this.period;
     if (java2DValue >= num3)
       return cycleBound + (num2 - java2DValue) * this.period / (num2 - num1);
     else
       return cycleBound - (java2DValue - num1) * this.period / (num2 - num1);
   }
   else
   {
     double num3 = (upperBound - cycleBound) * (num2 - num1) / this.period + num1;
     if (java2DValue <= num3)
       return cycleBound + (java2DValue - num1) * this.period / (num2 - num1);
     else
       return cycleBound - (num2 - java2DValue) * this.period / (num2 - num1);
   }
 }
Пример #22
0
 public ImageTitle(Image image, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)
   : this(image, image.getHeight((ImageObserver) null), image.getWidth((ImageObserver) null), position, horizontalAlignment, verticalAlignment, Title.__\u003C\u003EDEFAULT_PADDING)
 {
 }
Пример #23
0
 public override AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState)
 {
   AxisState axisState = base.draw(g2, cursor, plotArea, dataArea, edge, plotState);
   if (this.isAdvanceLineVisible())
   {
     double num = this.valueToJava2D(this.getRange().getUpperBound(), dataArea, edge);
     Line2D.Double @double = (Line2D.Double) null;
     g2.setStroke(this.getAdvanceLineStroke());
     g2.setPaint(this.getAdvanceLinePaint());
     if (edge == RectangleEdge.__\u003C\u003ELEFT)
       @double = new Line2D.Double(cursor, num, cursor + ((RectangularShape) dataArea).getWidth(), num);
     else if (edge == RectangleEdge.__\u003C\u003ERIGHT)
       @double = new Line2D.Double(cursor - ((RectangularShape) dataArea).getWidth(), num, cursor, num);
     else if (edge == RectangleEdge.__\u003C\u003ETOP)
       @double = new Line2D.Double(num, cursor + ((RectangularShape) dataArea).getHeight(), num, cursor);
     else if (edge == RectangleEdge.__\u003C\u003EBOTTOM)
       @double = new Line2D.Double(num, cursor, num, cursor - ((RectangularShape) dataArea).getHeight());
     g2.draw((Shape) @double);
   }
   return axisState;
 }
 protected internal override TextBlock createLabel(IComparable category, float width, RectangleEdge edge, Graphics2D g2)
 {
   TextBlock label = base.createLabel(category, width, edge, g2);
   string text = (string) this.sublabels.get((object) category);
   if (text != null)
   {
     if (edge == RectangleEdge.__\u003C\u003ETOP || edge == RectangleEdge.__\u003C\u003EBOTTOM)
     {
       TextLine line = new TextLine(text, this.sublabelFont, this.sublabelPaint);
       label.addLine(line);
     }
     else if (edge == RectangleEdge.__\u003C\u003ELEFT || edge == RectangleEdge.__\u003C\u003ERIGHT)
     {
       TextLine lastLine = label.getLastLine();
       if (lastLine != null)
       {
         TextLine textLine = lastLine;
         TextFragment.__\u003Cclinit\u003E();
         TextFragment fragment = new TextFragment(new StringBuffer().append("  ").append(text).toString(), this.sublabelFont, this.sublabelPaint);
         textLine.addFragment(fragment);
       }
     }
   }
   return label;
 }
Пример #25
0
 public override double valueToJava2D(double value, Rectangle2D plotArea, RectangleEdge edge)
 {
   Range range = this.getRange();
   double num1 = this.switchedLog10(range.getLowerBound());
   double num2 = this.switchedLog10(range.getUpperBound());
   double num3 = 0.0;
   double num4 = 0.0;
   if (RectangleEdge.isTopOrBottom(edge))
   {
     num3 = ((RectangularShape) plotArea).getMinX();
     num4 = ((RectangularShape) plotArea).getMaxX();
   }
   else if (RectangleEdge.isLeftOrRight(edge))
   {
     num3 = ((RectangularShape) plotArea).getMaxY();
     num4 = ((RectangularShape) plotArea).getMinY();
   }
   value = this.switchedLog10(value);
   if (this.isInverted())
     return num4 - (value - num1) / (num2 - num1) * (num4 - num3);
   else
     return num3 + (value - num1) / (num2 - num1) * (num4 - num3);
 }
Пример #26
0
 public TextTitle(string text, Font font, Paint paint, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, RectangleInsets padding)
   : base(position, horizontalAlignment, verticalAlignment, padding)
 {
   TextTitle textTitle = this;
   this.expandToFitSpace = false;
   this.maximumLinesToDisplay = int.MaxValue;
   if (text == null)
   {
     string str = "Null 'text' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new NullPointerException(str);
   }
   else if (font == null)
   {
     string str = "Null 'font' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new NullPointerException(str);
   }
   else if (paint == null)
   {
     string str = "Null 'paint' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new NullPointerException(str);
   }
   else
   {
     this.text = text;
     this.font = font;
     this.paint = paint;
     this.textAlignment = horizontalAlignment;
     this.backgroundPaint = (Paint) null;
     this.content = (TextBlock) null;
     this.toolTipText = (string) null;
     this.urlText = (string) null;
   }
 }
Пример #27
0
 protected internal override List refreshTicksHorizontal(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   ArrayList arrayList = new ArrayList();
   Range range = this.getRange();
   double val1 = range.getLowerBound();
   if (this.smallLogFlag && val1 < 1E-100)
     val1 = 1E-100;
   double upperBound = range.getUpperBound();
   int num1 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(val1)));
   int num2 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(upperBound)));
   if (num1 == num2 && num1 > 0 && Math.pow(10.0, (double) num1) > val1)
     num1 += -1;
   int num3 = 0;
   for (int index1 = num1; index1 <= num2; ++index1)
   {
     for (int index2 = 0; index2 < 10; ++index2)
     {
       double val2;
       string label;
       if (this.smallLogFlag)
       {
         val2 = Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (this.expTickLabelsFlag || index1 < 0 && val2 > 0.0 && val2 < 1.0)
         {
           if (index2 == 0 || index1 > -4 && index2 < 2 || val2 >= upperBound)
           {
             this.__\u003C\u003EnumberFormatterObj.setMaximumFractionDigits(-index1);
             label = this.makeTickLabel(val2, true);
           }
           else
             label = "";
         }
         else
           label = index2 < 1 || index1 < 1 && index2 < 5 || (index2 < 4 - index1 || val2 >= upperBound) ? this.makeTickLabel(val2) : "";
       }
       else
       {
         if (num3 != 0)
           index2 += -1;
         val2 = index1 < 0 ? -(Math.pow(10.0, (double) -index1) - Math.pow(10.0, (double) (-index1 - 1)) * (double) index2) : Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (num3 == 0)
         {
           if (Math.abs(val2 - 1.0) < 0.0001 && val1 <= 0.0 && upperBound >= 0.0)
           {
             val2 = 0.0;
             num3 = 1;
           }
         }
         else
           num3 = 0;
         label = this.expTickLabelsFlag && index2 < 2 || index2 < 1 || (index1 < 1 && index2 < 5 || (index2 < 4 - index1 || val2 >= upperBound)) ? this.makeTickLabel(val2) : "";
       }
       if (val2 > upperBound)
         return (List) arrayList;
       if (val2 >= val1 - 1E-100)
       {
         double angle = 0.0;
         TextAnchor textAnchor;
         TextAnchor rotationAnchor;
         if (this.isVerticalTickLabels())
         {
           textAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
           rotationAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
           angle = edge != RectangleEdge.__\u003C\u003ETOP ? -1.0 * Math.PI / 2.0 : Math.PI / 2.0;
         }
         else if (edge == RectangleEdge.__\u003C\u003ETOP)
         {
           textAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
           rotationAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
         }
         else
         {
           textAnchor = TextAnchor.__\u003C\u003ETOP_CENTER;
           rotationAnchor = TextAnchor.__\u003C\u003ETOP_CENTER;
         }
         NumberTick numberTick = new NumberTick((Number) new Double(val2), label, textAnchor, rotationAnchor, angle);
         ((List) arrayList).add((object) numberTick);
       }
     }
   }
   return (List) arrayList;
 }
Пример #28
0
 public LegendTitle(LegendItemSource source, Arrangement hLayout, Arrangement vLayout)
 {
   LegendTitle legendTitle = this;
   LegendItemSource[] legendItemSourceArray = new LegendItemSource[1];
   int index = 0;
   LegendItemSource legendItemSource = source;
   legendItemSourceArray[index] = legendItemSource;
   this.sources = legendItemSourceArray;
   this.items = new BlockContainer(hLayout);
   this.hLayout = hLayout;
   this.vLayout = vLayout;
   this.backgroundPaint = (Paint) null;
   this.legendItemGraphicEdge = RectangleEdge.__\u003C\u003ELEFT;
   this.legendItemGraphicAnchor = RectangleAnchor.__\u003C\u003ECENTER;
   this.legendItemGraphicLocation = RectangleAnchor.__\u003C\u003ECENTER;
   this.legendItemGraphicPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
   this.itemFont = LegendTitle.__\u003C\u003EDEFAULT_ITEM_FONT;
   this.itemPaint = LegendTitle.__\u003C\u003EDEFAULT_ITEM_PAINT;
   this.itemLabelPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
 }
Пример #29
0
 public DateTitle(int style, Locale locale, Font font, Paint paint, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, RectangleInsets padding)
   : base(DateFormat.getDateInstance(style, locale).format(new Date()), font, paint, position, horizontalAlignment, verticalAlignment, padding)
 {
 }
Пример #30
0
 public override double valueToJava2D(double value, Rectangle2D area, RectangleEdge edge)
 {
   double num1 = this.mapValueToFixedRange(value);
   double num2;
   if (this.displayStart < this.displayEnd)
   {
     num2 = this.trans(num1, area, edge);
   }
   else
   {
     double num3 = (this.displayStart + this.displayEnd) / 2.0;
     double num4 = this.fixedRange.getUpperBound() - this.displayStart;
     double num5 = this.displayEnd - this.fixedRange.getLowerBound();
     num2 = num1 <= num3 ? this.transEnd(num1, area, edge, num4, num5) : this.transStart(num1, area, edge, num4, num5);
   }
   return num2;
 }