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:
How to remove this white line which raised after two area addition and subtraction. It is one the border of the second Area.