blob: 8ae94854c3cc1f63492076954c4e2bc8566924a1 (
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
|
package jcgp.gui.population;
import javafx.scene.control.Label;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Circle;
import jcgp.backend.population.Output;
import jcgp.gui.constants.Constants;
public abstract class GUIOutput extends GUIGene implements GUIMutable {
private Output output;
public GUIOutput(final Output output) {
super();
this.output = output;
Circle socket = new Circle(-Constants.NODE_RADIUS, 0, Constants.SOCKET_RADIUS, Paint.valueOf("white"));
socket.setId(String.valueOf(0));
socket.setStroke(Paint.valueOf("black"));
Label connectionLabel = new Label("S");
connectionLabel.setStyle("-fx-background-color:rgb(255, 255, 255); -fx-border-color:rgba(0, 0, 0, 0.5);");
connectionLabel.relocate(socket.getCenterX() + 5, socket.getCenterY() - 10);
connectionLabel.setVisible(false);
getChildren().addAll(socket, connectionLabel);
}
void setOutput(Output output2) {
// TODO Auto-generated method stub
}
@Override
public void mouseEnter() {
setState(GUIGeneState.HOVER);
getGUIConnection(output.getSource()).activeHover(true);
}
@Override
public void mouseExit() {
setState(GUIGeneState.NEUTRAL);
getGUIConnection(output.getSource()).activeHover(false);
}
}
|