introduced constants in Style

This commit is contained in:
hneemann 2016-08-18 13:32:17 +02:00
parent 92f76a7f7c
commit d237f58027

View File

@ -8,56 +8,61 @@ import java.awt.*;
* @author hneemann * @author hneemann
*/ */
public class Style { public class Style {
private static final int WIRETHICK = 4;
private static final int LINETHICK = 4;
private static final int LINETHIN = 2;
private static final int LINEDASH = 1;
/** /**
* used for all lines to draw the shapes itself * used for all lines to draw the shapes itself
*/ */
public static final Style NORMAL = new Style(4, false, Color.BLACK); public static final Style NORMAL = new Style(LINETHICK, false, Color.BLACK);
/** /**
* Used for text which is integral part of the shape. * Used for text which is integral part of the shape.
* Text which uses this style is always included in sizing! * Text which uses this style is always included in sizing!
* Used for text only elements. * Used for text only elements.
*/ */
public static final Style NORMAL_TEXT = new Style(4, false, Color.BLACK); public static final Style NORMAL_TEXT = new Style(LINETHICK, false, Color.BLACK);
/** /**
* thin line used for the graphic in the clock or delay shape * thin line used for the graphic in the clock or delay shape
*/ */
public static final Style THIN = new Style(2, false, Color.BLACK); public static final Style THIN = new Style(LINETHIN, false, Color.BLACK);
/** /**
* Used for wires in editing mode * Used for wires in editing mode
*/ */
public static final Style WIRE = new Style(4, true, Color.BLUE.darker()); public static final Style WIRE = new Style(WIRETHICK, true, Color.BLUE.darker());
/** /**
* Used for low wires in running mode * Used for low wires in running mode
*/ */
public static final Style WIRE_LOW = new Style(4, true, new Color(0, 112, 0)); public static final Style WIRE_LOW = new Style(WIRETHICK, true, new Color(0, 112, 0));
/** /**
* Used for high wires in running mode * Used for high wires in running mode
*/ */
public static final Style WIRE_HIGH = new Style(4, true, new Color(102, 255, 102)); public static final Style WIRE_HIGH = new Style(WIRETHICK, true, new Color(102, 255, 102));
/** /**
* Used for wires in high Z state * Used for wires in high Z state
*/ */
public static final Style WIRE_HIGHZ = new Style(4, true, Color.GRAY); public static final Style WIRE_HIGHZ = new Style(WIRETHICK, true, Color.GRAY);
/** /**
* used to draw the output dots * used to draw the output dots
*/ */
public static final Style WIRE_OUT = new Style(4, true, Color.RED.darker()); public static final Style WIRE_OUT = new Style(LINETHICK, true, Color.RED.darker());
/** /**
* filld style used to fill the splitter or the dark LEDs * filld style used to fill the splitter or the dark LEDs
*/ */
public static final Style FILLED = new Style(4, true, Color.BLACK); public static final Style FILLED = new Style(LINETHICK, true, Color.BLACK);
/** /**
* Used to draw the grid in the graph * Used to draw the grid in the graph
*/ */
public static final Style DASH = new Style(1, false, Color.BLACK, new float[]{4, 4}); public static final Style DASH = new Style(LINEDASH, false, Color.BLACK, new float[]{4, 4});
/** /**
* Used todraw the pin description text * Used to draw the pin description text
*/ */
public static final Style SHAPE_PIN = new Style(4, false, Color.GRAY, 18, null); public static final Style SHAPE_PIN = new Style(LINETHICK, false, Color.GRAY, 18, null);
/** /**
* highlight color used for the circles to mark an element * highlight color used for the circles to mark an element
*/ */
public static final Style HIGHLIGHT = new Style(4, false, Color.CYAN); public static final Style HIGHLIGHT = new Style(WIRETHICK, false, Color.CYAN);
private final int thickness; private final int thickness;
private final boolean filled; private final boolean filled;