Merge remote-tracking branch 'origin/twocontrols'

This commit is contained in:
philippe lhardy
2017-11-16 21:53:39 +01:00

View File

@@ -66,7 +66,8 @@ public class Display extends JFrame
Container con = this.getContentPane();
con.add(new JScrollPane(maze), BorderLayout.CENTER);
controler = new MazeControler();
con.add(controler, BorderLayout.NORTH);
con.add(controler.getMoveControl(), BorderLayout.NORTH);
con.add(controler.getGenerationControl(), BorderLayout.SOUTH);
addComponentListener(new ComponentAdapter() {
@Override
@@ -270,11 +271,13 @@ public class Display extends JFrame
*/
private static final long serialVersionUID = 1L;
private MazeSettings settings = null;
public MazeControler()
{
MazeSettings settings = new MazeSettings();
controlPanel = new JPanel();
settings = new MazeSettings();
JButton button = new JButton("Resolve");
button.addActionListener(new ActionListener()
{
@@ -380,6 +383,16 @@ public class Display extends JFrame
add(settings,BorderLayout.EAST);
}
private JPanel getMoveControl()
{
return this;
}
private JPanel getGenerationControl()
{
return settings;
}
}
private JButton addDirection(final JPanel panel, final String direction, String key, Action goAction)