0

Here is my Interface

package Tools;

import java.awt.Color;
import java.io.Serializable;

/**
 *
 * @author DELL-PC
 */
public interface ToolsModel extends Serializable {

    public void setColor(Color color);

    public Color getColor();

    public void setVisible(boolean b);

    public boolean isVisible();

    public void setID(String id);

    public String getID();

    public ToolsModel getShape();

}

And i have done some creating irregular shape using this interface and from this interface and i want to Add.Subtract on interface and it's working fine but some white raised.
Here is my code which is used to Add,Subtract on interface.

public void trimShade(ToolsModel toolsModel) {
        System.out.println("I am at TrimShade");
        Area area = new Area();
        for (ToolsModel model : getShadeList()) {
            if (model.equals(toolsModel) || model.getID().equals(toolsModel.getID())) {
                continue;
            }
            area.add(new Area((Shape)model));
            if (!area.isEmpty()) {
                ((Area) model).subtract(new Area((Shape)toolsModel));

            }
        }
    }

First we draw here the polygonal irregular shape and then After we draw next shape inside the first shape.
Here is the output result:
enter image description here
How to remove this white line which raised after two area addition and subtraction. It is one the border of the second Area.

Dinesh Katwal
  • 930
  • 1
  • 14
  • 25
  • 1
    1) For better help sooner, post a [MCVE] or [Short, Self Contained, Correct Example](http://www.sscce.org/). 2) One way to get image(s) for an example is to hot link to images seen in [this Q&A](http://stackoverflow.com/q/19209650/418556). – Andrew Thompson Nov 17 '16 at 05:05
  • i'm assuming you're drawing onto an image, if that's the case it might be worth checking that these constructions lines are drawn on the panel and not the image itself. – Chains Nov 17 '16 at 10:20

1 Answers1

0

I got the solution and i fixed the problem when i comment the Anti aliasing and Quality render hints.

//g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
Dinesh Katwal
  • 930
  • 1
  • 14
  • 25