Skip to content

Commit

Permalink
Implement project icons
Browse files Browse the repository at this point in the history
And associate projects with pages as appropriate.

Many more pages still need to be labeled as associated with
this-or-that project, but the infrastructure is in place.

Closes #97.
  • Loading branch information
ctrueden committed Jun 22, 2021
1 parent 6ed7f2d commit 7750ef7
Show file tree
Hide file tree
Showing 52 changed files with 159 additions and 148 deletions.
27 changes: 6 additions & 21 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@ collections:
output: true
permalink: /:path
allow-jekyll-4: false
projects:
- name: ImageJ
description: the original version of ImageJ
link: /software/imagej
- name: ImageJ2
description: the ImageJ2 platform
link: /software/imagej2
- name: Fiji
description: the Fiji distribution of ImageJ
link: /software/fiji
- name: SciJava
description: the core SciJava software libraries
link: /libs/scijava
- name: SCIFIO
description: the SCIFIO library for scientific image I/O
link: /libs/scifio
defaults:
-
scope:
Expand Down Expand Up @@ -95,21 +79,21 @@ defaults:
type: pages
values:
icon: /media/icons/imglib2.png
project: ImgLib2
project: /libs/imglib2
-
scope:
path: "_pages/libs/scifio"
type: pages
values:
icon: /media/icons/scifio.png
project: SCIFIO
project: /libs/scifio
-
scope:
path: "_pages/libs/scijava"
type: pages
values:
icon: /media/icons/scijava.png
project: SciJava
project: /libs/scijava
-
scope:
path: "_pages/licensing"
Expand Down Expand Up @@ -164,20 +148,21 @@ defaults:
type: pages
values:
icon: /media/icons/fiji.svg
project: /software/fiji
-
scope:
path: "_pages/software/imagej"
type: pages
values:
icon: /media/icons/imagej.png
project: ImageJ
project: /software/imagej
-
scope:
path: "_pages/software/imagej2"
type: pages
values:
icon: /media/icons/imagej2.png
project: ImageJ2
project: /software/imagej2
-
scope:
path: "_pages/tutorials"
Expand Down
2 changes: 0 additions & 2 deletions _includes/layout/statbox
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ the javascript only populates fields when they are empty.
{%- assign artifact = page.artifact -%} {%- comment -%} The component's groupId:artifactId {%- endcomment -%}
{%- assign repository = page.repository -%} {%- comment -%} Maven repository where release artifact is deployed {%- endcomment -%}
{%- assign pom-url = page.pom-url -%} {%- comment -%} URL where the component's latest POM can be found. {%- endcomment -%}
{%- assign project = page.project -%} {%- comment -%} Project umbrella to which this component belongs {%- endcomment -%}
{%- assign source-url = page.source-url -%} {%- comment -%} URL where the component's source code can be found {%- endcomment -%}
{%- assign source-label = page.source-label -%} {%- comment -%} Label to use for the source code link {%- endcomment -%}
{%- assign license-url = page.license-url -%} {%- comment -%} URL where the component's licensing details can be found {%- endcomment -%}
Expand Down Expand Up @@ -284,7 +283,6 @@ refreshComponent();
{%- comment -%} ============== COMPONENT INFO ============== {%- endcomment -%}
{%- comment -%} TODO: Infer project from groupId. {%- endcomment -%}
{%- comment -%} TODO: Add support for licenseName, projectName, copyrightOwners. {%- endcomment -%}
{%- if project -%} {%- include statbox/row id="component-project" value=project -%} {%- endif -%}
{%- if autopop or source-label -%} {%- include statbox/row id="component-source" label="Source" url=source-url value=source-label -%} {%- endif -%}
{%- if autopop or license-url -%} {%- include statbox/row id="component-license" label="License" url=license-url value=license-label -%} {%- endif -%}
{%- if autopop or release-url -%} {%- include statbox/row id="component-release" label="Release" url=release-url value=release-version -%} {%- endif -%}
Expand Down
54 changes: 54 additions & 0 deletions _includes/layout/title
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{%- assign text = nil -%}
{%- if page.project or page.project-blurb -%}
{%- comment -%} Discern project ID. {%- endcomment -%}
{%- assign id = page.project -%}
{%- unless id -%}
{%- comment -%}
Project blurb given without project; assume current page is the project.
{%- endcomment -%}
{%- assign id = page.url | replace: "/index", "" -%}
{%- endunless -%}

