Skip to content

Commit

Permalink
Merge branch 'jnlp'
Browse files Browse the repository at this point in the history
  • Loading branch information
CHeuberger committed May 1, 2021
2 parents 91a3b02 + d67994b commit 7f345d1
Show file tree
Hide file tree
Showing 33 changed files with 345 additions and 121 deletions.
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" output="build/jnlp/JNLP-INF" path="src/jnlp"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.orig

*.csr
*.cer
*.jks

/build/
Expand Down
7 changes: 7 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>src/jnlp/JNLP-INF/APPLICATION.JNLP</name>
<type>1</type>
<location>C:/CFH/eclipse/Puzzle/src/puzzle.jnlp</location>
</link>
</linkedResources>
</projectDescription>
28 changes: 15 additions & 13 deletions Puzzle Test ARG.launch
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Puzzle/src/java/cfh/puzzle/Test.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="cfh.puzzle.Test"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${string_prompt}"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Puzzle"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Puzzle/src/java/cfh/puzzle/Test.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="cfh.puzzle.Test"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${string_prompt}"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Puzzle"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-splash:cfh/puzzle/resources/splash.png"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:Puzzle/build/classes}"/>
</launchConfiguration>
26 changes: 14 additions & 12 deletions Puzzle Test.launch
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Puzzle/src/java/cfh/puzzle/Test.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="cfh.puzzle.Test"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Puzzle"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Puzzle/src/java/cfh/puzzle/Test.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="cfh.puzzle.Test"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Puzzle"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-splash:cfh/puzzle/resources/splash.png"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:Puzzle/build/classes}"/>
</launchConfiguration>
54 changes: 23 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
# Puzzle

![splash](src/pics/splash.png)

My jigsaw puzzle

Just for doing some tests... work in progress.
Work in progress.

*use at your own risk - no warranties!*

## Instructions

Open an image file to create a new puzzle
or
open a previously saved puzzle to continue playing.

*Note:* puzzles are **not saved** automatically!

#### Moving Pieces

* Use the `LEFT` button to drag and drop pieces.
If a piece is dropped near the correct neighbour(s), the pieces will snap together.
* Hold the `CTRL` Key and click on a connected piece to disconnect it.
* Use the scroll wheel or double-click (`LEFT` or `RIGHT` button) to rotate the piece(s) under the cursor.

#### General
### Version

* `RIGHT` click background to open menu.
* Use `LEFT` button on background to drag the whole surface.
* `CTRL`-digit or `CTRL`-letter to save current surface position under that key.
The corresponding digit or letter, without `CTRL`, to move to the corresponding saved position.
* `BACKSPACE` to move back to last position.
- append to JAR file in `docs/puzzle_V<version>.jar`
- `dist/puzzle.jar` ?
- adjust `jar` entry in `src/puzzle.jnlp`
copy to `docs/`
- adjust `Implementation-Version` in `src/manifest.txt`
- adjust in `docs/index.md`

#### Marking
### Java Web Start

Marked (selected) pieces can be rearranged by selecting the `Arrange` menu point. If no pieces are marked, all pieces will be rearranged. Connected pieces are never rearranged. The pieces will be arranged horizontally starting at the current location, or vertically if the `CTRL` key is pressed when the menu is selected.
- `puzzle.jnlp` is available in `src/`
copy to `docs/`

* Pieces can be marked (selected) and unmarked by `SHIFT-LEFT`-clicking on them.
* Use `SHIFT-SPACE` to unmark all pieces.
### Pictures

#### Selection Group
Originals are available under `src/pics/` as Gimp files.

Pieces can be grouped together in Selection Groups named by a digit or letter. Activating such group will mark the pieces of that group. While the group is active, marking/unmarking a piece will add/remove that piece from that group.
- `icon.png`
scaled to 32x32
copy to `docs/` and `src/java/cfh/puzzle/resources`
- `splash.png`
scaled to 640x320
copy to `docs/` and `src/java/cfh/puzzle/resources`
- `social.png`
used as Social Preview on GitHub

- `SHIFT`-digit or `SHIFT`-letter to activate Selection Group.
- `SHIFT`-`SPACE` to deactivate any group and unmark all pieces.
- `CTRL`-`SHIFT`-digit or `CTRL`-`SHIFT`-letter to save the actually marked pieces to a Selection Group.

#### Background

