one pass on layout

build.xml exclude javafx ( remark lost with doit.sh ant ).
This commit is contained in:
philippe lhardy
2017-11-18 18:33:19 +01:00
parent e429919005
commit 8f234bb41b
3 changed files with 38 additions and 23 deletions

View File

@@ -17,7 +17,9 @@
<target name="compile" depends="init" <target name="compile" depends="init"
description="compile the source " > description="compile the source " >
<!-- Compile the java code from ${src} into ${build} --> <!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"/> <javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<exclude name="org/artisanlogiciel/games/javafx/*"/>
</javac>
</target> </target>
<target name="dist" depends="compile" <target name="dist" depends="compile"
@@ -25,8 +27,8 @@
<!-- Create the distribution directory --> <!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/> <mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the artloglaby-0.0.1.jar file ( ${DSTAMP} not used yet )--> <!-- Put everything in ${build} into the artloglaby-0.1.jar file ( ${DSTAMP} not used yet )-->
<jar jarfile="${dist}/lib/artloglaby-0.0.1.jar" basedir="${build}"> <jar jarfile="${dist}/lib/artloglaby-0.1.jar" basedir="${build}">
<manifest> <manifest>
<attribute name="Main-Class" value="org.artisanlogiciel.games.Display"/> <attribute name="Main-Class" value="org.artisanlogiciel.games.Display"/>
</manifest> </manifest>

View File

@@ -190,18 +190,21 @@ public class Display extends JFrame
} }
}); });
add(buttonCreate); add(buttonCreate);
JLabel widthLabel = new JLabel("width"); if ( params != null )
textWidth = new JTextField("0" + params.getWidth()); {
add(widthLabel); JLabel widthLabel = new JLabel("width");
add(textWidth); textWidth = new JTextField("0" + params.getWidth());
JLabel heightLabel = new JLabel("height"); add(widthLabel);
textHeight = new JTextField("0" + params.getHeight()); add(textWidth);
add(heightLabel); JLabel heightLabel = new JLabel("height");
add(textHeight); textHeight = new JTextField("0" + params.getHeight());
JLabel depthLabel = new JLabel("depth"); add(heightLabel);
textDepth = new JTextField("0" + params.getMaxDepth()); add(textHeight);
add(depthLabel); JLabel depthLabel = new JLabel("depth");
add(textDepth); textDepth = new JTextField("0" + params.getMaxDepth());
add(depthLabel);
add(textDepth);
}
} }
public MazeParams getParams() public MazeParams getParams()
@@ -284,11 +287,13 @@ public class Display extends JFrame
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private MazeSettings settings = null; private MazeSettings settings = null;
private JPanel resizecontrol = null;
public MazeControler(MazeParams params) public MazeControler(MazeParams params)
{ {
controlPanel = new JPanel(); super(new BorderLayout());
controlPanel = new JPanel(new BorderLayout());
settings = new MazeSettings(params); settings = new MazeSettings(params);
JButton button = new JButton("Resolve"); JButton button = new JButton("Resolve");
button.addActionListener(new ActionListener() button.addActionListener(new ActionListener()
@@ -350,7 +355,7 @@ public class Display extends JFrame
}; };
JButton south = addDirection(this, "South", "DOWN", goSouth); JButton south = addDirection(this, "South", "DOWN", goSouth);
add(button, BorderLayout.CENTER); controlPanel.add(button, BorderLayout.CENTER);
controlPanel.add(north, BorderLayout.NORTH); controlPanel.add(north, BorderLayout.NORTH);
controlPanel.add(west, BorderLayout.WEST); controlPanel.add(west, BorderLayout.WEST);
controlPanel.add(east, BorderLayout.EAST); controlPanel.add(east, BorderLayout.EAST);
@@ -359,7 +364,7 @@ public class Display extends JFrame
// control display panel contains controls for display // control display panel contains controls for display
// zoom , autozoom. // zoom , autozoom.
final JPanel controlDisplayPanel = new JPanel(); final JPanel controlDisplayPanel = new JPanel(new BorderLayout());
final JSlider slider = new JSlider(2, 40); final JSlider slider = new JSlider(2, 40);
slider.addChangeListener(new ChangeListener() slider.addChangeListener(new ChangeListener()
{ {
@@ -386,11 +391,14 @@ public class Display extends JFrame
} }
}; };
savePngButton.addActionListener(savePngAction); savePngButton.addActionListener(savePngAction);
controlDisplayPanel.add(slider, BorderLayout.WEST);
controlDisplayPanel.add(autoSlide, BorderLayout.EAST); resizecontrol = new JPanel();
controlDisplayPanel.add(savePngButton, BorderLayout.SOUTH); resizecontrol.add(slider, BorderLayout.WEST);
resizecontrol.add(autoSlide, BorderLayout.EAST);
resizecontrol.add(savePngButton, BorderLayout.SOUTH);
add(controlDisplayPanel, BorderLayout.SOUTH); add(controlDisplayPanel, BorderLayout.SOUTH);
add(resizecontrol,BorderLayout.WEST);
add(settings,BorderLayout.EAST); add(settings,BorderLayout.EAST);
} }
@@ -399,6 +407,11 @@ public class Display extends JFrame
return this; return this;
} }
private JPanel getResizeControl()
{
return resizecontrol;
}
private JPanel getGenerationControl() private JPanel getGenerationControl()
{ {
return settings; return settings;

View File

@@ -3,5 +3,5 @@ project_default=dist
project_basedir=$(pwd) project_basedir=$(pwd)
project_mainpackage=org.artisanlogiciel.games project_mainpackage=org.artisanlogiciel.games
project_mainclass=$project_mainpackage.Display project_mainclass=$project_mainpackage.Display
project_version=0.0.1 project_version=0.1
default_args='lab/lab30x30.raw' default_args='lab/lab30x30.raw'