Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mechanism for updating Java #93

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
<dependency>
<groupId>org.scijava</groupId>
<artifactId>scijava-common</artifactId>
<version>2.98.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.scijava</groupId>
Expand All @@ -207,6 +208,10 @@
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</dependency>
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/net/imagej/ui/swing/SwingColorBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -47,7 +47,7 @@

/**
* A widget for displaying a {@link ColorTable} as a bar.
*
*
* @author Curtis Rueden
* @author Grant Harris
*/
Expand Down Expand Up @@ -81,7 +81,7 @@ public SwingColorBar(final ColorTable lut, final int height) {

/** Sets the {@link ColorTable} displayed by this color bar. */
public void setColorTable(final ColorTable colorTable) {

if (bar == null || bar.getWidth() != colorTable.getLength()) {
// create compatible image
bar = AWTImageTools.createImage(colorTable.getLength(), 1);
Expand All @@ -94,7 +94,7 @@ public void setColorTable(final ColorTable colorTable) {
gfx.setColor(new Color(argb, false));
gfx.drawLine(i, 0, i, 1);
}
gfx.dispose();
gfx.dispose();
}

// -- JComponent methods --
Expand Down Expand Up @@ -124,11 +124,11 @@ public void paintComponent(final Graphics g) {
// -- Main method --

public static void main(final String[] args) {
final ColorTable[] luts =
{ ColorTables.FIRE, ColorTables.ICE, ColorTables.SPECTRUM,
ColorTables.RED, ColorTables.GREEN, ColorTables.BLUE, ColorTables.CYAN,
ColorTables.MAGENTA, ColorTables.YELLOW, ColorTables.GRAYS,
ColorTables.REDGREEN, ColorTables.RGB332 };
final ColorTable[] luts = { ColorTables.FIRE, ColorTables.ICE,
ColorTables.SPECTRUM, ColorTables.RED, ColorTables.GREEN,
ColorTables.BLUE, ColorTables.CYAN, ColorTables.MAGENTA,
ColorTables.YELLOW, ColorTables.GRAYS, ColorTables.REDGREEN,
ColorTables.RGB332 };

final JFrame frame = new JFrame();
frame.setTitle("LUTs");
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/net/imagej/ui/swing/commands/OverlayManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand All @@ -39,7 +39,7 @@

/**
* Command to pop up the {@link SwingOverlayManager}.
*
*
* @author Adam Fraser
*/
@Plugin(type = Command.class, menu = { //
Expand All @@ -51,7 +51,8 @@ public class OverlayManager extends ContextCommand {

@Override
public void run() {
final SwingOverlayManager overlaymgr = new SwingOverlayManager(getContext());
final SwingOverlayManager overlaymgr = new SwingOverlayManager(
getContext());
overlaymgr.setVisible(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -44,14 +44,15 @@
/**
* Multiple Document Interface implementation of Swing image display viewer. The
* MDI display is housed in a {@link JInternalFrame}.
*
*
* @author Grant Harris
* @author Curtis Rueden
* @author Lee Kamentsky
* @see SwingImageDisplayViewer
*/
@Plugin(type = DisplayViewer.class)
public class SwingMdiImageDisplayViewer extends AbstractSwingImageDisplayViewer
public class SwingMdiImageDisplayViewer extends
AbstractSwingImageDisplayViewer
{

// -- DisplayViewer methods --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -55,7 +55,7 @@
/**
* An abstract class that gives default behavior for the {@link JHotDrawAdapter}
* interface.
*
*
* @author Lee Kamentsky
*/
public abstract class AbstractJHotDrawAdapter<O extends Overlay, F extends Figure>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -46,7 +46,7 @@

/**
* JHotDraw adapter for angle overlays.
*
*
* @author Lee Kamentsky
* @author Barry DeZonia
* @see SwingAngleTool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -47,7 +47,7 @@

/**
* Utility functions for {@link GeneralPathJHotDrawAdapter}.
*
*
* @author Johannes Schindelin
*/
public class BezierPathFunctions {
Expand Down Expand Up @@ -115,11 +115,10 @@ public static void addToRegionOfInterest(final PathIterator iterator,
}

public enum OP {
ADD, XOR, INTERSECT, SUBTRACT
ADD, XOR, INTERSECT, SUBTRACT
}

public static BezierPath add(final BezierPath path1, final BezierPath path2)
{
public static BezierPath add(final BezierPath path1, final BezierPath path2) {
return op(path1, path2, OP.ADD);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -60,7 +60,7 @@
* The default adapter handles any kind of overlay. It uses the fill color and
* alpha of the overlay to draw the mask and leaves the rest of the figure
* transparent.
*
*
* @author Lee Kamentsky
*/
@Plugin(type = JHotDrawAdapter.class,
Expand Down Expand Up @@ -95,8 +95,8 @@ public Figure createDefaultFigure() {
}

@Override
public void
updateFigure(final OverlayView overlay, final ImageFigure figure)
public void updateFigure(final OverlayView overlay,
final ImageFigure figure)
{
super.updateFigure(overlay, figure);

Expand All @@ -109,18 +109,16 @@ public Figure createDefaultFigure() {
final long minY = (long) Math.floor(roi.realMin(1));
final long maxY = (long) Math.ceil(roi.realMax(1)) + 1;
final ColorRGB color = overlay.getData().getFillColor();
final IndexColorModel cm =
new IndexColorModel(1, 2, new byte[] { 0, (byte) color.getRed() },
new byte[] { 0, (byte) color.getGreen() }, new byte[] { 0,
(byte) color.getBlue() }, new byte[] { 0,
(byte) overlay.getData().getAlpha() });
final IndexColorModel cm = new IndexColorModel(1, 2, new byte[] { 0,
(byte) color.getRed() }, new byte[] { 0, (byte) color.getGreen() },
new byte[] { 0, (byte) color.getBlue() }, new byte[] { 0, (byte) overlay
.getData().getAlpha() });
final int w = (int) (maxX - minX);
final int h = (int) (maxY - minY);
final BufferedImage img =
new BufferedImage(w, h, BufferedImage.TYPE_BYTE_INDEXED, cm);
final SampleModel sm =
new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, w, h,
new int[] { 1 });
final BufferedImage img = new BufferedImage(w, h,
BufferedImage.TYPE_BYTE_INDEXED, cm);
final SampleModel sm = new SinglePixelPackedSampleModel(
DataBuffer.TYPE_BYTE, w, h, new int[] { 1 });
final DataBuffer dbuncast = sm.createDataBuffer();
assert dbuncast instanceof DataBufferByte;
final DataBufferByte db = (DataBufferByte) dbuncast;
Expand All @@ -140,8 +138,8 @@ public Figure createDefaultFigure() {
index++;
}
}
final Raster raster =
Raster.createRaster(sm, db, new java.awt.Point(0, 0));
final Raster raster = Raster.createRaster(sm, db, new java.awt.Point(0,
0));
img.setData(raster);
figure.setBounds(new Rectangle2D.Double(minX, minY, w, h));
figure.setBufferedImage(img);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2009 - 2023 ImageJ developers.
* Copyright (C) 2009 - 2024 ImageJ developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -50,7 +50,7 @@

/**
* JHotDraw adapter for ellipse overlays.
*
*
* @author Lee Kamentsky
* @author Barry DeZonia
* @see SwingEllipseTool
Expand Down Expand Up @@ -99,8 +99,7 @@ public Figure createDefaultFigure() {
}

@Override
public void updateFigure(final OverlayView view, final EllipseFigure figure)
{
public void updateFigure(final OverlayView view, final EllipseFigure figure) {
super.updateFigure(view, figure);
final EllipseOverlay overlay = downcastOverlay(view.getData());
final double centerX = overlay.getOrigin(0);
Expand All @@ -113,8 +112,8 @@ public void updateFigure(final OverlayView view, final EllipseFigure figure)
}

@Override
public void
updateOverlay(final EllipseFigure figure, final OverlayView view)
public void updateOverlay(final EllipseFigure figure,
final OverlayView view)
{
super.updateOverlay(figure, view);
final EllipseOverlay overlay = downcastOverlay(view.getData());
Expand Down
Loading
Loading