{%- comment -%} Look up the project page with the given ID. {%- endcomment -%}
{%- assign p = site.pages | where: "url", id -%}
{%- unless p.first -%}
{%- assign id-index = id | append: "/index" -%}
{%- assign p = site.pages | where: "url", id-index -%}
{%- endunless -%}

{%- if p.first -%}
{%- assign icon = p[0].icon -%}
{%- assign blurb = p[0].project-blurb -%}
{%- unless blurb -%}
{%- comment -%} Project has no blurb; fall back to page title. {%- endcomment -%}
{%- assign blurb = p[0].title -%}
{%- endunless -%}
{%- capture tip -%}
This page describes content relating to {{blurb}}. Click the logo for details.
{%- endcapture -%}
{%- else -%}
{%- comment -%} Project URL is invalid. {%- endcomment -%}
{%- assign icon = false -%}
{%- capture tip -%} The project URL '{{id}}' does not exist. {%- endcapture -%}
{%- endif -%}

{%- capture text -%}
{%- if icon -%}
<img src="{{icon}}">
{%- else -%}
&#10060;
{%- endif -%}
{%- endcapture -%}
{%- endif -%}

{%- if text -%}
<span class="project-icon shadowed-box">{% include tooltip text=text tooltip=tip %}</span>
<h1>{{page.title}}</h1>
<span class="project-counterweight"> </span>
{%- else -%}
<h1>{{page.title}}</h1>
{%- endif -%}

{%- comment -%}
# vi:syntax=liquid
{%- endcomment -%}
79 changes: 0 additions & 79 deletions _includes/project

This file was deleted.

2 changes: 1 addition & 1 deletion _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3>Page contents</h3>
<!-- Page title -->
<div class="container">
<header class="major special">
<h1><strong>{{page.title}}</strong></h1>
{% include layout/title %}
</header>
</div>

Expand Down
1 change: 1 addition & 0 deletions _pages/develop/architecture.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Architecture
section: Extend:Development
project: /software/imagej2
---

