mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 14:31:02 -04:00
minor changes to pull up and pull down resistors
This commit is contained in:
parent
c9956dc579
commit
2a35bcdb0f
@ -19,7 +19,14 @@ import static de.neemann.digital.draw.shapes.GenericShape.SIZE2;
|
||||
* Created by hneemann on 01.11.16.
|
||||
*/
|
||||
public class PullDownShape implements Shape {
|
||||
private static final int SIZE4 = SIZE / 4;
|
||||
/**
|
||||
* half the width of the resistor
|
||||
*/
|
||||
public static final int WIDTH2 = SIZE2 - 3;
|
||||
/**
|
||||
* height of the resistor
|
||||
*/
|
||||
public static final int HEIGHT = SIZE + SIZE / 3;
|
||||
|
||||
|
||||
private final PinDescriptions outputs;
|
||||
@ -49,14 +56,14 @@ public class PullDownShape implements Shape {
|
||||
public void drawTo(Graphic graphic, boolean highLight) {
|
||||
graphic.drawPolygon(
|
||||
new Polygon(true)
|
||||
.add(-SIZE4, 1)
|
||||
.add(-SIZE4, SIZE)
|
||||
.add(SIZE4, SIZE)
|
||||
.add(SIZE4, 1),
|
||||
.add(-WIDTH2, 1)
|
||||
.add(-WIDTH2, HEIGHT)
|
||||
.add(WIDTH2, HEIGHT)
|
||||
.add(WIDTH2, 1),
|
||||
Style.NORMAL
|
||||
);
|
||||
int o = 8;
|
||||
graphic.drawLine(new Vector(0, SIZE), new Vector(0, SIZE + SIZE2 + o), Style.NORMAL);
|
||||
graphic.drawLine(new Vector(0, HEIGHT), new Vector(0, SIZE + SIZE2 + o), Style.NORMAL);
|
||||
graphic.drawLine(new Vector(-SIZE2, SIZE + SIZE2 + o), new Vector(SIZE2, SIZE + SIZE2 + o), Style.THICK);
|
||||
}
|
||||
|
||||
|
@ -13,13 +13,14 @@ import de.neemann.digital.draw.graphics.Vector;
|
||||
|
||||
import static de.neemann.digital.draw.shapes.GenericShape.SIZE;
|
||||
import static de.neemann.digital.draw.shapes.GenericShape.SIZE2;
|
||||
import static de.neemann.digital.draw.shapes.PullDownShape.HEIGHT;
|
||||
import static de.neemann.digital.draw.shapes.PullDownShape.WIDTH2;
|
||||
|
||||
/**
|
||||
* A pull up resistor shape.
|
||||
* Created by hneemann on 01.11.16.
|
||||
*/
|
||||
public class PullUpShape implements Shape {
|
||||
private static final int SIZE4 = SIZE / 4;
|
||||
|
||||
private final PinDescriptions outputs;
|
||||
|
||||
@ -48,14 +49,14 @@ public class PullUpShape implements Shape {
|
||||
public void drawTo(Graphic graphic, boolean highLight) {
|
||||
graphic.drawPolygon(
|
||||
new Polygon(true)
|
||||
.add(-SIZE4, -1)
|
||||
.add(-SIZE4, -SIZE)
|
||||
.add(SIZE4, -SIZE)
|
||||
.add(SIZE4, -1),
|
||||
.add(-WIDTH2, -1)
|
||||
.add(-WIDTH2, -HEIGHT)
|
||||
.add(WIDTH2, -HEIGHT)
|
||||
.add(WIDTH2, -1),
|
||||
Style.NORMAL
|
||||
);
|
||||
int o = 4;
|
||||
graphic.drawLine(new Vector(0, -SIZE), new Vector(0, -SIZE - SIZE - o), Style.NORMAL);
|
||||
graphic.drawLine(new Vector(0, -HEIGHT), new Vector(0, -SIZE - SIZE - o), Style.NORMAL);
|
||||
graphic.drawPolygon(
|
||||
new Polygon(false)
|
||||
.add(-SIZE2, -SIZE - SIZE2 - o)
|
||||
|
Loading…
x
Reference in New Issue
Block a user