Loading jeuAssemblage/build.xml +4 −0 Changes for jeuAssemblage/build.xml: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -80,4 +80,8 @@ <target name="run" depends="dist"> <java jar="${dist.home}/${app.fullname}.jar" fork="true"/> </target> <!-- ==================== runWithoutComp Target ================================== --> <target name="runWithoutComp"> <java jar="${dist.home}/${app.fullname}.jar" fork="true"/> </target> </project> No newline at end of file jeuAssemblage/lib/pieces_puzzle-0.1.0.jar +276 B (5.56 KiB) File changed.No diff preview for this file type. View original file View changed file jeuAssemblage/src/view/component/GamePanel.java +0 −2 Changes for jeuAssemblage/src/view/component/GamePanel.java: 0 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -10,8 +10,6 @@ import view.component.board.PieceBoard; import view.utils.SwingUtils; import java.awt.Graphics; import java.awt.BorderLayout; public class GamePanel extends JPanel { Loading jeuAssemblage/src/view/component/GameSummary.java +16 −16 Changes for jeuAssemblage/src/view/component/GameSummary.java: 16 added lines, 16 removed lines. Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class GameSummary extends JPanel { int xEnd = areaInformation[2]; int yEnd = areaInformation[3]; double componentSize = Math.min( int componentSize = (int) Math.min( getHeightTimesPourcent(this, 0.95f) / ((yEnd - yBegin) * 1d), getWidthTimesPourcent(this, 0.95f) / ((xEnd - xBegin) * 1d) ); Loading @@ -48,36 +48,36 @@ public class GameSummary extends JPanel { double paddingWidth = this.getWidth () - (componentSize * ((xEnd - xBegin) * 1d)); double paddingHeight = this.getHeight() - (componentSize * ((yEnd - yBegin) * 1d)); //TODO METTRE A JOUR LA METHODE Graphics2D g2d = (Graphics2D) g; g2d.setColor(Color.WHITE); int[][] matrices = this.controller.getPlayBoard(); ArrayList<Piece> alreadyDraw = new ArrayList<Piece>(); for ( int i = yBegin; i < yEnd; i++) { double y = (i - yBegin) * componentSize + paddingHeight/2; int y = (i - yBegin) * componentSize + (int) paddingHeight / 2; for ( int j = xBegin; j < xEnd; j++) { double x = (j - xBegin) * componentSize + paddingWidth/2; int x = (j - xBegin) * componentSize + (int) paddingWidth / 2; Rectangle2D shape = new Rectangle2D.Double(x,y, componentSize, componentSize); if (matrices[i][j] != 0) { Piece p = this.controller.getPieceById(matrices[i][j]); if (!alreadyDraw.contains(p)) { // TODO rotate the image if needed Image img = this.controller.getImageById(p.getInstanceId()); g2d.drawImage(img, (int) Math.ceil(x), (int) Math.ceil(y), (int) Math.floor(componentSize * 3), (int) Math.floor(componentSize * 3), null); Image img = this.controller.getImageById(p.getInstanceId()); alreadyDraw.add(p); g2d.drawImage( img, x + 1, y + 1, componentSize, componentSize, null ); } } else { else { g2d.draw(shape); } } Loading jeuAssemblage/src/view/component/board/Grid.java +2 −2 Changes for jeuAssemblage/src/view/component/board/Grid.java: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -63,11 +63,11 @@ public class Grid extends JPanel { for ( int i = 0; i < matrices.length; i++) { int y = i * (int) componentSize + (int) paddingHeight / 2; int y = i * componentSize + (int) paddingHeight / 2; for ( int j = 0; j < matrices[i].length; j++) { int x = j * (int) componentSize + (int) paddingWidth / 2; int x = j * componentSize + (int) paddingWidth / 2; Rectangle2D shape = new Rectangle2D.Double(x,y, componentSize, componentSize); if (matrices[i][j] != 0) { Loading Loading
jeuAssemblage/build.xml +4 −0 Changes for jeuAssemblage/build.xml: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -80,4 +80,8 @@ <target name="run" depends="dist"> <java jar="${dist.home}/${app.fullname}.jar" fork="true"/> </target> <!-- ==================== runWithoutComp Target ================================== --> <target name="runWithoutComp"> <java jar="${dist.home}/${app.fullname}.jar" fork="true"/> </target> </project> No newline at end of file
jeuAssemblage/lib/pieces_puzzle-0.1.0.jar +276 B (5.56 KiB) File changed.No diff preview for this file type. View original file View changed file
jeuAssemblage/src/view/component/GamePanel.java +0 −2 Changes for jeuAssemblage/src/view/component/GamePanel.java: 0 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -10,8 +10,6 @@ import view.component.board.PieceBoard; import view.utils.SwingUtils; import java.awt.Graphics; import java.awt.BorderLayout; public class GamePanel extends JPanel { Loading
jeuAssemblage/src/view/component/GameSummary.java +16 −16 Changes for jeuAssemblage/src/view/component/GameSummary.java: 16 added lines, 16 removed lines. Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class GameSummary extends JPanel { int xEnd = areaInformation[2]; int yEnd = areaInformation[3]; double componentSize = Math.min( int componentSize = (int) Math.min( getHeightTimesPourcent(this, 0.95f) / ((yEnd - yBegin) * 1d), getWidthTimesPourcent(this, 0.95f) / ((xEnd - xBegin) * 1d) ); Loading @@ -48,36 +48,36 @@ public class GameSummary extends JPanel { double paddingWidth = this.getWidth () - (componentSize * ((xEnd - xBegin) * 1d)); double paddingHeight = this.getHeight() - (componentSize * ((yEnd - yBegin) * 1d)); //TODO METTRE A JOUR LA METHODE Graphics2D g2d = (Graphics2D) g; g2d.setColor(Color.WHITE); int[][] matrices = this.controller.getPlayBoard(); ArrayList<Piece> alreadyDraw = new ArrayList<Piece>(); for ( int i = yBegin; i < yEnd; i++) { double y = (i - yBegin) * componentSize + paddingHeight/2; int y = (i - yBegin) * componentSize + (int) paddingHeight / 2; for ( int j = xBegin; j < xEnd; j++) { double x = (j - xBegin) * componentSize + paddingWidth/2; int x = (j - xBegin) * componentSize + (int) paddingWidth / 2; Rectangle2D shape = new Rectangle2D.Double(x,y, componentSize, componentSize); if (matrices[i][j] != 0) { Piece p = this.controller.getPieceById(matrices[i][j]); if (!alreadyDraw.contains(p)) { // TODO rotate the image if needed Image img = this.controller.getImageById(p.getInstanceId()); g2d.drawImage(img, (int) Math.ceil(x), (int) Math.ceil(y), (int) Math.floor(componentSize * 3), (int) Math.floor(componentSize * 3), null); Image img = this.controller.getImageById(p.getInstanceId()); alreadyDraw.add(p); g2d.drawImage( img, x + 1, y + 1, componentSize, componentSize, null ); } } else { else { g2d.draw(shape); } } Loading
jeuAssemblage/src/view/component/board/Grid.java +2 −2 Changes for jeuAssemblage/src/view/component/board/Grid.java: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -63,11 +63,11 @@ public class Grid extends JPanel { for ( int i = 0; i < matrices.length; i++) { int y = i * (int) componentSize + (int) paddingHeight / 2; int y = i * componentSize + (int) paddingHeight / 2; for ( int j = 0; j < matrices[i].length; j++) { int x = j * (int) componentSize + (int) paddingWidth / 2; int x = j * componentSize + (int) paddingWidth / 2; Rectangle2D shape = new Rectangle2D.Double(x,y, componentSize, componentSize); if (matrices[i][j] != 0) { Loading