Contol Windwo Update. Velocity Change implemented. FONT and some other Var and method needs to be implemented in the GUI class not in Menu Window
Update Velocity SLider to have the right Starting Value.
This commit is contained in:
@@ -327,6 +327,10 @@ public class Control {
|
||||
clock.setVelocity(velocity);
|
||||
}
|
||||
|
||||
public int getVelocity() {
|
||||
return clock.getVelocity();
|
||||
}
|
||||
|
||||
public boolean isMouseLocked() {
|
||||
return mouseLocked;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class ControlWindow {
|
||||
velocitySlider.setBounds(120, 110, 230, 20);
|
||||
velocitySlider.setFont(text);
|
||||
velocitySlider.setForeground(Color.decode("#121212"));
|
||||
velocitySlider.setValue(6);
|
||||
velocitySlider.setValue(gui.getVelocity());
|
||||
velocitySlider.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
@@ -117,7 +117,7 @@ public class ControlWindow {
|
||||
velocitySliderName.setForeground(Color.decode("#121212"));
|
||||
velocitySliderName.setVisible(true);
|
||||
|
||||
velocitySliderLabel = new JTextField("6");
|
||||
velocitySliderLabel = new JTextField(String.valueOf(gui.getVelocity()));
|
||||
velocitySliderLabel.setBackground(null);
|
||||
velocitySliderLabel.setBorder(null);
|
||||
velocitySliderLabel.setBounds(120, 80, 200, 30);
|
||||
@@ -251,7 +251,7 @@ public class ControlWindow {
|
||||
private void initMultibleGenSkip(){
|
||||
|
||||
multipleGenSkipButton = new JButton();
|
||||
multipleGenSkipButton.setText("Next Generation");
|
||||
multipleGenSkipButton.setText("Next Generation");
|
||||
multipleGenSkipButton.setFont(text);
|
||||
multipleGenSkipButton.setForeground(Color.decode("#121212"));
|
||||
multipleGenSkipButton.setBorderPainted(true);
|
||||
@@ -270,9 +270,10 @@ public class ControlWindow {
|
||||
});
|
||||
|
||||
multipleGenSkipLable = new JTextField("6");
|
||||
multipleGenSkipLable.setOpaque(false);
|
||||
multipleGenSkipLable.setBackground(null);
|
||||
multipleGenSkipLable.setBorder(null);
|
||||
multipleGenSkipLable.setBounds(50, 450, 200, 30);
|
||||
multipleGenSkipLable.setBounds(160, 450, 50, 50);
|
||||
multipleGenSkipLable.setFont(text);
|
||||
multipleGenSkipLable.setForeground(Color.decode("#121212"));
|
||||
multipleGenSkipLable.setVisible(true);
|
||||
|
||||
@@ -151,6 +151,10 @@ public class GUI {
|
||||
gameWindow.updateTitle(gen);
|
||||
}
|
||||
|
||||
public int getVelocity(){
|
||||
return control.getVelocity();
|
||||
}
|
||||
|
||||
//TODO: Delet this Methods. Those are shit.
|
||||
public void setVisibility(boolean value){
|
||||
controlWindow.setVisibility(value);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class GameWindow {
|
||||
|
||||
this.title = title;
|
||||
|
||||
gameWindow = new JFrame(title + " Generation: " + gui.getGeneration());
|
||||
gameWindow = new JFrame(title + " | Generation: " + gui.getGeneration());
|
||||
|
||||
gameWindow.getContentPane().setPreferredSize(new Dimension(width + (2 * offset), height + (2 * offset)));
|
||||
gameWindow.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
@@ -161,7 +161,7 @@ public class GameWindow {
|
||||
return gameWindow.getLocation();
|
||||
}
|
||||
public void updateTitle(int gen){
|
||||
gameWindow.setTitle(title + " Generation: " + gen);
|
||||
gameWindow.setTitle(title + " | Generation: " + gen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user