Merge remote-tracking branch 'origin/twocontrols'
This commit is contained in:
@@ -66,7 +66,8 @@ public class Display extends JFrame
|
|||||||
Container con = this.getContentPane();
|
Container con = this.getContentPane();
|
||||||
con.add(new JScrollPane(maze), BorderLayout.CENTER);
|
con.add(new JScrollPane(maze), BorderLayout.CENTER);
|
||||||
controler = new MazeControler();
|
controler = new MazeControler();
|
||||||
con.add(controler, BorderLayout.NORTH);
|
con.add(controler.getMoveControl(), BorderLayout.NORTH);
|
||||||
|
con.add(controler.getGenerationControl(), BorderLayout.SOUTH);
|
||||||
|
|
||||||
addComponentListener(new ComponentAdapter() {
|
addComponentListener(new ComponentAdapter() {
|
||||||
@Override
|
@Override
|
||||||
@@ -270,11 +271,13 @@ public class Display extends JFrame
|
|||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private MazeSettings settings = null;
|
||||||
|
|
||||||
|
|
||||||
public MazeControler()
|
public MazeControler()
|
||||||
{
|
{
|
||||||
MazeSettings settings = new MazeSettings();
|
|
||||||
|
|
||||||
controlPanel = new JPanel();
|
controlPanel = new JPanel();
|
||||||
|
settings = new MazeSettings();
|
||||||
JButton button = new JButton("Resolve");
|
JButton button = new JButton("Resolve");
|
||||||
button.addActionListener(new ActionListener()
|
button.addActionListener(new ActionListener()
|
||||||
{
|
{
|
||||||
@@ -380,6 +383,16 @@ public class Display extends JFrame
|
|||||||
add(settings,BorderLayout.EAST);
|
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)
|
private JButton addDirection(final JPanel panel, final String direction, String key, Action goAction)
|
||||||
|
|||||||
Reference in New Issue
Block a user