Compare commits
	
		
			17 Commits
		
	
	
		
			1.0.1
			...
			2827d79556
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						2827d79556
	
				 | 
					
					
						|||
| 
						 | 
					367ad5921a | ||
| 
						 | 
					fd82088a08 | ||
| 
						
						
							
						
						8e836b1183
	
				 | 
					
					
						|||
| 
						
						
							
						
						44125ce13a
	
				 | 
					
					
						|||
| 
						
						
							
						
						76b44d22cf
	
				 | 
					
					
						|||
| 
						
						
							
						
						d19f9899cf
	
				 | 
					
					
						|||
| 
						 | 
					7e536cf644 | ||
| 
						 | 
					f5c63f9401 | ||
| c72efa8b44 | |||
| 07ab0b898f | |||
| ffaa310dbe | |||
| 7323fa8fb8 | |||
| 543d868bef | |||
| 223a92910e | |||
| 
						 | 
					d25cd93736 | ||
| 
						 | 
					d5fc28d743 | 
							
								
								
									
										34
									
								
								.github/workflows/maven-publish.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								.github/workflows/maven-publish.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,34 +0,0 @@
 | 
			
		||||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
 | 
			
		||||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
 | 
			
		||||
 | 
			
		||||
name: Maven Package
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  release:
 | 
			
		||||
    types: [created]
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    permissions:
 | 
			
		||||
      contents: read
 | 
			
		||||
      packages: write
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@v4
 | 
			
		||||
    - name: Set up JDK 21
 | 
			
		||||
      uses: actions/setup-java@v3
 | 
			
		||||
      with:
 | 
			
		||||
        java-version: '21'
 | 
			
		||||
        distribution: 'temurin'
 | 
			
		||||
        server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
 | 
			
		||||
        settings-path: ${{ github.workspace }} # location for the settings.xml file
 | 
			
		||||
 | 
			
		||||
    - name: Build with Maven
 | 
			
		||||
      run: mvn -B package --file pom.xml
 | 
			
		||||
 | 
			
		||||
    - name: Publish to GitHub Packages Apache Maven
 | 
			
		||||
      run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
 | 
			
		||||
      env:
 | 
			
		||||
        GITHUB_TOKEN: ${{ github.token }}
 | 
			
		||||
							
								
								
									
										7
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -41,4 +41,9 @@ bin/
 | 
			
		||||
### Mac OS ###
 | 
			
		||||
.DS_Store
 | 
			
		||||
.idea
 | 
			
		||||
lib
 | 
			
		||||
lib
 | 
			
		||||
target
 | 
			
		||||
.mvn
 | 
			
		||||
src/main/resources/META-INF
 | 
			
		||||
mvnw
 | 
			
		||||
mvnw.cmd
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								.idea/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.idea/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,8 +0,0 @@
 | 
			
		||||
# Default ignored files
 | 
			
		||||
/shelf/
 | 
			
		||||
/workspace.xml
 | 
			
		||||
# Editor-based HTTP Client requests
 | 
			
		||||
/httpRequests/
 | 
			
		||||
# Datasource local storage ignored files
 | 
			
		||||
/dataSources/
 | 
			
		||||
