diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index a436062..d8952f9 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -6,19 +6,19 @@ For the purpose of easier reading the script is divided into following sections: - - initialization - - compilation - - jar - - execution - - debugging - - javadoc - - test compilation - - test execution - - test debugging - - applet - - cleanup +- initialization +- compilation +- jar +- execution +- debugging +- javadoc +- test compilation +- test execution +- test debugging +- applet +- cleanup - --> +--> @@ -29,10 +29,10 @@ is divided into following sections: + ====================== + INITIALIZATION SECTION + ====================== + --> @@ -786,8 +786,8 @@ is divided into following sections: + pre NB7.2 profiling section; consider it deprecated + --> @@ -834,8 +834,8 @@ is divided into following sections: Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + end of pre NB7.2 profiling section + --> @@ -1048,10 +1048,10 @@ is divided into following sections: + =================== + COMPILATION SECTION + =================== + --> @@ -1124,10 +1124,10 @@ is divided into following sections: + ==================== + JAR BUILDING SECTION + ==================== + --> @@ -1257,10 +1257,10 @@ is divided into following sections: + ================= + DEPLOY SECTION + ================= + --> @@ -1322,10 +1322,10 @@ is divided into following sections: + ================= + EXECUTION SECTION + ================= + --> @@ -1345,10 +1345,10 @@ is divided into following sections: + ================= + DEBUGGING SECTION + ================= + --> @@ -1386,13 +1386,13 @@ is divided into following sections: + ================= + PROFILING SECTION + ================= + --> + pre NB7.2 profiler integration + --> This target only works when run from inside the NetBeans IDE. @@ -1445,8 +1445,8 @@ is divided into following sections: + end of pre NB72 profiling section + --> @@ -1481,10 +1481,10 @@ is divided into following sections: + =============== + JAVADOC SECTION + =============== + --> @@ -1532,10 +1532,10 @@ is divided into following sections: + ========================= + TEST COMPILATION SECTION + ========================= + --> @@ -1631,10 +1631,10 @@ is divided into following sections: + ======================= + TEST EXECUTION SECTION + ======================= + --> @@ -1668,10 +1668,10 @@ is divided into following sections: + ======================= + TEST DEBUGGING SECTION + ======================= + --> Must select one file in the IDE or set test.class @@ -1692,10 +1692,10 @@ is divided into following sections: + ========================= + APPLET EXECUTION SECTION + ========================= + --> Must select one file in the IDE or set applet.url @@ -1705,10 +1705,10 @@ is divided into following sections: + ========================= + APPLET DEBUGGING SECTION + ========================= + --> Must select one file in the IDE or set applet.url @@ -1719,10 +1719,10 @@ is divided into following sections: + =============== + CLEANUP SECTION + =============== + --> diff --git a/nbproject/project.properties b/nbproject/project.properties index d4663e6..a894bfc 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,9 +1,18 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=false -annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=Schack +application.vendor=love +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=4 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=4 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=8 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=80 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.enable-indent=true build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: @@ -30,6 +39,7 @@ dist.archive.excludes= dist.dir=dist dist.jar=${dist.dir}/Schack.jar dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= excludes= includes=** jar.compress=false @@ -54,6 +64,7 @@ javac.test.processorpath=\ javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} +javadoc.html5=false javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false @@ -62,6 +73,8 @@ javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=Schack main.class=schack.Schack manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF diff --git a/src/schack/Board.java b/src/schack/Board.java index ccc8445..03fa6e1 100644 --- a/src/schack/Board.java +++ b/src/schack/Board.java @@ -5,57 +5,33 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.util.ArrayList; -import javax.swing.JFrame; import javax.swing.JPanel; -public class Board extends JFrame -{ - +public class Board extends JPanel { + ArrayList pieces = new ArrayList<>(); - - public Board() - { - setTitle("Schack"); - setAlwaysOnTop(true); - setResizable(false); - setContentPane(cp); - cp.setPreferredSize(new Dimension(800, 800) ); - pack(); - setVisible(true); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + public Board() { + setPreferredSize(new Dimension(800, 800)); } - - JPanel cp = new JPanel() - { - - public void paintComponent(Graphics g) - { - Graphics2D g2 = (Graphics2D) g; - - g2.scale(100, 100); - g2.setBackground(Color.WHITE); - g2.setColor(Color.BLACK); - - for (int i = 0; i < 8; i += 2) { - for (int j = 0; j < 8; j += 2) { - g.fillRect(i, j, 1, 1); - } - } - - for (int i = 1; i < 8; i += 2) { - for (int j = 1; j < 8; j += 2) { - g.fillRect(i, j, 1, 1); - } + + public void paintComponent(Graphics g) { + Graphics2D g2 = (Graphics2D) g; + + g2.scale(100, 100); + g2.setBackground(Color.WHITE); + g2.setColor(Color.BLACK); + + for (int i = 0; i < 8; i += 2) { + for (int j = 0; j < 8; j += 2) { + g.fillRect(i, j, 1, 1); } } - }; -// for(Piece p : pieces){ -// p.draw(); -// } - public static void main(String[] args) - { - new Board(); + for (int i = 1; i < 8; i += 2) { + for (int j = 1; j < 8; j += 2) { + g.fillRect(i, j, 1, 1); + } + } } - } diff --git a/src/schack/DiagonalWalk.java b/src/schack/DiagonalWalk.java index c7009b8..d7eb2d0 100644 --- a/src/schack/DiagonalWalk.java +++ b/src/schack/DiagonalWalk.java @@ -9,8 +9,8 @@ package schack; * * @author lovbil251 */ -public interface DiagonalWalk -{ +public interface DiagonalWalk { + public void walDiagonal(); - + } diff --git a/src/schack/King.java b/src/schack/King.java index 83f396d..93fb16b 100644 --- a/src/schack/King.java +++ b/src/schack/King.java @@ -1,6 +1,8 @@ package schack; -public final class King extends Piece{ +public final class King extends Piece { - public boolean isSeen(){return true;} + public boolean isSeen() { + return true; + } } diff --git a/src/schack/Piece.java b/src/schack/Piece.java index 9173664..73e1430 100644 --- a/src/schack/Piece.java +++ b/src/schack/Piece.java @@ -4,13 +4,14 @@ import java.awt.Point; import java.util.ArrayList; public class Piece { - public Point position; - - - public boolean isValidMove(Point p, ArrayList pieces){return true;} - void draw() - { + public Point position; + + public boolean isValidMove(Point p, ArrayList pieces) { + return true; + } + + void draw() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } diff --git a/src/schack/Schack.java b/src/schack/Schack.java index 2063313..57c5230 100644 --- a/src/schack/Schack.java +++ b/src/schack/Schack.java @@ -1,35 +1,28 @@ package schack; -import java.awt.Color; import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; import javax.swing.JFrame; /** * * @author Love Billenius & Simon Hansson */ -public class Schack extends JFrame -{ +public class Schack extends JFrame { public Dimension size = new Dimension(800, 800); - public Schack() - { - setSize(size); + public Schack() { + setTitle("Schack"); setAlwaysOnTop(true); - setBackground(Color.black); - + setResizable(false); + setContentPane(new Board()); + pack(); setVisible(true); - } - - private void drawSquares(Graphics g){ - + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + } - public static void main(String[] args) - { + public static void main(String[] args) { new Schack(); }