Here you can find the source of paintShape(Shape shape, Graphics2D g2d, Color colorStroke, Stroke stroke, Color colorFill, double downsample)
public static void paintShape(Shape shape, Graphics2D g2d, Color colorStroke, Stroke stroke, Color colorFill, double downsample)
//package com.java2s; /*-// w w w .ja v a 2s . c om * #%L * This file is part of QuPath. * %% * Copyright (C) 2014 - 2016 The Queen's University of Belfast, Northern Ireland * Contact: IP Management (ipmanagement@qub.ac.uk) * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ import java.awt.Color; import java.awt.Graphics2D; import java.awt.Shape; import java.awt.Stroke; public class Main { public static void paintShape(Shape shape, Graphics2D g2d, Color colorStroke, Stroke stroke, Color colorFill, double downsample) { // if (shape instanceof Path2D && downsample > 10) { // Shape shape2 = downsampledShapes.get(shape); // if (shape2 == null) { // shape2 = ShapeSimplifierAwt.simplifyPath((Path2D)shape, 10); // if (shape2 != null) { // downsampledShapes.put(shape, shape2); // shape = shape2; // } // } // } // if (stroke != null) // g2d.setStroke(stroke); // g2d.setColor(colorStroke); // System.out.println("Drawing: " + AWTAreaROI.getVertices(shape).size()); // for (Vertices v : AWTAreaROI.getVertices(shape)) { // g2d.draw(PathROIToolsAwt.getShape(new PolygonROI(v.getPoints()))); // // g2d.fill(PathROIToolsAwt.getShape(new PolygonROI(v.getPoints()))); // } if (colorFill != null) { g2d.setColor(colorFill); g2d.fill(shape); } if (colorStroke != null) { if (stroke != null) g2d.setStroke(stroke); g2d.setColor(colorStroke); g2d.draw(shape); } } }