Selecting the `Background` menu option, a background image can be loaded. A color can be chosen, by entering `color` as file name.
2 changes: 1 addition & 1 deletion dist/bus.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@java -jar puzzle.jar bus.jpg 150x60
@start javaw -jar puzzle.jar bus.jpg 150x60
2 changes: 1 addition & 1 deletion dist/edtq.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@java -jar puzzle.jar edtq.jpg 150x65
@start javaw -jar puzzle.jar edtq.jpg 150x65
2 changes: 1 addition & 1 deletion dist/kirche.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@java -jar puzzle.jar kirche.jpg 200x60
@start javaw -jar puzzle.jar kirche.jpg 200x60
2 changes: 2 additions & 0 deletions dist/prompt.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@set /p image=Image address:
@start javaw -jar puzzle.jar %image%
Binary file modified dist/puzzle.jar
Binary file not shown.
Binary file added docs/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 81 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,81 @@
coming *soon*, check main [README](https://github.com/Heuberger/Puzzle/) for now
# Jigaw Puzzle Game

![splash](splash.png)

*use at your own risk - no warranties!* v0.07



## Running

There are basically two ways to execute the game:

1. `Java Web Start` - a bit complicated but includes automatic updates, desktop shortcut
2. `local` - just no updates or desktop shortcut, but easy



### Java Web Start

Select: [puzzle.jnlp](puzzle.jnlp)

This should start the application, if Java Web Start is working correctly;
otherwise the file is downloaded and must be started by double-click.

Java security needs the installation of 2 certificates to validate the download: if needed, download [here](https://cheuberger.github.io/keys/).



### Java (WIP)

Download the whole content from the `dist` folder. Start any batch file (e.g. `bus.bat`) or just start (double-click) `puzzle.jar` (command line `java -jar puzzle.jar`).



## Requirements

Java 8 (`JRE8`) must be installed. Version `8u202` is recommended, license of newer versions have changed - please check it yourself! Old versions can be found at [Java Archive](https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html).



## How to Play

Open an image file to create a new puzzle
or
open a previously saved puzzle to continue playing.

*Note:* puzzles are **not saved** automatically!

#### Moving Pieces

* Use the `LEFT` button to drag and drop pieces.
If a piece is dropped near the correct neighbour(s), the pieces will snap together.
* Hold the `CTRL` Key and click on a connected piece to disconnect it.
* Use the scroll wheel or double-click (`LEFT` or `RIGHT` button) to rotate the piece(s) under the cursor.

#### General

* `RIGHT` click background to open menu.
* Use `LEFT` button on background to drag the whole surface.
* `CTRL`-digit or `CTRL`-letter to save current surface position under that key.
The corresponding digit or letter, without `CTRL`, to move to the corresponding saved position.
* `BACKSPACE` to move back to last position.

#### Marking

Marked (selected) pieces can be rearranged by selecting the `Arrange` menu point. If no pieces are marked and no selection group is active, all pieces will be rearranged. Connected pieces are never rearranged. The pieces will be arranged horizontally starting at the current location, or vertically if the `CTRL` key is pressed when the menu is selected.

* Pieces can be marked (selected) and unmarked by `SHIFT-LEFT`-clicking on them.
* Use `SHIFT-SPACE` to unmark all pieces.

#### Selection Group

Pieces can be grouped together in Selection Groups named by a digit or letter. Activating such group will mark the pieces of that group. While the group is active, marking/unmarking a piece will add/remove that piece from that group.

- `SHIFT`-digit or `SHIFT`-letter to activate Selection Group.
- `SHIFT`-`SPACE` to deactivate any group and unmark all pieces.
- `CTRL`-`SHIFT`-digit or `CTRL`-`SHIFT`-letter to save the actually marked pieces to a Selection Group.

#### Background

A background image can be loaded selecting the `Background` menu option. A color can be chosen instead of an image by entering `color` as file name.
Binary file added docs/puzzle.jar
Binary file not shown.
39 changes: 39 additions & 0 deletions docs/puzzle.jnlp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<jnlp
spec="1.0+"
codebase="https://heuberger.github.io/Puzzle/"
href="puzzle.jnlp"
version="0.07">
<information>
<title>Jigsaw Puzzle</title>
<vendor>Carlos F. Heuberger</vendor>
<homepage href="https://heuberger.github.io/Puzzle/"/>
<description>Jigsaw Puzzle Game</description>
<description kind="short">An application to create and play Jigsaw puzzles.</description>
<icon href="icon.png"/>
<icon kind="splash" href="splash.png"/>
<offline-allowed/>
<shortcut online="true" install="true">
<desktop/>
<menu/>
</shortcut>
</information>

<update check="timeout" policy="prompt-update"/>

<security>
<all-permissions/>
</security>

<resources>
<!-- Application Resources -->
<j2se version="1.8+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="puzzle.jar"/>
</resources>

<application-desc
name="Jigsaw Puzzle"
main-class="cfh.puzzle.Test">
</application-desc>
</jnlp>
Binary file added docs/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion puzzle.jardesc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc>
<jar path="Puzzle/dist/puzzle.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/Puzzle/puzzle.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
Expand All @@ -12,5 +12,6 @@
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false">
<javaElement handleIdentifier="=Puzzle/src\/java"/>
<javaElement handleIdentifier="=Puzzle/src\/jnlp"/>
</selectedElements>
</jardesc>
10 changes: 10 additions & 0 deletions src/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if [ "$PASS_S" = "" ]
then
echo Please set PASS_S
return
fi

ALIAS_S=cfhsi
JKS_S=~/.jks/$ALIAS_S.jks
TIMESTAMP="-tsa http://timestamp.digicert.com"
# TIMESTAMP=
Loading

0 comments on commit 7f345d1

Please sign in to comment.