Skip to content

Commit

Permalink
Add icon, improve build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
qzed committed May 24, 2017
1 parent 28b36ca commit 8588a2d
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Binary file removed logo.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 27 additions & 15 deletions microtrafficsim-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ def main = 'microtrafficsim.ui.Main'


mainClassName = "${main}"
macAppBundle {
mainClassName = "${main}"
}
jar {
manifest {
attributes "Main-Class": "${main}"
Expand All @@ -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}"
Expand Down Expand Up @@ -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}"))
Expand All @@ -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())
Expand All @@ -152,7 +164,7 @@ task distAll {
dependsOn distRpm
dependsOn distDeb
dependsOn distArchPkg
dependsOn distApp
dependsOn createAppZip
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Binary file added resources/icon/microtrafficsim.icns
Binary file not shown.
Binary file added resources/icon/png/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/png/96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit 8588a2d

Please sign in to comment.