improve icons

This commit is contained in:
bancika
2016-11-08 17:52:27 +01:00
parent 9c0784d59f
commit 327a30215e
5 changed files with 10 additions and 14 deletions
Binary file not shown.
@@ -8,6 +8,7 @@ import java.awt.Graphics2D;
import java.awt.Point; import java.awt.Point;
import java.awt.Polygon; import java.awt.Polygon;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import java.awt.geom.Area; import java.awt.geom.Area;
import java.awt.geom.Ellipse2D; import java.awt.geom.Ellipse2D;
@@ -296,24 +297,17 @@ public class TransistorTO3 extends AbstractTransparentComponent<String> {
@Override @Override
public void drawIcon(Graphics2D g2d, int width, int height) { public void drawIcon(Graphics2D g2d, int width, int height) {
g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
int sizeLarge = getClosestOdd(width * 3d / 4); int sizeLarge = getClosestOdd(width * 3d / 4);
int sizeInner = getClosestOdd(width * 5d / 10); int sizeInner = getClosestOdd(width * 5d / 10);
int sizeSmall = getClosestOdd(width / 3d); int sizeSmall = getClosestOdd(width / 3d);
int hole = 4 * width / 32; int hole = 4 * width / 32;
Area area = new Area(new Ellipse2D.Double((width - sizeLarge) / 2, (height - sizeLarge) / 2, sizeLarge, sizeLarge)); Area area = new Area(new Ellipse2D.Double((width - sizeLarge) / 2, (height - sizeLarge) / 2, sizeLarge, sizeLarge));
// int[] x = new int[] { width / 2 + sizeSmall / 2,
// width / 2 + sizeLarge / 2, width / 2 + sizeSmall / 2, // Polygon p =
// width / 2 - sizeSmall / 2, width / 2 - sizeLarge / 2, // new Polygon(new int[] {(width - sizeSmall) / 2, (width + sizeSmall) / 2, (width + sizeLarge) / 2,
// width / 2 - sizeSmall / 2 }; // (width + sizeSmall) / 2, (width - sizeSmall) / 2, (width - sizeLarge) / 2}, new int[] {height / 8,
// int[] y = new int[] { height / 8, height / 2, height * 7 / 8, // height / 8, height / 2, height * 7 / 8, height * 7 / 8, height / 2}, 6);
// height * 7 / 8, height / 2, height / 8 };
// Area p = new Area(new Polygon(x, y, x.length));
// AffineTransform t = AffineTransform.getTranslateInstance(width / 2,
// height / 2);
// t.concatenate(AffineTransform.getScaleInstance(1.05, 1.05));
// t.concatenate(AffineTransform.getTranslateInstance(-width / 2,
// -height / 2));
// p.transform(t);
// area.add(new Area(p)); // area.add(new Area(p));
area.add(new Area(new Ellipse2D.Double((width - sizeSmall) / 2, height / 8 - sizeSmall / 2, sizeSmall, sizeSmall))); area.add(new Area(new Ellipse2D.Double((width - sizeSmall) / 2, height / 8 - sizeSmall / 2, sizeSmall, sizeSmall)));
area.add(new Area(new Ellipse2D.Double((width - sizeSmall) / 2, height * 7 / 8 - sizeSmall / 2, sizeSmall, area.add(new Area(new Ellipse2D.Double((width - sizeSmall) / 2, height * 7 / 8 - sizeSmall / 2, sizeSmall,
@@ -7,6 +7,7 @@ import java.awt.FontMetrics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.Area; import java.awt.geom.Area;
import java.awt.geom.Ellipse2D; import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
@@ -295,6 +296,7 @@ public class TransistorTO92 extends AbstractTransparentComponent<String> {
@Override @Override
public void drawIcon(Graphics2D g2d, int width, int height) { public void drawIcon(Graphics2D g2d, int width, int height) {
g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
int margin = 3 * width / 32; int margin = 3 * width / 32;
Area area = new Area(new Ellipse2D.Double(margin / 2, margin, width - 2 * margin, width - 2 * margin)); Area area = new Area(new Ellipse2D.Double(margin / 2, margin, width - 2 * margin, width - 2 * margin));
// area.subtract(new Area(new Rectangle2D.Double(0, 0, 2 * margin, // area.subtract(new Area(new Rectangle2D.Double(0, 0, 2 * margin,
Binary file not shown.
Binary file not shown.