Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaiparlog committed May 28, 2015
2 parents 3c636ce + 95a4b07 commit 7a59b3b
Show file tree
Hide file tree
Showing 188 changed files with 11,287 additions and 1,116 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ hs_err_pid*
# Eclipse project information generated by Maven
.classpath
.project
test-output
4 changes: 2 additions & 2 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=private
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=default
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=enabled
Expand Down Expand Up @@ -139,7 +139,7 @@ org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,22 @@ This somewhat vague sentiment does not translate to quality! The code is clean,

These features are present in the latest release:

### JavaFX

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

### Collections

* [TransformingCollections](https://github.com/CodeFX-org/LibFX/wiki/TransformingCollections): transforming collections to a different parametric type
* [TreeStreams](https://github.com/CodeFX-org/LibFX/wiki/TreeStreams): streaming nodes of a graph

### Misc

* [SerializableOptional](https://github.com/CodeFX-org/LibFX/wiki/SerializableOptional): serializable wrapper for `Optional`


## Documentation

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

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.

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

**Maven**:

``` XML
<dependency>
<groupId>org.codefx.libfx</groupId>
<artifactId>LibFX</artifactId>
<version>0.2.1</version>
<version>0.3.0</version>
</dependency>
```

**Gradle**:

```
compile 'org.codefx.libfx:LibFX:0.2.1'
compile 'org.codefx.libfx:LibFX:0.3.0'
```

## Development
Expand Down Expand Up @@ -73,6 +83,6 @@ Nicolai Parlog <br>
CodeFX

Web: http://codefx.org <br>
Mail: nipa@codefx.org <br>
Twitter: https://twitter.com/nipafx<br>
Mail: nipa@codefx.org <br>
PGP-Key: http://keys.gnupg.net/pks/lookup?op=vindex&search=0xA47A795BA5BF8326 <br>
52 changes: 36 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<groupId>org.codefx.libfx</groupId>
<artifactId>LibFX</artifactId>
<version>0.2.1</version>
<version>0.3.0</version>
<packaging>jar</packaging>

<!-- PROJECT META INFORMATION -->

<name>LibFX</name>
<description>LibFX provides utility classes for JavaFX.</description>
<description>LibFX provides usability classes for Java and JavaFX.</description>
<url>http://libfx.codefx.org</url>

<scm>
Expand Down Expand Up @@ -70,21 +70,36 @@
<!-- JUNIT for automated tests -->
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- MOCKITO to mock instances for automated tests -->
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- NEKOHTML to parse HTML to DOM Documents for tests -->
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.21</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- GUAVA-TESTLIB to test collections -->
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<version>18.0</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- JUNIT RUNNERS to use NestedRunner -->
<groupId>com.nitorcreations</groupId>
<artifactId>junit-runners</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -103,12 +118,25 @@
<!-- specify using Java 8 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<!-- prevent JDK internal API from sneaking in -->
<groupId>org.codefx.maven.plugin</groupId>
<artifactId>jdeps-maven-plugin</artifactId>
<version>0.1</version>
<executions>
<execution>
<goals>
<goal>jdkinternals</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- create sources.jar -->
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -127,7 +155,7 @@
<!-- create javadoc.jar -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -137,14 +165,6 @@
</execution>
</executions>
<configuration>
<!-- force links to Java 8 documentation (should happen automatically
but doesn't) -->
<javaApiLinks>
<property>
<name>api_1.8</name>
<value>https://docs.oracle.com/javase/8/docs/api/</value>
</property>
</javaApiLinks>
<!-- add license notice -->
<bottom>
<![CDATA[
Expand All @@ -160,7 +180,7 @@
<!-- sign all jars and pom -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -175,7 +195,7 @@
<!-- deploy to sonatype OSSRH -->
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.2</version>
<version>1.6.5</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.codefx.libfx.collection.transform;

import java.util.Set;

/**
* Demonstrates how to use the {@link EqualityTransformingSet}.
* <p>
* The demonstrated example is based on the situation that we want a set of strings which uses only their length for
* equality comparison.
*/
public class EqualityTransformingSetDemo {

/**
* A set of strings which uses the length for equality.
*/
private final Set<String> lengthSet;

/**
* Creates a new demo.
*/
public EqualityTransformingSetDemo() {
lengthSet = EqualityTransformingCollectionBuilder
.forType(String.class)
.withEquals((a, b) -> a.length() == b.length())
.withHash(String::length)
.buildSet();
}

/**
* Runs this demo.
*
* @param args
* command line arguments (will not be used)
*/
public static void main(String[] args) {
EqualityTransformingSetDemo demo = new EqualityTransformingSetDemo();

demo.addSomeElements();
}

private void addSomeElements() {
print("-- Adding some elements --");
print();

lengthSet.add("a");
lengthSet.add("b");
print(lengthSet.toString());
}

private static void print() {
System.out.println();
}

private static void print(String text) {
System.out.println(text);
}

}
Loading

0 comments on commit 7a59b3b

Please sign in to comment.