Skip to content

Commit 7a59b3b

Browse files
author
nicolaiparlog
committed
Merge branch 'develop'
2 parents 3c636ce + 95a4b07 commit 7a59b3b

File tree

188 files changed

+11287
-1116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+11287
-1116
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ hs_err_pid*
1717
# Eclipse project information generated by Maven
1818
.classpath
1919
.project
20+
test-output

.settings/org.eclipse.jdt.core.prefs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
5050
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
5151
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
5252
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
53-
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=private
53+
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=default
5454
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
5555
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
5656
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=enabled
@@ -139,7 +139,7 @@ org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration
139139
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
140140
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
141141
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
142-
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
142+
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
143143
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
144144
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
145145
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,22 @@ This somewhat vague sentiment does not translate to quality! The code is clean,
88

99
These features are present in the latest release:
1010

11+
### JavaFX
12+
1113
* [ControlPropertyListener](https://github.com/CodeFX-org/LibFX/wiki/ControlPropertyListener): creating listeners for the property map of JavaFX controls
1214
* [ListenerHandle](https://github.com/CodeFX-org/LibFX/wiki/ListenerHandle): encapsulating an observable and a listener for easier add/remove of the listener
1315
* [Nestings](https://github.com/CodeFX-org/LibFX/wiki/Nestings): using all the power of JavaFX' properties for nested object aggregations
14-
* [SerializableOptional](https://github.com/CodeFX-org/LibFX/wiki/SerializableOptional): serializable wrapper for `Optional`
1516
* [WebViewHyperlinkListener](https://github.com/CodeFX-org/LibFX/wiki/WebViewHyperlinkListener): add hyperlink listeners to JavaFX' `WebView`
1617

18+
### Collections
19+
20+
* [TransformingCollections](https://github.com/CodeFX-org/LibFX/wiki/TransformingCollections): transforming collections to a different parametric type
21+
* [TreeStreams](https://github.com/CodeFX-org/LibFX/wiki/TreeStreams): streaming nodes of a graph
22+
23+
### Misc
24+
25+
* [SerializableOptional](https://github.com/CodeFX-org/LibFX/wiki/SerializableOptional): serializable wrapper for `Optional`
26+
1727

1828
## Documentation
1929

@@ -29,22 +39,22 @@ License details can be found in the *LICENSE* file in the project's root folder.
2939

3040
Releases are published [on GitHub](https://github.com/CodeFX-org/LibFX/releases). The release notes also contain a link to the artifact in Maven Central and its coordinates.
3141

32-
The current version is [0.2.1](http://search.maven.org/#artifactdetails|org.codefx.libfx|LibFX|0.2.1|jar):
42+
The current version is [0.3.0](http://search.maven.org/#artifactdetails|org.codefx.libfx|LibFX|0.3.0|jar):
3343

3444
**Maven**:
3545

3646
``` XML
3747
<dependency>
3848
<groupId>org.codefx.libfx</groupId>
3949
<artifactId>LibFX</artifactId>
40-
<version>0.2.1</version>
50+
<version>0.3.0</version>
4151
</dependency>
4252
```
4353

4454
**Gradle**:
4555

4656
```
47-
compile 'org.codefx.libfx:LibFX:0.2.1'
57+
compile 'org.codefx.libfx:LibFX:0.3.0'
4858
```
4959

5060
## Development
@@ -73,6 +83,6 @@ Nicolai Parlog <br>
7383
CodeFX
7484

7585
Web: http://codefx.org <br>
76-
Mail: nipa@codefx.org <br>
7786
Twitter: https://twitter.com/nipafx<br>
87+
Mail: nipa@codefx.org <br>
7888
PGP-Key: http://keys.gnupg.net/pks/lookup?op=vindex&search=0xA47A795BA5BF8326 <br>

pom.xml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
<groupId>org.codefx.libfx</groupId>
88
<artifactId>LibFX</artifactId>
9-
<version>0.2.1</version>
9+
<version>0.3.0</version>
1010
<packaging>jar</packaging>
1111

1212
<!-- PROJECT META INFORMATION -->
1313

1414
<name>LibFX</name>
15-
<description>LibFX provides utility classes for JavaFX.</description>
15+
<description>LibFX provides usability classes for Java and JavaFX.</description>
1616
<url>http://libfx.codefx.org</url>
1717

1818
<scm>
@@ -70,21 +70,36 @@
7070
<!-- JUNIT for automated tests -->
7171
<groupId>junit</groupId>
7272
<artifactId>junit</artifactId>
73-
<version>4.11</version>
73+
<version>4.12</version>
7474
<scope>test</scope>
7575
</dependency>
7676
<dependency>
7777
<!-- MOCKITO to mock instances for automated tests -->
7878
<groupId>org.mockito</groupId>
7979
<artifactId>mockito-all</artifactId>
80-
<version>1.9.5</version>
80+
<version>1.10.19</version>
8181
<scope>test</scope>
8282
</dependency>
8383
<dependency>
8484
<!-- NEKOHTML to parse HTML to DOM Documents for tests -->
8585
<groupId>net.sourceforge.nekohtml</groupId>
8686
<artifactId>nekohtml</artifactId>
8787
<version>1.9.21</version>
88+
<scope>test</scope>
89+
</dependency>
90+
<dependency>
91+
<!-- GUAVA-TESTLIB to test collections -->
92+
<groupId>com.google.guava</groupId>
93+
<artifactId>guava-testlib</artifactId>
94+
<version>18.0</version>
95+
<scope>test</scope>
96+
</dependency>
97+
<dependency>
98+
<!-- JUNIT RUNNERS to use NestedRunner -->
99+
<groupId>com.nitorcreations</groupId>
100+
<artifactId>junit-runners</artifactId>
101+
<version>1.2</version>
102+
<scope>test</scope>
88103
</dependency>
89104
</dependencies>
90105

@@ -103,12 +118,25 @@
103118
<!-- specify using Java 8 -->
104119
<groupId>org.apache.maven.plugins</groupId>
105120
<artifactId>maven-compiler-plugin</artifactId>
106-
<version>3.2</version>
121+
<version>3.3</version>
107122
<configuration>
108123
<source>1.8</source>
109124
<target>1.8</target>
110125
</configuration>
111126
</plugin>
127+
<plugin>
128+
<!-- prevent JDK internal API from sneaking in -->
129+
<groupId>org.codefx.maven.plugin</groupId>
130+
<artifactId>jdeps-maven-plugin</artifactId>
131+
<version>0.1</version>
132+
<executions>
133+
<execution>
134+
<goals>
135+
<goal>jdkinternals</goal>
136+
</goals>
137+
</execution>
138+
</executions>
139+
</plugin>
112140
<plugin>
113141
<!-- create sources.jar -->
114142
<groupId>org.apache.maven.plugins</groupId>
@@ -127,7 +155,7 @@
127155
<!-- create javadoc.jar -->
128156
<groupId>org.apache.maven.plugins</groupId>
129157
<artifactId>maven-javadoc-plugin</artifactId>
130-
<version>2.10.1</version>
158+
<version>2.10.3</version>
131159
<executions>
132160
<execution>
133161
<id>attach-javadocs</id>
@@ -137,14 +165,6 @@
137165
</execution>
138166
</executions>
139167
<configuration>
140-
<!-- force links to Java 8 documentation (should happen automatically
141-
but doesn't) -->
142-
<javaApiLinks>
143-
<property>
144-
<name>api_1.8</name>
145-
<value>https://docs.oracle.com/javase/8/docs/api/</value>
146-
</property>
147-
</javaApiLinks>
148168
<!-- add license notice -->
149169
<bottom>
150170
<![CDATA[
@@ -160,7 +180,7 @@
160180
<!-- sign all jars and pom -->
161181
<groupId>org.apache.maven.plugins</groupId>
162182
<artifactId>maven-gpg-plugin</artifactId>
163-
<version>1.5</version>
183+
<version>1.6</version>
164184
<executions>
165185
<execution>
166186
<id>sign-artifacts</id>
@@ -175,7 +195,7 @@
175195
<!-- deploy to sonatype OSSRH -->
176196
<groupId>org.sonatype.plugins</groupId>
177197
<artifactId>nexus-staging-maven-plugin</artifactId>
178-
<version>1.6.2</version>
198+
<version>1.6.5</version>
179199
<extensions>true</extensions>
180200
<configuration>
181201
<serverId>ossrh</serverId>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package org.codefx.libfx.collection.transform;
2+
3+
import java.util.Set;
4+
5+
/**
6+
* Demonstrates how to use the {@link EqualityTransformingSet}.
7+
* <p>
8+
* The demonstrated example is based on the situation that we want a set of strings which uses only their length for
9+
* equality comparison.
10+
*/
11+
public class EqualityTransformingSetDemo {
12+
13+
/**
14+
* A set of strings which uses the length for equality.
15+
*/
16+
private final Set<String> lengthSet;
17+
18+
/**
19+
* Creates a new demo.
20+
*/
21+
public EqualityTransformingSetDemo() {
22+
lengthSet = EqualityTransformingCollectionBuilder
23+
.forType(String.class)
24+
.withEquals((a, b) -> a.length() == b.length())
25+
.withHash(String::length)
26+
.buildSet();
27+
}
28+
29+
/**
30+
* Runs this demo.
31+
*
32+
* @param args
33+
* command line arguments (will not be used)
34+
*/
35+
public static void main(String[] args) {
36+
EqualityTransformingSetDemo demo = new EqualityTransformingSetDemo();
37+
38+
demo.addSomeElements();
39+
}
40+
41+
private void addSomeElements() {
42+
print("-- Adding some elements --");
43+
print();
44+
45+
lengthSet.add("a");
46+
lengthSet.add("b");
47+
print(lengthSet.toString());
48+
}
49+
50+
private static void print() {
51+
System.out.println();
52+
}
53+
54+
private static void print(String text) {
55+
System.out.println(text);
56+
}
57+
58+
}

0 commit comments

Comments
 (0)