diff --git a/README.md b/README.md index 9d28178a..3ca08067 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Microscopic Traffic Simulation with OpenStreetMap data. -![Teaser: New York](teaser.png "Teaser: New York") +![Teaser: New York](resources/teaser.png "Teaser: New York") ## News Testing the simulation execution for determinism has finished. According diff --git a/examples/mapviewer/src/main/java/microtrafficsim/examples/mapviewer/MapViewerExample.java b/examples/mapviewer/src/main/java/microtrafficsim/examples/mapviewer/MapViewerExample.java index 0fca6af1..55d386c0 100644 --- a/examples/mapviewer/src/main/java/microtrafficsim/examples/mapviewer/MapViewerExample.java +++ b/examples/mapviewer/src/main/java/microtrafficsim/examples/mapviewer/MapViewerExample.java @@ -122,6 +122,7 @@ private TileBasedMapViewer setUpMapViewer(MapStyleSheet style) throws Unsupporte private JFrame setUpFrame(MapViewer viewer) { /* create and initialize the JFrame */ JFrame frame = new JFrame(getDefaultFrameTitle()); + frame.setIconImage(new ImageIcon(MapViewerExample.class.getResource("/icon/128x128.png")).getImage()); frame.setSize(viewer.getInitialWindowWidth(), viewer.getInitialWindowHeight()); frame.add(viewer.getVisualizationPanel()); diff --git a/examples/simulation/src/main/java/microtrafficsim/examples/simulation/SimulationExample.java b/examples/simulation/src/main/java/microtrafficsim/examples/simulation/SimulationExample.java index cbcea438..03bd1c2f 100644 --- a/examples/simulation/src/main/java/microtrafficsim/examples/simulation/SimulationExample.java +++ b/examples/simulation/src/main/java/microtrafficsim/examples/simulation/SimulationExample.java @@ -141,6 +141,7 @@ private TileBasedMapViewer setUpMapViewer(SimulationConfig config) throws Unsupp private JFrame setUpFrame(MapViewer viewer) { /* create and initialize the JFrame */ JFrame frame = new JFrame("MicroTrafficSim - Map Viewer Example"); + frame.setIconImage(new ImageIcon(SimulationExample.class.getResource("/icon/128x128.png")).getImage()); frame.setSize(viewer.getInitialWindowWidth(), viewer.getInitialWindowHeight()); frame.add(viewer.getVisualizationPanel()); diff --git a/logo.png b/logo.png deleted file mode 100644 index caf52269..00000000 Binary files a/logo.png and /dev/null differ diff --git a/microtrafficsim-core/src/main/resources/icon/128x128.png b/microtrafficsim-core/src/main/resources/icon/128x128.png new file mode 100644 index 00000000..2b79465c Binary files /dev/null and b/microtrafficsim-core/src/main/resources/icon/128x128.png differ diff --git a/microtrafficsim-ui/build.gradle b/microtrafficsim-ui/build.gradle index 1577f12a..bde7c366 100755 --- a/microtrafficsim-ui/build.gradle +++ b/microtrafficsim-ui/build.gradle @@ -29,9 +29,6 @@ def main = 'microtrafficsim.ui.Main' mainClassName = "${main}" -macAppBundle { - mainClassName = "${main}" -} jar { manifest { attributes "Main-Class": "${main}" @@ -42,6 +39,16 @@ jar { } } +macAppBundle { + appName = 'microtrafficsim' + dmgName = "${distName}_${distVersion}-${distRelease}_all.app" + + icon = "${rootProject.projectDir}/resources/icon/microtrafficsim.icns" + version = "${distVersion}-${distRelease}" + + mainClassName = "${main}" + bundleJRE = false +} ospackage { packageName = "${distName}" @@ -76,22 +83,17 @@ task distRpm(type: Rpm) { task distDeb(type: Deb) { dependsOn startScripts -} -task distApp(type: Zip) { - dependsOn createApp - - from fileTree("${->project.buildDir}/${->project.macAppBundle.appOutputDir}/${->project.macAppBundle.appName}.app") { - into 'microtrafficsim.app' - } - - destinationDir = file("${->project.buildDir}/distributions") - archiveName = "${distName}_${distVersion}-${distRelease}_all.app.zip" + packageGroup 'science' } distZip { archiveName = "$distName" + into("${archiveName}/icon") { + from "${rootProject.projectDir}/resources/icon/png" + } + doLast { def name = "${distName}_${distVersion}-${distRelease}_all.zip" archivePath.renameTo(file("${->project.buildDir}/distributions/${name}")) @@ -115,20 +117,30 @@ task writeArchPkgbuild() { pkgbuild <<= "pkgver=${distVersion}\n" pkgbuild <<= "pkgrel=${distRelease}\n" pkgbuild <<= "pkgdesc='Microscopic Traffic Simulation using OpenStreetMap'\n" + pkgbuild <<= "categories=\"Application;Science\"\n" pkgbuild <<= "arch=('any')\n" pkgbuild <<= "url='https://github.com/sgs-us/microtrafficsim/'\n" pkgbuild <<= "license=('GPL-3.0')\n" pkgbuild <<= "\n" pkgbuild <<= "depends=('java-environment')\n" + pkgbuild <<= "makedepends=('gendesk')\n" pkgbuild <<= "source=(\"${distZipUrl}\")\n" pkgbuild <<= "sha256sums=('${distZipSha256}')\n" pkgbuild <<= "\n" + pkgbuild <<= "build() {\n" + pkgbuild <<= " mv \"\${pkgname}/icon/512x512.png\" \${pkgname}.png\n" + pkgbuild <<= " rm -r \"\${pkgname}/icon\"\n" + pkgbuild <<= " rm \"\${pkgname}/bin/\${pkgname}.bat\"\n" + pkgbuild <<= " gendesk -f -n --pkgname \"\${pkgname}\" --pkgdesc \"\${pkgdesc}\" --categories \"\${categories}\"\n" + pkgbuild <<= "}\n" + pkgbuild <<= "\n" pkgbuild <<= "package() {\n" pkgbuild <<= " mkdir -p \"\${pkgdir}/usr/\"{bin,share}\n" pkgbuild <<= " cp -r \"\${pkgname}\" \"\${pkgdir}/usr/share/\"\n" - pkgbuild <<= " rm \"\${pkgdir}/usr/share/\${pkgname}/bin/\${pkgname}.bat\"\n" pkgbuild <<= " chmod 755 \"\${pkgdir}/usr/share/\${pkgname}/bin/\${pkgname}\"\n" pkgbuild <<= " ln -s \"/usr/share/\${pkgname}/bin/\${pkgname}\" \"\${pkgdir}/usr/bin/\${pkgname}\"\n" + pkgbuild <<= " install -Dm644 \"\${pkgname}.desktop\" \"\${pkgdir}/usr/share/applications/\${pkgname}.desktop\"\n" + pkgbuild <<= " install -Dm644 \"\${pkgname}.png\" \"\${pkgdir}/usr/share/pixmaps/\${pkgname}.png\"\n" pkgbuild <<= "}\n" file("$tmpdir/PKGBUILD").write(pkgbuild.toString()) @@ -152,7 +164,7 @@ task distAll { dependsOn distRpm dependsOn distDeb dependsOn distArchPkg - dependsOn distApp + dependsOn createAppZip } diff --git a/microtrafficsim-ui/src/main/java/microtrafficsim/ui/gui/statemachine/impl/SimulationController.java b/microtrafficsim-ui/src/main/java/microtrafficsim/ui/gui/statemachine/impl/SimulationController.java index d2d621c4..05e99a12 100644 --- a/microtrafficsim-ui/src/main/java/microtrafficsim/ui/gui/statemachine/impl/SimulationController.java +++ b/microtrafficsim-ui/src/main/java/microtrafficsim/ui/gui/statemachine/impl/SimulationController.java @@ -142,7 +142,8 @@ public SimulationController(BuildSetup buildSetup) { overlay.setSimulation(simulation); /* gui */ - frame = new JFrame(FrameTitle.DEFAULT.get()); + frame = new JFrame(FrameTitle.DEFAULT.get()); + frame.setIconImage(new ImageIcon(SimulationController.class.getResource("/icon/128x128.png")).getImage()); frame.addWindowListener(new WindowAdapter() { @Override public void windowActivated(WindowEvent e) { diff --git a/resources/icon/microtrafficsim.icns b/resources/icon/microtrafficsim.icns new file mode 100644 index 00000000..cef8689f Binary files /dev/null and b/resources/icon/microtrafficsim.icns differ diff --git a/resources/icon/png/128x128.png b/resources/icon/png/128x128.png new file mode 100644 index 00000000..2b79465c Binary files /dev/null and b/resources/icon/png/128x128.png differ diff --git a/resources/icon/png/16x16.png b/resources/icon/png/16x16.png new file mode 100644 index 00000000..0d5ba48c Binary files /dev/null and b/resources/icon/png/16x16.png differ diff --git a/resources/icon/png/24x24.png b/resources/icon/png/24x24.png new file mode 100644 index 00000000..55bf39c4 Binary files /dev/null and b/resources/icon/png/24x24.png differ diff --git a/resources/icon/png/256x256.png b/resources/icon/png/256x256.png new file mode 100644 index 00000000..d93cb594 Binary files /dev/null and b/resources/icon/png/256x256.png differ diff --git a/resources/icon/png/32x32.png b/resources/icon/png/32x32.png new file mode 100644 index 00000000..8b4a0c54 Binary files /dev/null and b/resources/icon/png/32x32.png differ diff --git a/resources/icon/png/48x48.png b/resources/icon/png/48x48.png new file mode 100644 index 00000000..e4104ed5 Binary files /dev/null and b/resources/icon/png/48x48.png differ diff --git a/resources/icon/png/512x512.png b/resources/icon/png/512x512.png new file mode 100644 index 00000000..fd8eadd1 Binary files /dev/null and b/resources/icon/png/512x512.png differ diff --git a/resources/icon/png/64x64.png b/resources/icon/png/64x64.png new file mode 100644 index 00000000..45810896 Binary files /dev/null and b/resources/icon/png/64x64.png differ diff --git a/resources/icon/png/96x96.png b/resources/icon/png/96x96.png new file mode 100644 index 00000000..2411bdc1 Binary files /dev/null and b/resources/icon/png/96x96.png differ diff --git a/teaser.png b/resources/teaser.png similarity index 100% rename from teaser.png rename to resources/teaser.png