Oval solder pads

This commit is contained in:
Branislav Stojkovic
2018-12-25 23:56:25 +01:00
parent 1268f83f5e
commit 1ffd9b50a8
5 changed files with 192 additions and 188 deletions
Binary file not shown.
@@ -1,24 +1,20 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC 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.
DIYLC 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 DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
*
* DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 held jointly by the individual authors.
*
* This file is part of DIYLC.
*
* DIYLC 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.
*
* DIYLC 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 DIYLC. If not, see
* <http://www.gnu.org/licenses/>.
*/
package org.diylc.components.connectivity;
import java.awt.Color;
@@ -76,6 +72,10 @@ public class SolderPad extends AbstractComponent<Void> {
drawingObserver.startTrackingContinuityArea(true);
if (type == Type.ROUND) {
g2d.fill(new Ellipse2D.Double(point.x - diameter / 2, point.y - diameter / 2, diameter, diameter));
} else if (type == Type.OVAL_HORIZONTAL) {
g2d.fill(new Ellipse2D.Double(point.x - diameter / 2, point.y - diameter * 3 / 8, diameter, diameter * 3 / 4));
} else if (type == Type.OVAL_VERTICAL) {
g2d.fill(new Ellipse2D.Double(point.x - diameter * 3 / 8, point.y - diameter / 2, diameter * 3 / 4, diameter));
} else {
g2d.fill(new Rectangle2D.Double(point.x - diameter / 2, point.y - diameter / 2, diameter, diameter));
}
@@ -186,11 +186,11 @@ public class SolderPad extends AbstractComponent<Void> {
public void setValue(Void value) {}
public static enum Type {
ROUND, SQUARE;
ROUND, SQUARE, OVAL_HORIZONTAL, OVAL_VERTICAL;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
return name().substring(0, 1) + name().substring(1).toLowerCase().replace('_', ' ');
}
}
}
Binary file not shown.
Binary file not shown.
+4
View File
@@ -2038,6 +2038,10 @@
<releaseDate>2018-12-25 00:00:00.000 CET</releaseDate>
<name></name>
<changes>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Oval solder pads, available as new types of regular "Solder Pad" components</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Faster click and popup menu response due to improved performance of selection area calculations, especially with bigger layouts</description>