static void drawALUIcon(ComponentDrawContext context, int x, int y) { Graphics g = context.getGraphics(); g.setColor(Color.BLACK); int xp[] = {x, x + 15, x + 15, x, x, x + 3, x}; int yp[] = {y, y + 5, y + 10, y + 15, y + 10, y + 8, y + 6}; g.drawPolygon(xp, yp, 7); }
public void draw(ComponentDrawContext context) { drawALU(context.getGraphics(), getBounds()); context.drawPin(this, 0, "A", Direction.EAST); context.drawPin(this, 1, "B", Direction.EAST); context.drawPin(this, 3, "Zero", Direction.WEST); context.drawPin(this, 4, "Res", Direction.WEST); context.drawPin(this, 5, " OF ", Direction.WEST); context.getGraphics().setColor(Color.GRAY); context.drawPin(this, 2, "Op", Direction.SOUTH); context.getGraphics().setColor(Color.BLACK); }