93 lines
2.8 KiB
Java
93 lines
2.8 KiB
Java
package de.ph87.electro;
|
|
|
|
import java.awt.*;
|
|
|
|
import static java.lang.Math.round;
|
|
|
|
@SuppressWarnings("unused")
|
|
public class CONFIG {
|
|
|
|
public static final double NO_RESISTANCE = 1e-12;
|
|
|
|
public static final double MAX_RESISTANCE = 1 / NO_RESISTANCE;
|
|
|
|
public static final double VOLTAGE_HIGH_MIN = 0.1;
|
|
|
|
public static final int RASTER = 200;
|
|
|
|
public static final int P03 = (int) round(0.03 * RASTER);
|
|
|
|
public static final int P05 = (int) round(0.05 * RASTER);
|
|
|
|
public static final int P10 = (int) round(0.1 * RASTER);
|
|
|
|
public static final int P25 = (int) round(0.25 * RASTER);
|
|
|
|
public static final int P50 = (int) round(0.5 * RASTER);
|
|
|
|
public static final int P65 = (int) round(0.65 * RASTER);
|
|
|
|
public static final int P75 = (int) round(0.75 * RASTER);
|
|
|
|
public static final int P70 = (int) round(0.7 * RASTER);
|
|
|
|
public static final int P80 = (int) round(0.8 * RASTER);
|
|
|
|
public static final int P90 = (int) round(0.9 * RASTER);
|
|
|
|
public static final int P95 = (int) round(0.95 * RASTER);
|
|
|
|
public static final int NODE_RADIUS = (int) round(0.09 * RASTER);
|
|
|
|
public static final int NODE_RADIUS_HOVER = (int) round(1.5 * NODE_RADIUS);
|
|
|
|
public static final Color PART_BACK_COLOR = new Color(224, 224, 224);
|
|
|
|
public static final Color PART_HOVER_COLOR = new Color(192, 192, 192, 128);
|
|
|
|
public static final Color NODE_HOVER_BORDER_COLOR = Color.BLACK;
|
|
|
|
public static final Color RASTER_COLOR = Color.gray;
|
|
|
|
public static final Color VOLTAGE_UNKNOWN_COLOR = Color.darkGray;
|
|
|
|
public static final Color VOLTAGE_HIGH_COLOR = Color.RED;
|
|
|
|
public static final Color VOLTAGE_LOW_COLOR = new Color(0, 128, 255);
|
|
|
|
public static final Color WIRE_HOVER_COLOR_BACK = Color.BLACK;
|
|
|
|
public static final Font LABEL_FONT = new Font("", Font.PLAIN, 20);
|
|
|
|
public static final BasicStroke RASTER_STROKE = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5}, 0);
|
|
|
|
public static final BasicStroke NODE_STROKE = new BasicStroke(1);
|
|
|
|
public static final BasicStroke HOVER_STROKE = new BasicStroke(2);
|
|
|
|
public static final BasicStroke SYMBOL_STROKE = new BasicStroke(3);
|
|
|
|
public static final BasicStroke WIRE_STROKE = new BasicStroke(5);
|
|
|
|
public static final BasicStroke WIRE_HOVER_STROKE = new BasicStroke(WIRE_STROKE.getLineWidth() + 2);
|
|
|
|
public static final BasicStroke WIRE_HOVER_STROKE_BACK = new BasicStroke(WIRE_HOVER_STROKE.getLineWidth() + 4);
|
|
|
|
public static final BasicStroke SWITCH_STROKE = new BasicStroke(15);
|
|
|
|
public static boolean SHOW_WIRE_DETAILS = true;
|
|
|
|
public static boolean SHOW_NODE_VOLTAGES = false;
|
|
|
|
public static boolean SHOW_NODE_NAMES = false;
|
|
|
|
public static Point ALIGN(final Point position) {
|
|
return new Point(position.x / RASTER * RASTER, position.y / RASTER * RASTER);
|
|
}
|
|
|
|
public static Point RASTER(final int x, final int y) {
|
|
return new Point(x * RASTER, y * RASTER);
|
|
}
|
|
|
|
}
|