예제 #1
0
파일: Program.cs 프로젝트: ajlopez/TddRocks
        static void Main(string[] args)
        {
            string inputname = args[0];
            string outputname = args[1];

            string[] lines = File.ReadAllLines(inputname);

            int ncases = int.Parse(lines[0]);
            int nline = 0;
            IList<string> results = new List<string>();
            Paint paint = new Paint();

            for (int k = 0; k < ncases; k++)
            {
                System.Console.WriteLine(string.Format("Solving Case #{0}", k + 1));
                nline++;
                string[] numbers = lines[nline].Split(' ');
                long radius = long.Parse(numbers[0]);
                long pnt = long.Parse(numbers[1]);
                long result = paint.CountFor(radius, pnt);
                results.Add(string.Format("Case #{0}: {1}", k + 1, result));
            }

            File.WriteAllLines(outputname, results.ToArray());
        }
예제 #2
0
 public LineBorder(Paint paint, Stroke stroke, RectangleInsets insets)
 {
   base.\u002Ector();
   LineBorder lineBorder = this;
   if (paint == null)
   {
     string str = "Null 'paint' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (stroke == null)
   {
     string str = "Null 'stroke' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (insets == null)
   {
     string str = "Null 'insets' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     this.paint = paint;
     this.stroke = stroke;
     this.insets = insets;
   }
 }
예제 #3
0
 public PaintScaleLegend(PaintScale scale, ValueAxis axis)
 {
   PaintScaleLegend paintScaleLegend = this;
   if (axis == null)
   {
     string str = "Null 'axis' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     this.scale = scale;
     this.axis = axis;
     this.axis.addChangeListener((AxisChangeListener) this);
     this.axisLocation = AxisLocation.__\u003C\u003EBOTTOM_OR_LEFT;
     this.axisOffset = 0.0;
     this.axis.setRange(scale.getLowerBound(), scale.getUpperBound());
     this.stripWidth = 15.0;
     this.stripOutlineVisible = true;
     this.stripOutlinePaint = (Paint) Color.gray;
     this.stripOutlineStroke = (Stroke) new BasicStroke(0.5f);
     this.backgroundPaint = (Paint) Color.white;
     this.subdivisions = 100;
   }
 }
 public StackedXYAreaRenderer(int type, XYToolTipGenerator labelGenerator, XYURLGenerator urlGenerator)
   : base(type, labelGenerator, urlGenerator)
 {
   StackedXYAreaRenderer stackedXyAreaRenderer = this;
   this.shapePaint = (Paint) null;
   this.shapeStroke = (Stroke) null;
 }
예제 #5
0
 public XYLine3DRenderer()
 {
   XYLine3DRenderer xyLine3Drenderer = this;
   this.wallPaint = XYLine3DRenderer.__\u003C\u003EDEFAULT_WALL_PAINT;
   this.xOffset = 12.0;
   this.yOffset = 8.0;
 }
 public XYPolygonAnnotation(double[] polygon, Stroke stroke, Paint outlinePaint, Paint fillPaint)
 {
   XYPolygonAnnotation polygonAnnotation = this;
   if (polygon == null)
   {
     string str = "Null 'polygon' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     int length = polygon.Length;
     int num1 = 2;
     int num2 = -1;
     if ((num1 != num2 ? length % num1 : 0) != 0)
     {
       string str = "The 'polygon' array must contain an even number of items.";
       Throwable.__\u003CsuppressFillInStackTrace\u003E();
       throw new IllegalArgumentException(str);
     }
     else
     {
       this.polygon = (double[]) polygon.Clone();
       this.stroke = stroke;
       this.outlinePaint = outlinePaint;
       this.fillPaint = fillPaint;
     }
   }
 }
예제 #7
0
 public XYLineAnnotation(double x1, double y1, double x2, double y2, Stroke stroke, Paint paint)
 {
   XYLineAnnotation xyLineAnnotation = this;
   if (stroke == null)
   {
     string str = "Null 'stroke' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (paint == null)
   {
     string str = "Null 'paint' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     this.x1 = x1;
     this.y1 = y1;
     this.x2 = x2;
     this.y2 = y2;
     this.stroke = stroke;
     this.paint = paint;
   }
 }
예제 #8
0
 public override void VisitRadialGradientBrush( Types.Rectangle bounds, Paint.Brushes.RadialGradientBrush radialGradientBrush )
 {
     _newBrush = new VectorGraphics.Paint.Brushes.RadialGradientBrush
         ( new Paint.Color( radialGradientBrush.InnerColor, radialGradientBrush.InnerColor.Alpha * _multiplier )
         , new Paint.Color( radialGradientBrush.OuterColor, radialGradientBrush.OuterColor.Alpha * _multiplier )
         , radialGradientBrush.InnerPoint, radialGradientBrush.OuterPoint );
 }
예제 #9
0
 public TextFragment(string text, Font font, Paint paint, float baselineOffset)
 {
   base.\u002Ector();
   TextFragment textFragment = this;
   if (text == null)
   {
     string str = "Null 'text' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (font == null)
   {
     string str = "Null 'font' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (paint == null)
   {
     string str = "Null 'paint' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     this.text = text;
     this.font = font;
     this.paint = paint;
     this.baselineOffset = baselineOffset;
   }
 }
예제 #10
0
 public LegendGraphic(Shape shape, Paint fillPaint)
 {
   LegendGraphic legendGraphic = this;
   if (shape == null)
   {
     string str = "Null 'shape' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (fillPaint == null)
   {
     string str = "Null 'fillPaint' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     this.shapeVisible = true;
     this.shape = shape;
     this.shapeAnchor = RectangleAnchor.__\u003C\u003ECENTER;
     this.shapeLocation = RectangleAnchor.__\u003C\u003ECENTER;
     this.shapeFilled = true;
     this.fillPaint = fillPaint;
     this.fillPaintTransformer = (GradientPaintTransformer) new StandardGradientPaintTransformer();
     this.setPadding(2.0, 2.0, 2.0, 2.0);
   }
 }
예제 #11
0
 public MeterInterval(string label, Range range, Paint outlinePaint, Stroke outlineStroke, Paint backgroundPaint)
 {
   base.\u002Ector();
   MeterInterval meterInterval = this;
   if (label == null)
   {
     string str = "Null 'label' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (range == null)
   {
     string str = "Null 'range' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     this.label = label;
     this.range = range;
     this.outlinePaint = outlinePaint;
     this.outlineStroke = outlineStroke;
     this.backgroundPaint = backgroundPaint;
   }
 }
예제 #12
0
 public ClipPath(double[] xValue, double[] yValue, bool clip, bool fillPath, bool drawPath)
 {
   int num1 = clip ? 1 : 0;
   int num2 = fillPath ? 1 : 0;
   int num3 = drawPath ? 1 : 0;
   base.\u002Ector();
   ClipPath clipPath = this;
   this.xValue = (double[]) null;
   this.yValue = (double[]) null;
   this.clip = true;
   this.drawPath = false;
   this.fillPath = false;
   this.fillPaint = (Paint) null;
   this.drawPaint = (Paint) null;
   this.drawStroke = (Stroke) null;
   this.composite = (Composite) null;
   this.xValue = xValue;
   this.yValue = yValue;
   this.clip = num1 != 0;
   this.fillPath = num2 != 0;
   this.drawPath = num3 != 0;
   this.fillPaint = (Paint) Color.gray;
   this.drawPaint = (Paint) Color.blue;
   this.drawStroke = (Stroke) new BasicStroke(1f);
   this.composite = (Composite) AlphaComposite.Src;
 }
 public StatisticalLineAndShapeRenderer(bool linesVisible, bool shapesVisible)
   : base(linesVisible, shapesVisible)
 {
   StatisticalLineAndShapeRenderer andShapeRenderer = this;
   this.errorIndicatorPaint = (Paint) null;
   this.errorIndicatorStroke = (Stroke) null;
 }
예제 #14
0
 public PaintSample(Paint paint)
 {
   base.\u002Ector();
   PaintSample paintSample = this;
   this.paint = paint;
   this.preferredSize = new Dimension(80, 12);
 }
 public ExtendedCategoryAxis(string label)
   : base(label)
 {
   ExtendedCategoryAxis extendedCategoryAxis = this;
   this.sublabels = (Map) new HashMap();
   this.sublabelFont = new Font("SansSerif", 0, 10);
   this.sublabelPaint = (Paint) Color.black;
 }
예제 #16
0
 public LineRenderer3D()
   : base(true, false)
 {
   LineRenderer3D lineRenderer3D = this;
   this.xOffset = 12.0;
   this.yOffset = 8.0;
   this.wallPaint = LineRenderer3D.__\u003C\u003EDEFAULT_WALL_PAINT;
 }
예제 #17
0
 public StandardDialFrame()
 {
   StandardDialFrame standardDialFrame = this;
   this.backgroundPaint = (Paint) Color.gray;
   this.foregroundPaint = (Paint) Color.black;
   this.stroke = (Stroke) new BasicStroke(2f);
   this.radius = 0.95;
 }
예제 #18
0
 public SubCategoryAxis(string label)
   : base(label)
 {
   SubCategoryAxis subCategoryAxis = this;
   this.subLabelFont = new Font("SansSerif", 0, 10);
   this.subLabelPaint = (Paint) Color.black;
   this.subCategories = (List) new ArrayList();
 }
예제 #19
0
 public DialCap()
 {
   DialCap dialCap = this;
   this.radius = 0.05;
   this.fillPaint = (Paint) Color.white;
   this.outlinePaint = (Paint) Color.black;
   this.outlineStroke = (Stroke) new BasicStroke(2f);
 }
예제 #20
0
파일: SettingGame.cs 프로젝트: Boykooo/Boom
 public SettingGame(int wh, int ht, IForm gameForm)
 {
     draw = new Paint(wh, ht);
     StructMap.BlockSize = 30;
     map = new StructMap();
     form = gameForm;
     ship1 = ship2 = ship3 = ship4 = 0;
 }
예제 #21
0
 public CategoryMarker(IComparable key, Paint paint, Stroke stroke, Paint outlinePaint, Stroke outlineStroke, float alpha)
   : base(paint, stroke, outlinePaint, outlineStroke, alpha)
 {
   CategoryMarker categoryMarker = this;
   this.drawAsLine = false;
   this.key = key;
   this.setLabelOffsetType(LengthAdjustmentType.__\u003C\u003EEXPAND);
 }
예제 #22
0
 public IntervalMarker(double start, double end, Paint paint, Stroke stroke, Paint outlinePaint, Stroke outlineStroke, float alpha)
   : base(paint, stroke, outlinePaint, outlineStroke, alpha)
 {
   IntervalMarker intervalMarker = this;
   this.startValue = start;
   this.endValue = end;
   this.gradientPaintTransformer = (GradientPaintTransformer) null;
   this.setLabelOffsetType(LengthAdjustmentType.__\u003C\u003ECONTRACT);
 }
예제 #23
0
 public GanttRenderer()
 {
   GanttRenderer ganttRenderer = this;
   this.setIncludeBaseInRange(false);
   this.completePaint = (Paint) Color.green;
   this.incompletePaint = (Paint) Color.red;
   this.startPercent = 0.35;
   this.endPercent = 0.65;
 }
 public XYBoxAndWhiskerRenderer(double boxWidth)
 {
   XYBoxAndWhiskerRenderer andWhiskerRenderer = this;
   this.artifactPaint = (Paint) Color.black;
   this.boxWidth = boxWidth;
   this.boxPaint = (Paint) Color.green;
   this.fillBox = true;
   this.setBaseToolTipGenerator((XYToolTipGenerator) new BoxAndWhiskerXYToolTipGenerator());
 }
예제 #25
0
        public GlossyBrush( Paint.Color lightener )
        {
            if( lightener == null )
            {
                throw new ArgumentNullException( "lightener" );
            }

            _lightener = lightener;
        }
예제 #26
0
        public static System.Drawing.Color Color( Paint.Color color )
        {
            int r = (int) (color.Red * 255);
            int g = (int) (color.Green * 255);
            int b = (int) (color.Blue * 255);
            int a = (int) (color.Alpha * 255);

            return System.Drawing.Color.FromArgb( a, r, g, b );
        }
예제 #27
0
 static MeterPlot()
 {
   Plot.__\u003Cclinit\u003E();
   MeterPlot.DEFAULT_DIAL_BACKGROUND_PAINT = (Paint) Color.black;
   MeterPlot.DEFAULT_NEEDLE_PAINT = (Paint) Color.green;
   MeterPlot.DEFAULT_VALUE_FONT = new Font("SansSerif", 1, 12);
   MeterPlot.DEFAULT_VALUE_PAINT = (Paint) Color.yellow;
   MeterPlot.__\u003C\u003EDEFAULT_LABEL_FONT = new Font("SansSerif", 1, 10);
   MeterPlot.localizationResources = org.jfree.chart.util.ResourceBundleWrapper.getBundle("org.jfree.chart.plot.LocalizationBundle");
 }
예제 #28
0
 public XYErrorRenderer()
   : base(false, true)
 {
   XYErrorRenderer xyErrorRenderer = this;
   this.drawXError = true;
   this.drawYError = true;
   this.errorPaint = (Paint) null;
   this.errorStroke = (Stroke) null;
   this.capLength = 4.0;
 }
 public MinMaxCategoryRenderer()
 {
   MinMaxCategoryRenderer categoryRenderer = this;
   this.plotLines = false;
   this.groupPaint = (Paint) Color.black;
   this.groupStroke = (Stroke) new BasicStroke(1f);
   this.minIcon = this.getIcon((Shape) new Arc2D.Double(-4.0, -4.0, 8.0, 8.0, 0.0, 360.0, 0), (Paint) null, (Paint) Color.black);
   this.maxIcon = this.getIcon((Shape) new Arc2D.Double(-4.0, -4.0, 8.0, 8.0, 0.0, 360.0, 0), (Paint) null, (Paint) Color.black);
   this.objectIcon = this.getIcon((Shape) new Line2D.Double(-4.0, 0.0, 4.0, 0.0), false, true);
   this.lastCategory = -1;
 }
예제 #30
0
 public CyclicNumberAxis(double period, double offset, string label)
   : base(label)
 {
   CyclicNumberAxis cyclicNumberAxis = this;
   this.advanceLineStroke = CyclicNumberAxis.DEFAULT_ADVANCE_LINE_STROKE;
   this.period = period;
   this.offset = offset;
   this.setFixedAutoRange(period);
   this.advanceLineVisible = true;
   this.advanceLinePaint = CyclicNumberAxis.__\u003C\u003EDEFAULT_ADVANCE_LINE_PAINT;
 }