{% include notice icon="info" content='This page describes the *technical* structure of [SciJava](/libs/scijava) projects.
Expand Down
13 changes: 7 additions & 6 deletions _pages/develop/coding-style.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---
title: Coding style
section: Extend:Development
project: /libs/scijava
---

We make a serious effort to keep the ImageJ2 codebase clean, consistent and easy to read—which includes both the source code and the revision history.
We make a serious effort to keep the SciJava codebase clean, consistent and easy to read—which includes both the source code and the revision history.

## Interface-driven design

ImageJ2 uses an [interface-driven design](https://msdn.microsoft.com/en-us/library/aa260635%28v=vs.60%29.aspx) where possible. Public interfaces, enumerations and constants (i.e., `public static final` fields) form the basis of ImageJ2's API contract with downstream code. While we make an effort not to change the public methods and fields of non-interfaces, they may require occasional changes to improve the system.
SciJava projects use an [interface-driven design](https://msdn.microsoft.com/en-us/library/aa260635%28v=vs.60%29.aspx) where possible. Public interfaces, enumerations and constants (i.e., `public static final` fields) form the basis of SciJava's API contract with downstream code. While we make an effort not to change the public methods and fields of non-interfaces, they may require occasional changes to improve the system.

## Versioning

ImageJ2 uses [Semantic Versioning](http://semver.org/). As of this writing, the project is still in beta, so the API is not finalized yet. But once we make the final 2.0.0 release, future versions will be fully compliant. See the [Architecture](/develop/architecture#versioning) page for further details.
SciJava projects use [Semantic Versioning](http://semver.org/). As of this writing, the project is still in beta, so the API is not finalized yet. But once we make the final 2.0.0 release, future versions will be fully compliant. See the [Architecture](/develop/architecture#versioning) page for further details.

## Naming

We have tried to name classes with similar logic to how the Java standard library does. We eschew the "I" prefix for interfaces, as well as the "Impl" suffix for implementations. Instead, like the Java standard library, we prefix abstract superclasses with "Abstract" and canonical implementations with "Default"—for example, the `Display` interface is implemented by an abstract superclass named `AbstractDisplay` and extended by a concrete implementation named `DefaultDisplay`.

## Cleverness

Because a large number of developers study the ImageJ2 codebase, and it provides many examples of use, we try to provide [easy to understand, maintainable code](http://www.daedtech.com/writing-maintainable-code-demands-creativity). We avoid "clever" or obfuscated solutions to problems, since such code tends to be much harder to understand.
Because a large number of developers study the SciJava codebase, and it provides many examples of use, we try to provide [easy to understand, maintainable code](http://www.daedtech.com/writing-maintainable-code-demands-creativity). We avoid "clever" or obfuscated solutions to problems, since such code tends to be much harder to understand.

## SCM history

Expand Down Expand Up @@ -81,12 +82,12 @@ We prefer use of private fields and methods over protected ones, where possible.

1. Protected fields provide an API contract to subclasses, which especially for reusable libraries must be carefully considered, just as you would public API. With too many protected fields, you can find yourself locked into your current internal design, with refactoring difficult or impossible.
2. You cannot exercise any restrictions or control over the usage of the protected fields. Conversely, providing getters and setters for private fields offers the ability to define in code any restrictions you need on those fields.
3. Relatedly, there is no mechanism in Java, even using a bytecode library such as Javassist, to add "seams" that inject or modify behavior when that field is read or written. For example, you could not later add a notification system for listeners that care about when the value of that field changes. In fact, you cannot detect at all when a field has changed, for the purposes of e.g. synchronization. We encountered this specific problem with the legacy layer to [ImageJ 1.x](/software/imagej), since it has quite a few non-private fields: when unknown third-party code changes an ImageJ field which stores some portion of the ImageJ program state, we cannot update the corresponding ImageJ2 state to match. We still have essentially no solution to this dilemma (the best we have come up with so far is polling, which is complex and error prone).
3. Relatedly, there is no mechanism in Java, even using a bytecode library such as Javassist, to add "seams" that inject or modify behavior when that field is read or written. For example, you could not later add a notification system for listeners that care about when the value of that field changes. In fact, you cannot detect at all when a field has changed, for the purposes of e.g. synchronization. We encountered this specific problem with [ImageJ2](/software/imagej2)'s legacy layer to [ImageJ](/software/imagej), since it has quite a few non-private fields: when unknown third-party code changes an ImageJ field which stores some portion of the ImageJ program state, we cannot update the corresponding ImageJ2 state to match. We still have essentially no solution to this dilemma (the best we have come up with so far is polling, which is complex and error prone).
4. One nice usage of non-private fields is for "struct"-style classes, such as `java.awt.Rectangle`, with its `x`, `y`, `width` and `height` fields. If all you are looking for is a "dumb" data structure class consisting of collections of primitives and object references, it can suffice, but given the points above, it is almost always superior to use private fields with getters and setters, even in classes fully intended to be subclassed.

More observations on this issue can be found at [this post on StackOverflow](http://stackoverflow.com/a/3631338).

All of that said, there are times when use of the `protected` modifier is appropriate, so you will certainly see it in a few places in the ImageJ2 codebase. In particular, we use `protected` for event handler methods, both to avoid unused method warnings in Eclipse, as well as to make it easier for subclasses to override the event handling behavior.
All of that said, there are times when use of the `protected` modifier is appropriate, so you will certainly see it in a few places in the SciJava codebase. In particular, we use `protected` for event handler methods, both to avoid unused method warnings in Eclipse, as well as to make it easier for subclasses to override the event handling behavior.

## See also

Expand Down
1 change: 1 addition & 0 deletions _pages/develop/command-line.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
section: Extend:Development:Tools:IDEs
title: Developing ImageJ2 on the command line
project: /software/imagej2
---

This article explains how to install and configure command line tools for use with [ImageJ2](/software/imagej2) development.
Expand Down
3 changes: 2 additions & 1 deletion _pages/develop/eclipse.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
mediawiki: Developing_ImageJ_in_Eclipse
title: Developing ImageJ in Eclipse
title: Developing ImageJ2 in Eclipse
section: Extend:Development:Tools:IDEs
project: /software/imagej2
---

This article explains how to install, configure and use Eclipse to develop
Expand Down
1 change: 1 addition & 0 deletions _pages/develop/ij1-ij2-cheat-sheet.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: ImageJ-ImageJ2 cheat sheet
project: /software/imagej2
---

This page summarizes translation of basic operations of [ImageJ 1.x](/software/imagej) and [ImageJ2](/software/imagej2) API. Based on the work of {% include person id='haesleinhuepf' %}, Scientific Computing Facility, MPI-CBG Dresden.
Expand Down
6 changes: 3 additions & 3 deletions _pages/develop/ij1-plugins.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Developing Plugins for ImageJ 1.x
title: Developing ImageJ Plugins
section: Extend:Development:Guides
project: ImageJ
project: /software/imagej
---

{% include notice icon="imagej" content='This page explains how to develop plugins with the ImageJ 1.x API. If you start developing a new plugin today, it is highly recommended to [develop for ImageJ2](/develop/plugins).' %}
{% include notice icon="imagej" content='This page explains how to develop plugins with the original ImageJ API. If you start developing a new plugin today, it is highly recommended to [develop for ImageJ2](/develop/plugins).' %}

# Plugin, script or macro?

Expand Down
2 changes: 1 addition & 1 deletion _pages/develop/ij1-unit-tests.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
mediawiki: Unit_tests_for_ImageJ1
title: Unit tests for ImageJ
project: ImageJ
project: /software/imagej
---

There are a [substantial number of unit tests](/news/2011-10-07-unit-tests-for-imagej-1-45) to exercise [ImageJ](/software/imagej) functionality. You can find them in the {% include github org='imagej' repo='ij1-tests' label='ij1-tests repository' %}:
Expand Down
1 change: 1 addition & 0 deletions _pages/develop/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
mediawiki: Development
title: Development
section: Extend:Develop
project: /software/imagej2
---

{% include notice icon="info" content="If your goal is to automate the behavior of ImageJ, consider writing a [script](/scripting/script-editor) using ImageJ2's [Script Editor](/scripting/script-editor)—it is often much simpler than a plugin in Java." %}
Expand Down
3 changes: 2 additions & 1 deletion _pages/develop/intellij.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
mediawiki: Developing_ImageJ_in_IntelliJ_IDEA
section: Extend:Development:Tools:IDEs
title: Developing ImageJ2 in IntelliJ IDEA
section: Extend:Development:Tools:IDEs
project: /software/imagej2
---

This article explains how to install and configure IntelliJ IDEA for use with [ImageJ2](/software/imagej2) development. Directions correspond to IntelliJ IDEA 11.1, and may need adjustment for other versions.
Expand Down
1 change: 1 addition & 0 deletions _pages/develop/javafx.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Build ImageJ2 Plugin With JavaFX
section: Extend:Development:Tools
project: /software/imagej2
---

{% include wikipedia title="JavaFX" %} is Java's new graphical toolkit
Expand Down
1 change: 1 addition & 0 deletions _pages/develop/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
mediawiki: Logging
title: Logging
section: Extend:Development:Guides
project: /libs/scijava
---

If you are a Java developer, then it is very likely you *love* logging. At least, that's the conclusion new Java developers inevitably must draw, based on the fact that 97.3% of all Java libraries in the wild are logging frameworks. Given the jungle of logging complexity out there, it's easy to get confused about how logging works for any given project, and in fact how logging works in general across the Java software ecosystem. Fortunately, this friendly wiki page is here to help you understand logging once and for all.
Expand Down
1 change: 1 addition & 0 deletions _pages/develop/minimaven.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
mediawiki: MiniMaven
title: MiniMaven
project: /libs/scijava
---

MiniMaven is a minimal build and dependency management system. It reads project configurations in the same format as [Maven](/develop/maven) (*pom.xml* files).
Expand Down
3 changes: 2 additions & 1 deletion _pages/develop/netbeans.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
mediawiki: Developing_ImageJ_in_NetBeans
section: Extend:Development:Tools:IDEs
title: Developing ImageJ2 in NetBeans
section: Extend:Development:Tools:IDEs
project: /libs/imagej2
---

{% include warning/outdated %}
Expand Down
Loading

0 comments on commit 7750ef7

Please sign in to comment.