Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
.idea/
.gradle/
.settings
.classpath
# OS generated files
################################################################################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# Others
################################################################################
.gradle
build/
src/main/java/net/rptools/dicetool/dicetool/
/bin/
target/
out/
/releases/
*.log
*~
\${sys:appHome}/
/.idea
57 changes: 48 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,66 @@
buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.26.1"
}
repositories {
mavenCentral()
}
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
//apply plugin: 'findbugs' -- findbugs does not work with java version 9

apply plugin: 'com.diffplug.gradle.spotless'

repositories {
mavenCentral()
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
maven {
url = 'http://maptool.craigs-stuff.net/repo/'
}
mavenCentral()
jcenter()
maven { url = 'http://maptool.craigs-stuff.net/repo/' }
maven { url = 'http://www.nerps.net/repo/' }
maven { url = 'https://jitpack.io' }
}

dependencies {
compile 'net.rptools.rplib:rplib:1.4.1.4'
compile 'net.rptools.dicelib:dicelib:1.4.0.1'
compile group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.3.1'
testCompile 'rhino:js:1.6R2'
testCompile group: 'junit', name: 'junit', version: '4.11'

implementation 'com.thoughtworks.xstream:xstream:1.4.11.1'
implementation 'net.rptools.rplib:rplib:1.4.1.7'
implementation 'com.github.RPTools:parser:1.8.2'
implementation 'com.github.RPTools:dicelib:1.6.6'
}

version='1.4.0'
spotless {
java {
licenseHeaderFile 'spotless.license.java'
// Now using the Google Java style guide
//eclipse().configFile('build-resources/eclipse.prefs.formatter.xml')
googleJavaFormat()
// If you get exceptions thrown by spotlessApply, this might
// help. Enable it here if the problem is with a Java file, and
// below if it is not. Don't leave it enabled, as nothing will
// actually be updated if you do.
// https://github.com/diffplug/spotless/blob/master/PADDEDCELL.md
//paddedCell()
}

format 'misc', {
target '**/*.gradle', '**/.gitignore'

// spotless has built-in rules for most basic formatting tasks
trimTrailingWhitespace()
// or spaces. Takes an integer argument if you don't like 4
indentWithSpaces(4)
//paddedCell()
}
}


version='1.4.1'
project.version = version

install {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sat Mar 04 13:37:30 EST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
24 changes: 24 additions & 0 deletions spotless.license.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* The MIT License
*
* Copyright (c) 2004,2005,2006 David Rice
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
76 changes: 34 additions & 42 deletions src/main/java/net/rptools/dicetool/DiceTool.java
Original file line number Diff line number Diff line change
@@ -1,62 +1,54 @@
/* The MIT License
*
* Copyright (c) 2004,2005 David Rice
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
*
* Copyright (c) 2004,2005,2006 David Rice
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.rptools.dicetool;

import java.awt.Toolkit;
import java.security.SecureRandom;
import java.util.Random;

import javax.swing.UIManager;

import net.rptools.dicetool.ui.MainFrame;
import net.rptools.dicetool.ui.MainFrame;


/**
* @author drice
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
* <p>To change the template for this generated type comment go to Window - Preferences - Java -
* Code Generation - Code and Comments
*/
public class DiceTool {
public static Random RANDOM = new SecureRandom();
public static Random RANDOM = new SecureRandom();

/** @param args the command line arguments */
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("de.muntjak.tinylookandfeel.TinyLookAndFeel");
} catch (Exception e) {
System.err.println("Exception during look and feel setup: " + e);
}

/**
* @param args
* the command line arguments
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("de.muntjak.tinylookandfeel.TinyLookAndFeel");
} catch (Exception e) {
System.err.println("Exception during look and feel setup: " + e);
}
// Draw frame contents on resize
Toolkit.getDefaultToolkit().setDynamicLayout(true);

// Draw frame contents on resize
Toolkit.getDefaultToolkit().setDynamicLayout(true);

MainFrame tool = new MainFrame();
}
MainFrame tool = new MainFrame();
}
}
60 changes: 41 additions & 19 deletions src/main/java/net/rptools/dicetool/Test02.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
/* The MIT License
*
* Copyright (c) 2004,2005,2006 David Rice
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.rptools.dicetool;

import com.jeta.forms.components.panel.FormPanel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractButton;
import javax.swing.JFrame;

import com.jeta.forms.components.panel.FormPanel;

public class Test02 {

public static void main(String... args) throws Exception {
FormPanel panel = new FormPanel("java/net.rptools.dicetool.dicetool/ui/forms/QuickRollPanel.xml");
AbstractButton addbtn = panel.getButton( "rollD2" );
addbtn.addActionListener( new ActionListener()
{
public void actionPerformed( ActionEvent evt )
{
System.out.println("Action done");
}
});
JFrame frame = new JFrame();
frame.add(panel);
frame.setVisible(true);
}
public static void main(String... args) throws Exception {
FormPanel panel =
new FormPanel("java/net.rptools.dicetool.dicetool/ui/forms/QuickRollPanel.xml");
AbstractButton addbtn = panel.getButton("rollD2");
addbtn.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent evt) {
System.out.println("Action done");
}
});

JFrame frame = new JFrame();
frame.add(panel);

frame.setVisible(true);
}
}
Loading