/dataSources.local.xml
 | 
			
		||||
							
								
								
									
										15
									
								
								.idea/checkstyle-idea.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										15
									
								
								.idea/checkstyle-idea.xml
									
									
									
										generated
									
									
									
								
							@@ -1,15 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="CheckStyle-IDEA" serialisationVersion="2">
 | 
			
		||||
    <checkstyleVersion>10.15.0</checkstyleVersion>
 | 
			
		||||
    <scanScope>JavaOnly</scanScope>
 | 
			
		||||
    <option name="thirdPartyClasspath" />
 | 
			
		||||
    <option name="activeLocationIds" />
 | 
			
		||||
    <option name="locations">
 | 
			
		||||
      <list>
 | 
			
		||||
        <ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
 | 
			
		||||
        <ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
 | 
			
		||||
      </list>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										16
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										16
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							@@ -1,16 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="GradleMigrationSettings" migrationVersion="1" />
 | 
			
		||||
  <component name="GradleSettings">
 | 
			
		||||
    <option name="linkedExternalProjectsSettings">
 | 
			
		||||
      <GradleProjectSettings>
 | 
			
		||||
        <option name="externalProjectPath" value="$PROJECT_DIR$" />
 | 
			
		||||
        <option name="modules">
 | 
			
		||||
          <set>
 | 
			
		||||
            <option value="$PROJECT_DIR$" />
 | 
			
		||||
          </set>
 | 
			
		||||
        </option>
 | 
			
		||||
      </GradleProjectSettings>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										204
									
								
								.idea/intellij-javadocs-4.0.1.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										204
									
								
								.idea/intellij-javadocs-4.0.1.xml
									
									
									
										generated
									
									
									
								
							@@ -1,204 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="JavaDocConfiguration">
 | 
			
		||||
    <GENERAL>
 | 
			
		||||
      <MODE>UPDATE</MODE>
 | 
			
		||||
      <OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
 | 
			
		||||
      <SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
 | 
			
		||||
      <LEVELS>
 | 
			
		||||
        <LEVEL>METHOD</LEVEL>
 | 
			
		||||
        <LEVEL>TYPE</LEVEL>
 | 
			
		||||
        <LEVEL>FIELD</LEVEL>
 | 
			
		||||
      </LEVELS>
 | 
			
		||||
      <VISIBILITIES>
 | 
			
		||||
        <VISIBILITY>DEFAULT</VISIBILITY>
 | 
			
		||||
        <VISIBILITY>PROTECTED</VISIBILITY>
 | 
			
		||||
        <VISIBILITY>PUBLIC</VISIBILITY>
 | 
			
		||||
      </VISIBILITIES>
 | 
			
		||||
    </GENERAL>
 | 
			
		||||
    <TEMPLATES>
 | 
			
		||||
      <CLASSES>
 | 
			
		||||
        <CLASS>
 | 
			
		||||
          <KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * The interface ${name}.\n
 | 
			
		||||
<#if element.typeParameters?has_content>        * \n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.typeParameters as typeParameter>
 | 
			
		||||
        * @param <${typeParameter.name}> the type parameter\n
 | 
			
		||||
</#list>
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </CLASS>
 | 
			
		||||
        <CLASS>
 | 
			
		||||
          <KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * The enum ${name}.\n
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </CLASS>
 | 
			
		||||
        <CLASS>
 | 
			
		||||
          <KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * The type ${name}.\n
 | 
			
		||||
<#if element.typeParameters?has_content>        * \n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.typeParameters as typeParameter>
 | 
			
		||||
        * @param <${typeParameter.name}> the type parameter\n
 | 
			
		||||
</#list>
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </CLASS>
 | 
			
		||||
        <CLASS>
 | 
			
		||||
          <KEY>.+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * The type ${name}.\n
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </CLASS>
 | 
			
		||||
      </CLASSES>
 | 
			
		||||
      <CONSTRUCTORS>
 | 
			
		||||
        <CONSTRUCTOR>
 | 
			
		||||
          <KEY>.+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * Instantiates a new ${name}.\n
 | 
			
		||||
