Skip to content

Commit

Permalink
Modularization (#160)
Browse files Browse the repository at this point in the history
* Add auto module name to manifest

Adds the `Automatic-Module-Name: <module name>` to the
`MANIFEST.MF`which gets packaged into the jar file. The artifactId is
used as `<module-name>`.
This is a first step towards making chartfx usable for projects using
the jigsaw module system as proposed in #156 by @ennerf.

* Document steps to be taken to support jigsaw

* make module name reverse dns

* Remove PerformanceTracker internal api

* remove jigsaw todo list
  • Loading branch information
wirew0rm authored and RalphSteinhagen committed Sep 10, 2020
1 parent f846230 commit a8c10d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sun.javafx.perf.PerformanceTracker; // keep for the future in case this becomes public API
// import com.sun.javafx.perf.PerformanceTracker; // keep for the future in case this becomes public API
import com.sun.management.OperatingSystemMXBean;

public class SimplePerformanceMeter {
Expand Down Expand Up @@ -58,7 +58,7 @@ public class SimplePerformanceMeter {
private final Field dirtyRootBits;
private final Field dirtyNodesSize;
private final long updateDuration;
private final PerformanceTracker fxPerformanceTracker; // keep for the future in case this becomes public
// private final PerformanceTracker fxPerformanceTracker; // keep for the future in case this becomes public
private Timer timer;
private final AnimationTimer animationTimer;
private long timerIterationLast = System.currentTimeMillis();
Expand All @@ -76,7 +76,7 @@ public SimplePerformanceMeter(Scene scene, long updateDuration) {
}
this.scene = scene;
this.updateDuration = Math.max(MIN_UPDATE_PERIOD, Math.min(updateDuration, MAX_UPDATE_PERIOD));
fxPerformanceTracker = PerformanceTracker.getSceneTracker(scene); // keep for the future in case this becomes public
// fxPerformanceTracker = PerformanceTracker.getSceneTracker(scene); // keep for the future in case this becomes public

animationTimer = new AnimationTimer() {
@Override
Expand Down Expand Up @@ -215,8 +215,8 @@ public void run() {
pulseRateInternal = diff > 0 ? pulseCount / diff : -1;
frameRateInternal = diff > 0 ? frameCount / diff : -1;
// alt via fxPerformanceTracker - keep for the future in case this becomes public
pulseRateInternal = fxPerformanceTracker.getInstantPulses();
frameRateInternal = fxPerformanceTracker.getInstantFPS();
// pulseRateInternal = fxPerformanceTracker.getInstantPulses();
// frameRateInternal = fxPerformanceTracker.getInstantFPS();

cpuLoadProcessInternal = OS_BEAN.getProcessCpuLoad() * 100 * N_CORES;
cpuLoadSystemInternal = OS_BEAN.getSystemCpuLoad() * 100 * N_CORES;
Expand Down
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@
<!-- put your configurations here -->
</configuration>
</plugin>
<!-- add automatic module name to manifest -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Automatic-Module-Name>${project.groupId}.${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down

0 comments on commit a8c10d8

Please sign in to comment.