aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/constants/Constants.java
blob: d53b1ca1f3b8c2a687454ad4e668e539e1296dd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package jcgp.gui.constants;

import javafx.scene.paint.Paint;

/**
 * Holds the constants used in the GUI.
 * 
 * @author Eduardo Pedroni
 *
 */
public final class Constants {

	/**
	 * Private constructor to prevent instantiation.
	 */
	private Constants(){}
	
	/* Colours */
	/**
	 * A {@code Paint} containing the colour used for representing neutrality.
	 */
	public static final Paint NEUTRAL_COLOUR = Paint.valueOf("#FFFFFF");
	/**
	 * A {@code Paint} containing the colour used for representing a hard highlight.
	 * A "hard" select, for instance, happens when an output path is locked on the chromosome
	 * pane.
	 */
	public static final Paint HARD_HIGHLIGHT_COLOUR = Paint.valueOf("#5496FF");
	/**
	 * A {@code Paint} containing the colour used for a medium highlight.
	 * One example of such a selection is the colour applied to a node
	 * when it is hovered over.
	 */
	public static final Paint MEDIUM_HIGHLIGHT_COLOUR = Paint.valueOf("#75BAFF");
	/**
	 * A {@code Paint} containing the colour used for a soft highlight.
	 * When hovering over a node, its connections are soft-selected.
	 */
	public static final Paint SOFT_HIGHLIGHT_COLOUR = Paint.valueOf("#C7DFFF");
	/**
	 * A {@code Paint} containing the colour used for representing a good selection.
	 * Ideally a shade of green, used for instance when a manual connection is valid.
	 */
	public static final Paint GOOD_SELECTION_COLOUR = Paint.valueOf("#38C25B");
	/**
	 * A {@code Paint} containing the colour used for representing a neutral selection.
	 * Ideally a shade of yellow, used for instance when a manual connection is already the
	 * current connection.
	 */
	public static final Paint NEUTRAL_SELECTION_COLOUR = Paint.valueOf("#FFEF73");
	/**
	 * A {@code Paint} containing the colour used for representing a bad selection.
	 * Ideally a shade of red, use for instance when a manual connection is not valid.
	 */
	public static final Paint BAD_SELECTION_COLOUR = Paint.valueOf("#FF5C5C");
	/**
	 * A {@code Paint} containing the colour used for the gene sockets.
	 */
	public static final Paint SOCKET_COLOUR = Paint.valueOf("#FFFFFF");
	
	
	/* Sizes and distances */
	/**
	 * The width or height of the area that can be clicked on
	 * to drag-resize a pane.
	 */
    public static final double RESIZE_MARGIN = 5.0;
    /**
	 * The minimum width of the settings pane, to prevent it
	 * from being resized beyond visibility.
	 */
    public static final double SETTINGS_MIN_WIDTH = 200;
    /**
	 * The minimum width of the console pane, to prevent it
	 * from being resized beyond visibility.
	 */
    public static final double CONSOLE_MIN_HEIGHT = 100;
    /**
     * Radius used for the representation of nodes in the grid.
     */
    public static final double NODE_RADIUS = 35;
	/**
	 * Spacing between each node.
	 */
	public static final double SPACING = 15;
	/**
	 * The margin between the genes and the edge of the chromosome pane.
	 */
	public static final double CHROMOSOME_PANE_MARGIN = 10;
	/**
	 * The angle across which the node's sockets are evenly distributed.
	 */
	public static final double THETA = Math.PI / 1.4;
	/**
	 * The radius of the connection sockets, calculated as a function of NODE_RADIUS.
	 */
	public static final double SOCKET_RADIUS = Math.sqrt(NODE_RADIUS) / 1.8;
	/**
	 * Size of the text in each node.
	 */
	public static final double NODE_TEXT = NODE_RADIUS / 2.5;
	
	
	/* CSS Styles
	 * TODO extract to stylesheet?
	 */
	/**
	 * The basic style of text boxes used in parameters.
	 */
	public static final String BASE_TEXT_STYLE = "-fx-border-color: #C9C9C9; -fx-border-radius: 2; -fx-padding: 0; ";
	/**
	 * The basic style of check boxes used in parameters.
	 */
	public static final String BASE_CHECKBOX_STYLE = "-fx-padding: 0; ";
	/**
	 * The style applied to invalid parameters, using BAD_SELECTION_COLOUR.
	 */
	public static final String INVALID_PARAMETER_STYLE = "-fx-background-color: " + BAD_SELECTION_COLOUR;
	/**
	 * The style applied to neutral parameters, using NEUTRAL_SELECTION_COLOUR.
	 */
	public static final String WARNING_PARAMETER_STYLE = "-fx-background-color: " + NEUTRAL_SELECTION_COLOUR;
	/**
	 * The style applied to valid parameters, using NEUTRAL_COLOUR.
	 */
	public static final String VALID_PARAMETER_STYLE = "-fx-background-color: " + NEUTRAL_COLOUR;	
    
}