<#if element.parameterList.parameters?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.parameterList.parameters as parameter>
 | 
			
		||||
         * @param ${parameter.name} the ${paramNames[parameter.name]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
<#if element.throwsList.referenceElements?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.throwsList.referenceElements as exception>
 | 
			
		||||
         * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </CONSTRUCTOR>
 | 
			
		||||
      </CONSTRUCTORS>
 | 
			
		||||
      <METHODS>
 | 
			
		||||
        <METHOD>
 | 
			
		||||
          <KEY>^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * Gets ${partName}.\n
 | 
			
		||||
<#if element.typeParameters?has_content>         * \n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.typeParameters as typeParameter>
 | 
			
		||||
         * @param <${typeParameter.name}> the type parameter\n
 | 
			
		||||
</#list>
 | 
			
		||||
<#if element.parameterList.parameters?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.parameterList.parameters as parameter>
 | 
			
		||||
         * @param ${parameter.name} the ${paramNames[parameter.name]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
<#if isNotVoid>
 | 
			
		||||
         *\n
 | 
			
		||||
         * @return the ${partName}\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#if element.throwsList.referenceElements?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.throwsList.referenceElements as exception>
 | 
			
		||||
         * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </METHOD>
 | 
			
		||||
        <METHOD>
 | 
			
		||||
          <KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * Sets ${partName}.\n
 | 
			
		||||
<#if element.typeParameters?has_content>         * \n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.typeParameters as typeParameter>
 | 
			
		||||
         * @param <${typeParameter.name}> the type parameter\n
 | 
			
		||||
</#list>
 | 
			
		||||
<#if element.parameterList.parameters?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.parameterList.parameters as parameter>
 | 
			
		||||
         * @param ${parameter.name} the ${paramNames[parameter.name]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
<#if isNotVoid>
 | 
			
		||||
         *\n
 | 
			
		||||
         * @return the ${partName}\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#if element.throwsList.referenceElements?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.throwsList.referenceElements as exception>
 | 
			
		||||
         * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </METHOD>
 | 
			
		||||
        <METHOD>
 | 
			
		||||
          <KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * The entry point of application.\n
 | 
			
		||||
 | 
			
		||||
     <#if element.parameterList.parameters?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
     * @param ${element.parameterList.parameters[0].name} the input arguments\n
 | 
			
		||||
<#if element.throwsList.referenceElements?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.throwsList.referenceElements as exception>
 | 
			
		||||
         * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </METHOD>
 | 
			
		||||
        <METHOD>
 | 
			
		||||
          <KEY>.+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * ${name}<#if isNotVoid> ${return}</#if>.\n
 | 
			
		||||
<#if element.typeParameters?has_content>         * \n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.typeParameters as typeParameter>
 | 
			
		||||
         * @param <${typeParameter.name}> the type parameter\n
 | 
			
		||||
</#list>
 | 
			
		||||
<#if element.parameterList.parameters?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.parameterList.parameters as parameter>
 | 
			
		||||
         * @param ${parameter.name} the ${paramNames[parameter.name]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
<#if isNotVoid>
 | 
			
		||||
         *\n
 | 
			
		||||
         * @return the ${return}\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#if element.throwsList.referenceElements?has_content>
 | 
			
		||||
         *\n
 | 
			
		||||
</#if>
 | 
			
		||||
<#list element.throwsList.referenceElements as exception>
 | 
			
		||||
         * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
 | 
			
		||||
</#list>
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </METHOD>
 | 
			
		||||
      </METHODS>
 | 
			
		||||
      <FIELDS>
 | 
			
		||||
        <FIELD>
 | 
			
		||||
          <KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
 * The constant ${element.getName()}.\n
 | 
			
		||||
 */</VALUE>
 | 
			
		||||
        </FIELD>
 | 
			
		||||
        <FIELD>
 | 
			
		||||
          <KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
    <#if element.parent.isInterface()>
 | 
			
		||||
        * The constant ${element.getName()}.\n
 | 
			
		||||
<#else>
 | 
			
		||||
        * The ${name}.\n
 | 
			
		||||
</#if> */</VALUE>
 | 
			
		||||
        </FIELD>
 | 
			
		||||
        <FIELD>
 | 
			
		||||
          <KEY>.+</KEY>
 | 
			
		||||
          <VALUE>/**\n
 | 
			
		||||
    <#if element.parent.isEnum()>
 | 
			
		||||
        *${name} ${typeName}.\n
 | 
			
		||||
<#else>
 | 
			
		||||
        * The ${name}.\n
 | 
			
		||||
</#if>*/</VALUE>
 | 
			
		||||
        </FIELD>
 | 
			
		||||
      </FIELDS>
 | 
			
		||||
    </TEMPLATES>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										17
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										17
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							@@ -1,17 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="ExternalStorageConfigurationManager" enabled="true" />
 | 
			
		||||
  <component name="FrameworkDetectionExcludesConfiguration">
 | 
			
		||||
    <file type="web" url="file://$PROJECT_DIR$" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="MavenProjectsManager">
 | 
			
		||||
    <option name="originalFiles">
 | 
			
		||||
      <list>
 | 
			
		||||
        <option value="$PROJECT_DIR$/pom.xml" />
 | 
			
		||||
      </list>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
 | 
			
		||||
    <output url="file://$PROJECT_DIR$/out" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										124
									
								
								.idea/uiDesigner.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										124
									
								
								.idea/uiDesigner.xml
									
									
									
										generated
									
									
									
								
							@@ -1,124 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="Palette2">
 | 
			
		||||
    <group name="Swing">
 | 
			
		||||
      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
 | 
			
		||||
        <initial-values>
 | 
			
		||||
          <property name="text" value="Button" />
 | 
			
		||||
        </initial-values>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
 | 
			
		||||
        <initial-values>
 | 
			
		||||
          <property name="text" value="RadioButton" />
 | 
			
		||||
        </initial-values>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
 | 
			
		||||
        <initial-values>
 | 
			
		||||
          <property name="text" value="CheckBox" />
 | 
			
		||||
        </initial-values>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
 | 
			
		||||
        <initial-values>
 | 
			
		||||
          <property name="text" value="Label" />
 | 
			
		||||
        </initial-values>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
 | 
			
		||||
          <preferred-size width="150" height="-1" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
 | 
			
		||||
          <preferred-size width="150" height="-1" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
 | 
			
		||||
          <preferred-size width="150" height="-1" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="150" height="50" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="150" height="50" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="150" height="50" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="150" height="50" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="150" height="50" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="150" height="50" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="200" height="200" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
 | 
			
		||||
          <preferred-size width="200" height="200" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
 | 
			
		||||
          <preferred-size width="-1" height="20" />
 | 
			
		||||
        </default-constraints>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
 | 
			
		||||
      </item>
 | 
			
		||||
      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
 | 
			
		||||
        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
 | 
			
		||||
      </item>
 | 
			
		||||
    </group>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										6
									
								
								.idea/vcs.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.idea/vcs.xml
									
									
									
										generated
									
									
									
								
							@@ -1,6 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="VcsDirectoryMappings">
 | 
			
		||||
    <mapping directory="" vcs="Git" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										37
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								README.md
									
									
									
									
									
								
							@@ -1 +1,36 @@
 | 
			
		||||
[](https://github.com/shrapnelnet/libremines/actions/workflows/maven-publish.yml)
 | 
			
		||||
# Libremines
 | 
			
		||||
 | 
			
		||||
"named this way because i didn't realise there was another libremines!"
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Building
 | 
			
		||||
 | 
			
		||||
### Requirements:
 | 
			
		||||
- Java 21 or newer (openjdk-21-jdk)
 | 
			
		||||
- Maven 3.8.8 (note: some versions cause gluon to freak out)
 | 
			
		||||
- GraalVM 21
 | 
			
		||||
 | 
			
		||||
### Instructions:
 | 
			
		||||
 | 
			
		||||
Create the maven wrapper. gluonfx does not like versions of maven that are not 3.8.8:
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
mvn wrapper:wrapper -Dmaven=3.8.8
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
This is helpful for version management, in case you have an incompatible version of maven installed.
 | 
			
		||||
Install dependencies:
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
./mvnw install
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Build and run:
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
GRAALVM_HOME=/path/to/graalvm ./mvnw gluonfx:build
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
A native binary should be placed at `target/gluonfx/<your architecture>/libremines`
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								pom.xml
									
									
									
									
									
								
							@@ -13,6 +13,14 @@
 | 
			
		||||
        <maven.compiler.target>21</maven.compiler.target>
 | 
			
		||||
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
    </properties>
 | 
			
		||||
    <profiles>
 | 
			
		||||
        <profile>
 | 
			
		||||
            <id>web</id>
 | 
			
		||||
            <properties>
 | 
			
		||||
                <gluonfx.target>web</gluonfx.target>
 | 
			
		||||
            </properties>
 | 
			
		||||
        </profile>
 | 
			
		||||
    </profiles>
 | 
			
		||||
    <dependencies>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.openjfx</groupId>
 | 
			
		||||
@@ -46,6 +54,9 @@
 | 
			
		||||
                <version>1.0.22</version>
 | 
			
		||||
                <configuration>
 | 
			
		||||
                    <mainClass>com.shr4pnel.minesweeper.Main</mainClass>
 | 
			
		||||
                    <reflectionList>
 | 
			
		||||
                        com.shr4pnel.minesweeper.Controller
 | 
			
		||||
                    </reflectionList>
 | 
			
		||||
                </configuration>
 | 
			
		||||
            </plugin>
 | 
			
		||||
            <plugin>
 | 
			
		||||
 
 | 
			
		||||
@@ -3,9 +3,12 @@ package com.shr4pnel.minesweeper;
 | 
			
		||||
import java.net.URL;
 | 
			
		||||
import java.util.Timer;
 | 
			
		||||
import java.util.TimerTask;
 | 
			
		||||
 | 
			
		||||
import javafx.event.ActionEvent;
 | 
			
		||||
import javafx.fxml.FXML;
 | 
			
		||||
import javafx.scene.Node;
 | 
			
		||||
import javafx.scene.control.Button;
 | 
			
		||||
import javafx.scene.control.RadioMenuItem;
 | 
			
		||||
import javafx.scene.image.Image;
 | 
			
		||||
import javafx.scene.image.ImageView;
 | 
			
		||||
import javafx.scene.input.MouseButton;
 | 
			
		||||
@@ -19,6 +22,9 @@ public class Controller {
 | 
			
		||||
    @FXML
 | 
			
		||||
    private ImageView smiley, time_1, time_2, time_3, bomb_2, bomb_3;
 | 
			
		||||
 | 
			
		||||
    @FXML
 | 
			
		||||
    private RadioMenuItem color, marks;
 | 
			
		||||
 | 
			
		||||
    private Grid gridHandler;
 | 
			
		||||
    private GridWrapper wrapper;
 | 
			
		||||
    private boolean gameOver = false;
 | 
			
		||||
@@ -28,14 +34,20 @@ public class Controller {
 | 
			
		||||
    private long startTime;
 | 
			
		||||
    private int bombCount = 99;
 | 
			
		||||
    private boolean[][] expandedTiles;
 | 
			
		||||
    private boolean isFirstClick = true;
 | 
			
		||||
 | 
			
		||||
    @FXML
 | 
			
		||||
    private void initialize() {
 | 
			
		||||
        setNotYetImplemented(color);
 | 
			
		||||
        setNotYetImplemented(marks);
 | 
			
		||||
        setupGrid();
 | 
			
		||||
        gridHandler = new Grid();
 | 
			
		||||
        wrapper = gridHandler.grid;
 | 
			
		||||
        expandedTiles = new boolean[30][16];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void setNotYetImplemented(RadioMenuItem node) {
 | 
			
		||||
        node.setOnAction((ActionEvent e) -> System.out.println("https://http.cat/images/501.jpg"));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void setupGrid() {
 | 
			
		||||
@@ -49,15 +61,29 @@ public class Controller {
 | 
			
		||||
 | 
			
		||||
    private Button createBlankButton() {
 | 
			
		||||
        Image blank =
 | 
			
		||||
            new Image(String.valueOf(getClass().getResource("img/blank.png")), 16, 16, true, true);
 | 
			
		||||
                new Image(String.valueOf(getClass().getResource("img/blank.png")), 16, 16, true, true);
 | 
			
		||||
        ImageView blankImage = new ImageView(blank);
 | 
			
		||||
        Button blankButton = new Button();
 | 
			
		||||
        blankButton.setGraphic(blankImage);
 | 
			
		||||
        blankButton.setMinSize(16, 16);
 | 
			
		||||
        blankButton.setOnMouseClicked(this::buttonClicked);
 | 
			
		||||
        blankButton.setOnMousePressed(this::mouseHeld);
 | 
			
		||||
        blankButton.setOnMouseReleased(this::mouseReleased);
 | 
			
		||||
        return blankButton;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void mouseHeld(MouseEvent mouseEvent) {
 | 
			
		||||
        if (gameOver)
 | 
			
		||||
            return;
 | 
			
		||||
        setImage(smiley, "img/face_ooh.png");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void mouseReleased(MouseEvent mouseEvent) {
 | 
			
		||||
        if (gameOver)
 | 
			
		||||
            return;
 | 
			
		||||
        setImage(smiley, "img/face_smile.png");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void buttonClicked(MouseEvent e) {
 | 
			
		||||
        if (gameOver) {
 | 
			
		||||
            return;
 | 
			
		||||
@@ -81,22 +107,76 @@ public class Controller {
 | 
			
		||||
        handlePrimaryClick(clicked, column, row);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private int[] setBombIfFirstTileIsBomb(int column, int row) {
 | 
			
		||||
        for (int c = 0; c < 30; ++c) {
 | 
			
		||||
            for (int r = 0; r < 16; ++r) {
 | 
			
		||||
                if (!wrapper.atColumn(c).atRow(r).isBomb()) {
 | 
			
		||||
                    wrapper.setBomb();
 | 
			
		||||
                    wrapper.updateGrid(column, row, c, r);
 | 
			
		||||
                    return new int[]{c, r};
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private String getButtonURL(Button button) {
 | 
			
		||||
        ImageView graphic = (ImageView) button.getGraphic();
 | 
			
		||||
        Image image = graphic.getImage();
 | 
			
		||||
        return image.getUrl();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private int numberOfUnrevealedTiles() {
 | 
			
		||||
        int unrevealedTiles = 0;
 | 
			
		||||
        int column, row;
 | 
			
		||||
        for (column = 0; column < 30; ++column) {
 | 
			
		||||
            for (row = 0; row < 16; ++row) {
 | 
			
		||||
                Button current = (Button) getNodeByRowColumnIndex(row, column);
 | 
			
		||||
                assert current != null;
 | 
			
		||||
                String currentURL = getButtonURL(current);
 | 
			
		||||
                if (currentURL.contains("blank.png") || currentURL.contains("flag.png")) {
 | 
			
		||||
                    unrevealedTiles++;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return unrevealedTiles;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private boolean checkWinCondition() {
 | 
			
		||||
        int unrevealedTiles = numberOfUnrevealedTiles();
 | 
			
		||||
        return unrevealedTiles == 99;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void handlePrimaryClick(Button clicked, int column, int row) {
 | 
			
		||||
        if (wrapper.atColumn(column).atRow(row).isBomb()) {
 | 
			
		||||
        if (wrapper.atColumn(column).atRow(row).isBomb() && !isFirstClick) {
 | 
			
		||||
            gameOver(clicked);
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        if (wrapper.isBomb() && isFirstClick) {
 | 
			
		||||
            int[] chosenColumnAndRow = setBombIfFirstTileIsBomb(column, row);
 | 
			
		||||
            // assertions are evil but i dont care
 | 
			
		||||
            assert chosenColumnAndRow != null;
 | 
			
		||||
            int columnMovedTo = chosenColumnAndRow[0];
 | 
			
		||||
            int rowMovedTo = chosenColumnAndRow[1];
 | 
			
		||||
            wrapper.atColumn(column).atRow(row).switchBomb(columnMovedTo, rowMovedTo);
 | 
			
		||||
            recursiveExpandTiles(column, row);
 | 
			
		||||
            clicked = (Button) getNodeByRowColumnIndex(row, column);
 | 
			
		||||
        }
 | 
			
		||||
        isFirstClick = false;
 | 
			
		||||
        int adjacentBombs = wrapper.adjacentBombCount();
 | 
			
		||||
        setAdjacentCount(clicked, adjacentBombs);
 | 
			
		||||
        if (adjacentBombs == 0) {
 | 
			
		||||
            recursiveExpandTiles(column, row);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        boolean win = checkWinCondition();
 | 
			
		||||
        if (win) {
 | 
			
		||||
            win();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void recursiveExpandTiles(int column, int row) {
 | 
			
		||||
        if (column < 0 || column >= 30 || row < 0 || row >= 16 ||
 | 
			
		||||
            expandedTiles[column][row] && !wrapper.atColumn(column).atRow(row).isBomb()) {
 | 
			
		||||
                expandedTiles[column][row] && !wrapper.atColumn(column).atRow(row).isBomb()) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        expandTile(column, row);
 | 
			
		||||
@@ -138,6 +218,7 @@ public class Controller {
 | 
			
		||||
 | 
			
		||||
    @FXML
 | 
			
		||||
    private void reinitialize() {
 | 
			
		||||
        gameOver = false;
 | 
			
		||||
        bombCount = 99;
 | 
			
		||||
        updateBombCounter();
 | 
			
		||||
        resetTimer();
 | 
			
		||||
@@ -145,6 +226,7 @@ public class Controller {
 | 
			
		||||
        gridHandler = new Grid();
 | 
			
		||||
        wrapper = gridHandler.grid;
 | 
			
		||||
        expandedTiles = new boolean[30][16];
 | 
			
		||||
        isFirstClick = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void resetTimer() {
 | 
			
		||||
@@ -173,12 +255,34 @@ public class Controller {
 | 
			
		||||
        showAllBombs(GridPane.getColumnIndex(tileClicked), GridPane.getRowIndex(tileClicked));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void win() {
 | 
			
		||||
        gameOver = true;
 | 
			
		||||
        timer.cancel();
 | 
			
		||||
        setImage(smiley, "img/face_win.png");
 | 
			
		||||
        flagAllRemaining();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void flagAllRemaining() {
 | 
			
		||||
        int column, row;
 | 
			
		||||
        for (column = 0; column < 30; ++column) {
 | 
			
		||||
            for (row = 0; row < 16; ++row) {
 | 
			
		||||
                Button current = (Button) getNodeByRowColumnIndex(row, column);
 | 
			
		||||
                assert current != null;
 | 
			
		||||
                String currentURL = getButtonURL(current);
 | 
			
		||||
                boolean tileIsBomb = wrapper.atColumn(column).atRow(row).isBomb();
 | 
			
		||||
                if (currentURL.contains("blank.png") && tileIsBomb) {
 | 
			
		||||
                    setImage(current, "img/bomb_flagged.png");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void flag(Node tileClicked) {
 | 
			
		||||
        Button tileAsButton = (Button) tileClicked;
 | 
			
		||||
        ImageView tileGraphic = (ImageView) tileAsButton.getGraphic();
 | 
			
		||||
        Image tileGraphicImage = tileGraphic.getImage();
 | 
			
		||||
        if (!tileGraphicImage.getUrl().contains("blank.png") &&
 | 
			
		||||
            !tileGraphicImage.getUrl().contains("flagged.png")) {
 | 
			
		||||
                !tileGraphicImage.getUrl().contains("flagged.png")) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        boolean flagged = tileGraphicImage.getUrl().contains("flagged.png");
 | 
			
		||||
@@ -189,7 +293,8 @@ public class Controller {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        bombCount--;
 | 
			
		||||
        updateBombCounter();
 | 
			
		||||
        if (bombCount > 0)
 | 
			
		||||
            updateBombCounter();
 | 
			
		||||
        setImage((Button) tileClicked, "img/bomb_flagged.png");
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
@@ -240,8 +345,8 @@ public class Controller {
 | 
			
		||||
            String buttonURL = ((ImageView) b.getGraphic()).getImage().getUrl();
 | 
			
		||||
            int column = GridPane.getColumnIndex(node);
 | 
			
		||||
            int row = GridPane.getRowIndex(node);
 | 
			
		||||
            if (!(column == clickedColumn && row == clickedRow) &&
 | 
			
		||||
                wrapper.atColumn(column).atRow(row).isBomb()) {
 | 
			
		||||
            // if the tile isn't the one that was clicked AND the tile is a bomb
 | 
			
		||||
            if (!(column == clickedColumn && row == clickedRow) && wrapper.atColumn(column).atRow(row).isBomb()) {
 | 
			
		||||
                setImage((Button) node, "img/bomb_revealed.png");
 | 
			
		||||
            }
 | 
			
		||||
            if (buttonURL.contains("flagged.png") && !wrapper.atColumn(column).atRow(row).isBomb()) {
 | 
			
		||||
@@ -267,7 +372,6 @@ public class Controller {
 | 
			
		||||
 | 
			
		||||
    @FXML
 | 
			
		||||
    private void smileyReleased() {
 | 
			
		||||
        gameOver = false;
 | 
			
		||||
        setImage(smiley, "img/face_smile.png");
 | 
			
		||||
        reinitialize();
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,13 @@ public class GridWrapper {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void switchBomb(int destinationColumn, int destinationRow) {
 | 
			
		||||
        if (isValid(currentColumn, currentRow) && isValid(destinationColumn, destinationRow)) {
 | 
			
		||||
            grid[destinationColumn][destinationRow] = true;
 | 
			
		||||
            grid[currentColumn][currentRow] = false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean isBomb() {
 | 
			
		||||
        return isValid(currentColumn, currentRow) && grid[currentColumn][currentRow];
 | 
			
		||||
    }
 | 
			
		||||
@@ -62,6 +69,11 @@ public class GridWrapper {
 | 
			
		||||
        return count;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void updateGrid(int oldColumn, int oldRow, int newColumn, int newRow) {
 | 
			
		||||
        grid[oldColumn][oldRow] = false;
 | 
			
		||||
        grid[newColumn][newRow] = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private boolean isBombAt(int column, int row) {
 | 
			
		||||
        return isValid(column, row) && grid[column][row];
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								src/main/resources/com/shr4pnel/minesweeper/fix-glow.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/main/resources/com/shr4pnel/minesweeper/fix-glow.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
* {
 | 
			
		||||
    -fx-focus-color: transparent;
 | 
			
		||||
    -fx-faint-focus-color: transparent;
 | 
			
		||||
}
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
<?import javafx.scene.layout.*?>
 | 
			
		||||
<?import javafx.scene.shape.*?>
 | 
			
		||||
 | 
			
		||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="350.0" prefWidth="500.0" style="-fx-border-color: black; -fx-border-width: 1px;" xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.shr4pnel.minesweeper.Controller">
 | 
			
		||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="350.0" prefWidth="500.0" style="-fx-border-color: black; -fx-border-width: 1px;" stylesheets="@fix-glow.css" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.shr4pnel.minesweeper.Controller">
 | 
			
		||||
    <children>
 | 
			
		||||
        <MenuBar style="-fx-background-color: white;">
 | 
			
		||||
            <menus>
 | 
			
		||||
@@ -26,8 +26,8 @@
 | 
			
		||||
                        <RadioMenuItem mnemonicParsing="false" text="Internmediate" toggleGroup="$difficulty" />
 | 
			
		||||
                        <RadioMenuItem mnemonicParsing="false" selected="true" text="Expert" toggleGroup="$difficulty" />
 | 
			
		||||
                        <SeparatorMenuItem mnemonicParsing="false" />
 | 
			
		||||
                        <RadioMenuItem mnemonicParsing="false" selected="true" text="Marks (?)" />
 | 
			
		||||
                        <RadioMenuItem mnemonicParsing="false" selected="true" text="Color" />
 | 
			
		||||
                        <RadioMenuItem fx:id="marks" mnemonicParsing="false" selected="true" text="Marks (?)" />
 | 
			
		||||
                        <RadioMenuItem fx:id="color" mnemonicParsing="false" selected="true" text="Color" />
 | 
			
		||||
                        <SeparatorMenuItem mnemonicParsing="false" />
 | 
			
		||||
                        <MenuItem mnemonicParsing="false" style="-fx-padding-right: 15; -fx-border-insets: 10px; -fx-background-insets: 10px;" text="Best Times..." />
 | 
			
		||||
                        <SeparatorMenuItem mnemonicParsing="false" />
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user