diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d008aea28e..385900efe5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 8 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '21' distribution: 'zulu' cache: maven - name: Build with Maven diff --git a/.gitignore b/.gitignore index 458f62e794..22b5d42e04 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ private local modules/DataBrowser/src/main/resources/my*.properties modules/Core/src/main/resources/my*.properties* +.claude \ No newline at end of file diff --git a/README.md b/README.md index d7e9d16add..0e790ad3f8 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,3 @@ The canonical two-server deployment of the MouseLight neuron tracing tools is de ## For Developers For information about building this code base, see the [Development](docs/Development.md). To create an official release, see the [Release](docs/ReleaseProcess.md) documentation. - diff --git a/docs/Development.md b/docs/Development.md index 5dddd27f1e..a497376d6d 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -2,6 +2,12 @@ The Janelia Workstation is built on top of the [Apache NetBeans Platform](https://netbeans.apache.org/kb/docs/platform/). It is recommended for developers to get familiar with the concepts used in this framework before diving into Workstation development. The best starting point is _The Definitive Guide to NetBeans Platform_ by Heiko Bock. +## Requirements + +Use JDK 21 or newer to build, run, and package the Workstation. The project is built against Apache NetBeans Platform RELEASE300 and compiles with `--release 21`, so generated classes target the Java 21 runtime level. + +The Maven enforcer accepts JDK 21 or newer. If multiple JDKs are installed, set `JAVA_HOME` to the JDK version you want Maven and `jpackage` to use. + ## Building To build the Janelia Workstation application for Janelia Research Campus, use the `janeliaws` profile: @@ -14,6 +20,57 @@ To build the Janelia HortaCloud application, use the `horta` profile: mvn --batch-mode -T 8 -Djava.awt.headless=true -P horta clean install ``` +To build the full project without running tests: +``` +mvn -DskipTests compile +``` + +### Packaging + +Native application images and installers are built with `jpackage`. + +Run package builds with JDK 21 or newer. For example, on macOS, to select JDK 21 explicitly: + +``` +JAVA_HOME=$(/usr/libexec/java_home -v 21) +``` + +To build the Janelia Workstation application image: +``` +mvn -Pjaneliaws,deployment -pl modules/application -am -DskipTests -Djpackage.type=APP_IMAGE package +``` + +The generated application image is written under: +``` +modules/application/target/jpackage/ +``` + +To build the Horta application image: +``` +mvn -Phorta,deployment -pl modules/application_horta -am -DskipTests -Djpackage.type=APP_IMAGE package +``` + +The generated application image is written under: +``` +modules/application_horta/target/jpackage/ +``` + +To build a native installer instead of an application image, change `jpackage.type` to the package type for the target operating system: +``` +# macOS +-Djpackage.type=DMG +-Djpackage.type=PKG + +# Windows +-Djpackage.type=MSI +-Djpackage.type=EXE + +# Linux +-Djpackage.type=DEB +``` + +Native packages must be built on the target operating system. For example, build `DMG` or `PKG` on macOS, `MSI` or `EXE` on Windows, and `DEB` on Linux. + ## Running To run the Janelia Workstation application, use the `janeliaws` profile: diff --git a/docs/ReleaseProcess.md b/docs/ReleaseProcess.md index c4fe651b59..d31888b726 100644 --- a/docs/ReleaseProcess.md +++ b/docs/ReleaseProcess.md @@ -4,6 +4,8 @@ The Workstation client is built and distributed using the [Apache NetBeans Platf ./release.sh +Release builds should be run with JDK 21 or newer. The client is built against Apache NetBeans Platform RELEASE300 and compiles with `--release 21`. + The version number should be in [Semantic Versioning](https://semver.org/) style. This release process automatically increments all module versions, and sets the overall Workstation version. You can then proceed over to the [jacs-cm](https://github.com/JaneliaSciComp/jacs-cm) repository to rebuild the workstation-site container using your newly released Workstation version. ## Docker Build diff --git a/modules/AdministrationGUI/pom.xml b/modules/AdministrationGUI/pom.xml index 770f5d301a..0271d7ff35 100644 --- a/modules/AdministrationGUI/pom.xml +++ b/modules/AdministrationGUI/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. AdministrationGUI org.janelia.workstation adminstration - 9.21 + 10.0 nbm @@ -111,7 +111,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/ColorDepthSearch/pom.xml b/modules/ColorDepthSearch/pom.xml index d14f546fa3..de361a47ab 100644 --- a/modules/ColorDepthSearch/pom.xml +++ b/modules/ColorDepthSearch/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. ColorDepthSearch org.janelia.workstation colordepth - 9.21 + 10.0 nbm @@ -82,7 +82,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/CommonGUI/pom.xml b/modules/CommonGUI/pom.xml index 24ce314eae..0351b27920 100644 --- a/modules/CommonGUI/pom.xml +++ b/modules/CommonGUI/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. CommonGUI org.janelia.workstation common-gui - 9.21 + 10.0 nbm @@ -124,7 +124,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/CommonGUI/src/main/java/org/janelia/workstation/common/gui/progress/SharedProgressBarUI.java b/modules/CommonGUI/src/main/java/org/janelia/workstation/common/gui/progress/SharedProgressBarUI.java index 02dff80f2e..4874a59b89 100644 --- a/modules/CommonGUI/src/main/java/org/janelia/workstation/common/gui/progress/SharedProgressBarUI.java +++ b/modules/CommonGUI/src/main/java/org/janelia/workstation/common/gui/progress/SharedProgressBarUI.java @@ -3,8 +3,7 @@ import org.eclipse.jetty.util.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import sun.swing.DefaultLookup; - +import javax.swing.UIManager; import javax.swing.BoundedRangeModel; import javax.swing.JComponent; import javax.swing.JProgressBar; @@ -459,7 +458,8 @@ private int getRepaintInterval() { } private int initRepaintInterval() { - repaintInterval = DefaultLookup.getInt(progressBar, this, "ProgressBar.repaintInterval", 50); + repaintInterval = UIManager.getInt("ProgressBar.repaintInterval"); + if (repaintInterval == 0) repaintInterval = 50; return repaintInterval; } @@ -478,7 +478,8 @@ private int initRepaintInterval() { // } private int initCycleTime() { - cycleTime = DefaultLookup.getInt(progressBar, this, "ProgressBar.cycleTime", 3000); + cycleTime = UIManager.getInt("ProgressBar.cycleTime"); + if (cycleTime == 0) cycleTime = 3000; return cycleTime; } diff --git a/modules/CommonLibraries/pom.xml b/modules/CommonLibraries/pom.xml index 0cdb1d1406..833ed4e140 100644 --- a/modules/CommonLibraries/pom.xml +++ b/modules/CommonLibraries/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. CommonLibraries org.janelia.workstation libraries - 9.21 + 10.0 nbm @@ -57,6 +57,10 @@ org.janelia.jacs-storage jacsstorage-clients + + org.janelia.workstation + woodstoxlib + org.janelia.legacy shared @@ -76,11 +80,6 @@ jai-core 1.1.3 - - com.sun.media - jai-codec - 1.1.3 - com.twelvemonkeys.imageio @@ -135,6 +134,16 @@ com.fasterxml.jackson.dataformat jackson-dataformat-xml ${janeliaws.jackson.version} + + + com.fasterxml.woodstox + woodstox-core + + + org.codehaus.woodstox + stax2-api + + com.fasterxml.jackson.dataformat @@ -286,6 +295,12 @@ org.apache.solr solr-solrj 3.5.0 + + + org.codehaus.woodstox + wstx-asl + + org.apache.jackrabbit @@ -382,7 +397,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin @@ -456,7 +471,6 @@ com.google.common.reflect com.google.common.util.concurrent com.google.gwt.user.client.rpc - com.sun.media.jai.codec com.twelvemonkeys com.twelvemonkeys.image com.twelvemonkeys.io diff --git a/modules/Core/pom.xml b/modules/Core/pom.xml index 2aba38c292..2cd80fd4dd 100644 --- a/modules/Core/pom.xml +++ b/modules/Core/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. Core org.janelia.workstation core - 9.21 + 10.0 nbm @@ -52,6 +52,14 @@ org.netbeans.api org-openide-dialogs + + org.netbeans.api + org-openide-filesystems + + + org.netbeans.api + org-openide-filesystems-nb + org.netbeans.api org-openide-modules @@ -99,6 +107,34 @@ test + + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 + + + org.glassfish.jaxb + jaxb-runtime + 2.3.8 + runtime + + + jakarta.activation + jakarta.activation-api + 1.2.2 + + + jakarta.xml.ws + jakarta.xml.ws-api + 2.3.3 + + + jakarta.jws + jakarta.jws-api + 2.1.0 + + @@ -110,6 +146,12 @@ org.apache.axis2 axis2-kernel 1.5.6 + + + org.codehaus.woodstox + wstx-asl + + org.apache.axis2 @@ -125,6 +167,12 @@ org.apache.ws.commons.axiom axiom-impl 1.2.12 + + + org.codehaus.woodstox + wstx-asl + + org.eclipse.jetty @@ -171,7 +219,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/Core/src/main/java/org/janelia/workstation/core/filecache/AbstractWebDav.java b/modules/Core/src/main/java/org/janelia/workstation/core/filecache/AbstractWebDav.java index 3813984d85..185f5e165d 100644 --- a/modules/Core/src/main/java/org/janelia/workstation/core/filecache/AbstractWebDav.java +++ b/modules/Core/src/main/java/org/janelia/workstation/core/filecache/AbstractWebDav.java @@ -1,7 +1,5 @@ package org.janelia.workstation.core.filecache; -import com.sun.org.apache.xpath.internal.operations.Mult; - import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.http.HttpStatus; diff --git a/modules/Core/src/main/java/org/janelia/workstation/core/util/SystemInfo.java b/modules/Core/src/main/java/org/janelia/workstation/core/util/SystemInfo.java index 748b730082..4cf3d1d17b 100644 --- a/modules/Core/src/main/java/org/janelia/workstation/core/util/SystemInfo.java +++ b/modules/Core/src/main/java/org/janelia/workstation/core/util/SystemInfo.java @@ -1,11 +1,14 @@ package org.janelia.workstation.core.util; +import java.io.File; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryMXBean; +import java.lang.management.MemoryUsage; + import org.openide.modules.InstalledFileLocator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; - /** * Adapted from IDEA code base. * @@ -24,8 +27,8 @@ public class SystemInfo { public static final String JAVA_VERSION = System.getProperty("java.version", "unknown"); public static final String JAVA_RUNTIME_NAME = System.getProperty("java.runtime.name", "Java"); public static final String JAVA_RUNTIME_VERSION = System.getProperty("java.runtime.version", "unknown"); - public static final String ARCH_DATA_MODEL = System.getProperty("sun.arch.data.model"); - public static final String SUN_DESKTOP = System.getProperty("sun.desktop"); + public static final String ARCH_DATA_MODEL = System.getProperty("sun.arch.data.model", "64"); + public static final String SUN_DESKTOP = System.getProperty("sun.desktop", ""); public static final String DOWNLOADS_DIR = "Downloads"; public static final String WORKSTATION_FILES_DIR = "Workstation"; @@ -45,8 +48,8 @@ public class SystemInfo { public static final boolean isLinux = OS_NAME_LC.startsWith("linux"); public static final boolean isUnix = !isWindows && !isOS2; - public static final boolean isKDE = SUN_DESKTOP != null && SUN_DESKTOP.toLowerCase().contains("kde"); - public static final boolean isGnome = SUN_DESKTOP != null && SUN_DESKTOP.toLowerCase().contains("gnome"); + public static final boolean isKDE = SUN_DESKTOP.toLowerCase().contains("kde"); + public static final boolean isGnome = SUN_DESKTOP.toLowerCase().contains("gnome"); public static final boolean isMacSystemMenu = isMac && "true".equals(System.getProperty("apple.laf.useScreenMenuBar")); @@ -140,29 +143,24 @@ public static String getInstallDir() { return cp.substring(0,cp.indexOf("JaneliaWorkstation")+"JaneliaWorkstation".length()); } - private static com.sun.management.OperatingSystemMXBean getOSMXBean() { - java.lang.management.OperatingSystemMXBean mxbean = java.lang.management.ManagementFactory.getOperatingSystemMXBean(); - com.sun.management.OperatingSystemMXBean sunmxbean = (com.sun.management.OperatingSystemMXBean) mxbean; - return sunmxbean; - } - public static Long getTotalSystemMemory() { try { - return getOSMXBean().getTotalPhysicalMemorySize(); + MemoryMXBean memXBean = ManagementFactory.getMemoryMXBean(); + return memXBean.getHeapMemoryUsage().getInit(); } - catch (Throwable e) { - log.error("Could not retrieve total system memory",e); - return null; + catch (Exception e) { + throw new IllegalStateException("Could not retrieve total system memory", e); } } public static Long getFreeSystemMemory() { try { - return getOSMXBean().getFreePhysicalMemorySize(); + MemoryMXBean memXBean = ManagementFactory.getMemoryMXBean(); + MemoryUsage memUsage = memXBean.getHeapMemoryUsage(); + return memUsage.getInit() - memUsage.getUsed(); } catch (Throwable e) { - log.error("Could not retrieve total system memory",e); - return null; + throw new IllegalStateException("Could not retrieve free system memory", e); } } diff --git a/modules/DarculaLAF/pom.xml b/modules/DarculaLAF/pom.xml deleted file mode 100644 index e23287914c..0000000000 --- a/modules/DarculaLAF/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - 4.0.0 - - org.janelia - workstation - 9.21 - ../.. - - - DarculaLAF - org.janelia.workstation - darcula - 9.21 - nbm - - - - - - org.janelia.thirdparty - custom-darcula - 1.0.0 - - - - - org.netbeans.api - org-netbeans-modules-options-api - - - org.netbeans.api - org-netbeans-swing-plaf - - - org.netbeans.api - org-openide-awt - - - org.netbeans.api - org-openide-dialogs - - - org.netbeans.api - org-openide-modules - - - org.netbeans.api - org-openide-util - - - org.netbeans.api - org-openide-util-lookup - - - org.netbeans.api - org-openide-util-ui - - - org.netbeans.api - org-openide-windows - - - - - - - - org.codehaus.mojo - nbm-maven-plugin - - - - - diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/DarculaLFCustoms.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/DarculaLFCustoms.java deleted file mode 100644 index 8e8496f74f..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/DarculaLFCustoms.java +++ /dev/null @@ -1,879 +0,0 @@ -package com.revivius.nb.darcula; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.event.KeyEvent; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.prefs.Preferences; - -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.InputMap; -import javax.swing.KeyStroke; -import javax.swing.UIManager; -import javax.swing.border.Border; -import javax.swing.border.MatteBorder; -import javax.swing.plaf.ColorUIResource; - -import org.netbeans.swing.plaf.LFCustoms; -import org.openide.util.ImageUtilities; -import org.openide.util.Lookup; -import org.openide.util.NbPreferences; - -import com.revivius.nb.darcula.options.DarculaLAFOptionsPanelController; -import com.revivius.nb.darcula.options.DarculaLAFPanel; -import com.revivius.nb.darcula.ui.InreasedInsetsTableHeaderBorder; -import com.revivius.nb.darcula.ui.ReducedInsetsDarculaButtonPainter; - -import sun.swing.SwingLazyValue; - -/** - * LFCustoms for Darcula LAF. - * - * KR: Edited to comment out anything that is not needed by the Janelia Workstation, - * mainly IDE/editor features that are not imported by our project and cause errors. - * - * @author Revivius - */ -public class DarculaLFCustoms extends LFCustoms { - - private static final String FONT_DEFAULT_NAME = "Dialog"; - private static final int FONT_DEFAULT_SIZE = 12; - public static final String DEFAULT_FONT = FONT_DEFAULT_NAME + " " + FONT_DEFAULT_SIZE; - - private static final String TAB_FOCUS_FILL_UPPER = "tab_focus_fill_upper"; //NOI18N - private static final String TAB_FOCUS_FILL_LOWER = "tab_focus_fill_lower"; //NOI18N - - private static final String TAB_UNSEL_FILL_UPPER = "tab_unsel_fill_upper"; //NOI18N - private static final String TAB_UNSEL_FILL_LOWER = "tab_unsel_fill_lower"; //NOI18N - - private static final String TAB_SEL_FILL = "tab_sel_fill"; //NOI18N - - private static final String TAB_MOUSE_OVER_FILL_UPPER = "tab_mouse_over_fill_upper"; //NOI18N - private static final String TAB_MOUSE_OVER_FILL_LOWER = "tab_mouse_over_fill_lower"; //NOI18N - - private static final String TAB_ATTENTION_FILL_UPPER = "tab_attention_fill_upper"; //NOI18N - private static final String TAB_ATTENTION_FILL_LOWER = "tab_attention_fill_lower"; //NOI18N - - private static final String TAB_BORDER = "tab_border"; //NOI18N - private static final String TAB_SEL_BORDER = "tab_sel_border"; //NOI18N - private static final String TAB_BORDER_INNER = "tab_border_inner"; //NOI18N - - @Override - public Object[] createGuaranteedKeysAndValues() { - // same color for DarculaMetalTheme getAcceleratorForeground() - Color asfg = new ColorUIResource(187, 187, 187); - - Object[] result = { - "controlShadow", new ColorUIResource(41, 43, 45), - "controlHighlight", new ColorUIResource(70, 72, 74), - "controlDkShadow", new ColorUIResource(41, 43, 45), - "controlLtHighlight", new ColorUIResource(70, 72, 74), - - "Menu.acceleratorSelectionForeground", asfg, - "MenuItem.acceleratorSelectionForeground", asfg, - "CheckBoxMenuItem.acceleratorSelectionForeground", asfg, - "RadioButtonMenuItem.acceleratorSelectionForeground", asfg - }; - - return result; - } - - @Override - public Object[] createLookAndFeelCustomizationKeysAndValues() { - Preferences prefs = NbPreferences.forModule(DarculaLAFPanel.class); - boolean useStretchedTabs = prefs.getBoolean(DarculaLAFOptionsPanelController.STRETCHED_TABS_BOOLEAN, false); - if (useStretchedTabs) { - // stretch view tabs - System.setProperty("winsys.stretching_view_tabs", "true"); - // stretching view tabs seems to be causing resize problems - System.setProperty("NB.WinSys.Splitter.Respect.MinimumSize.Enabled", "false"); - } - - Font controlFont = Font.decode(DEFAULT_FONT); - Integer in = (Integer) UIManager.get(CUSTOM_FONT_SIZE); //NOI18N - if (in != null) { - controlFont = Font.decode(FONT_DEFAULT_NAME + " " + in); - } - - boolean overrideFontOption = prefs.getBoolean(DarculaLAFOptionsPanelController.OVERRIDE_FONT_BOOLEAN, false); - if (overrideFontOption) { - String fontOption = prefs.get(DarculaLAFOptionsPanelController.FONT_STRING, DEFAULT_FONT); - controlFont = Font.decode(fontOption); - } - - /** - * HtmlLabelUI sets the border color to BLUE for focused cells if - * "Tree.selectionBorderColor" is same as background color (see lines - * 230 - 247). Here we modify "Tree.selectionBorderColor" slightly. - * Modification is not noticable to naked eye but enough to stop - * HtmlLabelUI to set focused renderer border color to BLUE. - */ - Color c = UIManager.getColor("Tree.selectionBackground"); - Color focusColor = new Color(c.getRed(), c.getGreen(), c.getBlue() + 1); - - Color foreground1 = new Color(220, 220, 220); // Brightest foreground, for sparse, important things - Color foreground2 = new Color(200, 200, 200); // Dimmer foreground, for things that shouldn't pop as much - Color foreground3 = new Color(190, 190, 190); // Ever dimmer foreground, for things that might be very dense like tables - Color foreground4 = new Color(110, 110, 110); // Dimmest foreground, for disabled items - - Object[] result = { - // The assorted standard NetBeans metal font customizations - CONTROLFONT, controlFont, - SYSTEMFONT, controlFont, - USERFONT, controlFont, - MENUFONT, controlFont, - WINDOWTITLEFONT, controlFont, - SUBFONT, controlFont.deriveFont(Font.PLAIN, Math.min(controlFont.getSize() - 1, 6)), - - - //################################################################################################################## - // Begin customizations for Janelia Workstation - //################################################################################################################## - - // Make all the common labels slightly brighter - "Label.foreground", foreground1, - "CheckBox.foreground", foreground2, - "ProgressBar.foreground", foreground2, - "RadioButton.foreground", foreground2, - - // Menus - "Menu.foreground", foreground2, - "MenuItem.foreground", foreground2, - "CheckBoxMenuItem.foreground", foreground2, - "RadioButtonMenuItem.foreground", foreground2, - "PopupMenu.foreground", foreground2, - - // Disabled menus - "Menu.disabledForeground", foreground4, - "MenuItem.disabledForeground", foreground4, - "CheckBoxMenuItem.disabledForeground", foreground4, - "RadioButtonMenuItem.disabledForeground", foreground4, - "PopupMenu.disabledForeground", foreground4, - - // Menu accelerators - "Menu.acceleratorForeground", foreground4, - "MenuItem.acceleratorForeground", foreground4, - "CheckBoxMenuItem.acceleratorForeground", foreground4, - "RadioButtonMenuItem.acceleratorForeground", foreground4, - - // Explorer trees - "Tree.foreground", foreground1, - "Tree.textForeground", foreground1, - - // Tables - "Table.foreground", foreground3, - "TableHeader.foreground", foreground2, - "Table.cellNoFocusBorder", new TransparentBorder(), - "Table.focusSelectedCellHighlightBorder", new TransparentBorder(), - - // Fix for submenus - "MenuUI", "com.revivius.nb.darcula.ui.FixedMenuUI", - "MenuItemUI", "com.revivius.nb.darcula.ui.FixedMenuItemUIBase", - "RadioButtonMenuItemUI", "com.revivius.nb.darcula.ui.FixedRadioButtonMenuItemUI", - "CheckBoxMenuItemUI", "com.revivius.nb.darcula.ui.FixedCheckBoxMenuItemUI", - - // Fix for table - "TableHeaderUI", "com.revivius.nb.darcula.ui.FixedTableHeaderUI", - - //################################################################################################################## - // End customizations for Janelia Workstation - //################################################################################################################## - - - // Bug in JDK 1.5 thru b59 - pale blue is incorrectly returned for this - "textInactiveText", Color.GRAY, - - /** - * Work around a bug in windows which sets the text area font to - * "MonoSpaced", causing all accessible dialogs to have monospaced text - */ - "TextArea.font", new GuaranteedValue("Label.font", controlFont), - - /** - * HtmlLabelUI uses UIManager.getColor("text") to find background - * color for unselected items. Make sure the background color used - * by HtmlLabelUI is same with the LAF. - */ - "text", new Color(60, 63, 65), - "textText", new Color(187, 187, 187), - "infoText", new Color(187, 187, 187), - - "TabbedPaneUI", "com.revivius.nb.darcula.ui.DarkScrollButtonTabbedPaneUI", - - "LabelUI", "com.revivius.nb.darcula.ui.OptionsAwareLabelUI", - "Label.font", controlFont, - - "ButtonUI", "com.revivius.nb.darcula.ui.ContentAreaAwareButtonUI", - "Button.border", new ReducedInsetsDarculaButtonPainter(), - "Button.font", controlFont, - - "ToggleButtonUI", "com.revivius.nb.darcula.ui.ContentAreaAwareToggleButtonUI", - "ToggleButton.border", new ReducedInsetsDarculaButtonPainter(), - "ToggleButton.font", controlFont, - - "ToolBarUI", "com.revivius.nb.darcula.ui.RolloverToolBarUI", - "ToolBar.font", controlFont, - - "SplitPaneUI", "com.revivius.nb.darcula.ui.DarculaSplitPaneUI", - - SPINNERFONT, controlFont, - "Spinner.font", controlFont, - - /** - * #31 - * Icon provided by Aqua LAF is not visible on dark background - * provide default Metal arrow icon for all LAFs - */ - "Menu.arrowIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getMenuArrowIcon"), - "Menu.acceleratorFont", controlFont, - "Menu.font", controlFont, - - "Table.font", controlFont, - "Table.ascendingSortIcon", new ImageIcon(DarculaLFCustoms.class.getResource("column-asc.png")), - "Table.descendingSortIcon", new ImageIcon(DarculaLFCustoms.class.getResource("column-desc.png")), - "Table.focusCellHighlightBorder", new TransparentBorder(), - - "TableHeader.cellBorder", new InreasedInsetsTableHeaderBorder(), - "TableHeader.font", controlFont, - - "TitledBorder.border", BorderFactory.createLineBorder(new Color(41, 43, 45), 1), - "TitledBorder.font", controlFont, - - "MenuItem.acceleratorForeground", new Color(238, 238, 238), - "MenuItem.acceleratorFont", controlFont, - "MenuItem.font", controlFont, - - LISTFONT, controlFont, - "List.font", controlFont, - "List.focusCellHighlightBorder", new TransparentBorder(), - - "TreeUI", "com.revivius.nb.darcula.ui.IndentAwareTreeUI", - TREEFONT, controlFont, - "Tree.font", controlFont, - "Tree.closedIcon", new ImageIcon(DarculaLFCustoms.class.getResource("open.png")), - "Tree.openIcon", new ImageIcon(DarculaLFCustoms.class.getResource("open.png")), - "Tree.selectionBorderColor", focusColor, // Use calculateD border color for HtmlLabelUI. - - // FileChooser icons - "FileView.directoryIcon", new ImageIcon(DarculaLFCustoms.class.getResource("closed.png")), - "FileView.fileIcon", new ImageIcon(DarculaLFCustoms.class.getResource("file.png")), - - "FileChooser.newFolderIcon", new ImageIcon(DarculaLFCustoms.class.getResource("newFolder.png")), - "FileChooser.upFolderIcon", new ImageIcon(DarculaLFCustoms.class.getResource("upFolder.png")), - "FileChooser.homeFolderIcon", new ImageIcon(DarculaLFCustoms.class.getResource("homeFolder.png")), - "FileChooser.detailsViewIcon", new ImageIcon(DarculaLFCustoms.class.getResource("detailsView.png")), - "FileChooser.listViewIcon", new ImageIcon(DarculaLFCustoms.class.getResource("listView.png")), - "FileChooser.computerIcon", new ImageIcon(DarculaLFCustoms.class.getResource("computer.png")), - "FileChooser.hardDriveIcon", new ImageIcon(DarculaLFCustoms.class.getResource("hardDrive.png")), - "FileChooser.floppyDriveIcon", new ImageIcon(DarculaLFCustoms.class.getResource("floppyDrive.png")), - - "CheckBox.font", controlFont, - "CheckBoxMenuItem.acceleratorFont", controlFont, - "CheckBoxMenuItem.font", controlFont, - "CheckBoxMenuItem.acceleratorForeground", new Color(238, 238, 238), - - "ColorChooser.font", controlFont, - - "ComboBox.font", controlFont, - - "EditorPane.font", controlFont, - - "FormattedTextField.font", controlFont, - - "IconButton.font", controlFont, - - "InternalFrame.optionDialogTitleFont", controlFont, - "InternalFrame.paletteTitleFont", controlFont, - "InternalFrame.titleFont", controlFont, - - "MenuBar.font", controlFont, - - "OptionPane.buttonFont", controlFont, - "OptionPane.font", controlFont, - "OptionPane.messageFont", controlFont, - "OptionPane.messageForeground", new Color(187, 187, 187), - - PANELFONT, controlFont, - "Panel.font", controlFont, - - "PasswordField.font", controlFont, - - "PopupMenu.font", controlFont, - - "ProgressBar.font", controlFont, - - "RadioButton.font", controlFont, - "RadioButtonMenuItem.acceleratorFont", controlFont, - "RadioButtonMenuItem.font", controlFont, - "RadioButtonMenuItem.acceleratorForeground", new Color(238, 238, 238), - - "ScrollPane.font", controlFont, - - "Slider.font", controlFont, - - "TabbedPane.font", controlFont, - //"TabbedPane.smallFont", controlFont, - - "TextArea.font", controlFont, - - "TextField.font", controlFont, - - "TextPane.font", controlFont, - - "ToolTip.font", controlFont, - "ToolTip.border", BorderFactory.createLineBorder(new Color(154, 154, 102)), - "ToolTip.borderInactive", BorderFactory.createLineBorder(new Color(154, 154, 102)), - "ToolTip.foregroundInactive", new Color(187, 187, 187), - "ToolTip.backgroundInactive", new Color(92, 92, 66), - - "Viewport.font", controlFont, - }; - - removeEnterFromTreeInputMap(); - - // KR: disable these because we don't use any editors, so it causes errors during L&F initialization -// replaceSearchNotFoundColor(); -// replaceGlyphGutterLineColor(); -// replaceFormDesignerGapBorderColors(); - - replaceLFCustomsTextFgColors(); -// replaceCompletionColors(); -// replaceSQLCompletionColumnColor(); -// replaceJSPCompletionColor(); -// replaceHTMLCompletionColor(); -// replaceCSSPreprocessorCompletionColors(); -// replaceProjectTabColors(); - - return result; - } - - @Override - public Object[] createApplicationSpecificKeysAndValues() { - UIBootstrapValue editorTabsUI = new Windows8EditorColorings( - "org.netbeans.swing.tabcontrol.plaf.Windows8EditorTabDisplayerUI"); - Object viewTabsUI = editorTabsUI.createShared( - "org.netbeans.swing.tabcontrol.plaf.Windows8ViewTabDisplayerUI"); - Object propertySheetValues = new Windows8PropertySheetColorings(); - - Object[] result = { - - - //################################################################################################################## - // Begin customizations for Janelia Workstation - //################################################################################################################## - - // Domain explorer trees - "ws.TreeSecondaryLabel", new Color(172, 145, 83), // Yellowish label for displaying the owner of each node - "ws.TreeExtraLabel", new Color(175, 170, 157), // A third (less-important) label which might contain the size or type of the node - "ws.ComponentBorderColor", new Color(41, 43, 45), - - //################################################################################################################## - // End customizations for Janelia Workstation - //################################################################################################################## - - - // enable _dark postfix for resource loading - "nb.dark.theme", Boolean.TRUE, - "nb.wizard.hideimage", Boolean.TRUE, - - // main toolbar - "Nb.MainWindow.Toolbar.Dragger", "com.revivius.nb.darcula.ToolbarXP", - "Nb.MainWindow.Toolbar.Border", BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(41, 43, 45)), - "Nb.ToolBar.border", BorderFactory.createEmptyBorder(), - - EDITOR_TAB_DISPLAYER_UI, editorTabsUI, - VIEW_TAB_DISPLAYER_UI, viewTabsUI, - SLIDING_BUTTON_UI, "org.netbeans.swing.tabcontrol.plaf.WinXPSlidingButtonUI", - PROPERTYSHEET_BOOTSTRAP, propertySheetValues, - - SCROLLPANE_BORDER, BorderFactory.createLineBorder(new Color(41, 43, 45)), - SCROLLPANE_BORDER_COLOR, new Color(41, 43, 45), - - EDITOR_TOOLBAR_BORDER, BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(41, 43, 45)), - EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(16, 0, 16, 0), - - DESKTOP_BACKGROUND, Color.RED, - DESKTOP_BORDER, BorderFactory.createEmptyBorder(), - WORKPLACE_FILL, Color.RED, - - DESKTOP_SPLITPANE_BORDER, BorderFactory.createEmptyBorder(), - SPLIT_PANE_DIVIDER_SIZE_VERTICAL, 2, - SPLIT_PANE_DIVIDER_SIZE_HORIZONTAL, 2, - - WARNING_FOREGROUND, new Color(254, 183, 24), - ERROR_FOREGROUND, new Color(255, 102, 102), - - // quicksearch - "nb.quicksearch.border", BorderFactory.createEmptyBorder(), - - // progress ui - "nb.progress.cancel.icon", ImageUtilities.loadImage("org/openide/awt/resources/mac_close_rollover_dark.png", false), - "nb.progress.cancel.icon.mouseover", ImageUtilities.loadImage("org/openide/awt/resources/mac_close_enabled_dark.png", false), - "nb.progress.cancel.icon.pressed", ImageUtilities.loadImage("org/openide/awt/resources/mac_close_pressed_dark.png", false), - - // explorer views - "nb.explorer.unfocusedSelBg", new Color(13, 41, 62), - "nb.explorer.unfocusedSelFg", new Color(187, 187, 187), - "nb.explorer.noFocusSelectionBackground", new Color(13, 41, 62), - "nb.explorer.noFocusSelectionForeground", new Color(187, 187, 187), - "ETableHeader.ascendingIcon", new ImageIcon(DarculaLFCustoms.class.getResource("column-asc.png")), - "ETableHeader.descendingIcon", new ImageIcon(DarculaLFCustoms.class.getResource("column-desc.png")), - - // popup switcher - "nb.popupswitcher.border", BorderFactory.createLineBorder(new Color(45, 45, 45)), - - // debugger - "nb.debugger.debugging.currentThread", new Color(30, 80, 28), - "nb.debugger.debugging.highlightColor", new Color(40, 60, 38), - "nb.debugger.debugging.BPHits", new Color(65, 65, 0), - "nb.debugger.debugging.bars.BPHits", new Color(120, 120, 25), - "nb.debugger.debugging.bars.currentThread", new Color(40, 100, 35), - - // heapview - "nb.heapview.border1", new Color(113, 113, 113), - "nb.heapview.border2", new Color(91, 91, 95), - "nb.heapview.border3", new Color(128, 128, 128), - "nb.heapview.foreground", new Color(222, 222, 222), - "nb.heapview.background1", new Color(53, 56, 58), - "nb.heapview.background2", new Color(50, 66, 114), - "nb.heapview.grid1.start", new Color(97, 95, 87), - "nb.heapview.grid1.end", new Color(98, 96, 88), - "nb.heapview.grid2.start", new Color(99, 97, 90), - "nb.heapview.grid2.end", new Color(101, 99, 92), - "nb.heapview.grid3.start", new Color(102, 101, 93), - "nb.heapview.grid3.end", new Color(105, 103, 95), - "nb.heapview.grid4.start", new Color(107, 105, 97), - "nb.heapview.grid4.end", new Color(109, 107, 99), - - // bug tracking - "nb.bugtracking.comment.background", new Color(59, 63, 64), - "nb.bugtracking.comment.foreground", new Color(187, 187, 187), - "nb.bugtracking.label.highlight", new Color(205, 205, 0), - "nb.bugtracking.table.background", new Color(59, 63, 64), - "nb.bugtracking.table.background.alternate", new Color(69, 73, 74), - "nb.bugtracking.new.color", new Color(73, 210, 73), - "nb.bugtracking.modified.color", new Color(26, 184, 255), - "nb.bugtracking.obsolete.color", new Color(142, 142, 142), - "nb.bugtracking.conflict.color", new Color(255, 100, 100), - - // db.dataview - "nb.dataview.table.gridbackground", UIManager.getColor("Table.gridColor"), - "nb.dataview.table.background", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.background"), - "nb.dataview.table.altbackground", new RelativeColor(new Color(0, 0, 0), new Color(30, 30, 30), "Table.background"), - "nb.dataview.table.sqlconstant.foreground", new Color(220, 220, 220), - "nb.dataview.tablecell.focused", /*new RelativeColor(new Color(0, 0, 0), new Color(10, 10, 30), "Table.selectionBackground"), */ new Color(13, 41, 62), - "nb.dataview.table.rollOverRowBackground", new RelativeColor(new Color(0, 0, 0), new Color(30, 30, 30), "Table.selectionBackground"), - "nb.dataview.tablecell.edited.selected.foreground", new Color(241, 255, 177), - "nb.dataview.tablecell.edited.unselected.foreground", /*new Color(0, 255, 16),*/ new Color(172, 221, 124), - "nb.dataview.jxdatetimepicker.background", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.background"), - "nb.dataview.jxdatetimepicker.foreground", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.foreground"), - "nb.dataview.jxdatetimepicker.selectedBackground", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.selectionBackground"), - "nb.dataview.jxdatetimepicker.selectedForeground", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.selectionForeground"), - "nb.dataview.jxdatetimepicker.daysOfTheWeekForeground", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.background"), - "nb.dataview.jxdatetimepicker.todayBackground", new RelativeColor(new Color(0, 0, 0), new Color(20, 20, 20), "TableHeader.background"), - "nb.dataview.jxdatetimepicker.todayPanel.background.gradient.start", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "TableHeader.background"), - "nb.dataview.jxdatetimepicker.todayPanel.background.gradient.end", new RelativeColor(new Color(0, 0, 0), new Color(10, 10, 10), "TableHeader.background"), - "nb.dataview.jxdatetimepicker.todayPanel.linkForeground", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "TableHeader.foreground"), - - // form designer - "nb.formdesigner.gap.fixed.color", new Color(70, 73, 75), - "nb.formdesigner.gap.resizing.color", new Color(66, 69, 71), - "nb.formdesigner.gap.min.color", new Color(78, 81, 83), - - // link - "nb.html.link.foreground", new Color(125, 160, 225), //NOI18N - "nb.html.link.foreground.hover", new Color(13, 41, 62), //NOI18N - "nb.html.link.foreground.visited", new Color(125, 160, 225), //NOI18N - "nb.html.link.foreground.focus", new Color(13, 41, 62), //NOI18N - - // startpage - "nb.startpage.defaultbackground", Boolean.TRUE, - "nb.startpage.defaultbuttonborder", Boolean.TRUE, - "nb.startpage.bottombar.background", new Color(13, 41, 62), - "nb.startpage.topbar.background", new Color(13, 41, 62), - "nb.startpage.border.color", new Color(13, 41, 62), - "nb.startpage.tab.border1.color", new Color(13, 41, 62), - "nb.startpage.tab.border2.color", new Color(13, 41, 62), - "nb.startpage.rss.details.color", new Color(187, 187, 187), - "nb.startpage.rss.header.color", new Color(125, 160, 225), - "nb.startpage.tab.imagename.selected", "org/netbeans/modules/welcome/resources/tab_selected_dark.png", //NOI18N - "nb.startpage.tab.imagename.rollover", "org/netbeans/modules/welcome/resources/tab_rollover_dark.png", //NOI18N - "nb.startpage.imagename.contentheader", "org/netbeans/modules/welcome/resources/content_banner_dark.png", //NOI18N - "nb.startpage.contentheader.color1", new Color(12, 33, 61), - "nb.startpage.contentheader.color2", new Color(16, 24, 42), - - // autoupdate - "nb.autoupdate.search.highlight", new Color(13, 41, 62), - - // notification displayer balloon - "nb.core.ui.balloon.defaultGradientStartColor", new Color(92, 92, 66), - "nb.core.ui.balloon.defaultGradientFinishColor", new Color(92, 92, 66), - "nb.core.ui.balloon.mouseOverGradientStartColor", new Color(92, 92, 66), - "nb.core.ui.balloon.mouseOverGradientFinishColor", new Color(92, 92, 66).brighter(), - - // git - "nb.versioning.added.color", new Color(73, 210, 73), - "nb.versioning.modified.color", new Color(26, 184, 255), - "nb.versioning.deleted.color", new Color(255, 175, 175), - "nb.versioning.conflicted.color", new Color(255, 100, 100), - "nb.versioning.ignored.color", new Color(142, 142, 142), - "nb.versioning.textannotation.color", Color.WHITE, - "nb.versioning.tooltip.background.color", new Color(92, 92, 66), - - // diff - "nb.diff.added.color", new Color(43, 85, 43), - "nb.diff.changed.color", new Color(40, 85, 112), - "nb.diff.deleted.color", new Color(85, 43, 43), - "nb.diff.applied.color", new Color(68, 113, 82), - "nb.diff.notapplied.color", new Color(67, 105, 141), - "nb.diff.unresolved.color", new Color(130, 30, 30), - "nb.diff.sidebar.deleted.color", new Color(85, 43, 43), - "nb.diff.sidebar.changed.color", new Color(30, 75, 112), - - // output - "nb.output.backgorund", new Color(43, 43, 43), - "nb.output.foreground", new Color(187, 187, 187), - "nb.output.input", new Color(0, 127, 0), - "nb.output.err.foreground", new Color(255, 107, 104), - "nb.output.link.foreground", new Color(126, 174, 241), - "nb.output.link.foreground.important", new Color(126, 174, 241), - "nb.output.warning.foreground", new Color(205, 205, 0), - "nb.output.failure.foreground", new Color(255, 107, 104), - "nb.output.success.foreground", new Color(112, 255, 112), - "nb.output.debug.foreground", new Color(145, 145, 145), - "textHighlight", new Color(240, 119, 70), - }; - - result = maybeEnableIconFilter(result); - - return result; - } - - private class Windows8EditorColorings extends UIBootstrapValue.Lazy { - - public Windows8EditorColorings(String name) { - super(name); - } - - @Override - public Object[] createKeysAndValues() { - return new Object[]{ - //selected & focused - TAB_FOCUS_FILL_UPPER, new Color(75, 110, 175), - TAB_FOCUS_FILL_LOWER, new Color(65, 81, 109), - - //no selection, no focus - TAB_UNSEL_FILL_UPPER, new Color(84, 88, 91), - TAB_UNSEL_FILL_LOWER, new Color(56, 58, 60), - - //selected, no focus - TAB_SEL_FILL, new Color(84, 88, 91), - - //no selection, mouse over - TAB_MOUSE_OVER_FILL_UPPER, new Color(114, 119, 122), - TAB_MOUSE_OVER_FILL_LOWER, new Color(98, 101, 104), - TAB_ATTENTION_FILL_UPPER, new Color(255, 255, 128), - TAB_ATTENTION_FILL_LOWER, new Color(230, 200, 64), - - TAB_BORDER, new Color(41, 43, 45), - TAB_SEL_BORDER, new Color(41, 43, 45), - TAB_BORDER_INNER, new Color(70, 72, 74), - - //Borders for the tab control - EDITOR_TAB_OUTER_BORDER, BorderFactory.createEmptyBorder(), - EDITOR_TAB_CONTENT_BORDER, BorderFactory.createCompoundBorder( - new MatteBorder(0, 1, 1, 1, new Color(41, 43, 45)), - BorderFactory.createEmptyBorder(0, 1, 0, 1) - ), - EDITOR_TAB_TABS_BORDER, BorderFactory.createEmptyBorder(), - VIEW_TAB_OUTER_BORDER, BorderFactory.createEmptyBorder(), - VIEW_TAB_CONTENT_BORDER, new MatteBorder(0, 1, 1, 1, new Color(41, 43, 45)), - VIEW_TAB_TABS_BORDER, BorderFactory.createEmptyBorder() - }; - } - } - - private class Windows8PropertySheetColorings extends UIBootstrapValue.Lazy { - - public Windows8PropertySheetColorings() { - super("propertySheet"); //NOI18N - } - - @Override - public Object[] createKeysAndValues() { - return new Object[]{ - PROPSHEET_BACKGROUND, new Color(69, 73, 74), - PROPSHEET_SELECTION_BACKGROUND, new Color(75, 110, 175), - PROPSHEET_SELECTION_FOREGROUND, Color.WHITE, - PROPSHEET_SET_BACKGROUND, new Color(82, 85, 86), - PROPSHEET_SET_FOREGROUND, Color.WHITE, - PROPSHEET_SELECTED_SET_BACKGROUND, new Color(75, 110, 175), - PROPSHEET_SELECTED_SET_FOREGROUND, Color.WHITE, - PROPSHEET_DISABLED_FOREGROUND, new Color(161, 161, 146), - PROPSHEET_BUTTON_FOREGROUND, new Color(187, 187, 187),}; - } - } - - /** - * Enables invert filter for icons if user requested. - */ - private Object[] maybeEnableIconFilter(Object[] defaults) { - if (NbPreferences.forModule(DarculaLAFPanel.class).getBoolean("invertIcons", false)) { - return appendToArray(defaults, "nb.imageicon.filter", new DarkIconFilter()); - } - return defaults; - } - - private Object[] appendToArray(Object[] result, final String key, final Object value) { - result = Arrays.copyOf(result, result.length + 2); - result[result.length - 2] = key; - result[result.length - 1] = value; - return result; - } - - /** - * DarculaLaf:L354-L358 registers ENTER to invoke 'toggle' action. This seems - * to cause problems as reported in #14 because enter key can not invoke - * default button in dialogs. - */ - private void removeEnterFromTreeInputMap() { - // Make ENTER work in JTrees - InputMap treeInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); - if (treeInputMap != null) { // it's really possible. For example, GTK+ doesn't have such map - treeInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); - } - } - - /** - * NOT_FOUND color is hardcoded, should be taken from UIManager. - * Use reflection as in DefaultOutlineCellRenderer. - */ - private static final String SEARCH_BAR_CLASS = "org.netbeans.modules.editor.search.SearchBar"; - private static final String NOT_FOUND_COLOR_FIELD = "NOT_FOUND"; - private void replaceSearchNotFoundColor() { - replaceFieldValue(SEARCH_BAR_CLASS, NOT_FOUND_COLOR_FIELD, new Color(255, 102, 102)); - } - - /** - * DEFAULT_GUTTER_LINE color is hardcoded, should be taken from UIManager. - * Use reflection as in DefaultOutlineCellRenderer. - */ - private static final String GLYPH_GUUTER_CLASS = "org.netbeans.editor.GlyphGutter"; - private static final String DEFAULT_GUTTER_LINE_COLOR_FIELD = "DEFAULT_GUTTER_LINE"; - private void replaceGlyphGutterLineColor() { - replaceFieldValue(GLYPH_GUUTER_CLASS, DEFAULT_GUTTER_LINE_COLOR_FIELD, new Color(136, 136, 136)); - } - - /** - * GAP_BORDER_COLOR and SAW_COLOR are hardcoded, should be taken from UIManager. - * Use reflection as in DefaultOutlineCellRenderer. - */ - private static final String FORMDESIGNER_LAYOUT_PAINTER_CLASS = "org.netbeans.modules.form.layoutdesign.LayoutPainter"; - private static final String GAP_BORDER_COLOR_FIELD = "gapBorderColor"; - private static final String SAW_COLOR_FIELD = "sawColor"; - private void replaceFormDesignerGapBorderColors() { - replaceFieldValue(FORMDESIGNER_LAYOUT_PAINTER_CLASS, GAP_BORDER_COLOR_FIELD, new Color(49, 53, 54)); - replaceFieldValue(FORMDESIGNER_LAYOUT_PAINTER_CLASS, SAW_COLOR_FIELD, new Color(49, 53, 54)); - } - - /** - * LFCustoms.getTextFgColor() && LFCustoms.getTextFgColorHTML() uses - * windowText. DarculaLaf does not override windowText which is initialized - * to Color.BLACK by BasicLookAndFeel (DarculaLaf uses BasicLookAndFeel - * with reflection) - */ - private static final String TEXT_FG_COLOR_HTML_FIELD = "textFgColorHTML"; - private static final String TEXT_FG_COLOR_FIELD = "textFgColor"; - private void replaceLFCustomsTextFgColors() { - replaceFieldValue(LFCustoms.class, TEXT_FG_COLOR_FIELD, new Color(187, 187, 187)); - replaceFieldValue(LFCustoms.class, TEXT_FG_COLOR_HTML_FIELD, ""); - } - - /** - * #21, #26 - * fixes code completion colors for all languages (at least for those extending GsfCompletionItem) - */ - private static final String GSF_COMPLETION_FORMATTER_CLASS = "org.netbeans.modules.csl.editor.completion.GsfCompletionItem$CompletionFormatter"; - private static final String PARAMETER_NAME_COLOR_FIELD = "PARAMETER_NAME_COLOR"; //getHTMLColor(160, 96, 1); - private static final String CLASS_COLOR_FIELD = "CLASS_COLOR"; // getHTMLColor(86, 0, 0); - private static final String PKG_COLOR_FIELD = "PKG_COLOR"; // getHTMLColor(128, 128, 128); - private static final String KEYWORD_COLOR_FIELD = "KEYWORD_COLOR"; //getHTMLColor(0, 0, 153); - private static final String FIELD_COLOR_FIELD = "FIELD_COLOR"; // getHTMLColor(0, 134, 24); - private static final String VARIABLE_COLOR_FIELD = "VARIABLE_COLOR"; // getHTMLColor(0, 0, 124); - private static final String CONSTRUCTOR_COLOR_FIELD = "CONSTRUCTOR_COLOR"; // getHTMLColor(178, 139, 0); - private static final String INTERFACE_COLOR_FIELD = "INTERFACE_COLOR"; // getHTMLColor(64, 64, 64); - private static final String PARAMETERS_COLOR_FIELD = "PARAMETERS_COLOR"; // getHTMLColor(128, 128, 128); - private void replaceCompletionColors() { - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, PARAMETER_NAME_COLOR_FIELD, getHTMLColor(new Color(255, 198, 109))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, CLASS_COLOR_FIELD, getHTMLColor(new Color(214, 128, 128))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, PKG_COLOR_FIELD, getHTMLColor(new Color(128, 214, 128))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, KEYWORD_COLOR_FIELD, getHTMLColor(new Color(180, 180, 255))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, FIELD_COLOR_FIELD, getHTMLColor(new Color(0, 202, 88))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, VARIABLE_COLOR_FIELD, getHTMLColor(new Color(0, 192, 255))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, CONSTRUCTOR_COLOR_FIELD, getHTMLColor(new Color(178, 139, 0))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, INTERFACE_COLOR_FIELD, getHTMLColor(new Color(214, 128, 128))); - replaceFieldValue(GSF_COMPLETION_FORMATTER_CLASS, PARAMETERS_COLOR_FIELD, getHTMLColor(new Color(64, 128, 64))); - } - - /** - * #67, Column color for SQL - */ - private static final String SQL_COMPLETION_ITEM_CLASS = "org.netbeans.modules.db.sql.editor.completion.SQLCompletionItem"; - private static final String COLUMN_COLOR_FIELD = "COLUMN_COLOR"; // getHtmlColor(7, 7, 171); // NOI18N - private void replaceSQLCompletionColumnColor() { - replaceFieldValue(SQL_COMPLETION_ITEM_CLASS, COLUMN_COLOR_FIELD, getHTMLColor(new Color(0, 202, 88))); - } - - /** - * JSP completion colors - */ - private static final String JSP_COMPLETION_ITEM_CLASS = "org.netbeans.modules.web.core.syntax.completion.api.JspCompletionItem"; - private static final String JSP_COLOR_BASE_COMPLETION = "COLOR_BASE_COMPLETION"; - private void replaceJSPCompletionColor() { - replaceFieldValue(JSP_COMPLETION_ITEM_CLASS, JSP_COLOR_BASE_COMPLETION, new Color(204, 105, 50)); - } - - /** - * #106 - * HTML completion colors for HTML Tags and Custom Tags - */ - private static final String HTML_COMPLETION_ITEM_CLASS = "org.netbeans.modules.html.editor.api.completion.HtmlCompletionItem$Tag"; - private static final String CUSTOM_TAG_COMPLETION_ITEM_CLASS = "org.netbeans.modules.html.custom.CustomTagCompletionItem"; - private static final String HTML_DEFAULT_FG_COLOR = "DEFAULT_FG_COLOR"; - private void replaceHTMLCompletionColor() { - replaceFieldValue(HTML_COMPLETION_ITEM_CLASS, HTML_DEFAULT_FG_COLOR, new Color(232, 191, 106)); - replaceFieldValue(CUSTOM_TAG_COMPLETION_ITEM_CLASS, HTML_DEFAULT_FG_COLOR, new Color(64, 127, 255)); - } - - /** - * #91, CSS selector and preprocessor completion colors (LESS and SASS) - */ - private static final String CP_COMPLETION_ITEM_CLASS = "org.netbeans.modules.css.prep.editor.CPCompletionItem"; - private static final String CP_LHS_COLOR_FIELD = "COLOR"; - private static final String CP_RHS_COLOR_FIELD = "ORIGIN_COLOR"; - private void replaceCSSPreprocessorCompletionColors() { - replaceFieldValue(CP_COMPLETION_ITEM_CLASS, CP_LHS_COLOR_FIELD, new Color(0, 164, 164)); - replaceFieldValue(CP_COMPLETION_ITEM_CLASS, CP_RHS_COLOR_FIELD, new Color(255, 255, 255)); - } - - /** - * #85, #88 - * Tab colors for files belonging to same project - */ - private static final String PROJECT_COLOR_TAB_DECORATOR_CLASS = "org.netbeans.core.multitabs.impl.ProjectColorTabDecorator"; - private static final String BACKGROUND_COLORS_FIELD = "backGroundColors"; - private void replaceProjectTabColors() { - List backgroundColors = new ArrayList(); - backgroundColors.add(new Color(96, 135, 117)); - backgroundColors.add(new Color(135, 101, 101)); - backgroundColors.add(new Color(135, 127, 94)); - backgroundColors.add(new Color(96, 119, 135)); - backgroundColors.add(new Color(121, 135, 89)); - backgroundColors.add(new Color(135, 105, 89)); - backgroundColors.add(new Color(108, 135, 96)); - backgroundColors.add(new Color(107, 135, 38)); - backgroundColors.add(new Color(118, 89, 135)); - - replaceFieldValue(PROJECT_COLOR_TAB_DECORATOR_CLASS, BACKGROUND_COLORS_FIELD, backgroundColors); - } - - private static String getHTMLColor(Color c) { - return ""; //NOI18N - } - - private void replaceFieldValue(String className, String fieldName, Object value) { - - Class sbClass = null; - try { - sbClass = ClassLoader.getSystemClassLoader().loadClass(className); - } catch (ClassNotFoundException ex) { - try { - sbClass = Thread.currentThread().getContextClassLoader().loadClass(className); - } catch (ClassNotFoundException ex1) { - try { - ClassLoader systemClassLoader = (ClassLoader) Lookup.getDefault().lookup(ClassLoader.class); - if (systemClassLoader != null) { - - sbClass = systemClassLoader.loadClass(className); - } - } catch (ClassNotFoundException ex2) { - Logger.getLogger(DarculaLFCustoms.class.getName()).log(Level.INFO, - "Can not find class, will not be able to replace its field...", ex2); - } - } - } catch (SecurityException ex) { - Logger.getLogger(DarculaLFCustoms.class.getName()).log(Level.INFO, - "Can not find class, will not be able to replace its field...", ex); - } catch (IllegalArgumentException ex) { - Logger.getLogger(DarculaLFCustoms.class.getName()).log(Level.INFO, - "Can not find class, will not be able to replace its field...", ex); - } - - if (sbClass == null) { - return; - } - - replaceFieldValue(sbClass, fieldName, value); - - } - - private void replaceFieldValue(Class clazz, String fieldName, Object value) { - try { - Field field = clazz.getDeclaredField(fieldName); - - field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); - - field.set(null, value); - } catch (IllegalAccessException ex) { - Logger.getLogger(DarculaLFCustoms.class.getName()).log(Level.INFO, - "Can not replace field...", ex); - } catch (NoSuchFieldException ex) { - Logger.getLogger(DarculaLFCustoms.class.getName()).log(Level.INFO, - "Can not replace field...", ex); - } catch (SecurityException ex) { - Logger.getLogger(DarculaLFCustoms.class.getName()).log(Level.INFO, - "Can not replace field...", ex); - } - } - - /** - * Fixes https://github.com/Revivius/nb-darcula/issues/119 - * - * @author markiewb - */ - private static class TransparentBorder implements Border { - - @Override - public Insets getBorderInsets(Component c) { - // KR: add cell padding - return new Insets(5, 5, 5, 5); - } - - @Override - public boolean isBorderOpaque() { - return false; - } - - @Override - public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { - } - } - -} \ No newline at end of file diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/DarkIconFilter.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/DarkIconFilter.java deleted file mode 100644 index a0967d28a7..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/DarkIconFilter.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 2013 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - * - * Portions Copyrighted 2013 Sun Microsystems, Inc. - */ -package com.revivius.nb.darcula; - -import java.awt.Color; -import java.awt.image.RGBImageFilter; - -/** - * COPIED from o.n.swing.laf.dark\src\org\netbeans\swing\laf\dark\DarkIconFilter.java - * - * For dark LaFs it inverts icon brightness (=inverts icon image to obtain dark icon, - * then inverts its hue to restore original colors). - * - * @author P. Somol - */ -public class DarkIconFilter extends RGBImageFilter { - - /** in dark LaFs brighten all icons; 0.0f = no change, 1.0f = maximum brightening */ - private static final float DARK_ICON_BRIGHTEN = 0.1f; - - @Override - public int filterRGB(int x, int y, int color) { - int a = color & 0xff000000; - int rgb[] = decode(color); - int inverted[] = invert(rgb); - int result[] = invertHueBrighten(inverted, DARK_ICON_BRIGHTEN); - return a | encode(result); - } - - private int[] invert(int[] rgb) { - return new int[]{255-rgb[0], 255-rgb[1], 255-rgb[2]}; - } - - private int[] invertHueBrighten(int[] rgb, float brighten) { - float hsb[] = new float[3]; - Color.RGBtoHSB(rgb[0], rgb[1], rgb[2], hsb); - return decode(Color.HSBtoRGB(hsb[0] > 0.5f ? hsb[0]-0.5f : hsb[0]+0.5f, hsb[1], hsb[2]+(1.0f-hsb[2])*brighten)); - } - - private int[] decode(int rgb) { - return new int[]{(rgb & 0x00ff0000) >> 16, (rgb & 0x0000ff00) >> 8, rgb & 0x000000ff}; - } - private int encode(int[] rgb) { - return (toBoundaries(rgb[0]) << 16) | (toBoundaries(rgb[1]) << 8) | toBoundaries(rgb[2]); - } - - private int toBoundaries(int color) { - return Math.max(0,Math.min(255,color)); - } - -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/GuaranteedValue.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/GuaranteedValue.java deleted file mode 100644 index 6b54b1b05d..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/GuaranteedValue.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.revivius.nb.darcula; - -import javax.swing.UIDefaults; -import javax.swing.UIManager; -import java.awt.Color; -import java.awt.Font; - -/** - * ------------------------------------------------------------ - * Copy paste from o.n.swing.plaf because it is module private. - * ------------------------------------------------------------ - * - * A simple mechanism for guaranteeing the presence of a value in UIDefaults. - * Some look and feels (GTK/Synth) don't necessarily provide these colors, - * resulting in null pointer exceptions. Since we want to make it easy to - * write maintainable components, it is preferable to centralize guaranteeing - * the value here, rather than have the codebase littered with null tests and - * fallbacks for null colors. - * - * It will either take on the existing value if present, or used the passed - * value if not present. If passed an array of UIManager keys, it will try - * them in order, and use the first value that returns non-null from - * UIManager.get(). - * - * Usage: - *
- * UIManager.put (new GuaranteedValue("controlShadow", Color.LIGHT_GRAY));
- *   or
- * UIManager.put (new GuaranteedValue(new String[] {"Tree.foreground", 
- *    List.foreground", "textText"}, Color.BLACK));
- * 
- * - * It can also be used to ensure a value matches another value, with a fallback - * if it is not present: - *
- * UIManager.put("TextArea.font", new GuaranteedValue ("Label.font", new Font("Dialog", Font.PLAIN, 11)))
- *
- * @author  Tim Boudreau
- */
-public class GuaranteedValue implements UIDefaults.LazyValue {
-    private Object value;
-    /** Creates a new instance of GuaranteedValue */
-    public GuaranteedValue(String key, Object fallback) {
-        //Be fail fast, so no random exceptions from random components later
-        if (key == null || fallback == null) {
-            throw new NullPointerException ("Null parameters: " + key + ',' + fallback);
-        }
-        
-        value = UIManager.get(key);
-        if (value == null) {
-            value = fallback;
-        }
-    }
-    
-    public GuaranteedValue(String[] keys, Object fallback) {
-        //Be fail fast, so no random exceptions from random components later
-        if (keys == null || fallback == null) {
-            throw new NullPointerException ("Null parameters: " + keys + ',' + fallback);
-        }
-        for (int i=0; i < keys.length; i++) {
-            value = UIManager.get(keys[i]);
-            if (value != null) {
-                break;
-            }
-        }
-        if (value == null) {
-            value = fallback;
-        }
-    }
-    
-    public Object createValue(UIDefaults table) {
-        return value;
-    }
-    
-    /** Convenience getter of the value as a color - returns null if this
-     * instance was used for some other type */
-    public Color getColor() {
-        Object o = createValue(null);
-        if (o instanceof Color) {
-            return (Color) o;
-        } else {
-            return null;
-        }
-    }
-
-    public Font getFont() {
-        Object o = createValue(null);
-        if (o instanceof Font) {
-            return (Font) o;
-        } else {
-            return null;
-        }
-    }
-}
diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/Installer.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/Installer.java
deleted file mode 100644
index 97b43d09e4..0000000000
--- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/Installer.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.revivius.nb.darcula;
-
-import com.bulenkov.darcula.DarculaLaf;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.prefs.Preferences;
-import javax.swing.UIManager;
-import org.openide.modules.ModuleInstall;
-import org.openide.util.Lookup;
-import org.openide.util.NbPreferences;
-import org.openide.windows.WindowManager;
-
-/**
- * Makes Darcula LAF available in preferred LAF combo, installs
- * DarculaLFCustoms, set Preferences and switch the editor color profile to
- * Darcula theme.
- *
- * @author Revivius
- */
-public class Installer extends ModuleInstall {
-
-    private static final String COLOR_MODEL_CLASS_NAME = "org.netbeans.modules.options.colors.ColorModel";
-
-    private static boolean SWITCH_EDITOR_COLORS = false;
-
-    @Override
-    public void validate() throws IllegalStateException {
-        Preferences prefs = NbPreferences.root().node("laf");
-        if (!prefs.getBoolean("darcula.installed", false)) {
-            prefs.put("laf", DarculaLaf.class.getName());
-            SWITCH_EDITOR_COLORS = true;
-        }
-        prefs.putBoolean("darcula.installed", true);
-
-        // to make LAF available in Tools > Options > Appearance > Look and Feel
-        UIManager.installLookAndFeel(new UIManager.LookAndFeelInfo(DarculaLaf.NAME, DarculaLaf.class.getName()));
-        UIManager.put("Nb.DarculaLFCustoms", new DarculaLFCustoms());
-    }
-
-    @Override
-    public void restored() {
-        // KR: disable because we don't use any editors
-//        if (SWITCH_EDITOR_COLORS) {
-//            WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
-//                @Override
-//                public void run() {
-//                    switchEditorColorsProfile();
-//                }
-//            });
-//        };
-    }
-
-    /**
-     * Returns if possible to change color profile. Use reflection to
-     * instantiate ColorModel (private package) class and get the current
-     * profile.
-     *
-     * @return {@code true} if current profile not equals this theme profile
-     * name or {@code false} otherwise.
-     */
-    private boolean isChangeEditorColorsPossible() {
-        ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);
-        if (loader == null) {
-            loader = Installer.class.getClassLoader();
-        }
-        try {
-            Class claszz = loader.loadClass(COLOR_MODEL_CLASS_NAME);
-            Object colorModel = claszz.newInstance();
-            Method method = claszz.getDeclaredMethod("getCurrentProfile", new Class[0]);
-            Object invokeResult = method.invoke(colorModel, new Object[0]);
-            return invokeResult != null && !DarculaLaf.NAME.equals(invokeResult);
-        } catch (Exception ex) {
-            //ignore
-            Logger.getLogger(Installer.class.getName()).log(Level.INFO, "Cannot get the current editor colors profile.", ex);
-        }
-        return false;
-    }
-
-    /**
-     * Switch the editor color profile if possible. Use reflection to
-     * instantiate ColorModel (private package) class and set the current
-     * profile
-     */
-    private void switchEditorColorsProfile() {
-        if (!isChangeEditorColorsPossible()) {
-            return;
-        }
-
-        ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);
-        if (loader == null) {
-            loader = Installer.class.getClassLoader();
-        }
-        try {
-            Class classz = loader.loadClass(COLOR_MODEL_CLASS_NAME);
-            Object colorModel = classz.newInstance();
-            Method method = classz.getDeclaredMethod("setCurrentProfile", String.class);
-            method.invoke(colorModel, DarculaLaf.NAME);
-
-            // method call above changes the token colors but not annotation
-            // colors. these two seems to solve the problem
-            method = classz.getDeclaredMethod("getAnnotations", String.class);
-            Object acs = method.invoke(colorModel, DarculaLaf.NAME);
-
-            method = classz.getDeclaredMethod("setAnnotations", String.class, Collection.class);
-            method.invoke(colorModel, DarculaLaf.NAME, acs);
-        } catch (Exception ex) {
-            //ignore
-            Logger.getLogger(Installer.class.getName()).log(Level.INFO, "Cannot change editors colors profile.", ex);
-        }
-    }
-}
diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/RelativeColor.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/RelativeColor.java
deleted file mode 100644
index 2c80eb6761..0000000000
--- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/RelativeColor.java
+++ /dev/null
@@ -1,326 +0,0 @@
-package com.revivius.nb.darcula;
-
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-import java.awt.Color;
-
-/** 
- * ------------------------------------------------------------
- * Copy paste from o.n.swing.plaf because it is module private.
- * ------------------------------------------------------------
- *
- * A color which can be placed into UIDefaults, which is computed from:
- * 
    - *
  • A base color, as defined in a UI spec - this might be the expected value - * for window titlebars, for example
  • - *
  • A target color, as defined in a UI spec, whose color is not the base - * color, but has a relation to it (such as brighter or darker, or - * hue shifted)
  • - *
  • The actual color - which may differ from the base color if the user has - * customized their UI them (for example, changing the color defaults in - * Windows)
  • - *
  • (optional) A color that the result must contrast with sufficiently that - * text will be readable
  • - *
- * When constructing the real value, a color will be generated which has the - * same relationship to the original value as the base color has to the target - * color. - * - *

What this class is for

- * A number of components in NetBeans have colors that should be based on a - * color taken from the desktop theme. Swing provides a mechanism for getting - * these colors, via UIManager, which will supply correct colors based on the - * desktop theme for a variety of operating systems. - *

- * But often the color in a UI specification is not the same as, but related to - * the color that should be used. For example, in windows classic, the tabs - * have a gradient based on a light blue color. The color should be related to - * the dark blue color normally used in Windows for window titles. However, - * if the user has set the window titlebar color to red, a reddish color should - * be used. - *

- * This class allows you to provide a base value (the default Windows - * titlebar color, hardcoded) and a prototype value (the blue color that should - * be used if the desktop colors are the defaults), and the actual - * value retrieved from the UI. The instance of this class is then dropped - * into UIDefaults; code can simply call - * UIManager.getColor("someColor") and get the right color without - * being cluttered with the details of deriving colors. - * - *

How it does what it does

- * The base and prototype are split into HSB color components. The relationship - * between the base and prototype values in saturation and brightness is then - * computed. This same relationship is then applied to the actual value - * as a function of the divergence between the base and actual values - * such that the more a color diverges, the less the relationship is applied - - * so that, if the base color is dark blue and the prototype color is light - * blue, but the actual color is light yellow, you get light yellow (as opposed - * to pure white, which a naive application of the relationship would get). - * - *

Note: It is possible to create cyclic - * references between RelativeColor instances (for example, a RelativeColor - * that has its own key as one of the keys it should fetch). Don't do that. - * - * @author Tim Boudreau - */ -public class RelativeColor implements UIDefaults.LazyValue { - private Color value = null; - private Color fallback = null; - /** Creates a new instance of RelativeColor. - * - * @param base A Color or UIManager key for a color that the target color is related to - * @param target A Color or UIManager key for a color that is what the target color should be if the - * actual color is equal to the base color - * @param actual Either a Color object or a UIManager String key resolvable - * to a color, which represents the - * actual color, which may or may not match the target color - * @param mustContrast Either a Color object or a UIManager String key - * resolvable to a color which must contrast sufficiently with the derived - * color that text will be readable. This parameter may be null; the others - * may not. */ - public RelativeColor(Object base, Object target, Object actual, Object mustContrast) { - if (base == null || target == null || actual == null) { - throw new NullPointerException ("Null argument(s): " + base + ',' - + target + ',' + actual + ',' + mustContrast); - } - if (base instanceof String) { - baseColorKey = (String) base; - } else { - baseColor = (Color) base; - } - if (target instanceof String) { - targetColorKey = (String) target; - } else { - targetColor = (Color) target; - } - if (actual instanceof String) { - actualColorKey = (String) actual; - } else { - actualColor = (Color) actual; - } - if (mustContrast != null) { - if (mustContrast instanceof String) { - mustContrastColorKey = (String) mustContrast; - } else { - mustContrastColor = (Color) mustContrast; - } - } - } - - /** Creates a new instance of RelativeColor. - * - * @param base A Color that the target color is related to - * @param target A Color that is what the target color should be if the - * actual color is equal to the base color - * @param actual Either a Color object or a UIManager String key resolvable - * to a color, which represents the - * actual color, which may or may not match the target color - * @param mustContrast Either a Color object or a UIManager String key - * resolvable to a color which must contrast sufficiently with the derived - * color that text will be readable - */ - public RelativeColor(Color base, Color target, Object actual) { - this (base, target, actual, null); - } - - public void clear() { - value = null; - if (actualColorKey != null) { - actualColor = null; - } - if (targetColorKey != null) { - targetColor = null; - } - if (mustContrastColorKey != null) { - mustContrastColor = null; - } - if (baseColorKey != null) { - baseColor = null; - } - } - - public Object createValue(UIDefaults table) { - if (value != null) { - return value; - } - Color actual = getActualColor(); - Color base = getBaseColor(); - if (actual.equals(base)) { - value = getTargetColor(); - } else { - value = deriveColor (base, actual, getTargetColor()); - } - if (hasMustContrastColor()) { - value = ensureContrast(value, getMustContrastColor()); - } - return value; - } - - /** Convenience getter, as this class is reasonably useful for creating - * derived colors without putting them into UIDefaults */ - public Color getColor() { - return (Color) createValue(null); - } - - private Color targetColor = null; - private String targetColorKey = null; - private Color getTargetColor() { - if (checkState (targetColor, targetColorKey)) { - targetColor = fetchColor(targetColorKey); - } - return targetColor; - } - - private Color baseColor = null; - private String baseColorKey = null; - private Color getBaseColor() { - if (checkState (baseColor, baseColorKey)) { - baseColor = fetchColor(baseColorKey); - } - return baseColor; - } - - private Color mustContrastColor = null; - private String mustContrastColorKey = null; - private Color getMustContrastColor() { - if (checkState (mustContrastColor, mustContrastColorKey)) { - mustContrastColor = fetchColor(mustContrastColorKey); - } - return mustContrastColor; - } - - private Color actualColor = null; - private String actualColorKey = null; - private Color getActualColor() { - if (checkState (actualColor, actualColorKey)) { - actualColor = fetchColor(actualColorKey); - } - return actualColor; - } - - private boolean hasMustContrastColor() { - return mustContrastColor != null || mustContrastColorKey != null; - } - - /** Ensures that the key and color are not null, and returns true if the - * color needs to be loaded. */ - private boolean checkState(Color color, String key) { - if (color == null && key == null) { - throw new NullPointerException("Both color and key are null for " + - this); - } - return color == null; - } - - private Color fetchColor(String key) { - //Todo - check for cyclic references - Color result = UIManager.getColor(key); - if (result == null) { - result = fallback; - } - return result; - } - - /** Does the actual leg-work of deriving the color */ - static Color deriveColor (Color base, Color actual, Color target) { - float[] baseHSB = Color.RGBtoHSB(base.getRed(), base.getGreen(), - base.getBlue(), null); - - float[] targHSB = Color.RGBtoHSB(target.getRed(), target.getGreen(), - target.getBlue(), null); - - float[] actualHSB = Color.RGBtoHSB(actual.getRed(), actual.getGreen(), - actual.getBlue(), null); - - float[] resultHSB = new float[3]; - float[] finalHSB = new float[3]; - - float[] diff = percentageDiff (actualHSB, baseHSB); - - resultHSB[0] = actualHSB[0] + (diff[0] * (targHSB[0] - baseHSB[0])); - resultHSB[1] = actualHSB[1] + (diff[1] * (targHSB[1] - baseHSB[1])); - resultHSB[2] = actualHSB[2] + (diff[2] * (targHSB[2] - baseHSB[2])); - - finalHSB[0] = saturate (resultHSB[0]); - finalHSB[1] = saturate (resultHSB[1]); - finalHSB[2] = saturate (resultHSB[2]); - - //If the target had *some* color, so should our result - if it pretty - //much doesn't, redistribute some of the brightness to the saturation value - if (targHSB[1] > 0.1 && resultHSB[1] <= 0.1) { - resultHSB[1] = resultHSB[2] * 0.25f; - resultHSB[2] = resultHSB[2] - (resultHSB[2] * 0.25f); - } - - Color result = new Color (Color.HSBtoRGB(finalHSB[0], finalHSB[1], finalHSB[2])); - return result; - } - - private static float[] percentageDiff (float[] a, float[] b) { - float[] result = new float[3]; - for (int i=0; i < 3; i++) { - result[i] = 1 - Math.abs(a[i] - b[i]); - if (result[i] == 0) { - result[i] = 1- a[i]; - } - } - return result; - } - - private static final void out (String nm, float[] f) { - //XXX for debugging - deleteme - StringBuffer sb = new StringBuffer(nm); - sb.append(": "); - for (int i=0; i < f.length; i++) { - sb.append (Math.round(f[i] * 100)); - if (i != f.length-1) { - sb.append(','); - sb.append(' '); - } - } - System.err.println(sb.toString()); - } - - /** Saturate a float value, clamping values below 0 to 0 and above 1 to 1 */ - private static float saturate (float f) { - return Math.max(0, Math.min(1, f)); - } - - - static Color ensureContrast (Color target, Color contrast) { - //XXX - this needs some work. What it should really do: - //Determine the distance from 0.5 for brightness and saturation of the contrasting color, to - //determine the direction in which to adjust. Then adjust in that - //direction as a function of the diff between 0.25 and 0.5 of the - //diff between the colors...or something like that. The point is - //there's a danger zone around 0.5 where things that should be - //adjusted away from each other aren't being - - float[] contHSB = Color.RGBtoHSB(contrast.getRed(), contrast.getGreen(), - contrast.getBlue(), null); - - float[] targHSB = Color.RGBtoHSB(target.getRed(), target.getGreen(), - target.getBlue(), null); - - float[] resultHSB = new float[3]; - System.arraycopy(targHSB, 0, resultHSB, 0, 3); - - float satDiff = Math.abs (targHSB[1] - contHSB[1]); - float briDiff = Math.abs (targHSB[2] - contHSB[2]); - - if (targHSB[1] > 0.6 && resultHSB[1] > 0.6 || (briDiff < 0.45f && satDiff < 0.4f)) { - resultHSB[1] /= 3; -// System.err.println("adjusting saturation to " + resultHSB[1] + " from " + targHSB[1]); - satDiff = Math.abs (targHSB[1] - contHSB[1]); - } - - if (briDiff < 0.3 || (satDiff < 0.3 && briDiff < 0.5)) { - float dir = 1.5f * (0.5f - contHSB[2]); - resultHSB[2] = saturate (resultHSB[2] + dir); -// System.err.println("adjusting brightness to " + resultHSB[2] + " from " + targHSB[2]); - } - - Color result = new Color (Color.HSBtoRGB(resultHSB[0], resultHSB[1], resultHSB[2])); - return result; - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ToolbarXP.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ToolbarXP.java deleted file mode 100644 index 81995c1f1d..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ToolbarXP.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.revivius.nb.darcula; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import javax.swing.JPanel; -import javax.swing.UIManager; - -/** - * Copy paste from o.n.swing.plaf. - * @author Revivius - */ -public final class ToolbarXP extends JPanel { - - /** Width of grip. */ - private static final int GRIP_WIDTH = 7; - /** Minimum size. */ - private final Dimension dim; - /** Maximum size. */ - private final Dimension max; - - public ToolbarXP() { - dim = new Dimension(GRIP_WIDTH, GRIP_WIDTH); - max = new Dimension(GRIP_WIDTH, Integer.MAX_VALUE); - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - int x = 3; - for (int i = 4; i < getHeight() - 4; i += 4) { - //first draw the rectangular highlight below each dot - g.setColor(UIManager.getColor("controlLtHighlight").brighter()); //NOI18N - g.fillRect(x + 1, i + 1, 2, 2); - //Get the shadow color. We'll paint the darkest dot first, - //and work our way to the lightest - Color col = UIManager.getColor("controlShadow").brighter(); //NOI18N - g.setColor(col); - //draw the darkest dot - g.drawLine(x + 1, i + 1, x + 1, i + 1); - - //Get the color components and calculate the amount each component - //should increase per dot - int red = col.getRed(); - int green = col.getGreen(); - int blue = col.getBlue(); - - //Get the default component background - we start with the dark - //color, and for each dot, add a percentage of the difference - //between this and the background color - Color back = getBackground(); - int rb = back.getRed(); - int gb = back.getGreen(); - int bb = back.getBlue(); - - //Get the amount to increment each component for each dot - int incr = (rb - red) / 5; - int incg = (gb - green) / 5; - int incb = (bb - blue) / 5; - - //Increment the colors - red += incr; - green += incg; - blue += incb; - //Create a slightly lighter color and draw the dot - col = new Color(red, green, blue); - g.setColor(col); - g.drawLine(x + 1, i, x + 1, i); - - //And do it for the next dot, and so on, for all four dots - red += incr; - green += incg; - blue += incb; - col = new Color(red, green, blue); - g.setColor(col); - g.drawLine(x, i + 1, x, i + 1); - - red += incr; - green += incg; - blue += incb; - col = new Color(red, green, blue); - g.setColor(col); - g.drawLine(x, i, x, i); - } - } - - /** - * @return minimum size - */ - @Override - public Dimension getMinimumSize() { - return dim; - } - - @Override - public Dimension getMaximumSize() { - return max; - } - -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/UIBootstrapValue.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/UIBootstrapValue.java deleted file mode 100644 index c64ccec29d..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/UIBootstrapValue.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.revivius.nb.darcula; - -import javax.swing.UIDefaults; -import javax.swing.UIManager; - -/** - * ------------------------------------------------------------ - * Copy paste from o.n.swing.plaf because it is module private. - * ------------------------------------------------------------ - * - * Value that can be placed into UIDefaults, which will put additional items into - * UIDefaults when its value is requested. - *

- * The idea is to avoid putting a lot of things that may not be used into - * UIDefaults on startup. So, for example, the first time a tab control's UI - * is requested, this value will return the string from which the UI can be - * fetched - but first it will put the assorted keys and values that that UI - * will need into UIDefaults. - *

- * Since multiple UIs may require the same things in UIDefaults, there is the - * method createShared(), which will create another instance (really an inner - * class instance) that shares the code and key/value pairs. Whichever is - * asked for first will initialize the keys and values required. So the usage - * pattern is something like: - *

- * Object someKeysAndValues = new Object[] {"fooColor", Color.BLUE, "barColor", Color.RED};
- * UIBootstrapValue bv = new UIBootstrapValue ("com.foo.FnordUIClass", someKeysAndValues);
- * Object next = bv.createShared ("com.foo.ThiptUIClass");
- * UIManager.put ("FnordUI", bv);
- * UIManager.put ("ThiptUI", next);
- * 
- * - * @author Tim Boudreau - */ -public class UIBootstrapValue implements UIDefaults.LazyValue { - private boolean installed = false; - private final String uiClassName; - protected Object[] defaults; - /** Creates a new instance of UIBootstrapValue */ - public UIBootstrapValue(String uiClassName, Object[] defaults) { - this.defaults = defaults; - this.uiClassName = uiClassName; - } - - /** Create the value that UIDefaults will return. If the keys and values - * the UI class we're representing requires have not yet been installed, - * this will install them. - */ - public Object createValue(UIDefaults uidefaults) { - if (!installed) { - installKeysAndValues(uidefaults); - } - return uiClassName; - } - - /** Install the defaults the UI we're representing will need to function */ - private void installKeysAndValues(UIDefaults ui) { - ui.putDefaults (getKeysAndValues()); - installed = true; - } - - public Object[] getKeysAndValues() { - return defaults; - } - - public void uninstall() { - if (defaults == null) { - return; - } - for (int i=0; i < defaults.length; i+=2) { - UIManager.put (defaults[i], null); - } - //null defaults so a Meta instance won't cause us to do work twice - defaults = null; - } - - public String toString() { - return getClass() + " for " + uiClassName; //NOI18N - } - - /** Create another entry value to put in UIDefaults, which will also - * trigger installing the keys and values, to ensure that they are only - * added once, by whichever entry is asked for the value first. */ - public UIDefaults.LazyValue createShared (String uiClassName) { - return new Meta (uiClassName); - } - - private class Meta implements UIDefaults.LazyValue { - private String name; - public Meta (String uiClassName) { - this.name = uiClassName; - } - - public Object createValue(javax.swing.UIDefaults uidefaults) { - if (!installed) { - installKeysAndValues(uidefaults); - } - return name; - } - - public String toString() { - return "Meta-" + super.toString() + " for " + uiClassName; //NOI18N - } - } - - public abstract static class Lazy extends UIBootstrapValue implements UIDefaults.LazyValue { - public Lazy (String uiClassName) { - super (uiClassName, null); - } - - public Object[] getKeysAndValues() { - if (defaults == null) { - defaults = createKeysAndValues(); - } - return defaults; - } - - public abstract Object[] createKeysAndValues(); - - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/options/DarculaLAFOptionsPanelController.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/options/DarculaLAFOptionsPanelController.java deleted file mode 100644 index 5a32b12eee..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/options/DarculaLAFOptionsPanelController.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2016 markiewb. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.revivius.nb.darcula.options; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.prefs.PreferenceChangeEvent; -import java.util.prefs.PreferenceChangeListener; -import javax.swing.JComponent; -import javax.swing.SwingUtilities; -import org.netbeans.spi.options.OptionsPanelController; -import org.openide.LifecycleManager; -import org.openide.awt.NotificationDisplayer; -import org.openide.util.HelpCtx; -import org.openide.util.ImageUtilities; -import org.openide.util.Lookup; -import org.openide.util.NbPreferences; - -@OptionsPanelController.SubRegistration( - location = "Appearance", - displayName = "#AdvancedOption_DisplayName_DarculaLAF", - keywords = "#AdvancedOption_Keywords_DarculaLAF", - keywordsCategory = "Appearance/DarculaLAF" -) -@org.openide.util.NbBundle.Messages({ - "AdvancedOption_DisplayName_DarculaLAF=Darcula Look and Feel", - "AdvancedOption_Keywords_DarculaLAF=darcula laf, dark, theme, font, laf" -}) -public final class DarculaLAFOptionsPanelController extends OptionsPanelController { - - - public static final String OVERRIDE_FONT_BOOLEAN = "overrideFont"; - public static final String FONT_STRING = "font"; - - public static final String OVERRIDE_TREE_INDENT_BOOLEAN = "overrideTreeIndent"; - public static final String TREE_INDENT_INT = "treeIndent"; - - public static final String INVERT_ICONS_BOOLEAN = "invertIcons"; - public static final String STRETCHED_TABS_BOOLEAN = "stretchedTabs"; - - private static final PreferenceChangeListener PREF_LISTENER = new PreferenceChangeListener() { - @Override - public void preferenceChange(PreferenceChangeEvent evt) { - NotificationDisplayer.getDefault().notify( - "Restart IDE", - ImageUtilities.loadImageIcon("com/revivius/nb/darcula/options/restart.png", true), - "Click here to restart IDE and apply new settings.", - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - LifecycleManager.getDefault().markForRestart(); - LifecycleManager.getDefault().exit(); - } - } - ); - } - }; - - static { - NbPreferences.forModule(DarculaLAFPanel.class).addPreferenceChangeListener(PREF_LISTENER); - } - - private DarculaLAFPanel panel; - private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); - private boolean changed; - - @Override - public void update() { - getPanel().load(); - changed = false; - } - - @Override - public void applyChanges() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - getPanel().store(); - changed = false; - } - }); - } - - @Override - public void cancel() { - // need not do anything special, if no changes have been persisted yet - } - - @Override - public boolean isValid() { - return getPanel().valid(); - } - - @Override - public boolean isChanged() { - return changed; - } - - @Override - public HelpCtx getHelpCtx() { - return null; // new HelpCtx("...ID") if you have a help set - } - - @Override - public JComponent getComponent(Lookup masterLookup) { - return getPanel(); - } - - @Override - public void addPropertyChangeListener(PropertyChangeListener l) { - pcs.addPropertyChangeListener(l); - } - - @Override - public void removePropertyChangeListener(PropertyChangeListener l) { - pcs.removePropertyChangeListener(l); - } - - private DarculaLAFPanel getPanel() { - if (panel == null) { - panel = new DarculaLAFPanel(this); - } - return panel; - } - - void changed() { - if (!changed) { - changed = true; - pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); - } - pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); - } - -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/options/DarculaLAFPanel.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/options/DarculaLAFPanel.java deleted file mode 100644 index 38fcf32fb8..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/options/DarculaLAFPanel.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2016 markiewb. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.revivius.nb.darcula.options; - -import com.revivius.nb.darcula.DarculaLFCustoms; -import java.awt.Font; -import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; -import java.util.prefs.Preferences; -import org.netbeans.spi.options.OptionsPanelController; -import org.openide.DialogDescriptor; -import org.openide.DialogDisplayer; -import org.openide.util.NbPreferences; - -@OptionsPanelController.Keywords( - location = "Appearance", - tabTitle = "Darcula Look and Feel", - keywords = { - "dark theme", - "dark", - "theme", - "laf", - "font", - "look and feel", - "darcula", - "invert", - "invert colors", - "stretched", - "stretched tabs" - } -) -public class DarculaLAFPanel extends javax.swing.JPanel { - - private final DarculaLAFOptionsPanelController controller; - - DarculaLAFPanel(DarculaLAFOptionsPanelController controller) { - this.controller = controller; - initComponents(); - } - - public void reinitUI() { - if (!cbOverride.isSelected()) { - lblFontName.setText(DarculaLFCustoms.DEFAULT_FONT); - } - - lblFont.setEnabled(cbOverride.isSelected()); - lblFontName.setEnabled(cbOverride.isSelected()); - lblRestart.setEnabled(cbOverride.isSelected()); - btnChooseFont.setEnabled(cbOverride.isSelected()); - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - - - // //GEN-BEGIN:initComponents - private void initComponents() { - - cbOverride = new javax.swing.JCheckBox(); - lblRestart = new javax.swing.JLabel(); - lblFontName = new javax.swing.JTextField(); - lblFont = new javax.swing.JLabel(); - btnChooseFont = new javax.swing.JButton(); - cbInvertIcons = new javax.swing.JCheckBox(); - cbStretchedTabs = new javax.swing.JCheckBox(); - - org.openide.awt.Mnemonics.setLocalizedText(cbOverride, org.openide.util.NbBundle.getMessage(DarculaLAFPanel.class, "DarculaLAFPanel.cbOverride.text")); // NOI18N - cbOverride.addChangeListener(new javax.swing.event.ChangeListener() { - public void stateChanged(javax.swing.event.ChangeEvent evt) { - cbOverrideStateChanged(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(lblRestart, org.openide.util.NbBundle.getMessage(DarculaLAFPanel.class, "DarculaLAFPanel.lblRestart.text")); // NOI18N - - lblFontName.setEditable(false); - lblFontName.setText(org.openide.util.NbBundle.getMessage(DarculaLAFPanel.class, "DarculaLAFPanel.lblFontName.text")); // NOI18N - - lblFont.setLabelFor(btnChooseFont); - org.openide.awt.Mnemonics.setLocalizedText(lblFont, org.openide.util.NbBundle.getMessage(DarculaLAFPanel.class, "DarculaLAFPanel.lblFont.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(btnChooseFont, org.openide.util.NbBundle.getMessage(DarculaLAFPanel.class, "DarculaLAFPanel.btnChooseFont.text")); // NOI18N - btnChooseFont.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnChooseFontActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(cbInvertIcons, org.openide.util.NbBundle.getMessage(DarculaLAFPanel.class, "DarculaLAFPanel.cbInvertIcons.text")); // NOI18N - cbInvertIcons.addItemListener(new java.awt.event.ItemListener() { - public void itemStateChanged(java.awt.event.ItemEvent evt) { - cbInvertIconsItemStateChanged(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(cbStretchedTabs, org.openide.util.NbBundle.getMessage(DarculaLAFPanel.class, "DarculaLAFPanel.cbStretchedTabs.text")); // NOI18N - cbStretchedTabs.addItemListener(new java.awt.event.ItemListener() { - public void itemStateChanged(java.awt.event.ItemEvent evt) { - cbStretchedTabsItemStateChanged(evt); - } - }); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(cbOverride)) - .addGroup(layout.createSequentialGroup() - .addGap(36, 36, 36) - .addComponent(lblFont) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblFontName, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnChooseFont) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblRestart)) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(cbInvertIcons)) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(cbStretchedTabs))) - .addContainerGap(100, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(cbOverride) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblFontName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblFont) - .addComponent(lblRestart) - .addComponent(btnChooseFont)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbInvertIcons) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbStretchedTabs) - .addContainerGap(27, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - - private void cbOverrideStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_cbOverrideStateChanged - controller.changed(); - reinitUI(); - }//GEN-LAST:event_cbOverrideStateChanged - - private void btnChooseFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChooseFontActionPerformed - PropertyEditor pe = PropertyEditorManager.findEditor(Font.class); - Font f = Font.decode(lblFontName.getText()); - pe.setValue(f); - DialogDescriptor dd = new DialogDescriptor( - pe.getCustomEditor(), - "Font Chooser" - ); - dd.setOptions(new Object[]{ - DialogDescriptor.OK_OPTION, - DialogDescriptor.CANCEL_OPTION - }); - DialogDisplayer.getDefault().createDialog(dd).setVisible(true); - if (dd.getValue() == DialogDescriptor.OK_OPTION) { - f = (Font) pe.getValue(); - lblFontName.setText(f.getName() + " " + f.getSize()); - controller.changed(); - } - }//GEN-LAST:event_btnChooseFontActionPerformed - - private void cbInvertIconsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbInvertIconsItemStateChanged - controller.changed(); - }//GEN-LAST:event_cbInvertIconsItemStateChanged - - private void cbStretchedTabsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbStretchedTabsItemStateChanged - controller.changed(); - }//GEN-LAST:event_cbStretchedTabsItemStateChanged - - void load() { - Preferences prefs = NbPreferences.forModule(DarculaLAFPanel.class); - - cbOverride.setSelected(prefs.getBoolean(DarculaLAFOptionsPanelController.OVERRIDE_FONT_BOOLEAN, false)); - lblFontName.setText(prefs.get(DarculaLAFOptionsPanelController.FONT_STRING, DarculaLFCustoms.DEFAULT_FONT)); - - cbInvertIcons.setSelected(prefs.getBoolean(DarculaLAFOptionsPanelController.INVERT_ICONS_BOOLEAN, false)); - cbStretchedTabs.setSelected(prefs.getBoolean(DarculaLAFOptionsPanelController.STRETCHED_TABS_BOOLEAN, false)); - - reinitUI(); - } - - void store() { - Preferences prefs = NbPreferences.forModule(DarculaLAFPanel.class); - - prefs.putBoolean(DarculaLAFOptionsPanelController.OVERRIDE_FONT_BOOLEAN, cbOverride.isSelected()); - prefs.put(DarculaLAFOptionsPanelController.FONT_STRING, lblFontName.getText()); - - prefs.putBoolean(DarculaLAFOptionsPanelController.INVERT_ICONS_BOOLEAN, cbInvertIcons.isSelected()); - prefs.putBoolean(DarculaLAFOptionsPanelController.STRETCHED_TABS_BOOLEAN, cbStretchedTabs.isSelected()); - } - - boolean valid() { - // TODO check whether form is consistent and complete - return true; - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton btnChooseFont; - private javax.swing.JCheckBox cbInvertIcons; - private javax.swing.JCheckBox cbOverride; - private javax.swing.JCheckBox cbStretchedTabs; - private javax.swing.JLabel lblFont; - private javax.swing.JTextField lblFontName; - private javax.swing.JLabel lblRestart; - // End of variables declaration//GEN-END:variables -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ContentAreaAwareButtonUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ContentAreaAwareButtonUI.java deleted file mode 100644 index 06141c3471..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ContentAreaAwareButtonUI.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import com.bulenkov.iconloader.util.GraphicsConfig; -import com.bulenkov.iconloader.util.GraphicsUtil; -import com.bulenkov.iconloader.util.SystemInfo; -import java.awt.Color; -import java.awt.Component; -import java.awt.FontMetrics; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Rectangle; -import javax.swing.AbstractButton; -import javax.swing.ButtonModel; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.UIManager; -import javax.swing.border.Border; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.UIResource; -import javax.swing.plaf.basic.BasicButtonUI; -import sun.swing.SwingUtilities2; - -/** - * A minor re-write of DarculaButtonUI to prevent painting background when - * content area filled property is set to false on button. - * - * Mostly copy paste from DarculaButtonUI. - * - * @author Revivius - */ -public class ContentAreaAwareButtonUI extends BasicButtonUI { - - public static ComponentUI createUI(JComponent c) { - return new ContentAreaAwareButtonUI(); - } - - public static boolean isSquare(Component c) { - if (c instanceof JButton) { - JButton b = (JButton) c; - return "square".equals(b.getClientProperty("JButton.buttonType")); - } - return false; - } - - @Override - public void paint(Graphics g, JComponent c) { - Border border = c.getBorder(); - GraphicsConfig config = GraphicsUtil.setupAAPainting(g); - boolean square = isSquare(c); - Graphics2D g2d = (Graphics2D) g; - AbstractButton b = (AbstractButton) c; - if ((c.isEnabled()) && (border != null)) { - //if (!square) { - g2d.setPaint(getBackgroundPaint(c)); - //} - - if (b.isContentAreaFilled()) { - int arc = 5; - if (square) { - arc = 3; - } - - g.fillRoundRect(1, 1, c.getWidth() - 2, c.getHeight() - 2, arc, arc); - } - } - super.paint(g, c); - config.restore(); - } - - protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) { - AbstractButton button = (AbstractButton) c; - ButtonModel model = button.getModel(); - Color fg = button.getForeground(); - if (((fg instanceof UIResource)) && ((button instanceof JButton)) && (((JButton) button).isDefaultButton())) { - Color selectedFg = UIManager.getColor("Button.darcula.selectedButtonForeground"); - if (selectedFg != null) { - fg = selectedFg; - } - } - g.setColor(fg); - - FontMetrics metrics = SwingUtilities2.getFontMetrics(c, g); - int mnemonicIndex = button.getDisplayedMnemonicIndex(); - if (model.isEnabled()) { - SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemonicIndex, textRect.x - + getTextShiftOffset(), textRect.y + metrics - .getAscent() + getTextShiftOffset()); - } else { - g.setColor(UIManager.getColor("Button.disabledText")); - SwingUtilities2.drawStringUnderlineCharAt(c, g, text, -1, textRect.x - + getTextShiftOffset(), textRect.y + metrics - .getAscent() + getTextShiftOffset()); - } - } - - - protected Paint getBackgroundPaint(JComponent c) { - JButton b = (JButton) c; - if (b.isDefaultButton()) { - return new GradientPaint( - 0.0F, 0.0F, getSelectedButtonColor1(), - 0.0F, c.getHeight(), getSelectedButtonColor2() - ); - } - return new GradientPaint( - 0.0F, 0.0F, getButtonColor1(), - 0.0F, c.getHeight(), getButtonColor2() - ); - } - - @Override - public void update(Graphics g, JComponent c) { - super.update(g, c); - if (c instanceof JButton) { - JButton b = (JButton) c; - if (b.isDefaultButton() && !SystemInfo.isMac && !c.getFont().isBold()) { - c.setFont(c.getFont().deriveFont(1)); - } - } - } - - protected Color getButtonColor1() { - return UIManager.getColor("Button.darcula.color1"); - } - - protected Color getButtonColor2() { - return UIManager.getColor("Button.darcula.color2"); - } - - protected Color getSelectedButtonColor1() { - return UIManager.getColor("Button.darcula.selection.color1"); - } - - protected Color getSelectedButtonColor2() { - return UIManager.getColor("Button.darcula.selection.color2"); - } - -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ContentAreaAwareToggleButtonUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ContentAreaAwareToggleButtonUI.java deleted file mode 100644 index 03de623ee1..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ContentAreaAwareToggleButtonUI.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Paint; -import javax.swing.JComponent; -import javax.swing.JToggleButton; -import javax.swing.plaf.ComponentUI; - -/** - * A minor re-write of DarculaButtonUI to prevent painting background when - * content area filled property is set to false on button and painting a - * noticable background if button is selected. - * - * Adapted from modified DarculaButtonUI. - * - * @author Revivius - */ -public class ContentAreaAwareToggleButtonUI extends ContentAreaAwareButtonUI { - - public static ComponentUI createUI(JComponent c) { - return new ContentAreaAwareToggleButtonUI(); - } - - @Override - protected Paint getBackgroundPaint(JComponent c) { - JToggleButton b = (JToggleButton) c; - if (b.isSelected()) { - return new GradientPaint( - 0.0F, 0.0F, getButtonColor1().brighter(), - 0.0F, c.getHeight(), getButtonColor2().brighter() - ); - } - return new GradientPaint( - 0.0F, 0.0F, getButtonColor1(), - 0.0F, c.getHeight(), getButtonColor2() - ); - } - - @Override - public void update(Graphics g, JComponent c) { - super.update(g, c); - } - -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarculaSplitPaneDivider.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarculaSplitPaneDivider.java deleted file mode 100644 index e4e41ab974..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarculaSplitPaneDivider.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Graphics; - -import javax.swing.Icon; -import javax.swing.JButton; -import javax.swing.JSplitPane; -import javax.swing.border.Border; -import javax.swing.plaf.basic.BasicSplitPaneDivider; - -import com.bulenkov.iconloader.IconLoader; -import com.bulenkov.iconloader.util.DoubleColor; -import com.bulenkov.iconloader.util.Gray; -import com.bulenkov.iconloader.util.UIUtil; - -/** - * Thanks to hudsonb: https://github.com/bulenkov/Darcula/pull/5 - * - * @author Revivius - */ -public class DarculaSplitPaneDivider extends BasicSplitPaneDivider { - private Icon splitGlueV = IconLoader.findIcon("/com/bulenkov/darcula/icons/splitGlueV.png", DarculaSplitPaneDivider.class, true); - private Icon splitGlueH = IconLoader.findIcon("/com/bulenkov/darcula/icons/splitGlueH.png", DarculaSplitPaneDivider.class, true); - - /** - * Creates an instance of DarculaSplitPaneDivider. Registers this - * instance for mouse events and mouse dragged events. - */ - public DarculaSplitPaneDivider(DarculaSplitPaneUI ui) { - super(ui); - } - - @Override - public void paint(Graphics g) { - super.paint(g); - - if(splitPane.getOrientation() == JSplitPane.VERTICAL_SPLIT) - splitGlueV.paintIcon(this, g, getWidth() / 2, (getHeight() - splitGlueV.getIconHeight()) / 2); - else - splitGlueH.paintIcon(this, g, (getWidth() - splitGlueH.getIconWidth()) / 2, getHeight() / 2); - } - - @Override - protected JButton createLeftOneTouchButton() { - JButton b = new JButton() { - public void setBorder(Border b) { - } - - public void paint(Graphics g) { - if (splitPane != null) { - int[] xs = new int[3]; - int[] ys = new int[3]; - int blockSize; - - // Fill the background first ... - g.setColor(this.getBackground()); - g.fillRect(0, 0, this.getWidth(), - this.getHeight()); - - // ... then draw the arrow. - g.setColor(new DoubleColor(Gray._255, UIUtil.getLabelForeground())); - if (orientation == JSplitPane.VERTICAL_SPLIT) { - blockSize = Math.min(getHeight(), ONE_TOUCH_SIZE); - xs[0] = blockSize; - xs[1] = 0; - xs[2] = blockSize << 1; - ys[0] = 0; - ys[1] = ys[2] = blockSize; - g.drawPolygon(xs, ys, 3); // Little trick to make the - // arrows of equal size - } - else { - blockSize = Math.min(getWidth(), ONE_TOUCH_SIZE); - xs[0] = xs[2] = blockSize; - xs[1] = 0; - ys[0] = 0; - ys[1] = blockSize; - ys[2] = blockSize << 1; - } - g.fillPolygon(xs, ys, 3); - } - } - // Don't want the button to participate in focus traversable. - public boolean isFocusTraversable() { - return false; - } - }; - b.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE)); - b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - b.setFocusPainted(false); - b.setBorderPainted(false); - b.setRequestFocusEnabled(false); - return b; - } - - @Override - protected JButton createRightOneTouchButton() { - JButton b = new JButton() { - public void setBorder(Border border) { - } - public void paint(Graphics g) { - if (splitPane != null) { - int[] xs = new int[3]; - int[] ys = new int[3]; - int blockSize; - - // Fill the background first ... - g.setColor(this.getBackground()); - g.fillRect(0, 0, this.getWidth(), - this.getHeight()); - - // ... then draw the arrow. - if (orientation == JSplitPane.VERTICAL_SPLIT) { - blockSize = Math.min(getHeight(), ONE_TOUCH_SIZE); - xs[0] = blockSize; - xs[1] = blockSize << 1; - xs[2] = 0; - ys[0] = blockSize; - ys[1] = ys[2] = 0; - } - else { - blockSize = Math.min(getWidth(), ONE_TOUCH_SIZE); - xs[0] = xs[2] = 0; - xs[1] = blockSize; - ys[0] = 0; - ys[1] = blockSize; - ys[2] = blockSize << 1; - } - g.setColor(new DoubleColor(Gray._255, UIUtil.getLabelForeground())); - g.fillPolygon(xs, ys, 3); - } - } - // Don't want the button to participate in focus traversable. - public boolean isFocusTraversable() { - return false; - } - }; - b.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE)); - b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - b.setFocusPainted(false); - b.setBorderPainted(false); - b.setRequestFocusEnabled(false); - return b; - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarculaSplitPaneUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarculaSplitPaneUI.java deleted file mode 100644 index d93cf33c94..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarculaSplitPaneUI.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicSplitPaneDivider; -import javax.swing.plaf.basic.BasicSplitPaneUI; - -/** - * Thanks to hudsonb: https://github.com/bulenkov/Darcula/pull/5 - * - * @author Revivius - */ -public class DarculaSplitPaneUI extends BasicSplitPaneUI { - @SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"}) - public static ComponentUI createUI(JComponent c) { - return new DarculaSplitPaneUI(); - } - - @Override - public BasicSplitPaneDivider createDefaultDivider() { - return new DarculaSplitPaneDivider(this); - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarkScrollButtonTabbedPaneUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarkScrollButtonTabbedPaneUI.java deleted file mode 100644 index 3de4feae50..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/DarkScrollButtonTabbedPaneUI.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2016 Revivius. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.revivius.nb.darcula.ui; - -import com.bulenkov.darcula.ui.DarculaTabbedPaneUI; -import java.awt.Color; -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.SwingConstants; -import static javax.swing.SwingConstants.EAST; -import static javax.swing.SwingConstants.NORTH; -import static javax.swing.SwingConstants.SOUTH; -import static javax.swing.SwingConstants.WEST; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.UIResource; -import javax.swing.plaf.basic.BasicArrowButton; - -/** - * Overrides {@link #createScrollButton(int)} to provide a button which is more suitable to dark look and feel. - * @author Revivius - */ -public class DarkScrollButtonTabbedPaneUI extends DarculaTabbedPaneUI { - - public static ComponentUI createUI(JComponent c) { - return new DarkScrollButtonTabbedPaneUI(); - } - - @Override - protected JButton createScrollButton(int direction) { - if (direction != SOUTH && direction != NORTH && direction != EAST && - direction != WEST) { - throw new IllegalArgumentException("Direction must be one of: " + - "SOUTH, NORTH, EAST or WEST"); - } - return new ScrollableTabButton(direction); - } - - private class ScrollableTabButton extends BasicArrowButton implements UIResource, - SwingConstants { - public ScrollableTabButton(int direction) { - super(direction, - new Color(60, 63, 65), - new Color(54, 54, 54), - new Color(169, 169, 169), - new Color(54, 54, 54)); - setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEmptyBorder(0, 0, 0, 1), - BorderFactory.createLineBorder(new Color(169, 169, 169))) - ); - } - } - -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedCheckBoxMenuItemUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedCheckBoxMenuItemUI.java deleted file mode 100644 index fb10e77e64..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedCheckBoxMenuItemUI.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.RenderingHints; - -import javax.swing.JComponent; -import javax.swing.MenuSelectionManager; -import javax.swing.plaf.ComponentUI; - -import com.bulenkov.iconloader.util.GraphicsConfig; -import com.bulenkov.iconloader.util.Gray; -import com.bulenkov.iconloader.util.UIUtil; - -import sun.swing.MenuItemLayoutHelper; - -/** - * @author Konstantin Bulenkov - */ -public class FixedCheckBoxMenuItemUI extends FixedMenuItemUIBase { - - public static ComponentUI createUI(JComponent c) { - return new FixedCheckBoxMenuItemUI(); - } - - protected String getPropertyPrefix() { - return "CheckBoxMenuItem"; - } - - // Stay open after click - @Override - protected void doClick(MenuSelectionManager msm) { - menuItem.doClick(0); - } - - @Override - protected void paintCheckIcon(Graphics g2, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr, Color holdc, Color foreground) { - Graphics2D g = (Graphics2D) g2; - final GraphicsConfig config = new GraphicsConfig(g); - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT); - - g.translate(lr.getCheckRect().x+2, lr.getCheckRect().y+2); - - final int sz = 13; - g.setPaint(new GradientPaint(sz / 2, 1, Gray._110, sz / 2, sz, Gray._95)); - g.fillRoundRect(0, 0, sz, sz - 1 , 4, 4); - - g.setPaint(new GradientPaint(sz / 2, 1, Gray._120.withAlpha(0x5a), sz / 2, sz, Gray._105.withAlpha(90))); - g.drawRoundRect(0, (UIUtil.isUnderDarcula() ? 1 : 0), sz, sz - 1, 4, 4); - - g.setPaint(Gray._40.withAlpha(180)); - g.drawRoundRect(0, 0, sz, sz - 1, 4, 4); - - - if (lh.getMenuItem().isSelected()) { - g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); - g.setStroke(new BasicStroke(2.0f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND)); - g.setPaint(Gray._30); - g.drawLine(4, 7, 7, 10); - g.drawLine(7, 10, sz, 2); - g.setPaint(Gray._170); - g.drawLine(4, 5, 7, 8); - g.drawLine(7, 8, sz, 0); - } - - g.translate(-lr.getCheckRect().x-2, -lr.getCheckRect().y-2); - config.restore(); - g.setColor(foreground); - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedMenuItemUIBase.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedMenuItemUIBase.java deleted file mode 100644 index 1822853e3a..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedMenuItemUIBase.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.MouseEvent; - -import javax.swing.ButtonModel; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.MenuElement; -import javax.swing.MenuSelectionManager; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicMenuItemUI; - -import sun.swing.MenuItemLayoutHelper; -import sun.swing.SwingUtilities2; - -/** - * The Darcula UI doesn't indent non-radio-buttons enough, and the text is not colored correctly. - * - * I don't think these fixes are NetBeans or Workstation specific. They could be merged into Darcula. - */ -public class FixedMenuItemUIBase extends BasicMenuItemUI { - - public static ComponentUI createUI(JComponent c) { - return new FixedMenuItemUIBase(); - } - - public void processMouseEvent(JMenuItem item, MouseEvent e, MenuElement path[], MenuSelectionManager manager) { - Point p = e.getPoint(); - if (p.x >= 0 && p.x < item.getWidth() && p.y >= 0 && p.y < item.getHeight()) { - if (e.getID() == MouseEvent.MOUSE_RELEASED) { - manager.clearSelectedPath(); - item.doClick(0); - item.setArmed(false); - } - else - manager.setSelectedPath(path); - } - else if (item.getModel().isArmed()) { - MenuElement newPath[] = new MenuElement[path.length - 1]; - int i, c; - for (i = 0, c = path.length - 1; i < c; i++) - newPath[i] = path[i]; - manager.setSelectedPath(newPath); - } - } - - protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, - int defaultTextIconGap) { - // Save original graphics font and color - Font holdf = g.getFont(); - Color holdc = g.getColor(); - - JMenuItem mi = (JMenuItem) c; - g.setFont(mi.getFont()); - - Rectangle viewRect = new Rectangle(0, 0, mi.getWidth(), mi.getHeight()); - // KR: commenting this out because it does not render correctly - //applyInsets(viewRect, mi.getInsets()); - - MenuItemLayoutHelper lh = new MenuItemLayoutHelper(mi, checkIcon, arrowIcon, viewRect, defaultTextIconGap, acceleratorDelimiter, - mi.getComponentOrientation().isLeftToRight(), mi.getFont(), acceleratorFont, MenuItemLayoutHelper.useCheckAndArrow(menuItem), - getPropertyPrefix()); - MenuItemLayoutHelper.LayoutResult lr = lh.layoutMenuItem(); - - paintBackground(g, mi, background); - paintCheckIcon(g, lh, lr, holdc, foreground); - paintIcon(g, lh, lr, holdc); - paintText(g, lh, lr); - paintAccText(g, lh, lr); - paintArrowIcon(g, lh, lr, foreground); - - // Restore original graphics font and color - g.setColor(holdc); - g.setFont(holdf); - } - - protected void paintIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr, Color holdc) { - if (lh.getIcon() != null) { - Icon icon; - ButtonModel model = lh.getMenuItem().getModel(); - if (!model.isEnabled()) { - icon = lh.getMenuItem().getDisabledIcon(); - } - else if (model.isPressed() && model.isArmed()) { - icon = lh.getMenuItem().getPressedIcon(); - if (icon == null) { - // Use default icon - icon = lh.getMenuItem().getIcon(); - } - } - else { - icon = lh.getMenuItem().getIcon(); - } - - if (icon != null) { - icon.paintIcon(lh.getMenuItem(), g, lr.getIconRect().x, lr.getIconRect().y); - g.setColor(holdc); - } - } - } - - protected void paintCheckIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr, Color holdc, Color foreground) { - if (lh.getCheckIcon() != null) { - ButtonModel model = lh.getMenuItem().getModel(); - if (model.isArmed() || (lh.getMenuItem() instanceof JMenu && model.isSelected())) { - g.setColor(foreground); - } - else { - g.setColor(holdc); - } - if (lh.useCheckAndArrow()) { - lh.getCheckIcon().paintIcon(lh.getMenuItem(), g, lr.getCheckRect().x, lr.getCheckRect().y); - } - g.setColor(holdc); - } - } - - protected void paintAccText(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr) { - if (!lh.getAccText().equals("")) { - ButtonModel model = lh.getMenuItem().getModel(); - g.setFont(lh.getAccFontMetrics().getFont()); - if (!model.isEnabled()) { - // *** paint the accText disabled - if (disabledForeground != null) { - g.setColor(disabledForeground); - SwingUtilities2.drawString(lh.getMenuItem(), g, lh.getAccText(), lr.getAccRect().x, - lr.getAccRect().y + lh.getAccFontMetrics().getAscent()); - } - else { - g.setColor(lh.getMenuItem().getBackground().brighter()); - SwingUtilities2.drawString(lh.getMenuItem(), g, lh.getAccText(), lr.getAccRect().x, - lr.getAccRect().y + lh.getAccFontMetrics().getAscent()); - g.setColor(lh.getMenuItem().getBackground().darker()); - SwingUtilities2.drawString(lh.getMenuItem(), g, lh.getAccText(), lr.getAccRect().x - 1, - lr.getAccRect().y + lh.getFontMetrics().getAscent() - 1); - } - } - else { - // *** paint the accText normally - if (model.isArmed() || (lh.getMenuItem() instanceof JMenu && model.isSelected())) { - g.setColor(acceleratorSelectionForeground); - } - else { - g.setColor(acceleratorForeground); - } - SwingUtilities2.drawString(lh.getMenuItem(), g, lh.getAccText(), lr.getAccRect().x, - lr.getAccRect().y + lh.getAccFontMetrics().getAscent()); - } - } - } - - protected void paintText(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr) { - if (!lh.getText().equals("")) { - if (lh.getHtmlView() != null) { - // Text is HTML - lh.getHtmlView().paint(g, lr.getTextRect()); - } - else { - // Text isn't HTML - // KR: fix menu text color - g.setColor(menuItem.getForeground()); - paintText(g, lh.getMenuItem(), lr.getTextRect(), lh.getText()); - } - } - } - - protected void paintArrowIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr, Color foreground) { - if (lh.getArrowIcon() != null) { - ButtonModel model = lh.getMenuItem().getModel(); - if (model.isArmed() || (lh.getMenuItem() instanceof JMenu && model.isSelected())) { - g.setColor(foreground); - } - if (lh.useCheckAndArrow()) { - lh.getArrowIcon().paintIcon(lh.getMenuItem(), g, lr.getArrowRect().x, lr.getArrowRect().y); - } - } - } - - protected void applyInsets(Rectangle rect, Insets insets) { - if (insets != null) { - rect.x += insets.left; - rect.y += insets.top; - rect.width -= (insets.right + rect.x); - rect.height -= (insets.bottom + rect.y); - } - } -} \ No newline at end of file diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedMenuUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedMenuUI.java deleted file mode 100644 index 40086e1558..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedMenuUI.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.Rectangle; - -import javax.swing.ButtonModel; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicMenuUI; - -import sun.swing.MenuItemLayoutHelper; -import sun.swing.SwingUtilities2; - -/** - * The Darcula UI doesn't indent non-radio-buttons enough. - * - * This fix is not NetBeans or Workstation specific and could be merged into Darcula. - */ -public class FixedMenuUI extends BasicMenuUI { - - public static ComponentUI createUI(JComponent c) { - return new FixedMenuUI(); - } - - @Override - protected void paintMenuItem(Graphics g, JComponent c, - Icon checkIcon, Icon arrowIcon, - Color background, Color foreground, - int defaultTextIconGap) { - // Save original graphics font and color - Font holdf = g.getFont(); - Color holdc = g.getColor(); - - JMenuItem mi = (JMenuItem) c; - g.setFont(mi.getFont()); - - Rectangle viewRect = new Rectangle(0, 0, mi.getWidth(), mi.getHeight()); - // KR: commenting this out because it does not render correctly -// applyInsets(viewRect, mi.getInsets()); - - MenuItemLayoutHelper lh = new MenuItemLayoutHelper(mi, checkIcon, - arrowIcon, viewRect, defaultTextIconGap, acceleratorDelimiter, - mi.getComponentOrientation().isLeftToRight(), mi.getFont(), - acceleratorFont, MenuItemLayoutHelper.useCheckAndArrow(menuItem), - getPropertyPrefix()); - MenuItemLayoutHelper.LayoutResult lr = lh.layoutMenuItem(); - - paintBackground(g, mi, background); - paintCheckIcon(g, lh, lr, holdc, foreground); - paintIcon(g, lh, lr, holdc); - g.setColor(foreground); - paintText(g, lh, lr); - paintAccText(g, lh, lr); - paintArrowIcon(g, lh, lr, foreground); - - // Restore original graphics font and color - g.setColor(holdc); - g.setFont(holdf); - } - - protected void paintIcon(Graphics g, MenuItemLayoutHelper lh, - MenuItemLayoutHelper.LayoutResult lr, Color holdc) { - if (lh.getIcon() != null) { - Icon icon; - ButtonModel model = lh.getMenuItem().getModel(); - if (!model.isEnabled()) { - icon = lh.getMenuItem().getDisabledIcon(); - } else if (model.isPressed() && model.isArmed()) { - icon = lh.getMenuItem().getPressedIcon(); - if (icon == null) { - // Use default icon - icon = lh.getMenuItem().getIcon(); - } - } else { - icon = lh.getMenuItem().getIcon(); - } - - if (icon != null) { - icon.paintIcon(lh.getMenuItem(), g, lr.getIconRect().x, - lr.getIconRect().y); - g.setColor(holdc); - } - } - } - - protected void paintCheckIcon(Graphics g, MenuItemLayoutHelper lh, - MenuItemLayoutHelper.LayoutResult lr, - Color holdc, Color foreground) { - if (lh.getCheckIcon() != null) { - ButtonModel model = lh.getMenuItem().getModel(); - if (model.isArmed() || (lh.getMenuItem() instanceof JMenu - && model.isSelected())) { - g.setColor(foreground); - } else { - g.setColor(holdc); - } - if (lh.useCheckAndArrow()) { - lh.getCheckIcon().paintIcon(lh.getMenuItem(), g, - lr.getCheckRect().x, lr.getCheckRect().y); - } - g.setColor(holdc); - } - } - - protected void paintAccText(Graphics g, MenuItemLayoutHelper lh, - MenuItemLayoutHelper.LayoutResult lr) { - if (!lh.getAccText().equals("")) { - ButtonModel model = lh.getMenuItem().getModel(); - g.setFont(lh.getAccFontMetrics().getFont()); - if (!model.isEnabled()) { - // *** paint the accText disabled - if (disabledForeground != null) { - g.setColor(disabledForeground); - SwingUtilities2.drawString(lh.getMenuItem(), g, - lh.getAccText(), lr.getAccRect().x, - lr.getAccRect().y + lh.getAccFontMetrics().getAscent()); - } else { - g.setColor(lh.getMenuItem().getBackground().brighter()); - SwingUtilities2.drawString(lh.getMenuItem(), g, - lh.getAccText(), lr.getAccRect().x, - lr.getAccRect().y + lh.getAccFontMetrics().getAscent()); - g.setColor(lh.getMenuItem().getBackground().darker()); - SwingUtilities2.drawString(lh.getMenuItem(), g, - lh.getAccText(), lr.getAccRect().x - 1, - lr.getAccRect().y + lh.getFontMetrics().getAscent() - 1); - } - } else { - // *** paint the accText normally - if (model.isArmed() - || (lh.getMenuItem() instanceof JMenu - && model.isSelected())) { - g.setColor(acceleratorSelectionForeground); - } else { - g.setColor(acceleratorForeground); - } - SwingUtilities2.drawString(lh.getMenuItem(), g, lh.getAccText(), - lr.getAccRect().x, lr.getAccRect().y + - lh.getAccFontMetrics().getAscent()); - } - } - } - - protected void paintText(Graphics g, MenuItemLayoutHelper lh, - MenuItemLayoutHelper.LayoutResult lr) { - if (!lh.getText().equals("")) { - if (lh.getHtmlView() != null) { - // Text is HTML - lh.getHtmlView().paint(g, lr.getTextRect()); - } else { - // Text isn't HTML - // KR: fix menu text color - g.setColor(menuItem.getForeground()); - paintText(g, lh.getMenuItem(), lr.getTextRect(), lh.getText()); - } - } - } - - protected void paintArrowIcon(Graphics g, MenuItemLayoutHelper lh, - MenuItemLayoutHelper.LayoutResult lr, - Color foreground) { - if (lh.getArrowIcon() != null) { - ButtonModel model = lh.getMenuItem().getModel(); - if (model.isArmed() || (lh.getMenuItem() instanceof JMenu - && model.isSelected())) { - g.setColor(foreground); - } - if (lh.useCheckAndArrow()) { - lh.getArrowIcon().paintIcon(lh.getMenuItem(), g, - lr.getArrowRect().x, lr.getArrowRect().y); - } - } - } - - protected void applyInsets(Rectangle rect, Insets insets) { - if(insets != null) { - rect.x += insets.left; - rect.y += insets.top; - rect.width -= (insets.right + rect.x); - rect.height -= (insets.bottom + rect.y); - } - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedRadioButtonMenuItemUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedRadioButtonMenuItemUI.java deleted file mode 100644 index 04b4c10479..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedRadioButtonMenuItemUI.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.Color; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.RenderingHints; - -import javax.swing.JComponent; -import javax.swing.UIManager; -import javax.swing.plaf.ComponentUI; - -import com.bulenkov.iconloader.util.ColorUtil; -import com.bulenkov.iconloader.util.GraphicsConfig; -import com.bulenkov.iconloader.util.Gray; - -import sun.swing.MenuItemLayoutHelper; - -/** - * @author Konstantin Bulenkov - */ -public class FixedRadioButtonMenuItemUI extends FixedMenuItemUIBase { - - public static ComponentUI createUI(JComponent c) { - return new FixedRadioButtonMenuItemUI(); - } - - protected String getPropertyPrefix() { - return "RadioButtonMenuItem"; - } - - @Override - protected void paintCheckIcon(Graphics g2, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr, Color holdc, Color foreground) { - Graphics2D g = (Graphics2D) g2; - final GraphicsConfig config = new GraphicsConfig(g); - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT); - - g.translate(lr.getCheckRect().x + 1, lr.getCheckRect().y + 1); - - int rad = 5; - - final int x = 0; - final int y = 0; - final int w = 13; - final int h = 13; - - g.translate(x, y); - - // setup AA for lines - Color bg = lh.getMenuItem().getBackground(); - g.setPaint(new GradientPaint(0, 0, ColorUtil.shift(bg, 1.5), 0, 16, ColorUtil.shift(bg, 1.2))); - - g.fillOval(0, 1, w - 1, h - 1); - - g.setPaint(new GradientPaint(w / 2, 1, Gray._160.withAlpha(90), w / 2, h, Gray._100.withAlpha(90))); - g.drawOval(0, 2, w - 1, h - 1); - - g.setPaint(Gray._40.withAlpha(200)); - g.drawOval(0, 1, w - 1, h - 1); - - if (lh.getMenuItem().isSelected()) { - final boolean enabled = lh.getMenuItem().isEnabled(); - g.setColor(UIManager - .getColor(enabled ? "RadioButton.darcula.selectionEnabledShadowColor" : "RadioButton.darcula.selectionDisabledShadowColor")); - g.fillOval((w - rad) / 2, h / 2, rad, rad); - g.setColor(UIManager.getColor(enabled ? "RadioButton.darcula.selectionEnabledColor" : "RadioButton.darcula.selectionDisabledColor")); - g.fillOval((w - rad) / 2, h / 2 - 1, rad, rad); - } - config.restore(); - g.translate(-x, -y); - - g.translate(-lr.getCheckRect().x - 1, -lr.getCheckRect().y - 1); - config.restore(); - } -} \ No newline at end of file diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedTableHeaderUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedTableHeaderUI.java deleted file mode 100644 index a65c1a6090..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/FixedTableHeaderUI.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import com.bulenkov.iconloader.util.ColorUtil; -import com.bulenkov.iconloader.util.GraphicsConfig; -import com.bulenkov.iconloader.util.Gray; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicTableHeaderUI; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableColumn; -import java.awt.Color; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.util.Enumeration; - -/** - * KR: Fixed: last header cell does not have a right border, making it difficult to resize - * - * @author Konstantin Bulenkov - */ -public class FixedTableHeaderUI extends BasicTableHeaderUI { - - @SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"}) - public static ComponentUI createUI(JComponent c) { - return new FixedTableHeaderUI(); - } - - @Override - public void paint(Graphics g2, JComponent c) { - final Graphics2D g = (Graphics2D)g2; - final GraphicsConfig config = new GraphicsConfig(g); - final Color bg = c.getBackground(); - g.setPaint(new GradientPaint(0, 0, ColorUtil.shift(bg, 1.4), 0, c.getHeight(), ColorUtil.shift(bg, 0.9))); - final int h = c.getHeight(); - final int w = c.getWidth(); - g.fillRect(0,0, w, h); - g.setPaint(ColorUtil.shift(bg, 0.75)); - g.drawLine(0, h-1, w, h-1); - g.drawLine(w-1, 0, w-1, h-1); - - final Enumeration columns = ((JTableHeader)c).getColumnModel().getColumns(); - - final Color lineColor = ColorUtil.shift(bg, 0.7); - final Color shadow = Gray._255.withAlpha(30); - int offset = 0; - while (columns.hasMoreElements()) { - final TableColumn column = columns.nextElement(); - // Fixed: -// if (columns.hasMoreElements() && column.getWidth() > 0) { - if (column.getWidth() > 0) { - offset += column.getWidth(); - g.setColor(lineColor); - g.drawLine(offset-1, 1, offset-1, h-3); - g.setColor(shadow); - g.drawLine(offset, 1, offset, h-3); - } - } - - config.restore(); - - super.paint(g, c); - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/IndentAwareTreeUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/IndentAwareTreeUI.java deleted file mode 100644 index eae7113732..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/IndentAwareTreeUI.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2017 Revivius. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.revivius.nb.darcula.ui; - -import com.bulenkov.darcula.ui.DarculaTreeUI; -import com.revivius.nb.darcula.options.DarculaLAFOptionsPanelController; -import com.revivius.nb.darcula.options.DarculaLAFPanel; - -import java.awt.event.KeyListener; -import java.util.prefs.Preferences; -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import org.openide.util.NbPreferences; - -/** - * Overriden to workarround isSkinny() method in DarculaTreeUI. - * @author Revivius - */ -public class IndentAwareTreeUI extends DarculaTreeUI { - - private static final Preferences PREFS = NbPreferences.forModule(DarculaLAFPanel.class); - - public static ComponentUI createUI(JComponent c) { - return new IndentAwareTreeUI(); - } - - @Override - protected int getRowX(int row, int depth) { - if (PREFS.getBoolean(DarculaLAFOptionsPanelController.OVERRIDE_TREE_INDENT_BOOLEAN, false)) { - return totalChildIndent * (depth + depthOffset); - } - - return super.getRowX(row, depth); - } - - // Disable alphanumeric node navigation - @Override - protected KeyListener createKeyListener() { - return null; - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/InreasedInsetsTableHeaderBorder.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/InreasedInsetsTableHeaderBorder.java deleted file mode 100644 index 3599167bc8..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/InreasedInsetsTableHeaderBorder.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import com.bulenkov.darcula.DarculaTableHeaderBorder; -import java.awt.Component; -import java.awt.Insets; - -/** - * Increases table header insets. - * @author Revivius - */ -public class InreasedInsetsTableHeaderBorder extends DarculaTableHeaderBorder { - - @Override - public Insets getBorderInsets(Component c) { - // KR: increased even more - return new Insets(2, 3, 2, 3); - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/OptionsAwareLabelUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/OptionsAwareLabelUI.java deleted file mode 100644 index f167c9ec68..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/OptionsAwareLabelUI.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Graphics; -import java.beans.PropertyChangeEvent; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.border.Border; -import javax.swing.border.CompoundBorder; -import javax.swing.border.EmptyBorder; -import javax.swing.border.LineBorder; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalLabelUI; -import org.netbeans.swing.plaf.LFCustoms; - -/** - * Many thanks to Neil C. Smith of Praxis-Life. This trick is mostly - * based on his excellent blog article: - * https://praxisintermedia.wordpress.com/2011/09/29/the-dark-arts-of-netbeans-hackery/ - * - * @author Revivius - */ -public class OptionsAwareLabelUI extends MetalLabelUI { - - private static final String OPTIONS_PANEL_NAME = "org.netbeans.modules.options.OptionsPanel"; - - private static boolean bgReplaced = false; - - public static ComponentUI createUI(JComponent c) { - if (c.getClass().getName().startsWith(OPTIONS_PANEL_NAME)) { - return new OptionsAwareLabelUI(); - } - return MetalLabelUI.createUI(c); - } - - private static final Color oldHighlighted = new Color(224, 232, 246); - - private final Color fgNormal = UIManager.getColor("textText"); - private final Color bgNormal = UIManager.getColor("List.background"); - private final Color bgSelected = UIManager.getColor("List.selectionBackground"); - private final Color bgHighlighted = new Color(13, 41, 62); - private final Border normalBorder = new EmptyBorder(6, 8, 6, 8); - private final Border highlightBorder = new CompoundBorder( - new LineBorder(bgNormal), - new EmptyBorder(4, 7, 4, 7) - ); - private boolean ignoreChanges; - - @Override - public void update(Graphics g, JComponent c) { - super.update(g, c); - - if (bgReplaced) { - return; - } - - // In NB 8.1 CategoryButtons are in a JScrollPane - Container parent = SwingUtilities.getAncestorOfClass(JScrollPane.class, c); - if (parent == null) { - parent = SwingUtilities.getAncestorOfClass(JPanel.class, c); - } - // In NB 8.0 CategoryButtons are in a JPanel - if (parent != null) { - parent = parent.getParent(); - } - if (parent != null && (parent instanceof JPanel)) { - JPanel panel = (JPanel) parent; - replaceBg(panel); - panel.setBorder(BorderFactory.createMatteBorder( - 0, 0, 1, 0, UIManager.getColor(LFCustoms.SCROLLPANE_BORDER_COLOR))); - bgReplaced = true; - } - } - - private void replaceBg(JComponent component) { - component.setBackground(bgNormal); - if (component instanceof JScrollPane) { - JScrollPane sc = (JScrollPane) component; - sc.getViewport().setBackground(bgNormal); - sc.getViewport().getView().setBackground(bgNormal); - } - Component[] components = component.getComponents(); - for (Component c : components) { - if (c instanceof JPanel || c instanceof JScrollPane) { - replaceBg((JComponent) c); - } - } - } - - @Override - public void propertyChange(PropertyChangeEvent e) { - if (ignoreChanges) { - super.propertyChange(e); - return; - } - if (!(e.getSource() instanceof JLabel)) { - super.propertyChange(e); - return; - } - JLabel c = (JLabel) e.getSource(); - if ("background".equals(e.getPropertyName())) { - ignoreChanges = true; - Color bgCurrent = c.getBackground(); - if (Color.WHITE.equals(bgCurrent)) { - c.setBackground(bgNormal); - } else if (oldHighlighted.equals(bgCurrent)) { - c.setBackground(bgHighlighted); - } else if (!bgNormal.equals(bgCurrent)) { - c.setBackground(bgSelected); - } - ignoreChanges = false; - } else if ("foreground".equals(e.getPropertyName())) { - ignoreChanges = true; - if (!fgNormal.equals(c.getForeground())) { - c.setForeground(fgNormal); - } - ignoreChanges = false; - } else if ("border".equals(e.getPropertyName())) { - ignoreChanges = true; - Border current = c.getBorder(); - if (current instanceof EmptyBorder) { - c.setBorder(normalBorder); - } else { - c.setBorder(highlightBorder); - } - ignoreChanges = false; - } else { - super.propertyChange(e); - } - } - -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ReducedInsetsDarculaButtonPainter.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ReducedInsetsDarculaButtonPainter.java deleted file mode 100644 index 9508115468..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/ReducedInsetsDarculaButtonPainter.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import com.bulenkov.darcula.DarculaUIUtil; -import com.bulenkov.darcula.ui.DarculaButtonUI; -import com.bulenkov.iconloader.util.GraphicsConfig; -import com.bulenkov.iconloader.util.Gray; -import java.awt.Component; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.RenderingHints; -import javax.swing.border.Border; -import javax.swing.plaf.InsetsUIResource; -import javax.swing.plaf.UIResource; - -/** - * A minor re-write of DarculaButtonPainter to reduce border insets. - * - * Mostly copy paste from DarculaButtonPainter. - * - * @author Revivius - */ -public class ReducedInsetsDarculaButtonPainter implements Border, UIResource { - - @Override - public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { - Graphics2D g2d = (Graphics2D) g; - boolean square = DarculaButtonUI.isSquare(c); - if (c.hasFocus()) { - DarculaUIUtil.paintFocusRing(g2d, 2, 2, width - 3, height - 3); - } else { - GraphicsConfig config = new GraphicsConfig(g); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT); - g2d.setPaint(new GradientPaint( - width / 2, y, Gray._80.withAlpha(90), - width / 2, height, Gray._90.withAlpha(90))); - - g2d.setPaint(Gray._100.withAlpha(180)); - - int arc = 5; - if (square) { - arc = 3; - } - g.drawRoundRect(x + 1, y + 1, width - 2, height - 2, arc, arc); - - config.restore(); - } - } - - @Override - public Insets getBorderInsets(Component c) { - if (DarculaButtonUI.isSquare(c)) { - return new InsetsUIResource(2, 0, 2, 0); - } - return new InsetsUIResource(4, 6, 4, 6); - } - - @Override - public boolean isBorderOpaque() { - return false; - } -} diff --git a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/RolloverToolBarUI.java b/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/RolloverToolBarUI.java deleted file mode 100644 index 0184b673f9..0000000000 --- a/modules/DarculaLAF/src/main/java/com/revivius/nb/darcula/ui/RolloverToolBarUI.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.revivius.nb.darcula.ui; - -import java.awt.Color; -import java.awt.Component; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import javax.swing.AbstractButton; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.UIManager; -import javax.swing.border.Border; -import javax.swing.border.LineBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicToolBarUI; -import org.netbeans.swing.plaf.LFCustoms; - -/** - * A ToolBarUI that installs a ChangeListener on buttons to enable rollover for - * JButtons and JToggleButtons. - * - * @author Revivius - */ -public class RolloverToolBarUI extends BasicToolBarUI { - - private static final String LISTENER_KEY = "ToolbarUI.ListenerKey"; - - private static final ChangeListener LISTENER = new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - AbstractButton b = (AbstractButton) e.getSource(); - boolean rollover = b.getModel().isRollover(); - - b.setContentAreaFilled(rollover || b.getModel().isSelected()); - b.setBorderPainted(rollover); - } - }; - - // #24 - // o.openide.awt.ToolbarWithOverflow - private static final PropertyChangeListener BORDER_UPDATER = new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - JComponent src = (JComponent) evt.getSource(); - Border border = src.getBorder(); - if (border instanceof LineBorder) { - LineBorder lb = (LineBorder) border; - if (lb.getThickness() == 1 && Color.LIGHT_GRAY.equals(lb.getLineColor())) { - src.setBorder(BorderFactory.createLineBorder(UIManager.getColor(LFCustoms.SCROLLPANE_BORDER_COLOR))); - } - } - } - }; - - public static ComponentUI createUI(JComponent c) { - return new RolloverToolBarUI(); - } - - @Override - public void installUI(JComponent c) { - super.installUI(c); - // #24 - if ("overflowToolbar".equals(toolBar.getName())) { - toolBar.addPropertyChangeListener("border", BORDER_UPDATER); - } - } - - @Override - protected void uninstallDefaults() { - super.uninstallDefaults(); - // #24 - if ("overflowToolbar".equals(toolBar.getName())) { - toolBar.removePropertyChangeListener("border", BORDER_UPDATER); - } - } - - @Override - protected void setBorderToNonRollover(Component c) { - if (c instanceof AbstractButton) { - AbstractButton b = (AbstractButton) c; - configureButton(b); - } - } - - @Override - protected void setBorderToRollover(Component c) { - if (c instanceof AbstractButton) { - AbstractButton b = (AbstractButton) c; - configureButton(b); - } - } - - @Override - protected void setBorderToNormal(Component c) { - if (c instanceof AbstractButton) { - AbstractButton b = (AbstractButton) c; - - b.setBorderPainted(true); - b.setContentAreaFilled(true); - b.setRolloverEnabled(false); - uninstallListener(b); - } - } - - private void configureButton(AbstractButton b) { - b.setBorderPainted(false); - b.setContentAreaFilled(false); - b.setRolloverEnabled(true); - installListener(b); - } - - private void installListener(AbstractButton b) { - Object o = b.getClientProperty(LISTENER_KEY); - if (o == null) { - b.addChangeListener(LISTENER); - LISTENER.stateChanged(new ChangeEvent(b)); - } - } - - private void uninstallListener(AbstractButton b) { - Object o = b.getClientProperty(LISTENER_KEY); - if (o != null) { - b.addChangeListener(LISTENER); - } - } - -} diff --git a/modules/DarculaLAF/src/main/nbm/manifest.mf b/modules/DarculaLAF/src/main/nbm/manifest.mf deleted file mode 100644 index a8e0a1e426..0000000000 --- a/modules/DarculaLAF/src/main/nbm/manifest.mf +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -AutoUpdate-Show-In-Client: true -OpenIDE-Module-Localizing-Bundle: com/revivius/nb/darcula/Bundle.properties -OpenIDE-Module-Layer: com/revivius/nb/darcula/layer.xml -OpenIDE-Module-Install: com/revivius/nb/darcula/Installer.class -OpenIDE-Module-Specification-Version: 3.0 -OpenIDE-Module-Implementation-Version: ${buildNumber} diff --git a/modules/DarculaLAF/src/main/resources/com/bulenkov/darcula/icons/splitGlueH.png b/modules/DarculaLAF/src/main/resources/com/bulenkov/darcula/icons/splitGlueH.png deleted file mode 100644 index 459554e08b..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/bulenkov/darcula/icons/splitGlueH.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/bulenkov/darcula/icons/splitGlueV.png b/modules/DarculaLAF/src/main/resources/com/bulenkov/darcula/icons/splitGlueV.png deleted file mode 100644 index 507f9c5baf..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/bulenkov/darcula/icons/splitGlueV.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Bundle.properties b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Bundle.properties deleted file mode 100644 index cd24ccd18a..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Bundle.properties +++ /dev/null @@ -1,4 +0,0 @@ -OpenIDE-Module-Display-Category=Janelia Workstation -OpenIDE-Module-Name=Darcula LAF -OpenIDE-Module-Short-Description=Dark theme for the Workstation, based on the Darcula theme for NetBeans - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/annotations.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/annotations.xml deleted file mode 100644 index 1183bb10e4..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/annotations.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/highlights.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/highlights.xml deleted file mode 100644 index ddc6eccf59..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/highlights.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 21d6cfc461..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/application/xml-dtd/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/application/xml-dtd/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 17889dbc72..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/application/xml-dtd/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/css/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/css/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index d528b5e9cf..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/css/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/html/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/html/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index a4b8967c1d..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/html/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/plain/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/plain/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 2151022def..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/plain/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/resources/script/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/resources/script/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index e591da22f0..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/resources/script/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-apache-conf/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-apache-conf/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 6a16b2e476..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-apache-conf/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-diff/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-diff/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 32cffe8550..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-diff/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-el/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-el/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 9acbc4cbda..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-el/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-json/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-json/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index f57efc1800..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-json/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-jsp/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-jsp/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 957c0a8149..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-jsp/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-php5/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-php5/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index c2a7c68cd4..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-php5/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-properties/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-properties/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index e8640b002d..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-properties/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-resources/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-resources/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 96d518f909..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-resources/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-sql/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-sql/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 07e039eb9a..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-sql/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-tag/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-tag/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index e32e267154..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-tag/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-tpl/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-tpl/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index aed448426e..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/x-tpl/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xhtml/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xhtml/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index d70d51a85d..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xhtml/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xml-external-parsed-entity/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xml-external-parsed-entity/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index 382dc745dd..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xml-external-parsed-entity/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xml/FontsColors/Darcula/tokenColorings.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xml/FontsColors/Darcula/tokenColorings.xml deleted file mode 100644 index d510326a7a..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/Editors/text/xml/FontsColors/Darcula/tokenColorings.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/closed.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/closed.png deleted file mode 100644 index e38659fbd2..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/closed.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/column-asc.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/column-asc.png deleted file mode 100644 index 3a9a46f67e..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/column-asc.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/column-desc.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/column-desc.png deleted file mode 100644 index 00d7b5c236..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/column-desc.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/computer.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/computer.png deleted file mode 100644 index dd42408abe..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/computer.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/detailsView.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/detailsView.png deleted file mode 100644 index 0d0ff4f83f..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/detailsView.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/file.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/file.png deleted file mode 100644 index f62491e9e9..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/file.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/floppyDrive.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/floppyDrive.png deleted file mode 100644 index 0d531eb7c8..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/floppyDrive.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/folder.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/folder.png deleted file mode 100644 index cf65d02baf..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/folder.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/hardDrive.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/hardDrive.png deleted file mode 100644 index d31655e9c2..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/hardDrive.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/homeFolder.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/homeFolder.png deleted file mode 100644 index efbd3c622e..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/homeFolder.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/layer.xml b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/layer.xml deleted file mode 100644 index c588e242d1..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/layer.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/listView.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/listView.png deleted file mode 100644 index 3250a71711..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/listView.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/newFolder.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/newFolder.png deleted file mode 100644 index a7fa87facc..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/newFolder.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/open.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/open.png deleted file mode 100644 index f2454ae9a9..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/open.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/Bundle.properties b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/Bundle.properties deleted file mode 100644 index ebf4319ba0..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/Bundle.properties +++ /dev/null @@ -1,7 +0,0 @@ -DarculaLAFPanel.cbOverride.text=Ove&rride default fonts by -DarculaLAFPanel.lblFontName.text=Fontname Size -DarculaLAFPanel.lblFont.text=F&ont: -DarculaLAFPanel.lblRestart.text=(needs restart) -DarculaLAFPanel.btnChooseFont.text=... -DarculaLAFPanel.cbInvertIcons.text=In&vert icon color values (light and dark levels) -DarculaLAFPanel.cbStretchedTabs.text=&Use stretched tabs diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/DarculaLAFPanel.form b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/DarculaLAFPanel.form deleted file mode 100644 index 41ef46bf5a..0000000000 --- a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/DarculaLAFPanel.form +++ /dev/null @@ -1,136 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/restart.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/restart.png deleted file mode 100644 index a65144591d..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/options/restart.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/upFolder.png b/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/upFolder.png deleted file mode 100644 index 13e7d6ee0f..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/com/revivius/nb/darcula/upFolder.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/down_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/down_dark.png deleted file mode 100644 index dd49b67d30..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/down_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/left_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/left_dark.png deleted file mode 100644 index 4b72c10597..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/left_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/maximize_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/maximize_dark.png deleted file mode 100644 index 703be44bca..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/maximize_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/right_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/right_dark.png deleted file mode 100644 index bdbd3db67e..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multitabs/resources/right_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multiview/resources/splitview_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/core/multiview/resources/splitview_dark.png deleted file mode 100644 index 885129dda5..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/core/multiview/resources/splitview_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/host_no_ssh_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/host_no_ssh_dark.png deleted file mode 100644 index 480501d9dc..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/host_no_ssh_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/host_with_ssh_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/host_with_ssh_dark.png deleted file mode 100644 index 36d3486d23..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/host_with_ssh_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/sshClosed_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/sshClosed_dark.gif deleted file mode 100644 index d598f552e1..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/sshClosed_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/sshOpen_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/sshOpen_dark.gif deleted file mode 100644 index bfa0afb6e3..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/cnd/remote/resources/sshOpen_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/filter_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/filter_dark.png deleted file mode 100644 index 96f50d3cd6..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/filter_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/filter_rollover_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/filter_rollover_dark.png deleted file mode 100644 index 876bfcc289..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/filter_rollover_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/notificationsError_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/notificationsError_dark.png deleted file mode 100644 index 521c1140b7..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/notificationsError_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/notifications_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/notifications_dark.png deleted file mode 100644 index 061b1cf27f..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/notifications/resources/notifications_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/attachButton_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/attachButton_dark.gif deleted file mode 100644 index fa382d9899..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/attachButton_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/closePanel_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/closePanel_dark.png deleted file mode 100644 index 518a85b3ee..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/closePanel_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/collapsedSnippet_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/collapsedSnippet_dark.png deleted file mode 100644 index 62566da7fd..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/collapsedSnippet_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/expandedSnippet_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/expandedSnippet_dark.png deleted file mode 100644 index 19fe982826..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/expandedSnippet_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/filterContains_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/filterContains_dark.png deleted file mode 100644 index cd2a0aa2ce..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/filterContains_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/filterNotContains_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/filterNotContains_dark.png deleted file mode 100644 index 396bc537fc..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/filterNotContains_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/hideColumn_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/hideColumn_dark.png deleted file mode 100644 index b1a1c27d6a..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/hideColumn_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/libraries_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/libraries_dark.png deleted file mode 100644 index a747024c9e..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/libraries_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/maximizePanel_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/maximizePanel_dark.png deleted file mode 100644 index 8ccc774c38..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/maximizePanel_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/minimizePanel_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/minimizePanel_dark.png deleted file mode 100644 index 4f8b713306..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/minimizePanel_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/popupArrow_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/popupArrow_dark.png deleted file mode 100644 index eecaccb44b..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/popupArrow_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/rename_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/rename_dark.png deleted file mode 100644 index e0223e053c..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/rename_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/restorePanel_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/restorePanel_dark.png deleted file mode 100644 index 5d70772f0f..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/restorePanel_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/runButton_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/runButton_dark.gif deleted file mode 100644 index f6c17a4d77..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/runButton_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectCPU32_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectCPU32_dark.gif deleted file mode 100644 index 18ef12f35f..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectCPU32_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectCPU_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectCPU_dark.gif deleted file mode 100644 index 791228f1d5..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectCPU_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectFragment32_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectFragment32_dark.gif deleted file mode 100644 index 73756dfc21..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectFragment32_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectFragment_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectFragment_dark.gif deleted file mode 100644 index c8caf80a4c..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectFragment_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectMemory32_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectMemory32_dark.gif deleted file mode 100644 index 660fc60656..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectMemory32_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectMemory_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectMemory_dark.gif deleted file mode 100644 index d7881157be..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/snapshotDataObjectMemory_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/sortAsc_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/sortAsc_dark.png deleted file mode 100644 index ce9fdc9e73..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/sortAsc_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/sortDesc_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/sortDesc_dark.png deleted file mode 100644 index 865780479b..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/profiler/impl/icons/sortDesc_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/tasklist/ui/resources/columnsSortedAsc_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/tasklist/ui/resources/columnsSortedAsc_dark.gif deleted file mode 100644 index 9804d8b81e..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/tasklist/ui/resources/columnsSortedAsc_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/tasklist/ui/resources/columnsSortedDesc_dark.gif b/modules/DarculaLAF/src/main/resources/org/netbeans/modules/tasklist/ui/resources/columnsSortedDesc_dark.gif deleted file mode 100644 index 2efac235e9..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/modules/tasklist/ui/resources/columnsSortedDesc_dark.gif and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_enabled_dark.png deleted file mode 100644 index cd98444c08..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_pressed_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_pressed_dark.png deleted file mode 100644 index c50ce3c8c7..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_pressed_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_rollover_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_rollover_dark.png deleted file mode 100644 index b6c7c361d5..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slidebottom_rollover_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_enabled_dark.png deleted file mode 100644 index b6bf6bd046..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_pressed_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_pressed_dark.png deleted file mode 100644 index e6fde46b27..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_pressed_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_rollover_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_rollover_dark.png deleted file mode 100644 index 30c5a74217..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideleft_rollover_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_enabled_dark.png deleted file mode 100644 index 1498a150bd..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_pressed_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_pressed_dark.png deleted file mode 100644 index 5e4e7dd868..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_pressed_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_rollover_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_rollover_dark.png deleted file mode 100644 index 6e06c5007f..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/vista_slideright_rollover_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_maximize_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_maximize_enabled_dark.png deleted file mode 100644 index 313ebc0c1e..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_maximize_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_minimize_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_minimize_enabled_dark.png deleted file mode 100644 index f040f34f1e..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_minimize_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_pin_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_pin_enabled_dark.png deleted file mode 100644 index 9b75fa5c44..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_pin_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_popup_disabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_popup_disabled_dark.png deleted file mode 100644 index 9d27bc51db..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_popup_disabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_popup_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_popup_enabled_dark.png deleted file mode 100644 index 7f805ff543..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_popup_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_restore_group_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_restore_group_enabled_dark.png deleted file mode 100644 index 9b75fa5c44..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_restore_group_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollleft_disabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollleft_disabled_dark.png deleted file mode 100644 index a691d83894..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollleft_disabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollleft_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollleft_enabled_dark.png deleted file mode 100644 index e5cd7a96a9..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollleft_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollright_disabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollright_disabled_dark.png deleted file mode 100644 index 1f060fbfbe..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollright_disabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollright_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollright_enabled_dark.png deleted file mode 100644 index 34f706ee17..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/netbeans/swing/tabcontrol/resources/win8_scrollright_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/arrow_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/arrow_dark.png deleted file mode 100644 index 4ce4b947d6..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/arrow_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_enabled_dark.png deleted file mode 100644 index c39cde6edc..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_pressed_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_pressed_dark.png deleted file mode 100644 index 816404d5be..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_pressed_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_rollover_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_rollover_dark.png deleted file mode 100644 index 99faa0dd1c..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/mac_close_rollover_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_enabled_dark.png deleted file mode 100644 index ec463bdb6c..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_pressed_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_pressed_dark.png deleted file mode 100644 index a8da81cd80..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_pressed_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_rollover_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_rollover_dark.png deleted file mode 100644 index 10975c5bee..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_bigclose_rollover_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_enabled_dark.png deleted file mode 100644 index b1579be8d1..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_pressed_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_pressed_dark.png deleted file mode 100644 index a3114facb1..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_pressed_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_rollover_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_rollover_dark.png deleted file mode 100644 index 6dca404168..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/metal_close_rollover_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/quicksearch/findMenu_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/quicksearch/findMenu_dark.png deleted file mode 100644 index c0ab95fca4..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/quicksearch/findMenu_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/toolbar_arrow_horizontal_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/toolbar_arrow_horizontal_dark.png deleted file mode 100644 index 5691131bd1..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/toolbar_arrow_horizontal_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/toolbar_arrow_vertical_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/toolbar_arrow_vertical_dark.png deleted file mode 100644 index e91981ad3b..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/toolbar_arrow_vertical_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/win8_bigclose_enabled_dark.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/win8_bigclose_enabled_dark.png deleted file mode 100644 index 0751de5307..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/win8_bigclose_enabled_dark.png and /dev/null differ diff --git a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/win8_bigclose_enabled_dark_old.png b/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/win8_bigclose_enabled_dark_old.png deleted file mode 100644 index 6e954ee0d3..0000000000 Binary files a/modules/DarculaLAF/src/main/resources/org/openide/awt/resources/win8_bigclose_enabled_dark_old.png and /dev/null differ diff --git a/modules/DataBrowser/pom.xml b/modules/DataBrowser/pom.xml index 608a0adde0..54758cd740 100644 --- a/modules/DataBrowser/pom.xml +++ b/modules/DataBrowser/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. DataBrowser org.janelia.workstation browser - 9.21 + 10.0 nbm @@ -41,10 +41,10 @@ core - + org.janelia.workstation - jogl213lib + jogl260lib @@ -161,7 +161,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/FreehandRoi.java b/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/FreehandRoi.java index 06498cc17a..21aa5e4bf4 100644 --- a/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/FreehandRoi.java +++ b/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/FreehandRoi.java @@ -7,10 +7,7 @@ public class FreehandRoi extends PolygonRoi { public FreehandRoi(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); -// if (Toolbar.getToolId()==Toolbar.FREEROI) - type = FREEROI; -// else -// type = FREELINE; + type = FREEROI; if (nPoints==2) nPoints--; } @@ -29,8 +26,6 @@ protected void grow(int sx, int sy) { xp[nPoints] = ox-x; yp[nPoints] = oy-y; nPoints++; -// if (IJ.altKeyDown()) -// wipeBack(); if (nPoints==xp.length) enlargeArrays(); drawLine(); @@ -76,12 +71,6 @@ void drawLine() { int margin = 4; if (lineWidth>margin && isLine()) margin = lineWidth; -// if (ic!=null) { -// double mag = ic.getMagnification(); -// if (mag<1.0) margin = (int)(margin/mag); -// } -// if (IJ.altKeyDown()) -// margin += 20; // for wipeBack imp.draw(xmin-margin, ymin-margin, (xmax-xmin)+margin*2, (ymax-ymin)+margin*2); } diff --git a/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/Roi.java b/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/Roi.java index f52da25f00..2ecb35810f 100644 --- a/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/Roi.java +++ b/modules/DataBrowser/src/main/java/org/janelia/workstation/browser/gui/lasso/Roi.java @@ -41,9 +41,7 @@ public class Roi extends Object implements Cloneable, java.io.Serializable, Iter public static Roi previousRoi; public static final BasicStroke onePixelWide = new BasicStroke(1); -// protected static Color ROIColor = Prefs.getColor(Prefs.ROICOLOR,Color.yellow); protected static Color ROIColor = Color.yellow; -// protected static int pasteMode = Blitter.COPY; protected static int lineWidth = 1; protected static Color defaultFillColor; private static Vector listeners = new Vector(); @@ -78,7 +76,6 @@ public class Roi extends Object implements Cloneable, java.io.Serializable, Iter private int position; private int channel, slice, frame; private boolean hyperstackPosition; -// private Overlay prototypeOverlay; private boolean subPixel; private boolean activeOverlayRoi; private Properties props; @@ -87,17 +84,11 @@ public class Roi extends Object implements Cloneable, java.io.Serializable, Iter private double ycenter; private boolean listenersNotified; - /** Creates a rectangular ROI. */ public Roi(int x, int y, int width, int height) { this(x, y, width, height, 0); } -// /** Creates a rectangular ROI using double arguments. */ -// public Roi(double x, double y, double width, double height) { -// this(x, y, width, height, 0); -// } - /** Creates a new rounded rectangular ROI. */ public Roi(int x, int y, int width, int height, int cornerDiameter) { setImage(null); @@ -120,25 +111,8 @@ public Roi(int x, int y, int width, int height, int cornerDiameter) { clipHeight = height; state = NORMAL; type = RECTANGLE; -// if (ic!=null) { -// Graphics g = ic.getGraphics(); -// draw(g); -// g.dispose(); -// } fillColor = defaultFillColor; } - -// /** Creates a rounded rectangular ROI using double arguments. */ -// public Roi(double x, double y, double width, double height, int cornerDiameter) { -// this((int)x, (int)y, (int)Math.ceil(width), (int)Math.ceil(height), cornerDiameter); -// bounds = new Rectangle2D.Double(x, y, width, height); -// subPixel = true; -// } -// -// /** Creates a new rectangular Roi. */ -// public Roi(Rectangle r) { -// this(r.x, r.y, r.width, r.height); -// } /** Starts the process of creating a user-defined rectangular Roi, where sx and sy are the starting screen coordinates. */ @@ -161,23 +135,9 @@ public Roi(int sx, int sy, ImagePlus imp, int cornerDiameter) { height = 0; state = CONSTRUCTING; type = RECTANGLE; -// if (cornerDiameter>0) { -// double swidth = RectToolOptions.getDefaultStrokeWidth(); -// if (swidth>0.0) -// setStrokeWidth(swidth); -// Color scolor = RectToolOptions.getDefaultStrokeColor(); -// if (scolor!=null) -// setStrokeColor(scolor); -// } fillColor = defaultFillColor; } -// /** @deprecated */ -// public Roi(int x, int y, int width, int height, ImagePlus imp) { -// this(x, y, width, height); -// setImage(imp); -// } - /** Set the location of the ROI in image coordinates. */ public void setLocation(int x, int y) { this.x = x; @@ -189,20 +149,7 @@ public void setLocation(int x, int y) { bounds.y = y; } } - - /** Set the location of the ROI in image coordinates. */ -// public void setLocation(double x, double y) { -// setLocation((int)x, (int)y); -// if ((int)x==x && (int)y==y) -// return; -// if (bounds!=null) { -// bounds.x = x; -// bounds.y = y; -// } else -// bounds = new Rectangle2D.Double(x, y, width, height); -// subPixel = true; -// } - + public void setImage(ImagePlus imp) { this.imp = imp; cachedMask = null; @@ -238,411 +185,13 @@ public int getState() { /** Returns the perimeter length. */ public double getLength() { double pw=1.0, ph=1.0; -// if (imp!=null) { -// Calibration cal = imp.getCalibration(); -// pw = cal.pixelWidth; -// ph = cal.pixelHeight; -// } return 2.0*width*pw+2.0*height*ph; } - -// /** Returns Feret's diameter, the greatest distance between -// any two points along the ROI boundary. */ -// public double getFeretsDiameter() { -// double[] a = getFeretValues(); -// return a!=null?a[0]:0.0; -// } - -// /** Caculates "Feret" (maximum caliper width), "FeretAngle" -// and "MinFeret" (minimum caliper width), "FeretX" and "FeretY". */ -// public double[] getFeretValues() { -// double min=Double.MAX_VALUE, diameter=0.0, angle=0.0, feretX=0.0, feretY=0.0; -// int p1=0, p2=0; -// double pw=1.0, ph=1.0; -// if (imp!=null) { -// Calibration cal = imp.getCalibration(); -// pw = cal.pixelWidth; -// ph = cal.pixelHeight; -// } -// Polygon poly = getConvexHull(); -// if (poly==null) { -// poly = getPolygon(); -// if (poly==null) return null; -// } -// double w2=pw*pw, h2=ph*ph; -// double dx, dy, d; -// for (int i=0; idiameter) {diameter=d; p1=i; p2=j;} -// } -// } -// Rectangle r = getBounds(); -// double cx = r.x + r.width/2.0; -// double cy = r.y + r.height/2.0; -// int n = poly.npoints; -// double[] x = new double[n]; -// double[] y = new double[n]; -// for (int i=0; ixmax) xmax = xr; -// if (yrymax) ymax = yr; -// } -// double width = xmax - xmin; -// double height = ymax - ymin; -// double min2 = Math.min(width, height); -// min = Math.min(min, min2); -// } -// double x1=poly.xpoints[p1], y1=poly.ypoints[p1]; -// double x2=poly.xpoints[p2], y2=poly.ypoints[p2]; -// if (x1>x2) { -// double tx1=x1, ty1=y1; -// x1=x2; y1=y2; x2=tx1; y2=ty1; -// } -// feretX = x1*pw; -// feretY = y1*ph; -// dx=x2-x1; dy=y1-y2; -// angle = (180.0/Math.PI)*Math.atan2(dy*ph, dx*pw); -// if (angle<0.0) -// angle += 180.0; -// //breadth = getFeretBreadth(poly, angle, x1, y1, x2, y2); -// double[] a = new double[5]; -// a[0] = diameter; -// a[1] = angle; -// a[2] = min; -// a[3] = feretX; -// a[4] = feretY; -// return a; -// } -// -// public Polygon getConvexHull() { -// return getPolygon(); -// } -// -// double getFeretBreadth(Shape shape, double angle, double x1, double y1, double x2, double y2) { -// double cx = x1 + (x2-x1)/2; -// double cy = y1 + (y2-y1)/2; -// AffineTransform at = new AffineTransform(); -// at.rotate(angle*Math.PI/180.0, cx, cy); -// Shape s = at.createTransformedShape(shape); -// Rectangle2D r = s.getBounds2D(); -// return Math.min(r.getWidth(), r.getHeight()); -// /* -// ShapeRoi roi2 = new ShapeRoi(s); -// Roi[] rois = roi2.getRois(); -// if (rois!=null && rois.length>0) { -// Polygon p = rois[0].getPolygon(); -// ImageProcessor ip = imp.getProcessor(); -// for (int i=0; i0) { -// ImageProcessor ip = getMask(); -// Roi roi2 = (new ThresholdToSelection()).convert(ip); -// if (roi2!=null) { -// roi2.setLocation(x, y); -// return roi2.getFloatPolygon(); -// } -// } -// if (subPixelResolution() && bounds!=null) { -// float[] xpoints = new float[4]; -// float[] ypoints = new float[4]; -// xpoints[0] = (float)bounds.x; -// ypoints[0] = (float)bounds.y; -// xpoints[1] = (float)(bounds.x+bounds.width); -// ypoints[1] = (float)bounds.y; -// xpoints[2] = (float)(bounds.x+bounds.width); -// ypoints[2] = (float)(bounds.y+bounds.height); -// xpoints[3] = (float)bounds.x; -// ypoints[3] = (float)(bounds.y+bounds.height); -// return new FloatPolygon(xpoints, ypoints); -// } else { -// Polygon p = getPolygon(); -// return new FloatPolygon(toFloat(p.xpoints), toFloat(p.ypoints), p.npoints); -// } -// } - -// /** Returns, as a FloatPolygon, an interpolated version -// * of this selection that has points spaced 1.0 pixel apart. -// */ -// public FloatPolygon getInterpolatedPolygon() { -// return getInterpolatedPolygon(1.0, false); -// } -// -// /** Returns, as a FloatPolygon, an interpolated version of -// * this selection with points spaced 'interval' pixels apart. -// * If 'smooth' is true, traced and freehand selections are -// * first smoothed using a 3 point running average. -// */ -// public FloatPolygon getInterpolatedPolygon(double interval, boolean smooth) { -// FloatPolygon p = (this instanceof Line)?((Line)this).getFloatPoints():getFloatPolygon(); -// return getInterpolatedPolygon(p, interval, smooth); -// } -// -// /** -// * Returns, as a FloatPolygon, an interpolated version of this selection -// * with points spaced abs('interval') pixels apart. If 'smooth' is true, traced -// * and freehand selections are first smoothed using a 3 point running -// * average. -// * If 'interval' is negative, the program is allowed to decrease abs('interval') -// * so that the last segment will hit the end point -// */ -// protected FloatPolygon getInterpolatedPolygon(FloatPolygon p, double interval, boolean smooth) { -// boolean allowToAdjust = interval < 0; -// interval = Math.abs(interval); -// boolean isLine = this.isLine(); -// double length = p.getLength(isLine); -// -// int npoints = p.npoints; -// if (!isLine) {//**append (and later remove) closing point to end of array -// npoints++; -// p.xpoints = java.util.Arrays.copyOf(p.xpoints, npoints); -// p.xpoints[npoints - 1] = p.xpoints[0]; -// p.ypoints = java.util.Arrays.copyOf(p.ypoints, npoints); -// p.ypoints[npoints - 1] = p.ypoints[0]; -// } -// int npoints2 = (int) (10 + (length * 1.5) / interval);//allow some headroom -// -// double tryInterval = interval; -// double minDiff = 1e9; -// double bestInterval = 0; -// int srcPtr = 0;//index of source polygon -// int destPtr = 0;//index of destination polygon -// double[] destXArr = new double[npoints2]; -// double[] destYArr = new double[npoints2]; -// int nTrials = 50; -// int trial = 0; -// while (trial <= nTrials) { -// destXArr[0] = p.xpoints[0]; -// destYArr[0] = p.ypoints[0]; -// srcPtr = 0; -// destPtr = 0; -// double xA = p.xpoints[0];//start of current segment -// double yA = p.ypoints[0]; -// -// while (srcPtr < npoints - 1) {//collect vertices -// double xC = destXArr[destPtr];//center circle -// double yC = destYArr[destPtr]; -// double xB = p.xpoints[srcPtr + 1];//end of current segment -// double yB = p.ypoints[srcPtr + 1]; -// double[] intersections = lineCircleIntersection(xA, yA, xB, yB, xC, yC, tryInterval, true); -// if (intersections.length >= 2) { -// xA = intersections[0];//only use first of two intersections -// yA = intersections[1]; -// destPtr++; -// destXArr[destPtr] = xA; -// destYArr[destPtr] = yA; -// } else { -// srcPtr++;//no intersection found, pick next segment -// xA = p.xpoints[srcPtr]; -// yA = p.ypoints[srcPtr]; -// } -// } -// destPtr++; -// destXArr[destPtr] = p.xpoints[npoints - 1]; -// destYArr[destPtr] = p.ypoints[npoints - 1]; -// destPtr++; -// if (!allowToAdjust) { -// if (isLine) -// destPtr--; -// break; -// } -// -// int nSegments = destPtr - 1; -// double dx = destXArr[destPtr - 2] - destXArr[destPtr - 1]; -// double dy = destYArr[destPtr - 2] - destYArr[destPtr - 1]; -// double lastSeg = Math.sqrt(dx * dx + dy * dy); -// -// double diff = lastSeg - tryInterval;//always <= 0 -// if (Math.abs(diff) < minDiff) { -// minDiff = Math.abs(diff); -// bestInterval = tryInterval; -// } -// double feedBackFactor = 0.66;//factor <1: applying soft successive approximation -// tryInterval = tryInterval + feedBackFactor * diff / nSegments; -// //stop if tryInterval < 80% of interval, OR if last segment differs < 0.05 pixels -// if ((tryInterval < 0.8 * interval || Math.abs(diff) < 0.05 || trial == nTrials - 1) && trial < nTrials) { -// trial = nTrials;//run one more loop with bestInterval to get best polygon -// tryInterval = bestInterval; -// } else -// trial++; -// } -// if (!isLine) //**remove closing point from end of array -// destPtr--; -// float[] xPoints = new float[destPtr]; -// float[] yPoints = new float[destPtr]; -// for (int jj = 0; jj < destPtr; jj++) { -// xPoints[jj] = (float) destXArr[jj]; -// yPoints[jj] = (float) destYArr[jj]; -// } -// FloatPolygon fPoly = new FloatPolygon(xPoints, yPoints); -// return fPoly; -// } -// -// /** Returns the coordinates of the pixels inside this ROI as an array of Points. -// * @see #getContainedFloatPoints() -// * @see #iterator() -// */ -// public Point[] getContainedPoints() { -// if (isLine()) { -// FloatPolygon p = getInterpolatedPolygon(); -// Point[] points = new Point[p.npoints]; -// for (int i=0; i -// * Calculates intersections of a line segment with a circle -// * Author N.Vischer -// * ax, ay, bx, by: points A and B of line segment -// * cx, cy, rad: Circle center and radius. -// * ignoreOutside: if true, ignores intersections outside the line segment A-B -// * Returns an array of 0, 2 or 4 coordinates (for 0, 1, or 2 intersection -// * points). If two intersection points are returned, they are listed in travel -// * direction A->B -// *
-// */ -// public static double[] lineCircleIntersection(double ax, double ay, double bx, double by, double cx, double cy, double rad, boolean ignoreOutside) { -// //rotates & translates points A, B and C, creating new points A2, B2 and C2. -// //A2 is then on origin, and B2 is on positive x-axis -// -// double dxAC = cx - ax; -// double dyAC = cy - ay; -// double lenAC = Math.sqrt(dxAC * dxAC + dyAC * dyAC); -// -// double dxAB = bx - ax; -// double dyAB = by - ay; -// -// //calculate B2 and C2: -// double xB2 = Math.sqrt(dxAB * dxAB + dyAB * dyAB); -// -// double phi1 = Math.atan2(dyAB, dxAB);//amount of rotation -// double phi2 = Math.atan2(dyAC, dxAC); -// double phi3 = phi1 - phi2; -// double xC2 = lenAC * Math.cos(phi3); -// double yC2 = lenAC * Math.sin(phi3);//rotation & translation is done -// if (Math.abs(yC2) > rad) -// return new double[0];//no intersection found -// double halfChord = Math.sqrt(rad * rad - yC2 * yC2); -// double sectOne = xC2 - halfChord;//first intersection point, still on x axis -// double sectTwo = xC2 + halfChord;//second intersection point, still on x axis -// double[] xyCoords = new double[4]; -// int ptr = 0; -// if ((sectOne >= 0 && sectOne <= xB2) || !ignoreOutside) { -// double sectOneX = Math.cos(phi1) * sectOne + ax;//undo rotation and translation -// double sectOneY = Math.sin(phi1) * sectOne + ay; -// xyCoords[ptr++] = sectOneX; -// xyCoords[ptr++] = sectOneY; -// } -// if ((sectTwo >= 0 && sectTwo <= xB2) || !ignoreOutside) { -// double sectTwoX = Math.cos(phi1) * sectTwo + ax;//undo rotation and translation -// double sectTwoY = Math.sin(phi1) * sectTwo + ay; -// xyCoords[ptr++] = sectTwoX; -// xyCoords[ptr++] = sectTwoY; -// } -// if (halfChord == 0 && ptr > 2) //tangent line returns only one intersection -// ptr = 2; -// xyCoords = java.util.Arrays.copyOf(xyCoords,ptr); -// return xyCoords; -// } /** Returns a copy of this roi. See Thinking is Java by Bruce Eckel (www.eckelobjects.com) for a good description of object cloning. */ @@ -659,7 +208,7 @@ public synchronized Object clone() { } catch (CloneNotSupportedException e) {return null;} } - + protected void grow(int sx, int sy) { if (clipboard!=null) return; int xNew = ic.offScreenX(sx); @@ -729,203 +278,6 @@ private void growConstrained(int xNew, int yNew) { oldHeight = height; } -// protected void moveHandle(int sx, int sy) { -// double asp; -// if (clipboard!=null) return; -// int ox = ic.offScreenX(sx); -// int oy = ic.offScreenY(sy); -// if (ox<0) ox=0; if (oy<0) oy=0; -// if (ox>xMax) ox=xMax; if (oy>yMax) oy=yMax; -// int x1=x, y1=y, x2=x1+width, y2=y+height, xc=x+width/2, yc=y+height/2; -// if (width > 7 && height > 7) { -// asp = (double)width/(double)height; -// asp_bk = asp; -// } else -// asp = asp_bk; -// -// switch (activeHandle) { -// case 0: -// x=ox; y=oy; -// break; -// case 1: -// y=oy; -// break; -// case 2: -// x2=ox; y=oy; -// break; -// case 3: -// x2=ox; -// break; -// case 4: -// x2=ox; y2=oy; -// break; -// case 5: -// y2=oy; -// break; -// case 6: -// x=ox; y2=oy; -// break; -// case 7: -// x=ox; -// break; -// } -// if (x=x2) { -// width=1; -// x=x2=xc; -// } -// if (y>=y2) { -// height=1; -// y=y2=yc; -// } -// bounds = null; -// } -// -// if (constrain) { -// if (activeHandle==1 || activeHandle==5) -// width=height; -// else -// height=width; -// -// if(x>=x2) { -// width=1; -// x=x2=xc; -// } -// if (y>=y2) { -// height=1; -// y=y2=yc; -// } -// switch (activeHandle) { -// case 0: -// x=x2-width; -// y=y2-height; -// break; -// case 1: -// x=xc-width/2; -// y=y2-height; -// break; -// case 2: -// y=y2-height; -// break; -// case 3: -// y=yc-height/2; -// break; -// case 5: -// x=xc-width/2; -// break; -// case 6: -// x=x2-width; -// break; -// case 7: -// y=yc-height/2; -// x=x2-width; -// break; -// } -// if (center) { -// x=xc-width/2; -// y=yc-height/2; -// } -// } -// -// if (aspect && !constrain) { -// if (activeHandle==1 || activeHandle==5) width=(int)Math.rint((double)height*asp); -// else height=(int)Math.rint((double)width/asp); -// -// switch (activeHandle){ -// case 0: -// x=x2-width; -// y=y2-height; -// break; -// case 1: -// x=xc-width/2; -// y=y2-height; -// break; -// case 2: -// y=y2-height; -// break; -// case 3: -// y=yc-height/2; -// break; -// case 5: -// x=xc-width/2; -// break; -// case 6: -// x=x2-width; -// break; -// case 7: -// y=yc-height/2; -// x=x2-width; -// break; -// } -// if (center) { -// x=xc-width/2; -// y=yc-height/2; -// } -// -// // Attempt to preserve aspect ratio when roi very small: -// if (width<8) { -// if(width<1) width = 1; -// height=(int)Math.rint((double)width/asp_bk); -// } -// if (height<8) { -// if(height<1) height =1; -// width=(int)Math.rint((double)height*asp_bk); -// } -// } -// -// updateClipRect(); -// imp.draw(clipX, clipY, clipWidth, clipHeight); -// oldX=x; oldY=y; -// oldWidth=width; oldHeight=height; -// bounds = null; -// subPixel = false; -// } - void move(int sx, int sy) { int xNew = ic.offScreenX(sx); int yNew = ic.offScreenY(sy); @@ -939,103 +291,20 @@ void move(int sx, int sy) { bounds.x += dx; bounds.y += dy; } -// boolean isImageRoi = this instanceof ImageRoi; -// if (clipboard==null && type==RECTANGLE && !isImageRoi) { -// if (x<0) x=0; if (y<0) y=0; -// if ((x+width)>xMax) x = xMax-width; -// if ((y+height)>yMax) y = yMax-height; -// } startX = xNew; startY = yNew; -// if (type==POINT || ((this instanceof TextRoi) && ((TextRoi)this).getAngle()!=0.0)) -// ignoreClipRect = true; updateClipRect(); -// if ((lineWidth>1 && isLine()) || ignoreClipRect || ((this instanceof PolygonRoi)&&((PolygonRoi)this).isSplineFit())) -// imp.draw(); -// else - imp.draw(clipX, clipY, clipWidth, clipHeight); + imp.draw(clipX, clipY, clipWidth, clipHeight); oldX = x; oldY = y; oldWidth = width; oldHeight=height; -// if (isImageRoi) showStatus(); if (bounds!=null) { bounds.x = x; bounds.y = y; } } -// /** Nudge ROI one pixel on arrow key press. */ -// public void nudge(int key) { -// if (WindowManager.getActiveWindow() instanceof ij.plugin.frame.RoiManager) -// return; -// switch(key) { -// case KeyEvent.VK_UP: -// y--; -// if (y<0 && (type!=RECTANGLE||clipboard==null)) -// y = 0; -// break; -// case KeyEvent.VK_DOWN: -// y++; -// if ((y+height)>=yMax && (type!=RECTANGLE||clipboard==null)) -// y = yMax-height; -// break; -// case KeyEvent.VK_LEFT: -// x--; -// if (x<0 && (type!=RECTANGLE||clipboard==null)) -// x = 0; -// break; -// case KeyEvent.VK_RIGHT: -// x++; -// if ((x+width)>=xMax && (type!=RECTANGLE||clipboard==null)) -// x = xMax-width; -// break; -// } -// updateClipRect(); -// if (type==POINT) -// imp.draw(); -// else -// imp.draw(clipX, clipY, clipWidth, clipHeight); -// oldX = x; oldY = y; -// bounds = null; -// showStatus(); -// notifyListeners(RoiListener.MOVED); -// } -// -// /** Nudge lower right corner of rectangular and oval ROIs by -// one pixel based on arrow key press. */ -// public void nudgeCorner(int key) { -// if (type>OVAL || clipboard!=null) -// return; -// switch(key) { -// case KeyEvent.VK_UP: -// height--; -// if (height<1) height = 1; -// notifyListeners(RoiListener.MODIFIED); -// break; -// case KeyEvent.VK_DOWN: -// height++; -// if ((y+height) > yMax) height = yMax-y; -// notifyListeners(RoiListener.MODIFIED); -// break; -// case KeyEvent.VK_LEFT: -// width--; -// if (width<1) width = 1; -// notifyListeners(RoiListener.MODIFIED); -// break; -// case KeyEvent.VK_RIGHT: -// width++; -// if ((x+width) > xMax) width = xMax-x; -// notifyListeners(RoiListener.MODIFIED); -// break; -// } -// updateClipRect(); -// imp.draw(clipX, clipY, clipWidth, clipHeight); -// oldX = x; oldY = y; -// cachedMask = null; -// showStatus(); -// } - // Finds the union of current and previous roi protected void updateClipRect() { clipX = (x<=oldX)?x:oldX; @@ -1043,11 +312,6 @@ protected void updateClipRect() { clipWidth = ((x+width>=oldX+oldWidth)?x+width:oldX+oldWidth) - clipX + 1; clipHeight = ((y+height>=oldY+oldHeight)?y+height:oldY+oldHeight) - clipY + 1; int m = 3; -// if (ic!=null) { -// double mag = ic.getMagnification(); -// if (mag<1.0) -// m = (int)(4.0/mag); -// } m += clipRectMargin(); m = (int)(m+getStrokeWidth()*2); clipX-=m; clipY-=m; @@ -1061,7 +325,6 @@ protected int clipRectMargin() { protected void handleMouseDrag(int sx, int sy, int flags) { if (ic==null) return; constrain = (flags&Event.SHIFT_MASK)!=0; -// center = (flags&Event.CTRL_MASK)!=0 || (IJ.isMacintosh()&&(flags&Event.META_MASK)!=0); center = (flags&Event.CTRL_MASK)!=0 || (SystemInfo.isMac&&(flags&Event.META_MASK)!=0); aspect = (flags&Event.ALT_MASK)!=0; switch(state) { @@ -1071,38 +334,20 @@ protected void handleMouseDrag(int sx, int sy, int flags) { case MOVING: move(sx, sy); break; -// case MOVING_HANDLE: -// moveHandle(sx, sy); -// break; default: break; } -// notifyListeners(state==MOVING?RoiListener.MOVED:RoiListener.MODIFIED); } -// int getHandleSize() { -// double mag = ic!=null?ic.getMagnification():1.0; -// double size = HANDLE_SIZE/mag; -// return (int)(size*mag); -// } - public void draw(Graphics g) { Color color = strokeColor!=null? strokeColor:ROIColor; if (fillColor!=null) color = fillColor; -// if (Interpreter.isBatchMode() && imp!=null && imp.getOverlay()!=null && strokeColor==null && fillColor==null) -// return; g.setColor(color); mag = getMagnification(); int sw = (int)(width*mag); int sh = (int)(height*mag); int sx1 = screenX(x); int sy1 = screenY(y); -// if (subPixelResolution() && bounds!=null) { -// sw = (int)(bounds.width*mag); -// sh = (int)(bounds.height*mag); -// sx1 = screenXD(bounds.x); -// sy1 = screenYD(bounds.y); -// } int sx2 = sx1+sw/2; int sy2 = sy1+sh/2; int sx3 = sx1+sw; @@ -1123,10 +368,7 @@ public void draw(Graphics g) { g.setColor(Color.cyan); g.drawRect(sx1, sy1, sw, sh); } else { -// if (!(this instanceof TextRoi)) -// g.fillRect(sx1, sy1, sw, sh); -// else - g.drawRect(sx1, sy1, sw, sh); + g.drawRect(sx1, sy1, sw, sh); } } else g.drawRect(sx1, sy1, sw, sh); @@ -1148,17 +390,9 @@ public void draw(Graphics g) { if (updateFullWindow) {updateFullWindow = false; imp.draw();} } - -// public void drawOverlay(Graphics g) { -// overlay = true; -// draw(g); -// overlay = false; -// } - + void drawPreviousRoi(Graphics g) { if (previousRoi!=null && previousRoi!=this && previousRoi.modState!=NO_MODS) { -// if (type!=POINT && previousRoi.getType()==POINT && previousRoi.modState!=SUBTRACT_FROM_ROI) -// return; previousRoi.setImage(imp); previousRoi.draw(g); } @@ -1187,50 +421,7 @@ void drawHandle(Graphics g, int x, int y) { g.fillRect(x+2,y+2,1,1); } } -// -// /** -// * @deprecated -// * replaced by drawPixels(ImageProcessor) -// */ -// public void drawPixels() { -// if (imp!=null) -// drawPixels(imp.getProcessor()); -// } -// -// /** Draws the selection outline on the specified ImageProcessor. -// @see ij.process.ImageProcessor#setColor -// @see ij.process.ImageProcessor#setLineWidth -// */ -// public void drawPixels(ImageProcessor ip) { -// endPaste(); -// int saveWidth = ip.getLineWidth(); -// if (getStrokeWidth()>1f) -// ip.setLineWidth((int)Math.round(getStrokeWidth())); -// if (cornerDiameter>0) -// drawRoundedRect(ip); -// else { -// if (ip.getLineWidth()==1) -// ip.drawRect(x, y, width+1, height+1); -// else -// ip.drawRect(x, y, width, height); -// } -// ip.setLineWidth(saveWidth); -// if (Line.getWidth()>1 || getStrokeWidth()>1) -// updateFullWindow = true; -// } -// -// private void drawRoundedRect(ImageProcessor ip) { -// int margin = (int)getStrokeWidth()/2; -// BufferedImage bi = new BufferedImage(width+margin*2+1, height+margin*2+1, BufferedImage.TYPE_BYTE_GRAY); -// Graphics2D g = bi.createGraphics(); -// if (stroke!=null) -// g.setStroke(stroke); -// g.drawRoundRect(margin, margin, width, height, cornerDiameter, cornerDiameter); -// ByteProcessor mask = new ByteProcessor(bi); -// ip.setRoi(x-margin, y-margin, width+margin*2+1, height+margin*2+1); -// ip.fill(mask); -// } - + public boolean contains(int x, int y) { Rectangle r = new Rectangle(this.x, this.y, width, height); boolean contains = r.contains(x, y); @@ -1243,32 +434,9 @@ public boolean contains(int x, int y) { /** Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1. */ public int isHandle(int sx, int sy) { -// if (clipboard!=null || ic==null) return -1; -// double mag = ic.getMagnification(); -// int margin = IJ.getScreenSize().width>1280?5:3; -// int size = HANDLE_SIZE+margin; -// int halfSize = size/2; -// double x = getXBase(); -// double y = getYBase(); -// double width = getFloatWidth(); -// double height = getFloatHeight(); -// int sx1 = ic.screenXD(x) - halfSize; -// int sy1 = ic.screenYD(y) - halfSize; -// int sx3 = ic.screenXD(x+width) - halfSize; -// int sy3 = ic.screenYD(y+height) - halfSize; -// int sx2 = sx1 + (sx3 - sx1)/2; -// int sy2 = sy1 + (sy3 - sy1)/2; -// if (sx>=sx1&&sx<=sx1+size&&sy>=sy1&&sy<=sy1+size) return 0; -// if (sx>=sx2&&sx<=sx2+size&&sy>=sy1&&sy<=sy1+size) return 1; -// if (sx>=sx3&&sx<=sx3+size&&sy>=sy1&&sy<=sy1+size) return 2; -// if (sx>=sx3&&sx<=sx3+size&&sy>=sy2&&sy<=sy2+size) return 3; -// if (sx>=sx3&&sx<=sx3+size&&sy>=sy3&&sy<=sy3+size) return 4; -// if (sx>=sx2&&sx<=sx2+size&&sy>=sy3&&sy<=sy3+size) return 5; -// if (sx>=sx1&&sx<=sx1+size&&sy>=sy3&&sy<=sy3+size) return 6; -// if (sx>=sx1&&sx<=sx1+size&&sy>=sy2&&sy<=sy2+size) return 7; return -1; } -// + protected void mouseDownInHandle(int handle, int sx, int sy) { state = MOVING_HANDLE; activeHandle = handle; @@ -1281,7 +449,6 @@ protected void handleMouseDown(int sx, int sy) { startY = ic.offScreenY(sy); startXD = ic.offScreenXD(sx); startYD = ic.offScreenYD(sy); - //showStatus(); } } @@ -1289,39 +456,12 @@ protected void handleMouseUp(int screenX, int screenY) { state = NORMAL; if (imp==null) return; imp.draw(clipX-5, clipY-5, clipWidth+10, clipHeight+10); -// if (Recorder.record) { -// String method; -// if (type==OVAL) -// Recorder.record("makeOval", x, y, width, height); -// else if (!(this instanceof TextRoi)) { -// if (cornerDiameter==0) -// Recorder.record("makeRectangle", x, y, width, height); -// else { -// if (Recorder.scriptMode()) -// Recorder.recordCall("imp.setRoi(new Roi("+x+","+y+","+width+","+height+","+cornerDiameter+"));"); -// else -// Recorder.record("makeRectangle", x, y, width, height, cornerDiameter); -// } -// } -// } -// if (Toolbar.getToolId()==Toolbar.OVAL&&Toolbar.getBrushSize()>0) { -// int flags = ic!=null?ic.getModifiers():16; -// if ((flags&16)==0) // erase ROI Brush -// {imp.draw(); return;} -// } modifyRoi(); } void modifyRoi() { if (previousRoi==null || previousRoi.modState==NO_MODS || imp==null) return; -// if (type==POINT || previousRoi.getType()==POINT) { -// if (type==POINT && previousRoi.getType()==POINT) { -// addPoint(); -// } else if (isArea() && previousRoi.getType()==POINT && previousRoi.modState==SUBTRACT_FROM_ROI) -// subtractPoints(); -// return; -// } Roi previous = (Roi)previousRoi.clone(); previous.modState = NO_MODS; ShapeRoi s1 = null; @@ -1352,117 +492,16 @@ void modifyRoi() { imp.setRoi(roi2); previousRoi = previous; } - -// void addPoint() { -// if (!(type==POINT && previousRoi.getType()==POINT)) { -// modState = NO_MODS; -// imp.draw(); -// return; -// } -// previousRoi.modState = NO_MODS; -// PointRoi p1 = (PointRoi)previousRoi; -// FloatPolygon poly = getFloatPolygon(); -// p1.addPoint(imp, poly.xpoints[0], poly.ypoints[0]); -// imp.setRoi(p1); -// } -// -// void subtractPoints() { -// previousRoi.modState = NO_MODS; -// PointRoi p1 = (PointRoi)previousRoi; -// PointRoi p2 = p1.subtractPoints(this); -// if (p2!=null) -// imp.setRoi(p1.subtractPoints(this)); -// else -// imp.deleteRoi(); -// } -// -// /** If 'add' is true, adds this selection to the previous one. If 'subtract' is true, subtracts -// it from the previous selection. Called by the IJ.doWand() method, and the makeRectangle(), -// makeOval(), makePolygon() and makeSelection() macro functions. */ -// public void update(boolean add, boolean subtract) { -// if (previousRoi==null) return; -// if (add) { -// previousRoi.modState = ADD_TO_ROI; -// modifyRoi(); -// } else if (subtract) { -// previousRoi.modState = SUBTRACT_FROM_ROI; -// modifyRoi(); -// } else -// previousRoi.modState = NO_MODS; -// } protected void showStatus() { -// if (imp==null) -// return; - String value; -// if (state!=CONSTRUCTING && (type==RECTANGLE||type==POINT) && width<=25 && height<=25) { -// ImageProcessor ip = imp.getProcessor(); -// double v = ip.getPixelValue(x,y); -// int digits = (imp.getType()==ImagePlus.GRAY8||imp.getType()==ImagePlus.GRAY16)?0:2; -// value = ", value="+IJ.d2s(v,digits); -// } else -// value = ""; -// Calibration cal = imp.getCalibration(); -// String size; -// if (cal.scaled() && !(IJ.altKeyDown()||(state==NORMAL&&IJ.shiftKeyDown()))) -// size = ", w="+IJ.d2s(width*cal.pixelWidth)+" ("+width+"), h="+IJ.d2s(height*cal.pixelHeight)+" ("+height+")"; -// else -// size = ", w="+width+", h="+height; -// IJ.showStatus(imp.getLocationAsString(x,y)+size+value); + // do nothing } /** Always returns null for rectangular Roi's */ public ImageProcessor getMask() { -// if (cornerDiameter>0) -// return (new ShapeRoi(new RoundRectangle2D.Float(x, y, width, height, cornerDiameter, cornerDiameter))).getMask(); -// else - return null; - } -// -// public void startPaste(ImagePlus clipboard) { -// IJ.showStatus("Pasting..."); -// IJ.wait(10); -// this.clipboard = clipboard; -// imp.getProcessor().snapshot(); -// updateClipRect(); -// imp.draw(clipX, clipY, clipWidth, clipHeight); -// } -// -// void updatePaste() { -// if (clipboard!=null) { -// imp.getMask(); -// ImageProcessor ip = imp.getProcessor(); -// ip.reset(); -// int xoffset=0, yoffset=0; -// Roi croi = clipboard.getRoi(); -// if (croi!=null) { -// Rectangle r = croi.getBounds(); -// if (r.x<0) xoffset=-r.x; -// if (r.y<0) yoffset=-r.y; -// } -// ip.copyBits(clipboard.getProcessor(), x+xoffset, y+yoffset, pasteMode); -// if (type!=RECTANGLE) -// ip.reset(ip.getMask()); -// if (ic!=null) -// ic.setImageUpdated(); -// } -// } -// -// public void endPaste() { -// if (clipboard!=null) { -// updatePaste(); -// clipboard = null; -// Undo.setup(Undo.FILTER, imp); -// } -// activeOverlayRoi = false; -// } -// -// public void abortPaste() { -// clipboard = null; -// imp.getProcessor().reset(); -// imp.updateAndDraw(); -// } -// + return null; + } + /** Returns the angle in degrees between the specified line and a horizontal line. */ public double getAngle(int x1, int y1, int x2, int y2) { return getFloatAngle(x1, y1, x2, y2); @@ -1472,11 +511,6 @@ public double getAngle(int x1, int y1, int x2, int y2) { public double getFloatAngle(double x1, double y1, double x2, double y2) { double dx = x2-x1; double dy = y1-y2; -// if (imp!=null && !IJ.altKeyDown()) { -// Calibration cal = imp.getCalibration(); -// dx *= cal.pixelWidth; -// dy *= cal.pixelHeight; -// } return (180.0/Math.PI)*Math.atan2(dy, dx); } @@ -1500,7 +534,6 @@ public static Color getColor() { * overrides the global color set by the static setColor() method. * @see #getStrokeColor * @see #setStrokeWidth - * @see ij.ImagePlus#setOverlay(ij.gui.Overlay) */ public void setStrokeColor(Color c) { strokeColor = c; @@ -1582,12 +615,10 @@ public void setNonScalable(boolean nonScalable) { * the width to 0.0 and the ROI will be drawn using a * a 1 pixel stroke width regardless of the magnification. * @see #setStrokeColor(Color) - * @see ij.ImagePlus#setOverlay(ij.gui.Overlay) */ public void setStrokeWidth(float width) { if (width<0f) width = 0f; - boolean notify = listeners.size()>0 && isLine() && getStrokeWidth()!=width; if (width==0) stroke = null; else if (wideLine) @@ -1596,8 +627,6 @@ else if (wideLine) this.stroke = new BasicStroke(width); if (width>1f) fillColor = null; -// if (notify) -// notifyListeners(RoiListener.MODIFIED); } /** This is a version of setStrokeWidth() that accepts a double argument. */ @@ -1621,15 +650,7 @@ public BasicStroke getStroke() { } protected BasicStroke getScaledStroke() { - if (ic==null) - return stroke; -// double mag = ic.getMagnification(); -// if (mag!=1.0) { -// float width = (float)(stroke.getLineWidth()*mag); -// //return new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL); -// return new BasicStroke(width, stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit(), stroke.getDashArray(), stroke.getDashPhase()); -// } else - return stroke; + return stroke; } /** Returns the name of this ROI, or null. */ @@ -1642,149 +663,6 @@ public void setName(String name) { this.name = name; } -// /** Sets the Paste transfer mode. -// @see ij.process.Blitter -// */ -// public static void setPasteMode(int transferMode) { -// if (transferMode==pasteMode) return; -// pasteMode = transferMode; -// ImagePlus imp = WindowManager.getCurrentImage(); -// if (imp!=null) -// imp.updateAndDraw(); -// } -// -// /** Sets the rounded rectangle corner diameter (pixels). */ -// public void setCornerDiameter(int cornerDiameter) { -// if (cornerDiameter<0) cornerDiameter = 0; -// this.cornerDiameter = cornerDiameter; -// ImagePlus imp = WindowManager.getCurrentImage(); -// if (imp!=null && this==imp.getRoi()) -// imp.updateAndDraw(); -// } -// -// /** Returns the rounded rectangle corner diameter (pixels). */ -// public int getCornerDiameter() { -// return cornerDiameter; -// } -// -// /** Obsolete; replaced by setCornerDiameter(). */ -// public void setRoundRectArcSize(int cornerDiameter) { -// setCornerDiameter(cornerDiameter); -// } -// -// /** Obsolete; replaced by getCornerDiameter(). */ -// public int getRoundRectArcSize() { -// return cornerDiameter; -// } -// -// /** Sets the stack position (image number) of this ROI. In an overlay, this -// * ROI is only displayed when the stack is at the specified position. -// * Set to zero to have the ROI displayed on all images in the stack. -// * @see ij.gui.Overlay -// */ -// public void setPosition(int n) { -// if (n<0) n=0; -// position = n; -// channel = slice = frame = 0; -// hyperstackPosition = false; -// } -// -// /** Returns the stack position (image number) of this ROI, or -// * zero if the ROI is not associated with a particular stack image. -// * @see ij.gui.Overlay -// */ -// public int getPosition() { -// return position; -// } -// -// /** Sets the hyperstack position of this ROI. In an overlay, this -// * ROI is only displayed when the hyperstack is at the specified position. -// * @see ij.gui.Overlay -// */ -// public void setPosition(int channel, int slice, int frame) { -// if (channel<0) channel=0; -// this.channel = channel; -// if (slice<0) slice=0; -// this.slice = slice; -// if (frame<0) frame=0; -// this.frame = frame; -// position = 0; -// hyperstackPosition = true; -// } -// -// /** Returns 'true' if setPosition(C,Z,T) has been called. */ -// public boolean hasHyperStackPosition() { -// return hyperstackPosition; -// } -// -// /** Sets the position of this ROI based on the stack position of the specified image. */ -// public void setPosition(ImagePlus imp ) { -// if (imp==null) -// return; -// if (imp.isHyperStack()) { -// int channel = imp.getDisplayMode()==IJ.COMPOSITE?0:imp.getChannel(); -// setPosition(channel, imp.getSlice(), imp.getFrame()); -// } else if (imp.getStackSize()>1) -// setPosition(imp.getCurrentSlice()); -// else -// setPosition(0); -// } -// -// /** Returns the channel position of this ROI, or zero -// * if this ROI is not associated with a particular channel. -// */ -// public final int getCPosition() { -// return channel; -// } -// -// /** Returns the slice position of this ROI, or zero -// * if this ROI is not associated with a particular slice. -// */ -// public final int getZPosition() { -// return slice==0&&!hyperstackPosition?position:slice; -// } -// -// /** Returns the frame position of this ROI, or zero -// * if this ROI is not associated with a particular frame. -// */ -// public final int getTPosition() { -// return frame; -// } -// -// // Used by the FileSaver and RoiEncoder to save overlay settings. */ -// public void setPrototypeOverlay(Overlay overlay) { -// prototypeOverlay = new Overlay(); -// prototypeOverlay.drawLabels(overlay.getDrawLabels()); -// prototypeOverlay.drawNames(overlay.getDrawNames()); -// prototypeOverlay.drawBackgrounds(overlay.getDrawBackgrounds()); -// prototypeOverlay.setLabelColor(overlay.getLabelColor()); -// prototypeOverlay.setLabelFont(overlay.getLabelFont()); -// } -// -// // Used by the FileOpener and RoiDecoder to restore overlay settings. */ -// public Overlay getPrototypeOverlay() { -// if (prototypeOverlay!=null) -// return prototypeOverlay; -// else -// return new Overlay(); -// } -// -// /** Returns the current paste transfer mode, or NOT_PASTING (-1) -// if no paste operation is in progress. -// @see ij.process.Blitter -// */ -// public int getPasteMode() { -// if (clipboard==null) -// return NOT_PASTING; -// else -// return pasteMode; -// } -// -// /** Returns the current paste transfer mode. */ -// public static int getCurrentPasteMode() { -// return pasteMode; -// } - /** Returns 'true' if this is an area selection. */ public boolean isArea() { return (type>=RECTANGLE && type<=TRACED_ROI) || type==COMPOSITE; @@ -1794,114 +672,26 @@ public boolean isArea() { public boolean isLine() { return type>=LINE && type<=FREELINE; } - -// /** Returns 'true' if this is an ROI primarily used from drawing -// (e.g., TextRoi or Arrow). */ -// public boolean isDrawingTool() { -// //return cornerDiameter>0; -// return false; -// } - + protected double getMagnification() { -// return ic!=null?ic.getMagnification():1.0; return 1.0; } -// -// /** Convenience method that converts Roi type to a human-readable form. */ -// public String getTypeAsString() { -// String s=""; -// switch(type) { -// case POLYGON: s="Polygon"; break; -// case FREEROI: s="Freehand"; break; -// case TRACED_ROI: s="Traced"; break; -// case POLYLINE: s="Polyline"; break; -// case FREELINE: s="Freeline"; break; -// case ANGLE: s="Angle"; break; -// case LINE: s="Straight Line"; break; -// case OVAL: s="Oval"; break; -// case COMPOSITE: s = "Composite"; break; -// case POINT: s="Point"; break; -// default: -// if (this instanceof TextRoi) -// s = "Text"; -// else if (this instanceof ImageRoi) -// s = "Image"; -// else -// s = "Rectangle"; -// break; -// } -// return s; -// } -// + /** Returns true if this ROI is currently displayed on an image. */ public boolean isVisible() { return ic!=null; } -// /** Returns true if this is a slection that supports sub-pixel resolution. */ -// public boolean subPixelResolution() { -// return subPixel; -// } -// -// /** Returns true if this is a PolygonRoi that supports sub-pixel -// resolution and polygons are drawn on zoomed images offset -// down and to the right by 0.5 pixels.. */ -// public boolean getDrawOffset() { -// return false; -// } -// -// public void setDrawOffset(boolean drawOffset) { -// } -// -// public void setIgnoreClipRect(boolean ignoreClipRect) { -// this.ignoreClipRect = ignoreClipRect; -// } - /** Returns 'true' if this ROI is displayed and is also in an overlay. */ public final boolean isActiveOverlayRoi() { -// if (imp==null || this!=imp.getRoi()) - return false; -// Overlay overlay = imp.getOverlay(); -// if (overlay!=null && overlay.contains(this)) -// return true; -// ImageCanvas ic = imp.getCanvas(); -// overlay = ic!=null?ic.getShowAllList():null; // ROI Manager overlay -// return overlay!=null && overlay.contains(this); + return false; } -// /** Checks whether two rectangles are equal. */ -// public boolean equals(Object obj) { -// if (obj instanceof Roi) { -// Roi roi2 = (Roi)obj; -// if (type!=roi2.getType()) return false; -// if (!getBounds().equals(roi2.getBounds())) return false; -// if (getLength()!=roi2.getLength()) return false; -// return true; -// } else -// return false; -// } -// protected int screenX(int ox) {return ic!=null?ic.screenX(ox):ox;} protected int screenY(int oy) {return ic!=null?ic.screenY(oy):oy;} protected int screenXD(double ox) {return ic!=null?ic.screenXD(ox):(int)ox;} protected int screenYD(double oy) {return ic!=null?ic.screenYD(oy):(int)oy;} -// -// /** Converts a float array to an int array using truncation. */ -// public static int[] toInt(float[] arr) { -// return toInt(arr, null, arr.length); -// } -// -// public static int[] toInt(float[] arr, int[] arr2, int size) { -// int n = arr.length; -// if (size>n) size=n; -// int[] temp = arr2; -// if (temp==null || temp.length -// * Author: Peter Haub (phaub at dipsystems.de) -// */ -// public double[] getContourCentroid() { -// double xC=0, yC=0, lSum=0, x, y, dx, dy, l; -// FloatPolygon poly = getFloatPolygon(); -// int nPoints = poly.npoints; -// int n2 = nPoints-1; -// for (int n1=0; n1 * Author: Wilhelm Burger - * @see #getContainedPoints() - * @see #getContainedFloatPoints() */ public Iterator iterator() { // Returns the default (mask-based) point iterator. Note that 'Line' overrides the // iterator() method and returns a specific point iterator. return new RoiPointsIteratorMask(); } - /** * Default iterator over points contained in a mask-backed {@link Roi}. @@ -2177,18 +771,10 @@ private class RoiPointsIteratorMask implements Iterator { private int next; RoiPointsIteratorMask() { -// if (isLine()) { -// Roi roi2 = Selection.lineToArea(Roi.this); -// mask = roi2.getMask(); -// bounds = roi2.getBounds(); -// xbase = roi2.x; -// ybase = roi2.y; -// } else { mask = getMask(); bounds = getBounds(); xbase = Roi.this.x; ybase = Roi.this.y; -// } n = bounds.width * bounds.height; findNext(0); // sets next } @@ -2216,17 +802,6 @@ public void remove() { // finds the next element (from start), sets next private void findNext(int start) { throw new UnsupportedOperationException(); -// if (mask == null) -// next = start; -// else { -// next = n; -// for (int i=start; i=15.0) { - roi = new PolygonRoi(xPoints, yPoints, n, POLYGON); - } - } - break; + int n = xPoints.length; + roi = new PolygonRoi(xPoints, yPoints, n, roiType); + if (roiType==FREEROI) { + double length = roi.getLength(); + if (length/n>=15.0) { + roi = new PolygonRoi(xPoints, yPoints, n, POLYGON); + } } - //if(roi!=null && imp!=null) roi.setImage(imp); return roi; } @@ -598,175 +568,6 @@ public boolean contains(int x, int y) { return shape.contains(x-this.x, y-this.y); } -// /** Caculates "Feret" (maximum caliper width) and "MinFeret" (minimum caliper width). */ -// public double[] getFeretValues() { -// Roi[] rois = getRois(); -// if (rois!=null && rois.length==1) { -// rois[0].setImage(imp); -// return rois[0].getFeretValues(); -// } -// double min=Double.MAX_VALUE, diameter=0.0, angle=0.0; -// int p1=0, p2=0; -// double pw=1.0, ph=1.0; -// if (imp!=null) { -// Calibration cal = imp.getCalibration(); -// pw = cal.pixelWidth; -// ph = cal.pixelHeight; -// } -// Shape shape = getShape(); -// Shape s = null; -// Rectangle2D r = shape.getBounds2D(); -// double cx = r.getX() + r.getWidth()/2; -// double cy = r.getY() + r.getHeight()/2; -// AffineTransform at = new AffineTransform(); -// at.translate(cx, cy); -// for (int i=0; i<181; i++) { -// at.rotate(Math.PI/180.0); -// s = at.createTransformedShape(shape); -// r = s.getBounds2D(); -// double max2 = Math.max(r.getWidth(), r.getHeight()); -// if (max2>diameter) { -// diameter = max2*pw; -// //angle = i; -// } -// double min2 = Math.min(r.getWidth(), r.getHeight()); -// min = Math.min(min, min2); -// } -// if (pw!=ph) { -// diameter = 0.0; -// angle = 0.0; -// } -// if (pw==ph) -// min *= pw; -// else { -// min = 0.0; -// angle = 0.0; -// } -// double[] a = new double[5]; -// a[0] = diameter; -// a[1] = angle; -// a[2] = min; -// a[3] = 0.0; // FeretX -// a[4] = 0.0; // FeretY -// return a; -// } - -// /**Returns the perimeter if this ShapeRoi can be decomposed -// into simple ROIs, otherwise returns zero. */ -// public double getLength() { -// if (width==0 && height==0) -// return 0.0; -// double length = 0.0; -// Roi[] rois = getRois(); -// ImagePlus imp2 = getImage(); -// if (rois!=null) { -// for (int i=0; i -// * "Jens Gravesen. Adaptive subdivision and the length and energy of Bézier curves. Computational Geometry 8:13-31 (1997)" -// * implemented using java.awt.geom.CubicCurve2D.Double. -// * Please visit {@link Graphics Gems IV} for -// * examples of other possible implementations in C and C++. -// */ -// double cBezLength(CubicCurve2D.Double c) { -// double l = 0.0; -// double cl = cclength(c); -// double pl = cplength(c); -// if((pl-cl)/2.0 > maxerror) -// { -// CubicCurve2D.Double[] cc = cBezSplit(c); -// for(int i=0; i<2; i++) l+=cBezLength(cc[i]); -// return l; -// } -// l = 0.5*pl+0.5*cl; -// return l; -// } -// -// /**Calculates the length of a quadratic Bézier curve specified in double precision. -// * The algorithm is based on the theory presented in paper
-// * "Jens Gravesen. Adaptive subdivision and the length and energy of Bézier curves. Computational Geometry 8:13-31 (1997)" -// * implemented using java.awt.geom.CubicCurve2D.Double. -// * Please visit {@link Graphics Gems IV} for -// * examples of other possible implementations in C and C++. -// */ -// double qBezLength(QuadCurve2D.Double c) { -// double l = 0.0; -// double cl = qclength(c); -// double pl = qplength(c); -// if((pl-cl)/2.0 > maxerror) -// { -// QuadCurve2D.Double[] cc = qBezSplit(c); -// for(int i=0; i<2; i++) l+=qBezLength(cc[i]); -// return l; -// } -// l = (2.0*pl+cl)/3.0; -// return l; -// } -// -// /**Splits a cubic Bézier curve in half. -// * @param c A cubic Bézier curve to be divided -// * @return an array with the left and right cubic Bézier subcurves -// * -// */ -// CubicCurve2D.Double[] cBezSplit(CubicCurve2D.Double c) { -// CubicCurve2D.Double[] cc = new CubicCurve2D.Double[2]; -// for (int i=0; i<2 ; i++) cc[i] = new CubicCurve2D.Double(); -// c.subdivide(cc[0],cc[1]); -// return cc; -// } -// -// /**Splits a quadratic Bézier curve in half. -// * @param c A quadratic Bézier curve to be divided -// * @return an array with the left and right quadratic Bézier subcurves -// * -// */ -// QuadCurve2D.Double[] qBezSplit(QuadCurve2D.Double c) { -// QuadCurve2D.Double[] cc = new QuadCurve2D.Double[2]; -// for(int i=0; i<2; i++) cc[i] = new QuadCurve2D.Double(); -// c.subdivide(cc[0],cc[1]); -// return cc; -// } - - // c is an array of even length with x0, y0, x1, y1, ... ,xn, yn coordinate pairs /**Scales a coordinate array with the size calibration of a 2D image. * The array is modified in place. * @param c Array of coordinates in double precision with a fixed structure:
@@ -785,65 +586,6 @@ void scaleCoords(double[] c, double pw, double ph) { } } -// Vector parseSegments(PathIterator pI) { -// Vector v = new Vector(); -// if (parsePath(pI, null, v, null, null)) return v; -// return null; -// } -// -// /** Retrieves the end points and control points of the path as a float array. The array -// contains a sequence of variable length segments that use from from one to seven elements. -// The first element of a segment is the type as defined in the PathIterator interface. SEG_MOVETO -// and SEG_LINETO segments also include two coordinates, SEG_QUADTO segments include four -// coordinates and SEG_CUBICTO segments include six coordinates. */ -// public float[] getShapeAsArray() { -// if(shape==null) return null; -// //if (savedRois!=null) -// // return getSavedRoisAsArray(); -// PathIterator pIt = shape.getPathIterator(new AffineTransform()); -// Vector h = new Vector(); // handles -// Vector s = new Vector(); // segment types -// if (!(parsePath(pIt, null, s, null, h))) return null; -// float[] result = new float[7*s.size()]; -// Point2D.Double p; -// int segType; -// int k=0, j=0; -// int index = 0; -// for (int i=0; i0) { closed = ((int)ux0==(int)usX && (int)uy0==(int)usY); if (closed && (int)ux0!=(int)usX && (int)uy0!=(int)usY) { // this may only happen after a SEG_CLOSE - xCoords.add(new Integer(((Integer)xCoords.elementAt(0)).intValue())); - yCoords.add(new Integer(((Integer)yCoords.elementAt(0)).intValue())); + xCoords.add(Integer.valueOf(((Integer)xCoords.elementAt(0)).intValue())); + yCoords.add(Integer.valueOf(((Integer)yCoords.elementAt(0)).intValue())); } if (rois!=null) { roiType = guessType(count, linesOnly, curvesOnly, closed); @@ -933,8 +670,8 @@ boolean parsePath(PathIterator pIter, double[] params, Vector segments, Vector r x0 = coords[0]; y0 = coords[1]; handles.add(new Point2D.Double(ucoords[0],ucoords[1])); - xCoords.add(new Integer((int)ucoords[0])); - yCoords.add(new Integer((int)ucoords[1])); + xCoords.add(Integer.valueOf((int)ucoords[0])); + yCoords.add(Integer.valueOf((int)ucoords[1])); closed = false; break; case PathIterator.SEG_LINETO: @@ -946,41 +683,10 @@ boolean parsePath(PathIterator pIter, double[] params, Vector segments, Vector r x0 = coords[0]; y0 = coords[1]; handles.add(new Point2D.Double(ucoords[0],ucoords[1])); - xCoords.add(new Integer((int)ucoords[0])); - yCoords.add(new Integer((int)ucoords[1])); + xCoords.add(Integer.valueOf((int)ucoords[0])); + yCoords.add(Integer.valueOf((int)ucoords[1])); closed = ((int)ux0==(int)usX && (int)uy0==(int)usY); break; -// case PathIterator.SEG_QUADTO: -// linesOnly = linesOnly & false; -// curvesOnly = curvesOnly & true; -// curve = new QuadCurve2D.Double(x0,y0,coords[0],coords[2],coords[2],coords[3]); -// pathLength += qBezLength((QuadCurve2D.Double)curve); -// ux0 = ucoords[2]; -// uy0 = ucoords[3]; -// x0 = coords[2]; -// y0 = coords[3]; -// handles.add(new Point2D.Double(ucoords[0],ucoords[1])); -// handles.add(new Point2D.Double(ucoords[2],ucoords[3])); -// xCoords.add(new Integer((int)ucoords[2])); -// yCoords.add(new Integer((int)ucoords[3])); -// closed = ((int)ux0==(int)usX && (int)uy0==(int)usY); -// break; -// case PathIterator.SEG_CUBICTO: -// linesOnly = linesOnly & false; -// curvesOnly = curvesOnly & true; -// curve = new CubicCurve2D.Double(x0,y0,coords[0],coords[1],coords[2],coords[3],coords[4],coords[5]); -// pathLength += cBezLength((CubicCurve2D.Double)curve); -// ux0 = ucoords[4]; -// uy0 = ucoords[5]; -// x0 = coords[4]; -// y0 = coords[5]; -// handles.add(new Point2D.Double(ucoords[0],ucoords[1])); -// handles.add(new Point2D.Double(ucoords[2],ucoords[3])); -// handles.add(new Point2D.Double(ucoords[4],ucoords[5])); -// xCoords.add(new Integer((int)ucoords[4])); -// yCoords.add(new Integer((int)ucoords[5])); -// closed = ((int)ux0==(int)usX && (int)uy0==(int)usY); -// break; case PathIterator.SEG_CLOSE: if((int)ux0 != (int)usX && (int)uy0 != (int)usY) pathLength += Math.sqrt(Math.pow((x0-sX),2.0) + Math.pow((y0-sY),2.0)); closed = true; @@ -992,8 +698,8 @@ boolean parsePath(PathIterator pIter, double[] params, Vector segments, Vector r done = pIter.isDone() || (shapeToRoi&&rois!=null&&rois.size()==1); if (done) { if(closed && (int)x0!=(int)sX && (int)y0!=(int)sY) { // this may only happen after a SEG_CLOSE - xCoords.add(new Integer(((Integer)xCoords.elementAt(0)).intValue())); - yCoords.add(new Integer(((Integer)yCoords.elementAt(0)).intValue())); + xCoords.add(Integer.valueOf(((Integer)xCoords.elementAt(0)).intValue())); + yCoords.add(Integer.valueOf(((Integer)yCoords.elementAt(0)).intValue())); } if (rois!=null) { roiType = shapeToRoi?TRACED_ROI:guessType(count+1, linesOnly, curvesOnly, closed); @@ -1011,15 +717,12 @@ boolean parsePath(PathIterator pIter, double[] params, Vector segments, Vector r public void draw(Graphics g) { Color color = strokeColor!=null? strokeColor:ROIColor; boolean isActiveOverlayRoi = !overlay && isActiveOverlayRoi(); - //IJ.log("draw: "+overlay+" "+isActiveOverlayRoi); if (isActiveOverlayRoi) color = Color.cyan; - if (fillColor!=null) color = fillColor; + if (fillColor != null) color = fillColor; g.setColor(color); AffineTransform aTx = (((Graphics2D)g).getDeviceConfiguration()).getDefaultTransform(); Graphics2D g2d = (Graphics2D)g; -// if (stroke!=null && !isActiveOverlayRoi) -// g2d.setStroke((ic!=null&&ic.getCustomRoi())||isCursor()?stroke:getScaledStroke()); mag = getMagnification(); int basex=0, basey=0; if (ic!=null) { @@ -1028,65 +731,12 @@ public void draw(Graphics g) { } aTx.setTransform(mag, 0.0, 0.0, mag, -basex*mag, -basey*mag); aTx.translate(x, y); - if (fillColor!=null) { -// if (isActiveOverlayRoi) { -// g2d.setColor(Color.cyan); -// g2d.draw(aTx.createTransformedShape(shape)); -// } else -// g2d.fill(aTx.createTransformedShape(shape)); - } else + if (fillColor == null) { g2d.draw(aTx.createTransformedShape(shape)); + } if (stroke!=null) g2d.setStroke(defaultStroke); -// if (Toolbar.getToolId()==Toolbar.OVAL) -// drawRoiBrush(g); -// if (state!=NORMAL && imp!=null && imp.getRoi()!=null) -// showStatus(); -// if (updateFullWindow) -// {updateFullWindow = false; imp.draw();} } -// public void drawRoiBrush(Graphics g) { -// g.setColor(ROIColor); -// int size = Toolbar.getBrushSize(); -// if (size==0 || ic==null) -// return; -// int flags = ic.getModifiers(); -// if ((flags&16)==0) return; // exit if mouse button up -// size = (int)(size*mag); -// Point p = ic.getCursorLoc(); -// int sx = ic.screenX(p.x); -// int sy = ic.screenY(p.y); -// g.drawOval(sx-size/2, sy-size/2, size, size); -// } - -// /**Draws the shape of this object onto the specified ImageProcessor. -// *
This method will always draw a flattened version of the actual shape -// * (i.e., all curve segments will be approximated by line segments). -// */ -// public void drawPixels(ImageProcessor ip) { -// PathIterator pIter = shape.getPathIterator(new AffineTransform(), flatness); -// float[] coords = new float[6]; -// float sx=0f, sy=0f; -// while (!pIter.isDone()) { -// int segType = pIter.currentSegment(coords); -// switch(segType) { -// case PathIterator.SEG_MOVETO: -// sx = coords[0]; -// sy = coords[1]; -// ip.moveTo(x+(int)sx, y+(int)sy); -// break; -// case PathIterator.SEG_LINETO: -// ip.lineTo(x+(int)coords[0], y+(int)coords[1]); -// break; -// case PathIterator.SEG_CLOSE: -// ip.lineTo(x+(int)sx, y+(int)sy); -// break; -// default: break; -// } -// pIter.next(); -// } -// } - /** Returns this ROI's mask pixels as a ByteProcessor with pixels "in" the mask set to white (255) and pixels "outside" the mask set to black (0). */ public ImageProcessor getMask() { diff --git a/modules/DataBrowser/src/test/java/org/janelia/workstation/gui/viewer3d/TestMip3d.java b/modules/DataBrowser/src/test/java/org/janelia/workstation/gui/viewer3d/TestMip3d.java index 14c4c6cf58..a60d8a88fd 100644 --- a/modules/DataBrowser/src/test/java/org/janelia/workstation/gui/viewer3d/TestMip3d.java +++ b/modules/DataBrowser/src/test/java/org/janelia/workstation/gui/viewer3d/TestMip3d.java @@ -32,7 +32,7 @@ public void run() { Mip3d mipWidget = new Mip3d(); mipWidget.clear(); try { - // mipWidget.loadVolume("/Users/brunsc/smallRefTest.tif"); + // mipWidget.loadVolume("/Users/brunsc/smallRefTest.tif"); // This load-up works perfectly. // String fn = "/Volumes/jacsData/brunsTest/3d_test_images/ConsolidatedSignal2_25.v3dpbd"; diff --git a/modules/GLViewerTools/pom.xml b/modules/GLViewerTools/pom.xml index 67a8e999c4..0f569ca23c 100644 --- a/modules/GLViewerTools/pom.xml +++ b/modules/GLViewerTools/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. GLViewerTools org.janelia.workstation gltools - 9.21 + 10.0 nbm @@ -35,10 +35,10 @@ integration
- + org.janelia.workstation - jogl224lib + jogl260lib @@ -84,7 +84,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicGL3Actor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicGL3Actor.java index efd7335bdb..164afb6581 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicGL3Actor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicGL3Actor.java @@ -2,7 +2,7 @@ package org.janelia.gltools; import java.util.Collection; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.BasicObject3D; import org.janelia.geometry3d.Matrix4; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicScreenBlitActor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicScreenBlitActor.java index 918eefca46..147e63253f 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicScreenBlitActor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicScreenBlitActor.java @@ -2,8 +2,8 @@ import java.io.IOException; import java.util.Collection; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.ChannelBrightnessModel; import org.janelia.geometry3d.Matrix4; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicShaderProgram.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicShaderProgram.java index c579745edd..4e8ce47908 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicShaderProgram.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BasicShaderProgram.java @@ -5,8 +5,8 @@ import java.nio.IntBuffer; import java.util.ArrayList; import java.util.List; -import javax.media.opengl.GL3; -import javax.media.opengl.GLException; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLException; /** * Represents an OpenGL shader diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BufferClearActor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BufferClearActor.java index ab1cede1f4..d83e9e0c44 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/BufferClearActor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/BufferClearActor.java @@ -1,7 +1,7 @@ package org.janelia.gltools; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/ColorBackgroundActor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/ColorBackgroundActor.java index d81609afd1..cf5eb6d62a 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/ColorBackgroundActor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/ColorBackgroundActor.java @@ -1,7 +1,7 @@ package org.janelia.gltools; import java.awt.Color; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.geometry3d.ScreenQuadMesh; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/Framebuffer.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/Framebuffer.java index b34663ecf8..7ec244b899 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/Framebuffer.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/Framebuffer.java @@ -3,11 +3,11 @@ import java.util.ArrayList; import java.util.List; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLEventListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Actor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Actor.java index b22072b840..9d217cebbc 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Actor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Actor.java @@ -1,7 +1,7 @@ package org.janelia.gltools; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.geometry3d.CompositeObject3d; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Resource.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Resource.java index af7914102a..3fabfc5d7a 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Resource.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/GL3Resource.java @@ -1,7 +1,7 @@ package org.janelia.gltools; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; /** * diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/LightingBlitActor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/LightingBlitActor.java index ad35283593..5c96adaaf8 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/LightingBlitActor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/LightingBlitActor.java @@ -2,7 +2,7 @@ import java.io.IOException; import java.io.InputStream; -import javax.media.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES2; import org.janelia.gltools.material.BasicMaterial; import org.janelia.gltools.material.Material; import org.janelia.gltools.texture.Texture2d; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshActor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshActor.java index f206e55cdf..6319e196d3 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshActor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshActor.java @@ -15,7 +15,7 @@ import java.util.Map; import java.util.Observable; import java.util.Observer; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.ConstVector; import org.janelia.geometry3d.CompositeObject3d; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshFloatVbo.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshFloatVbo.java index d38bf5f749..ed754b2390 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshFloatVbo.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/MeshFloatVbo.java @@ -5,7 +5,7 @@ import java.nio.FloatBuffer; import java.util.ArrayList; import java.util.List; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/MultipassRenderer.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/MultipassRenderer.java index 89b58426f4..7791cf937f 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/MultipassRenderer.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/MultipassRenderer.java @@ -1,7 +1,7 @@ package org.janelia.gltools; import java.util.ArrayList; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; /** diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderPass.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderPass.java index 9f919032ac..c2358f1e39 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderPass.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderPass.java @@ -6,7 +6,7 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.ComposableObservable; import org.janelia.geometry3d.ObservableInterface; import org.janelia.geometry3d.AbstractCamera; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderTarget.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderTarget.java index 3aa839cad2..84de016c44 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderTarget.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/RenderTarget.java @@ -5,10 +5,10 @@ import com.jogamp.common.nio.Buffers; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLContext; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLContext; /** * One (of possibly many) textures used as render targets in a FrameBuffer diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderProgram.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderProgram.java index 0b7c4ca046..05022e3a17 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderProgram.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderProgram.java @@ -1,7 +1,7 @@ package org.janelia.gltools; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; /** * diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderStep.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderStep.java index 956fb662b6..83bf265af5 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderStep.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/ShaderStep.java @@ -5,9 +5,9 @@ import java.io.IOException; import java.io.InputStream; import java.nio.IntBuffer; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; -import javax.media.opengl.GLException; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLException; import org.apache.commons.io.IOUtils; /** diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/SolidColorGLRenderer.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/SolidColorGLRenderer.java index 1f510c39ed..a8b63f9fce 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/SolidColorGLRenderer.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/SolidColorGLRenderer.java @@ -2,9 +2,9 @@ package org.janelia.gltools; import java.awt.Color; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLEventListener; /** * Renderer that paints the entire viewport a single color. diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/BasicMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/BasicMaterial.java index 4c6467932d..eb0d0b5be8 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/BasicMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/BasicMaterial.java @@ -1,7 +1,7 @@ package org.janelia.gltools.material; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.gltools.MeshActor; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/DiffuseMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/DiffuseMaterial.java index 440dc2036d..2d1e5d4f2d 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/DiffuseMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/DiffuseMaterial.java @@ -1,7 +1,7 @@ package org.janelia.gltools.material; -import javax.media.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES2; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/FlatMeshShader.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/FlatMeshShader.java index d8a51d3655..cb79c7aafd 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/FlatMeshShader.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/FlatMeshShader.java @@ -1,7 +1,7 @@ package org.janelia.gltools.material; -import javax.media.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES2; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/IBLDiffuseMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/IBLDiffuseMaterial.java index e1ac7b8143..b746ff6aa0 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/IBLDiffuseMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/IBLDiffuseMaterial.java @@ -2,8 +2,8 @@ package org.janelia.gltools.material; import java.io.IOException; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ImageParticleMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ImageParticleMaterial.java index 44292ff1ef..77658bb486 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ImageParticleMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ImageParticleMaterial.java @@ -4,8 +4,8 @@ import java.awt.Color; import java.awt.image.BufferedImage; import java.io.IOException; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.geometry3d.PerspectiveCamera; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/Material.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/Material.java index 2cc487a551..098f309091 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/Material.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/Material.java @@ -1,7 +1,7 @@ package org.janelia.gltools.material; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.gltools.GL3Resource; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/NormalMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/NormalMaterial.java index c2f2266bd1..68896283d6 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/NormalMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/NormalMaterial.java @@ -1,7 +1,7 @@ package org.janelia.gltools.material; -import javax.media.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES2; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/OutlineMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/OutlineMaterial.java index a7c7d30493..07b7b94070 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/OutlineMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/OutlineMaterial.java @@ -3,9 +3,9 @@ import java.awt.Color; import java.io.IOException; -import javax.media.opengl.GL; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.gltools.BasicShaderProgram; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ScreenGradientColorMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ScreenGradientColorMaterial.java index aeadac25fb..795f074c33 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ScreenGradientColorMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/ScreenGradientColorMaterial.java @@ -1,6 +1,6 @@ package org.janelia.gltools.material; -import javax.media.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES2; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TexCoordMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TexCoordMaterial.java index 4d7d529e1f..986361e80c 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TexCoordMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TexCoordMaterial.java @@ -1,7 +1,7 @@ package org.janelia.gltools.material; -import javax.media.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES2; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TransparentEnvelope.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TransparentEnvelope.java index 2e4443ca00..091994cf6d 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TransparentEnvelope.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/TransparentEnvelope.java @@ -3,8 +3,8 @@ import java.awt.Color; import java.io.IOException; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/VolumeSurfaceMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/VolumeSurfaceMaterial.java index 392fdc405a..08153c1edd 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/VolumeSurfaceMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/VolumeSurfaceMaterial.java @@ -2,8 +2,8 @@ package org.janelia.gltools.material; import java.io.IOException; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/WireframeMaterial.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/WireframeMaterial.java index 4a4b5ed709..46f599f996 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/WireframeMaterial.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/material/WireframeMaterial.java @@ -3,8 +3,8 @@ import java.awt.Color; import java.io.IOException; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderStep; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DisposeGlVisitor.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DisposeGlVisitor.java index 85a6946b32..9709a665cb 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DisposeGlVisitor.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DisposeGlVisitor.java @@ -1,6 +1,6 @@ package org.janelia.gltools.scenegraph; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; /** * diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DrawableNode.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DrawableNode.java index 2c396d61c6..6d64530c74 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DrawableNode.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/DrawableNode.java @@ -1,6 +1,6 @@ package org.janelia.gltools.scenegraph; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; /** * diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/SceneGraphRenderer.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/SceneGraphRenderer.java index 9a408d60df..aa93ad6337 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/SceneGraphRenderer.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/scenegraph/SceneGraphRenderer.java @@ -3,11 +3,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLEventListener; /** * diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/BasicTexture.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/BasicTexture.java index 7a698f9a3b..fe91c9c6ab 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/BasicTexture.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/BasicTexture.java @@ -8,9 +8,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GL3; import org.apache.commons.lang.ArrayUtils; import org.janelia.gltools.GL3Resource; import org.slf4j.Logger; diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture2d.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture2d.java index cd144afeab..a6f47f4061 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture2d.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture2d.java @@ -6,8 +6,8 @@ import java.io.InputStream; import java.io.PushbackInputStream; import java.nio.ByteBuffer; -import javax.media.opengl.GL; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL3; import org.janelia.gltools.GL3Resource; /** diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture3d.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture3d.java index 46f01f18c3..9774c82727 100644 --- a/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture3d.java +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/Texture3d.java @@ -16,12 +16,11 @@ import java.util.concurrent.Future; import java.util.concurrent.ScheduledThreadPoolExecutor; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; -import com.sun.media.jai.codec.ImageCodec; -import com.sun.media.jai.codec.ImageDecoder; -import com.sun.media.jai.codec.MemoryCacheSeekableStream; -import com.sun.media.jai.codec.SeekableStream; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; import org.apache.commons.lang3.tuple.Pair; import org.janelia.geometry.util.PerformanceTimer; @@ -762,25 +761,21 @@ public void run() { private RenderedImage[] renderedImagesFromTiffStack(InputStream stackStream) throws IOException { PerformanceTimer timer = new PerformanceTimer(); - SeekableStream tiffStream; - if (stackStream instanceof SeekableStream) { - tiffStream = (SeekableStream) stackStream; - } else { - tiffStream = new MemoryCacheSeekableStream(stackStream); - } - - ImageDecoder decoder = ImageCodec.createImageDecoder("tiff", tiffStream, null); - if (decoder != null) { - LOG.debug("Creating image decoder from tiff file took {} ms", timer.reportMsAndRestart()); - int sz = decoder.getNumPages(); - RenderedImage slices[] = new RenderedImage[sz]; + ImageReader reader = TiffImageIOHelper.getTiffReader(); + ImageInputStream iis = ImageIO.createImageInputStream(stackStream); + reader.setInput(iis); + try { + LOG.debug("Creating image reader from tiff stream took {} ms", timer.reportMsAndRestart()); + int sz = reader.getNumImages(true); + RenderedImage[] slices = new RenderedImage[sz]; for (int z = 0; z < sz; ++z) { - slices[z] = decoder.decodeAsRenderedImage(z); + slices[z] = reader.readAsRenderedImage(z, null); } LOG.debug("Creating RenderedImages for all slices took {} ms", timer.reportMsAndRestart()); return slices; - } else { - return null; + } finally { + reader.dispose(); + iis.close(); } } diff --git a/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/TiffImageIOHelper.java b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/TiffImageIOHelper.java new file mode 100644 index 0000000000..f7815683f3 --- /dev/null +++ b/modules/GLViewerTools/src/main/java/org/janelia/gltools/texture/TiffImageIOHelper.java @@ -0,0 +1,60 @@ +package org.janelia.gltools.texture; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageWriter; +import java.util.Iterator; + +/** + * Helper for acquiring TIFF ImageReader/ImageWriter instances. + *

+ * Under NetBeans module isolation, {@link ImageIO} SPI discovery may fail to find + * TwelveMonkeys providers. This helper first tries the standard SPI route, then + * falls back to instantiating the TwelveMonkeys SPIs directly. + */ +public final class TiffImageIOHelper { + + private TiffImageIOHelper() {} + + /** + * Returns a TIFF {@link ImageReader}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageReaderSpi} directly. + * + * @return a ready-to-use TIFF ImageReader (caller must call {@code setInput}) + * @throws IllegalStateException if no TIFF reader is available + */ + public static ImageReader getTiffReader() { + Iterator readers = ImageIO.getImageReadersByFormatName("TIFF"); + if (readers.hasNext()) { + return readers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly (avoids NetBeans classloader issues) + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReaderSpi() + .createReaderInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageReader available", e); + } + } + + /** + * Returns a TIFF {@link ImageWriter}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageWriterSpi} directly. + * + * @return a ready-to-use TIFF ImageWriter (caller must call {@code setOutput}) + * @throws IllegalStateException if no TIFF writer is available + */ + public static ImageWriter getTiffWriter() { + Iterator writers = ImageIO.getImageWritersByFormatName("TIFF"); + if (writers.hasNext()) { + return writers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageWriterSpi() + .createWriterInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageWriter available", e); + } + } +} diff --git a/modules/GLViewerTools/src/test/java/org/janelia/gltools/scenegraph/SceneGraphRendererTest.java b/modules/GLViewerTools/src/test/java/org/janelia/gltools/scenegraph/SceneGraphRendererTest.java index 689c398d2c..06485b41ad 100644 --- a/modules/GLViewerTools/src/test/java/org/janelia/gltools/scenegraph/SceneGraphRendererTest.java +++ b/modules/GLViewerTools/src/test/java/org/janelia/gltools/scenegraph/SceneGraphRendererTest.java @@ -1,9 +1,9 @@ package org.janelia.gltools.scenegraph; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLOffscreenAutoDrawable; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLDrawableFactory; +import com.jogamp.opengl.GLOffscreenAutoDrawable; +import com.jogamp.opengl.GLProfile; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; diff --git a/modules/Geometry3d/pom.xml b/modules/Geometry3d/pom.xml index ed819ba711..c258428215 100644 --- a/modules/Geometry3d/pom.xml +++ b/modules/Geometry3d/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. Geometry3d org.janelia.workstation geometry3d - 9.21 + 10.0 nbm @@ -44,7 +44,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/HortaTracer/pom.xml b/modules/HortaTracer/pom.xml index d61bc5cf49..a3872453e7 100644 --- a/modules/HortaTracer/pom.xml +++ b/modules/HortaTracer/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. HortaTracer org.janelia.workstation horta - 9.21 + 10.0 nbm @@ -34,10 +34,10 @@ core - + org.janelia.workstation - jogl224lib + jogl260lib @@ -188,7 +188,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/NeuronTracerTopComponent.java b/modules/HortaTracer/src/main/java/org/janelia/horta/NeuronTracerTopComponent.java index 5760fb28fc..2d0c8c07f3 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/NeuronTracerTopComponent.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/NeuronTracerTopComponent.java @@ -46,7 +46,7 @@ import java.util.prefs.Preferences; import javax.imageio.ImageIO; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ActionMap; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/CenterCrossHairActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/CenterCrossHairActor.java index cdce974f72..a01cfbb026 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/CenterCrossHairActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/CenterCrossHairActor.java @@ -3,8 +3,8 @@ import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.geometry3d.MeshGeometry; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ConesMaterial.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ConesMaterial.java index e03320abf2..7981bb7bc7 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ConesMaterial.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ConesMaterial.java @@ -2,7 +2,7 @@ import java.awt.Color; import java.io.IOException; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.gltools.BasicShaderProgram; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeActor.java index 8b1a670f5d..b6833b5043 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeActor.java @@ -12,8 +12,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GL3; -import javax.media.opengl.GL4; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GL4; import java.util.ArrayList; import java.util.Collections; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeMeshActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeMeshActor.java index 2ee1fd1947..e73a8dc8e1 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeMeshActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/OmeZarrVolumeMeshActor.java @@ -16,7 +16,7 @@ import org.janelia.horta.volume.VolumeMipMaterial; import org.janelia.workstation.controller.model.color.ImageColorModel; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import java.io.IOException; import java.util.List; import java.util.ArrayList; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ParentVertexActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ParentVertexActor.java index 7a3cb8967b..cfe3d95356 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ParentVertexActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ParentVertexActor.java @@ -1,7 +1,7 @@ package org.janelia.horta.actors; import java.io.IOException; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.gltools.texture.Texture2d; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ScaleBar.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ScaleBar.java index da0349a96e..f92afed7c2 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ScaleBar.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/ScaleBar.java @@ -8,8 +8,8 @@ import java.awt.image.BufferedImage; import java.text.DecimalFormat; import java.text.NumberFormat; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.geometry3d.MeshGeometry; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresActor.java index db8a48f2bf..d5a1af03b2 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresActor.java @@ -1,7 +1,7 @@ package org.janelia.horta.actors; import java.awt.Color; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.workstation.controller.model.DefaultNeuron; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresMaterial.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresMaterial.java index 7f71f5ce65..3e23d14ccf 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresMaterial.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/SpheresMaterial.java @@ -2,8 +2,8 @@ import java.awt.Color; import java.io.IOException; -import javax.media.opengl.GL3; -import javax.media.opengl.GLException; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLException; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.gltools.BasicShaderProgram; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeActor.java index 01fcc665a7..87896b9d23 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeActor.java @@ -11,8 +11,8 @@ import java.util.Observable; import java.util.Observer; import javax.imageio.ImageIO; -import javax.media.opengl.GL3; -import javax.media.opengl.GL4; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GL4; import org.janelia.geometry3d.ObservableInterface; import org.janelia.workstation.controller.model.color.ChannelColorModel; import org.janelia.workstation.controller.model.color.ImageColorModel; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMaterial.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMaterial.java index 7f74c91175..f21a3aed69 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMaterial.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMaterial.java @@ -6,7 +6,7 @@ import java.nio.IntBuffer; import java.util.HashSet; import java.util.Set; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.gltools.BasicShaderProgram; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMeshActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMeshActor.java index 6a25b07c0d..8fb07641e2 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMeshActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/actors/TetVolumeMeshActor.java @@ -7,7 +7,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.ConstVector3; import org.janelia.geometry3d.MeshGeometry; import org.janelia.geometry3d.Vector3; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/KtxTileCache.java b/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/KtxTileCache.java index ae1dea8952..0b4ba3361c 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/KtxTileCache.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/KtxTileCache.java @@ -3,7 +3,7 @@ import java.io.IOException; import java.util.Collection; import java.util.Map; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.horta.actors.SortableBlockActor; /** diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/OmeZarrTileCache.java b/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/OmeZarrTileCache.java index 88321253cb..771b5904c6 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/OmeZarrTileCache.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/blocks/OmeZarrTileCache.java @@ -2,7 +2,7 @@ import org.janelia.horta.actors.SortableBlockActor; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import java.util.Collection; import java.util.Map; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVbo.java b/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVbo.java index 79c5995d47..4c784fc797 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVbo.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVbo.java @@ -5,7 +5,7 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.util.*; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.model.domain.tiledMicroscope.TmGeoAnnotation; import org.janelia.model.domain.tiledMicroscope.TmNeuronEdge; import org.janelia.model.domain.tiledMicroscope.TmNeuronMetadata; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboActor.java index a869f70283..f48c7737c5 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboActor.java @@ -2,7 +2,7 @@ import java.util.Collection; import java.util.Iterator; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.Matrix4; import org.janelia.geometry3d.Object3d; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboPool.java b/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboPool.java index 2fd485b6f7..7293873846 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboPool.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/neuronvbo/NeuronVboPool.java @@ -3,7 +3,7 @@ import java.io.IOException; import java.util.*; import java.util.concurrent.ConcurrentLinkedDeque; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.gltools.BasicShaderProgram; import org.janelia.gltools.ShaderProgram; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/render/BackgroundRenderPass.java b/modules/HortaTracer/src/main/java/org/janelia/horta/render/BackgroundRenderPass.java index 4bedc63882..71030fd730 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/render/BackgroundRenderPass.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/render/BackgroundRenderPass.java @@ -1,7 +1,7 @@ package org.janelia.horta.render; import java.awt.Color; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL3; import org.janelia.geometry3d.AbstractCamera; import org.janelia.gltools.ColorBackgroundActor; import org.janelia.gltools.RenderPass; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/render/NeuronMPRenderer.java b/modules/HortaTracer/src/main/java/org/janelia/horta/render/NeuronMPRenderer.java index c0af144114..6bc9c1cbc4 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/render/NeuronMPRenderer.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/render/NeuronMPRenderer.java @@ -10,8 +10,8 @@ import java.util.Observable; import java.util.Observer; import java.util.Set; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.geometry3d.ObservableInterface; import org.janelia.workstation.controller.listener.NeuronCreationListener; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/render/OpaqueRenderPass.java b/modules/HortaTracer/src/main/java/org/janelia/horta/render/OpaqueRenderPass.java index 4a090f33cb..06103bb4a3 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/render/OpaqueRenderPass.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/render/OpaqueRenderPass.java @@ -2,8 +2,8 @@ import java.awt.geom.Point2D; import java.nio.ByteBuffer; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.LateralOffsetCamera; import org.janelia.geometry3d.PerspectiveCamera; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/render/RemapColorActor.java b/modules/HortaTracer/src/main/java/org/janelia/horta/render/RemapColorActor.java index cdc634db2b..b95b06e351 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/render/RemapColorActor.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/render/RemapColorActor.java @@ -2,8 +2,8 @@ package org.janelia.horta.render; import java.io.IOException; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.janelia.workstation.controller.model.color.ChannelColorModel; import org.janelia.workstation.controller.model.color.ImageColorModel; import org.janelia.geometry3d.AbstractCamera; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/render/VolumeRenderPass.java b/modules/HortaTracer/src/main/java/org/janelia/horta/render/VolumeRenderPass.java index 65cf639754..f2ccd9dee0 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/render/VolumeRenderPass.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/render/VolumeRenderPass.java @@ -1,7 +1,7 @@ package org.janelia.horta.render; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.geometry3d.AbstractCamera; import org.janelia.gltools.Framebuffer; import org.janelia.gltools.GL3Actor; diff --git a/modules/HortaTracer/src/main/java/org/janelia/horta/volume/VolumeMipMaterial.java b/modules/HortaTracer/src/main/java/org/janelia/horta/volume/VolumeMipMaterial.java index 51c7429f04..91295df000 100644 --- a/modules/HortaTracer/src/main/java/org/janelia/horta/volume/VolumeMipMaterial.java +++ b/modules/HortaTracer/src/main/java/org/janelia/horta/volume/VolumeMipMaterial.java @@ -2,8 +2,8 @@ package org.janelia.horta.volume; import java.io.IOException; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL3; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL3; import org.apache.commons.io.IOUtils; import org.janelia.geometry3d.*; import org.janelia.workstation.controller.model.color.ChannelColorModel; diff --git a/modules/IntegrationAPIs/pom.xml b/modules/IntegrationAPIs/pom.xml index 91d6085651..bfe2542eed 100644 --- a/modules/IntegrationAPIs/pom.xml +++ b/modules/IntegrationAPIs/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. IntegrationAPIs org.janelia.workstation integration - 9.21 + 10.0 nbm @@ -46,7 +46,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/Jogl213Lib/pom.xml b/modules/Jogl213Lib/pom.xml deleted file mode 100644 index 0c7f954631..0000000000 --- a/modules/Jogl213Lib/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - - org.janelia - workstation - 9.21 - ../.. - - - Jogl213Lib - org.janelia.workstation - jogl213lib - 9.21 - nbm - - - - - - org.jogamp.jogl - jogl-all-main - 2.1.3 - - - org.jogamp.gluegen - gluegen-rt-main - 2.1.3 - - - - - - - - org.codehaus.mojo - nbm-maven-plugin - - - com.jogamp.common - com.jogamp.common.nio - com.jogamp.common.type - com.jogamp.common.util - com.jogamp.nativewindow.awt - com.jogamp.newt.event - com.jogamp.opengl - com.jogamp.opengl.util - com.jogamp.opengl.util.awt - com.jogamp.opengl.util.gl2 - com.jogamp.opengl.util.glsl - com.jogamp.opengl.util.glsl.fixedfunc - com.jogamp.opengl.util.texture - com.jogamp.opengl.util.texture.awt - javax.media.nativewindow - javax.media.nativewindow.util - javax.media.opengl - javax.media.opengl.awt - javax.media.opengl.fixedfunc - javax.media.opengl.glu - jogamp.opengl - - - - - - - diff --git a/modules/Jogl213Lib/src/main/nbm/manifest.mf b/modules/Jogl213Lib/src/main/nbm/manifest.mf deleted file mode 100644 index a56d29b3d5..0000000000 --- a/modules/Jogl213Lib/src/main/nbm/manifest.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module-Localizing-Bundle: org/janelia/jogl213lib/Bundle.properties -OpenIDE-Module-Specification-Version: ${janeliaws.modules.specification.version} -OpenIDE-Module-Implementation-Version: ${buildNumber} diff --git a/modules/Jogl224Lib/pom.xml b/modules/Jogl224Lib/pom.xml deleted file mode 100644 index a9b0216fbf..0000000000 --- a/modules/Jogl224Lib/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - - org.janelia - workstation - 9.21 - ../.. - - - Jogl224Lib - org.janelia.workstation - jogl224lib - 9.21 - nbm - - - - - - org.jogamp.jogl - jogl-all-main - 2.2.4 - - - org.jogamp.gluegen - gluegen-rt-main - 2.2.4 - - - - - - - - org.codehaus.mojo - nbm-maven-plugin - - - com.jogamp.common - com.jogamp.common.nio - com.jogamp.common.type - com.jogamp.common.util - com.jogamp.nativewindow.awt - com.jogamp.newt.event - com.jogamp.opengl - com.jogamp.opengl.util - com.jogamp.opengl.util.awt - com.jogamp.opengl.util.gl2 - com.jogamp.opengl.util.glsl - com.jogamp.opengl.util.glsl.fixedfunc - com.jogamp.opengl.util.texture - com.jogamp.opengl.util.texture.awt - javax.media.nativewindow - javax.media.nativewindow.util - javax.media.opengl - javax.media.opengl.awt - javax.media.opengl.fixedfunc - javax.media.opengl.glu - jogamp.opengl - - - - - - - diff --git a/modules/Jogl224Lib/src/main/nbm/manifest.mf b/modules/Jogl224Lib/src/main/nbm/manifest.mf deleted file mode 100644 index 4820a35d48..0000000000 --- a/modules/Jogl224Lib/src/main/nbm/manifest.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module-Localizing-Bundle: org/janelia/jogl224lib/Bundle.properties -OpenIDE-Module-Specification-Version: ${janeliaws.modules.specification.version} -OpenIDE-Module-Implementation-Version: ${buildNumber} diff --git a/modules/Jogl224Lib/src/main/resources/org/janelia/jogl224lib/Bundle.properties b/modules/Jogl224Lib/src/main/resources/org/janelia/jogl224lib/Bundle.properties deleted file mode 100644 index c6d1768a8f..0000000000 --- a/modules/Jogl224Lib/src/main/resources/org/janelia/jogl224lib/Bundle.properties +++ /dev/null @@ -1,2 +0,0 @@ -OpenIDE-Module-Display-Category=Libraries -OpenIDE-Module-Name=Jogl224 Library diff --git a/modules/Jogl260Lib/pom.xml b/modules/Jogl260Lib/pom.xml new file mode 100644 index 0000000000..3aae126881 --- /dev/null +++ b/modules/Jogl260Lib/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + org.janelia + workstation + 10.0 + ../.. + + + Jogl260Lib + org.janelia.workstation + jogl260lib + 10.0 + nbm + + + + + + org.jogamp.jogl + jogl-all-main + 2.6.0 + + + org.jogamp.gluegen + gluegen-rt-main + 2.6.0 + + + + + + + + org.apache.netbeans.utilities + nbm-maven-plugin + + + com.jogamp.common + com.jogamp.common.nio + com.jogamp.common.type + com.jogamp.common.util + com.jogamp.nativewindow + com.jogamp.nativewindow.awt + com.jogamp.nativewindow.util + com.jogamp.newt.event + com.jogamp.opengl + com.jogamp.opengl.awt + com.jogamp.opengl.fixedfunc + com.jogamp.opengl.glu + com.jogamp.opengl.util + com.jogamp.opengl.util.awt + com.jogamp.opengl.util.gl2 + com.jogamp.opengl.util.glsl + com.jogamp.opengl.util.glsl.fixedfunc + com.jogamp.opengl.util.texture + com.jogamp.opengl.util.texture.awt + jogamp.opengl + + + + + + + diff --git a/modules/Jogl260Lib/src/main/nbm/manifest.mf b/modules/Jogl260Lib/src/main/nbm/manifest.mf new file mode 100644 index 0000000000..b71b3b11e5 --- /dev/null +++ b/modules/Jogl260Lib/src/main/nbm/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +OpenIDE-Module-Localizing-Bundle: org/janelia/jogl260lib/Bundle.properties + diff --git a/modules/Jogl213Lib/src/main/resources/org/janelia/jogl213lib/Bundle.properties b/modules/Jogl260Lib/src/main/resources/org/janelia/jogl260lib/Bundle.properties similarity index 53% rename from modules/Jogl213Lib/src/main/resources/org/janelia/jogl213lib/Bundle.properties rename to modules/Jogl260Lib/src/main/resources/org/janelia/jogl260lib/Bundle.properties index dc6e3708bb..45cd3566f9 100644 --- a/modules/Jogl213Lib/src/main/resources/org/janelia/jogl213lib/Bundle.properties +++ b/modules/Jogl260Lib/src/main/resources/org/janelia/jogl260lib/Bundle.properties @@ -1,2 +1,2 @@ OpenIDE-Module-Display-Category=Libraries -OpenIDE-Module-Name=Jogl213 Library +OpenIDE-Module-Name=Jogl260 Library diff --git a/modules/LMDataBrowser/pom.xml b/modules/LMDataBrowser/pom.xml index de91dc7fce..8082f7bcfd 100644 --- a/modules/LMDataBrowser/pom.xml +++ b/modules/LMDataBrowser/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. LMDataBrowser org.janelia.workstation lmdatabrowser - 9.21 + 10.0 nbm @@ -122,7 +122,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/LargeVolumeViewer/pom.xml b/modules/LargeVolumeViewer/pom.xml index c57a47eaae..ea2cdc2d09 100644 --- a/modules/LargeVolumeViewer/pom.xml +++ b/modules/LargeVolumeViewer/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. LargeVolumeViewer org.janelia.workstation large_volume_viewer - 9.21 + 10.0 nbm @@ -41,10 +41,10 @@ common-gui - + org.janelia.workstation - jogl213lib + jogl260lib @@ -133,14 +133,6 @@ amqp-client 5.5.1 - - org.janelia.workstation - viewercontroller - - - org.janelia.workstation - viewercontroller - diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/CreateSyntheticTiff.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/CreateSyntheticTiff.java index c13573f889..70a782bf50 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/CreateSyntheticTiff.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/CreateSyntheticTiff.java @@ -2,16 +2,13 @@ import java.awt.image.BufferedImage; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStream; -import java.util.Iterator; -import com.google.common.collect.Iterators; -import com.sun.media.jai.codec.ImageCodec; -import com.sun.media.jai.codec.ImageEncoder; -import com.sun.media.jai.codec.TIFFEncodeParam; +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageOutputStream; public class CreateSyntheticTiff { @@ -40,22 +37,18 @@ public static void main(String[] args) { } } } - // Write output tiff - TIFFEncodeParam params = new TIFFEncodeParam(); - Iterator it = Iterators.forArray(slices); - if (it.hasNext()) it.next(); // Avoid duplicate first slice - params.setExtraImages(it); - OutputStream out; - try { - out = new FileOutputStream(tiffFile); - ImageEncoder encoder = ImageCodec.createImageEncoder("tiff", out, params); - encoder.encode(slices[0]); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - System.exit(1); + // Write multi-page output tiff using ImageIO + TwelveMonkeys + try (FileOutputStream fos = new FileOutputStream(tiffFile); + ImageOutputStream ios = ImageIO.createImageOutputStream(fos)) { + ImageWriter writer = TiffImageIOHelper.getTiffWriter(); + writer.setOutput(ios); + writer.prepareWriteSequence(null); + for (BufferedImage slice : slices) { + writer.writeToSequence(new IIOImage(slice, null, null), null); + } + writer.endWriteSequence(); + writer.dispose(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); } } @@ -64,5 +57,5 @@ public static void main(String[] args) { public static void usage() { System.out.println("Usage: java -jar CreateSyntheticTiff.jar "); } - + } diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLCanvasWrapper.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLCanvasWrapper.java index 464a573930..16c2b00f7e 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLCanvasWrapper.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLCanvasWrapper.java @@ -7,12 +7,12 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelListener; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesChooser; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.awt.GLCanvas; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLCapabilitiesChooser; +import com.jogamp.opengl.GLContext; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.awt.GLCanvas; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.ToolTipManager; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLContextSharer.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLContextSharer.java index 3b0397129e..560e63cd31 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLContextSharer.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLContextSharer.java @@ -1,14 +1,14 @@ package org.janelia.workstation.gui.large_volume_viewer; -import javax.media.opengl.DefaultGLCapabilitiesChooser; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesChooser; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.GLOffscreenAutoDrawable; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.DefaultGLCapabilitiesChooser; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLCapabilitiesChooser; +import com.jogamp.opengl.GLContext; +import com.jogamp.opengl.GLDrawableFactory; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.GLOffscreenAutoDrawable; +import com.jogamp.opengl.GLProfile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,8 +60,7 @@ private void instantiateMaybe() { factory.getDefaultDevice(), capabilities, chooser, - 1, 1, // Small size that never changes - null); // null means create a new context + 1, 1); // Small size that never changes masterContextPbuffer.addGLEventListener(this); masterContextPbuffer.display(); // Attempt render, to force context creation. } diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLDrawableWrapper.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLDrawableWrapper.java index 899b3dff09..4fbcc16b4c 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLDrawableWrapper.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLDrawableWrapper.java @@ -2,7 +2,7 @@ import java.awt.Component; import java.awt.Graphics; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; import javax.swing.JComponent; /** diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLJPanelWrapper.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLJPanelWrapper.java index 42cea83b83..c6b3d55bf5 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLJPanelWrapper.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/GLJPanelWrapper.java @@ -2,11 +2,11 @@ import java.awt.Component; import java.awt.Graphics; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesChooser; -import javax.media.opengl.GLContext; -import javax.media.opengl.awt.GLJPanel; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLCapabilitiesChooser; +import com.jogamp.opengl.GLContext; +import com.jogamp.opengl.awt.GLJPanel; import javax.swing.JComponent; /** diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/LargeVolumeViewer.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/LargeVolumeViewer.java index b0153647da..575445e680 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/LargeVolumeViewer.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/LargeVolumeViewer.java @@ -31,9 +31,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesChooser; -import javax.media.opengl.GLContext; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLCapabilitiesChooser; +import com.jogamp.opengl.GLContext; import javax.swing.JComponent; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/OrthogonalViewer.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/OrthogonalViewer.java index 5479e865fd..5facfa98a1 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/OrthogonalViewer.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/OrthogonalViewer.java @@ -12,9 +12,9 @@ import java.util.List; import java.util.Vector; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesChooser; -import javax.media.opengl.GLContext; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLCapabilitiesChooser; +import com.jogamp.opengl.GLContext; import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.JMenuItem; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/PermuteTiff.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/PermuteTiff.java index 714d62b6e0..a6fddad618 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/PermuteTiff.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/PermuteTiff.java @@ -2,29 +2,25 @@ import java.awt.image.BufferedImage; import java.awt.image.Raster; +import java.awt.image.RenderedImage; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStream; import java.util.Iterator; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.media.jai.NullOpImage; -import javax.media.jai.OpImage; - -import com.google.common.collect.Iterators; -import com.sun.media.jai.codec.FileSeekableStream; -import com.sun.media.jai.codec.ImageCodec; -import com.sun.media.jai.codec.ImageDecoder; -import com.sun.media.jai.codec.ImageEncoder; -import com.sun.media.jai.codec.SeekableStream; -import com.sun.media.jai.codec.TIFFEncodeParam; +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageInputStream; +import javax.imageio.stream.ImageOutputStream; public class PermuteTiff { private static boolean oneFolderAtATime = true; - + /** * @param args */ @@ -46,12 +42,12 @@ public static void main(String[] args) { else permuteOctree(folder); // Serially permute entire tree } - + public static void usage() { System.out.println("Usage: java -jar PermuteTiff.jar "); } - - public static void permuteOctree( File folder ) + + public static void permuteOctree( File folder ) { // Top folders first permuteFolder(folder); @@ -73,7 +69,7 @@ public static void permuteOctree( File folder ) } } } - + public static void permuteFolder (File folder) { if (folder == null) return; @@ -90,58 +86,87 @@ public static void permuteFolder (File folder) { permuteTiff(f); } } - - public static void permuteTiff(File inTiff, File outTiff, int permuteSteps) + + public static void permuteTiff(File inTiff, File outTiff, int permuteSteps) throws IOException { permuteSteps = permuteSteps % 3; - // Load first slice from input file to determine image format - SeekableStream s = new FileSeekableStream(inTiff); - ImageDecoder decoder = ImageCodec.createImageDecoder("tiff", s, null); - NullOpImage slice1 = new NullOpImage( - decoder.decodeAsRenderedImage(0), - null, - null, - OpImage.OP_NETWORK_BOUND); - // Note volume size - int sx = slice1.getWidth(); - int sy = slice1.getHeight(); - int sz = decoder.getNumPages(); - BufferedImage bufferedSlice1 = slice1.getAsBufferedImage(); - // Initialize output slices - int sizeOut[] = {sx, sy, sz}; - permute(sizeOut, permuteSteps); - BufferedImage outSlices[] = new BufferedImage[sizeOut[2]]; - for (int z = 0; z < sizeOut[2]; ++z) - outSlices[z] = new BufferedImage( - sizeOut[0], sizeOut[1], - bufferedSlice1.getType()); - // Copy permuted pixel by pixel - int bandCount = slice1.getColorModel().getNumColorComponents(); - int pixel[] = new int[bandCount]; - for (int z = 0; z < sz; ++z) { - Raster inSlice = decoder.decodeAsRaster(z); - for (int y = 0; y < sy; ++y) { - for (int x = 0; x < sx; ++x) { - int ixOut[] = {x, y, z}; - permute(ixOut, permuteSteps); - BufferedImage outSlice = outSlices[ixOut[2]]; - pixel = inSlice.getPixel(x, y, pixel); - outSlice.getRaster().setPixel(ixOut[0], ixOut[1], pixel); + + // Load input TIFF using ImageIO + TwelveMonkeys + ImageReader reader = TiffImageIOHelper.getTiffReader(); + ImageInputStream iis = ImageIO.createImageInputStream(inTiff); + reader.setInput(iis); + try { + // Read first slice to determine image format + RenderedImage slice1ri = reader.readAsRenderedImage(0, null); + BufferedImage bufferedSlice1 = toBufferedImage(slice1ri); + + // Note volume size + int sx = bufferedSlice1.getWidth(); + int sy = bufferedSlice1.getHeight(); + int sz = reader.getNumImages(true); + + // Initialize output slices + int sizeOut[] = {sx, sy, sz}; + permute(sizeOut, permuteSteps); + BufferedImage outSlices[] = new BufferedImage[sizeOut[2]]; + for (int z = 0; z < sizeOut[2]; ++z) + outSlices[z] = new BufferedImage( + sizeOut[0], sizeOut[1], + bufferedSlice1.getType()); + + // Copy permuted pixel by pixel + int bandCount = bufferedSlice1.getColorModel().getNumColorComponents(); + int pixel[] = new int[bandCount]; + for (int z = 0; z < sz; ++z) { + Raster inSlice = reader.readRaster(z, null); + for (int y = 0; y < sy; ++y) { + for (int x = 0; x < sx; ++x) { + int ixOut[] = {x, y, z}; + permute(ixOut, permuteSteps); + BufferedImage outSlice = outSlices[ixOut[2]]; + pixel = inSlice.getPixel(x, y, pixel); + outSlice.getRaster().setPixel(ixOut[0], ixOut[1], pixel); + } + } + } + + // Write output tiff as multi-page + try (FileOutputStream fos = new FileOutputStream(outTiff); + ImageOutputStream ios = ImageIO.createImageOutputStream(fos)) { + ImageWriter writer = TiffImageIOHelper.getTiffWriter(); + writer.setOutput(ios); + writer.prepareWriteSequence(null); + for (BufferedImage outSlice : outSlices) { + writer.writeToSequence(new IIOImage(outSlice, null, null), null); } + writer.endWriteSequence(); + writer.dispose(); } + } finally { + reader.dispose(); + iis.close(); } - // Write output tiff - TIFFEncodeParam params = new TIFFEncodeParam(); - Iterator it = Iterators.forArray(outSlices); - if (it.hasNext()) it.next(); // Avoid duplicate first slice - params.setExtraImages(it); - OutputStream out = new FileOutputStream(outTiff); - ImageEncoder encoder = ImageCodec.createImageEncoder("tiff", out, params); - encoder.encode(outSlices[0]); - out.close(); } - + + /** + * Convert a RenderedImage to BufferedImage, preserving sample model. + */ + private static BufferedImage toBufferedImage(RenderedImage ri) { + if (ri instanceof BufferedImage) { + return (BufferedImage) ri; + } + BufferedImage bi = new BufferedImage( + ri.getColorModel(), + ri.getColorModel().createCompatibleWritableRaster(ri.getWidth(), ri.getHeight()), + ri.getColorModel().isAlphaPremultiplied(), + null); + java.awt.Graphics2D g = bi.createGraphics(); + g.drawRenderedImage(ri, new java.awt.geom.AffineTransform()); + g.dispose(); + return bi; + } + public static void permuteTiff(File tiffFile) { Pattern filePattern = Pattern.compile("^default\\.(\\d+)\\.tif$"); // Only want to convert default.?.tif @@ -151,9 +176,6 @@ public static void permuteTiff(File tiffFile) { int channel = Integer.parseInt(matcher.group(1)); File yzFile = new File(tiffFile.getParentFile(), "YZ."+channel+".tif"); File zxFile = new File(tiffFile.getParentFile(), "ZX."+channel+".tif"); - // System.out.println( "File:" + f.getAbsoluteFile()); - // System.out.println( " YZ:" + yzFile.getAbsoluteFile()); - // System.out.println( " ZX:" + zxFile.getAbsoluteFile()); if (! yzFile.exists()) { try { System.out.println( "Creating:" + yzFile.getAbsoluteFile()); @@ -171,15 +193,15 @@ public static void permuteTiff(File tiffFile) { // TODO Auto-generated catch block e.printStackTrace(); } - } + } } - + private static void permute(int[] in, int count) { for (int i = 0; i < count; ++i) { permute1(in); } } - + private static void permute1(int[] in) { int first = in[0]; for (int i = 0; i < (in.length-1); ++i) { diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/QuadViewUi.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/QuadViewUi.java index c98d85135c..ff803626d9 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/QuadViewUi.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/QuadViewUi.java @@ -19,7 +19,7 @@ import java.util.Arrays; import java.util.List; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.GLProfile; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceActor.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceActor.java index 47e0905135..700a16ffdf 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceActor.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceActor.java @@ -1,8 +1,8 @@ package org.janelia.workstation.gui.large_volume_viewer; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.controller.model.color.ImageColorModel; import org.janelia.workstation.geom.CoordinateAxis; import org.janelia.workstation.geom.Vec3; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceRenderer.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceRenderer.java index 3929fd59e8..306112f2f9 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceRenderer.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/SliceRenderer.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.large_volume_viewer; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.geom.Rotation3d; import org.janelia.workstation.gui.camera.Camera3d; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/TiffImageIOHelper.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/TiffImageIOHelper.java new file mode 100644 index 0000000000..4be2f6d5da --- /dev/null +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/TiffImageIOHelper.java @@ -0,0 +1,60 @@ +package org.janelia.workstation.gui.large_volume_viewer; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageWriter; +import java.util.Iterator; + +/** + * Helper for acquiring TIFF ImageReader/ImageWriter instances. + *

+ * Under NetBeans module isolation, {@link ImageIO} SPI discovery may fail to find + * TwelveMonkeys providers. This helper first tries the standard SPI route, then + * falls back to instantiating the TwelveMonkeys SPIs directly. + */ +public final class TiffImageIOHelper { + + private TiffImageIOHelper() {} + + /** + * Returns a TIFF {@link ImageReader}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageReaderSpi} directly. + * + * @return a ready-to-use TIFF ImageReader (caller must call {@code setInput}) + * @throws IllegalStateException if no TIFF reader is available + */ + public static ImageReader getTiffReader() { + Iterator readers = ImageIO.getImageReadersByFormatName("TIFF"); + if (readers.hasNext()) { + return readers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly (avoids NetBeans classloader issues) + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReaderSpi() + .createReaderInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageReader available", e); + } + } + + /** + * Returns a TIFF {@link ImageWriter}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageWriterSpi} directly. + * + * @return a ready-to-use TIFF ImageWriter (caller must call {@code setOutput}) + * @throws IllegalStateException if no TIFF writer is available + */ + public static ImageWriter getTiffWriter() { + Iterator writers = ImageIO.getImageWritersByFormatName("TIFF"); + if (writers.hasNext()) { + return writers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageWriterSpi() + .createWriterInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageWriter available", e); + } + } +} diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/TileOutlineActor.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/TileOutlineActor.java index cd377df5f9..ddbbee6217 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/TileOutlineActor.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/TileOutlineActor.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.large_volume_viewer; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.controller.tileimagery.Tile2d; import org.janelia.workstation.controller.tileimagery.TileSet; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/action/GenerateCarveoutAction.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/action/GenerateCarveoutAction.java index 9a799c3fc0..5f1196a557 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/action/GenerateCarveoutAction.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/action/GenerateCarveoutAction.java @@ -1,7 +1,6 @@ package org.janelia.workstation.gui.large_volume_viewer.action; import java.awt.event.ActionEvent; -import java.awt.image.BufferedImage; import java.io.*; import java.net.URI; import java.nio.channels.ClosedByInterruptException; @@ -20,10 +19,6 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.collect.Iterators; -import com.sun.media.jai.codec.ImageCodec; -import com.sun.media.jai.codec.ImageEncoder; -import com.sun.media.jai.codec.TIFFEncodeParam; import org.apache.commons.io.FileUtils; import org.janelia.model.domain.tiledMicroscope.TmGeoAnnotation; import org.janelia.model.domain.tiledMicroscope.TmNeuronMetadata; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/AnchorShader.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/AnchorShader.java index 0004aa555d..194e79b6c2 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/AnchorShader.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/AnchorShader.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.large_volume_viewer.shader; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; public class AnchorShader extends PassThroughTextureShader { diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/NumeralShader.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/NumeralShader.java index be5a74fe24..8d138356e6 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/NumeralShader.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/NumeralShader.java @@ -5,7 +5,7 @@ import java.awt.image.BufferedImage; import java.nio.ByteBuffer; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import javax.swing.ImageIcon; import org.janelia.workstation.controller.model.color.ChannelColorModel; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/OutlineShader.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/OutlineShader.java index 41a4659f95..e708dd7510 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/OutlineShader.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/OutlineShader.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.large_volume_viewer.shader; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; public class OutlineShader extends PassThroughTextureShader { diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/PassThroughTextureShader.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/PassThroughTextureShader.java index 56eeaca4ee..97de57cc6c 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/PassThroughTextureShader.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/PassThroughTextureShader.java @@ -2,13 +2,13 @@ import java.nio.IntBuffer; -// import javax.media.opengl.GL2; +// import com.jogamp.opengl.GL2; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.glu.GLU; import org.janelia.workstation.gui.viewer3d.shader.AbstractShader; import org.slf4j.Logger; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/SliceColorShader.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/SliceColorShader.java index 00a9b3e669..d80c38bef4 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/SliceColorShader.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/shader/SliceColorShader.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.large_volume_viewer.shader; import java.awt.Color; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import org.janelia.workstation.controller.model.color.ChannelColorModel; import org.janelia.workstation.controller.model.color.ImageColorModel; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/AxesActor.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/AxesActor.java index 0840366781..115f0597f2 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/AxesActor.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/AxesActor.java @@ -12,8 +12,8 @@ import java.nio.IntBuffer; import java.util.ArrayList; import java.util.Collection; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.geom.BoundingBox3d; import org.janelia.workstation.gui.viewer3d.MeshViewContext; import org.janelia.workstation.gui.viewer3d.text.AxisLabel; @@ -158,8 +158,8 @@ public void init(GLAutoDrawable glDrawable) { vertexPointerHelper = new GenericVPLinesHelper(context, "ticked-axes-actor"); this.matrixManager = new MatrixManager( context, - glDrawable.getWidth(), - glDrawable.getHeight() + glDrawable.getSurfaceWidth(), + glDrawable.getSurfaceHeight() ); } catch ( Exception ex ) { diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesActor.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesActor.java index 3f29807408..50f01b277e 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesActor.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesActor.java @@ -6,9 +6,9 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.geom.Vec3; import org.janelia.workstation.gui.viewer3d.matrix_support.MatrixManager.FocusBehavior; import org.janelia.workstation.gui.opengl.GLActor; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesShader.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesShader.java index e9dca29b00..595f4d678b 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesShader.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/DirectionalReferenceAxesShader.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.large_volume_viewer.skeleton; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; import org.janelia.workstation.gui.viewer3d.OpenGLUtils; import org.janelia.workstation.gui.viewer3d.shader.AbstractShader; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/GenericVPLinesHelper.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/GenericVPLinesHelper.java index 1eae32919c..403755f9d4 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/GenericVPLinesHelper.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/GenericVPLinesHelper.java @@ -1,8 +1,8 @@ package org.janelia.workstation.gui.large_volume_viewer.skeleton; import java.nio.IntBuffer; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.gui.viewer3d.MeshViewContext; import static org.janelia.workstation.gui.viewer3d.OpenGLUtils.reportError; import org.janelia.workstation.gui.viewer3d.matrix_support.MatrixManager; diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/SkeletonActor.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/SkeletonActor.java index f819d51bc9..0bf25acadd 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/SkeletonActor.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/SkeletonActor.java @@ -10,10 +10,10 @@ import java.util.List; import java.util.Map; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; import javax.swing.ImageIcon; import org.janelia.workstation.controller.model.TmModelManager; @@ -293,7 +293,7 @@ private synchronized void displayLines(GLAutoDrawable glDrawable) { gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, model.getCummulativeLineOffset(), model.getLineBuffer(), GL.GL_DYNAMIC_DRAW); } - gl.glEnableClientState(GL2.GL_VERTEX_ARRAY); + gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY); lineShader.load(gl2); lineShader.setUniform(gl, "zThickness", getZoomedZThicknessInPixels()); float focus[] = { @@ -303,7 +303,7 @@ private synchronized void displayLines(GLAutoDrawable glDrawable) { lineShader.setUniform3v(gl, "focus", 1, focus); gl.glEnable(GL2.GL_LINE_SMOOTH); gl.glHint(GL2.GL_LINE_SMOOTH_HINT, GL2.GL_NICEST); - gl.glEnableClientState(GL2.GL_COLOR_ARRAY); + gl2.glEnableClientState(GL2.GL_COLOR_ARRAY); List lineOffsets = model.getLineOffsets(); List vertexOffsets = model.getVertexOffsets(); @@ -343,8 +343,8 @@ private synchronized void displayLines(GLAutoDrawable glDrawable) { //log.info("displayLines2 Check4"); - gl.glDisableClientState(GL2.GL_VERTEX_ARRAY); - gl.glDisableClientState(GL2.GL_COLOR_ARRAY); + gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY); + gl2.glDisableClientState(GL2.GL_COLOR_ARRAY); gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0); gl.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0); transparencyDepthMode(gl, false); diff --git a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/TracedPathActor.java b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/TracedPathActor.java index 9374ce7711..97134987fd 100644 --- a/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/TracedPathActor.java +++ b/modules/LargeVolumeViewer/src/main/java/org/janelia/workstation/gui/large_volume_viewer/skeleton/TracedPathActor.java @@ -11,10 +11,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.glu.GLU; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; diff --git a/modules/LargeVolumeViewer/src/test/java/org/janelia/workstation/gui/large_volume_viewer/TiffRoundTripTest.java b/modules/LargeVolumeViewer/src/test/java/org/janelia/workstation/gui/large_volume_viewer/TiffRoundTripTest.java new file mode 100644 index 0000000000..2db9013bec --- /dev/null +++ b/modules/LargeVolumeViewer/src/test/java/org/janelia/workstation/gui/large_volume_viewer/TiffRoundTripTest.java @@ -0,0 +1,103 @@ +package org.janelia.workstation.gui.large_volume_viewer; + +import static org.junit.Assert.*; + +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferUShort; +import java.awt.image.RenderedImage; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageInputStream; +import javax.imageio.stream.ImageOutputStream; + +import org.junit.Test; + +/** + * Round-trip validation: write a multi-page 16-bit grayscale TIFF using the + * migrated writer path, read it back using the migrated reader path, and assert + * exact pixel-level fidelity. + */ +public class TiffRoundTripTest { + + private static final int WIDTH = 64; + private static final int HEIGHT = 64; + private static final int PAGES = 3; + + /** Known pixel values for each page (distinctive 16-bit values). */ + private static final int[] PAGE_FILL = { 1000, 32767, 65000 }; + + @Test + public void testMultiPage16bitGrayscaleRoundTrip() throws IOException { + + // ---- WRITE ------------------------------------------------------- + // Build PAGES synthetic 16-bit grayscale images with known pixel values. + BufferedImage[] pages = new BufferedImage[PAGES]; + for (int p = 0; p < PAGES; p++) { + BufferedImage img = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_USHORT_GRAY); + short fillValue = (short)(PAGE_FILL[p] & 0xFFFF); + short[] data = ((DataBufferUShort) img.getRaster().getDataBuffer()).getData(); + for (int i = 0; i < data.length; i++) { + data[i] = fillValue; + } + pages[p] = img; + } + + File tmpFile = File.createTempFile("tiff-roundtrip-", ".tif"); + tmpFile.deleteOnExit(); + + // Use the migrated writer path (same as CreateSyntheticTiff / PermuteTiff) + try (FileOutputStream fos = new FileOutputStream(tmpFile); + ImageOutputStream ios = ImageIO.createImageOutputStream(fos)) { + + ImageWriter writer = TiffImageIOHelper.getTiffWriter(); + assertNotNull("Could not obtain a TIFF ImageWriter", writer); + writer.setOutput(ios); + writer.prepareWriteSequence(null); + for (BufferedImage page : pages) { + writer.writeToSequence(new IIOImage(page, null, null), null); + } + writer.endWriteSequence(); + writer.dispose(); + } + + System.out.println("[TiffRoundTripTest] Written " + PAGES + "-page 16-bit TIFF to: " + tmpFile); + + // ---- READ -------------------------------------------------------- + // Use the migrated reader path (same as Texture3d / TifVolumeFileLoader) + ImageReader reader = TiffImageIOHelper.getTiffReader(); + assertNotNull("Could not obtain a TIFF ImageReader", reader); + ImageInputStream iis = ImageIO.createImageInputStream(tmpFile); + reader.setInput(iis); + try { + int numPages = reader.getNumImages(true); + assertEquals("Page count mismatch", PAGES, numPages); + + for (int p = 0; p < numPages; p++) { + RenderedImage ri = reader.readAsRenderedImage(p, null); + assertNotNull("Null RenderedImage for page " + p, ri); + + assertEquals("Width mismatch on page " + p, WIDTH, ri.getWidth()); + assertEquals("Height mismatch on page " + p, HEIGHT, ri.getHeight()); + + // Sample the centre pixel — should be exactly PAGE_FILL[p] + int[] sample = ri.getData().getPixel(WIDTH / 2, HEIGHT / 2, (int[]) null); + int actualValue = sample[0]; + System.out.println("[TiffRoundTripTest] Page " + p + + ": expected=" + PAGE_FILL[p] + + " actual=" + actualValue); + assertEquals("Pixel value mismatch on page " + p, PAGE_FILL[p], actualValue); + } + } finally { + reader.dispose(); + iis.close(); + } + + System.out.println("[TiffRoundTripTest] PASS: 16-bit multi-page TIFF round-trip verified pixel-accurate."); + } +} diff --git a/modules/N5Viewer/pom.xml b/modules/N5Viewer/pom.xml index dcd2c1b8ba..3a82261908 100644 --- a/modules/N5Viewer/pom.xml +++ b/modules/N5Viewer/pom.xml @@ -5,14 +5,14 @@ workstation org.janelia - 9.21 + 10.0 ../.. N5Viewer org.janelia.workstation n5viewer - 9.21 + 10.0 nbm @@ -52,6 +52,15 @@ org.janelia.saalfeldlab n5-viewer_fiji 5.1.0-kr + + + + com.formdev + flatlaf + + org.janelia.saalfeldlab @@ -119,7 +128,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/SceneWindow/pom.xml b/modules/SceneWindow/pom.xml index ccb8319e71..d946274997 100644 --- a/modules/SceneWindow/pom.xml +++ b/modules/SceneWindow/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. SceneWindow org.janelia.workstation scenegraph - 9.21 + 10.0 nbm @@ -23,10 +23,10 @@ libraries - + org.janelia.workstation - jogl224lib + jogl260lib @@ -89,7 +89,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponent.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponent.java index 6cd9c2b122..9316ba9927 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponent.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponent.java @@ -3,7 +3,7 @@ import java.awt.Component; import java.awt.event.ActionListener; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; import javax.swing.JComponent; /** diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponentFactory.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponentFactory.java index f7cb6b4280..dda56078f3 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponentFactory.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/GLJComponentFactory.java @@ -9,11 +9,11 @@ import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelListener; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.awt.GLCanvas; -import javax.media.opengl.awt.GLJPanel; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.awt.GLCanvas; +import com.jogamp.opengl.awt.GLJPanel; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneRenderer.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneRenderer.java index ed18a49a51..2f60972591 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneRenderer.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneRenderer.java @@ -8,10 +8,10 @@ import java.util.List; import java.util.Set; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLEventListener; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.LateralOffsetCamera; diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneWindow.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneWindow.java index 908db90975..b2895490db 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneWindow.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/SceneWindow.java @@ -7,10 +7,10 @@ import java.util.Collection; import java.util.Observable; import java.util.Observer; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLContext; +import com.jogamp.opengl.GLProfile; import javax.swing.Action; import javax.swing.JComponent; import org.janelia.geometry3d.AbstractCamera; diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/AnaglyphRenderer.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/AnaglyphRenderer.java index cfc8a24938..5bef49c435 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/AnaglyphRenderer.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/AnaglyphRenderer.java @@ -1,9 +1,9 @@ package org.janelia.scenewindow.stereo; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.LateralOffsetCamera; import org.janelia.geometry3d.PerspectiveCamera; diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/HardwareRenderer.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/HardwareRenderer.java index a91b7c5471..615be847f6 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/HardwareRenderer.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/HardwareRenderer.java @@ -1,12 +1,12 @@ package org.janelia.scenewindow.stereo; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL2; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilitiesImmutable; -import javax.media.opengl.GLDrawable; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilitiesImmutable; +import com.jogamp.opengl.GLDrawable; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.LateralOffsetCamera; import org.janelia.geometry3d.PerspectiveCamera; diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/LeftEyeRenderer.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/LeftEyeRenderer.java index 495d3f60cf..3c410e0540 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/LeftEyeRenderer.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/LeftEyeRenderer.java @@ -1,9 +1,9 @@ package org.janelia.scenewindow.stereo; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.camera.BasicFrustumShift; import org.janelia.geometry3d.camera.ConstFrustumShift; diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/MonoscopicRenderer.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/MonoscopicRenderer.java index 99909e181b..c575542dca 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/MonoscopicRenderer.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/MonoscopicRenderer.java @@ -1,9 +1,9 @@ package org.janelia.scenewindow.stereo; -import javax.media.opengl.DebugGL3; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.DebugGL3; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.scenewindow.SceneRenderer; /** diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/SideBySideRenderer.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/SideBySideRenderer.java index c609f708fd..0c1141798a 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/SideBySideRenderer.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/SideBySideRenderer.java @@ -1,9 +1,9 @@ package org.janelia.scenewindow.stereo; -import javax.media.opengl.GL; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.geometry3d.AbstractCamera; import org.janelia.geometry3d.LateralOffsetCamera; import org.janelia.geometry3d.PerspectiveCamera; diff --git a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/StereoRenderer.java b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/StereoRenderer.java index b691a2810d..7d19a4a25a 100644 --- a/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/StereoRenderer.java +++ b/modules/SceneWindow/src/main/java/org/janelia/scenewindow/stereo/StereoRenderer.java @@ -1,7 +1,7 @@ package org.janelia.scenewindow.stereo; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.scenewindow.SceneRenderer; /** diff --git a/modules/SiteHortaCloud/pom.xml b/modules/SiteHortaCloud/pom.xml index 8f04f472f2..baf204908e 100644 --- a/modules/SiteHortaCloud/pom.xml +++ b/modules/SiteHortaCloud/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. SiteHortaCloud org.janelia.workstation sitehortacloud - 9.21 + 10.0 nbm @@ -62,7 +62,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/SiteJRC/pom.xml b/modules/SiteJRC/pom.xml index 9a23c409cc..8b9f5db47b 100644 --- a/modules/SiteJRC/pom.xml +++ b/modules/SiteJRC/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. SiteJRC org.janelia.workstation sitejrc - 9.21 + 10.0 nbm @@ -70,7 +70,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/Viewer3D/pom.xml b/modules/Viewer3D/pom.xml index e03b599431..ecca6bb7b1 100644 --- a/modules/Viewer3D/pom.xml +++ b/modules/Viewer3D/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. Viewer3D org.janelia.workstation viewer3d - 9.21 + 10.0 nbm @@ -29,10 +29,10 @@ integration - + org.janelia.workstation - jogl213lib + jogl260lib @@ -61,7 +61,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/CompositeGLActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/CompositeGLActor.java index b7f9c3ec1e..896e38b34d 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/CompositeGLActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/CompositeGLActor.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.Vector; -import javax.media.opengl.GL; +import com.jogamp.opengl.GL; public class CompositeGLActor diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2Adapter.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2Adapter.java index 90757c2d04..66dc7a1fd5 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2Adapter.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2Adapter.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.opengl; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2GL3; /** * Allow some parts of GL2 to be faked up in GL3 diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2AdapterFactory.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2AdapterFactory.java index 5f06cd6fa9..a71815e4f7 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2AdapterFactory.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GL2AdapterFactory.java @@ -1,11 +1,11 @@ package org.janelia.workstation.gui.opengl; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.glu.GLU; import org.janelia.workstation.geom.Vec3; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActor.java index da70db9f0a..2d7ad392bb 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActor.java @@ -1,9 +1,9 @@ package org.janelia.workstation.gui.opengl; -// import javax.media.opengl.GL2; +// import com.jogamp.opengl.GL2; import org.janelia.workstation.geom.BoundingBox3d; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; public interface GLActor extends GLResource diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActorContext.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActorContext.java index 92bb6b4df7..74865eab91 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActorContext.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLActorContext.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.opengl; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; // TODO - use GLActorContext as the parameter sent to GLActors public class GLActorContext { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLError.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLError.java index afea67f512..d3ef297b9b 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLError.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLError.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.opengl; -import javax.media.opengl.GL; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.glu.GLU; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLOrthoCamera.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLOrthoCamera.java index 2b801c84ea..69d0d34aa1 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLOrthoCamera.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLOrthoCamera.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.opengl; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import org.janelia.workstation.geom.Rotation3d; import org.janelia.workstation.geom.Quaternion.AngleAxis; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLResource.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLResource.java index 534cd9c915..3d28c55a7d 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLResource.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLResource.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.opengl; -// import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +// import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; public interface GLResource { public void init(GLAutoDrawable glDrawable); diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLSceneComposer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLSceneComposer.java index af9103c63c..716b075f03 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLSceneComposer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/GLSceneComposer.java @@ -1,11 +1,11 @@ package org.janelia.workstation.gui.opengl; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilitiesImmutable; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilitiesImmutable; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.glu.GLU; import org.janelia.workstation.geom.Rotation3d; import org.janelia.workstation.geom.Vec3; @@ -268,7 +268,7 @@ public void setStereoMode(StereoMode mode) { if (this.stereoMode != mode) { stereoMode = mode; stereoModeNeedsCleanup = true; - mode.reshape(glComponent.getWidth(), glComponent.getHeight()); + mode.reshape(glComponent.getSurfaceWidth(), glComponent.getSurfaceHeight()); } viewChangedSignal.emit(); } diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/LightingActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/LightingActor.java index 42518776df..720b6a177e 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/LightingActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/LightingActor.java @@ -2,8 +2,8 @@ import org.janelia.workstation.geom.BoundingBox3d; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; public class LightingActor implements GL3Actor { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshActor.java index 52dcb3aa37..4b0d0392ea 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshActor.java @@ -5,10 +5,10 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.glu.GLU; import org.janelia.workstation.geom.Vec3; import org.janelia.workstation.geom.BoundingBox3d; @@ -215,8 +215,8 @@ private void displayUsingVertexBufferObjects(GL2 gl2) { if (vertexNormalVbo < 1) // first time? initializeVbos(gl2); checkGlError(gl, "display mesh using vbos 211"); - gl2gl3.glEnableClientState(GL2.GL_VERTEX_ARRAY); - gl2gl3.glEnableClientState(GL2.GL_NORMAL_ARRAY); + gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY); + gl2.glEnableClientState(GL2.GL_NORMAL_ARRAY); checkGlError(gl, "display mesh using vbos 214"); final int bytesPerVertexNormal = (floatsPerVertex + floatsPerNormal)*bytesPerFloat; @@ -228,8 +228,8 @@ private void displayUsingVertexBufferObjects(GL2 gl2) { gl2.glEnable(GL2.GL_LIGHTING); gl2gl3.glDrawElements(GL.GL_TRIANGLES, indexCount, GL.GL_UNSIGNED_INT, 0); - gl2gl3.glDisableClientState(GL2.GL_NORMAL_ARRAY); - gl2gl3.glDisableClientState(GL2.GL_VERTEX_ARRAY); + gl2.glDisableClientState(GL2.GL_NORMAL_ARRAY); + gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY); checkGlError(gl, "display mesh using vbos"); } diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshGroupActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshGroupActor.java index bb17ba7e02..de218b1e90 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshGroupActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/MeshGroupActor.java @@ -9,8 +9,8 @@ import java.util.List; import java.util.Vector; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; /** * Parent actor so multiple mesh actors can share a single shader diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/SolidBackgroundActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/SolidBackgroundActor.java index 8c1166984c..e6b8e95a15 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/SolidBackgroundActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/SolidBackgroundActor.java @@ -5,8 +5,8 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; import org.janelia.workstation.gui.opengl.shader.BasicShader; import org.janelia.workstation.gui.opengl.shader.SolidColor120Shader; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/VertexBuffer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/VertexBuffer.java index 931371e558..38a9e3a48e 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/VertexBuffer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/VertexBuffer.java @@ -4,8 +4,8 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; // Intended to eventually back actors like MeshActor and VolumeActor public class VertexBuffer { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/GourdDemo.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/GourdDemo.java index a4c0a6b882..9c57233abf 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/GourdDemo.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/GourdDemo.java @@ -4,9 +4,9 @@ import java.awt.Dimension; import java.io.IOException; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; -import javax.media.opengl.awt.GLCanvas; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLProfile; +import com.jogamp.opengl.awt.GLCanvas; // GLJPanel won't work with GL3! import javax.swing.JFrame; import javax.swing.JMenu; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TeapotDemo.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TeapotDemo.java index acadafec84..bde80470cb 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TeapotDemo.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TeapotDemo.java @@ -4,11 +4,11 @@ import java.awt.Component; import java.awt.Dimension; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; -import javax.media.opengl.awt.GLCanvas; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLProfile; +import com.jogamp.opengl.awt.GLCanvas; // GLJPanel won't work with hardware stereo 3d -// import javax.media.opengl.awt.GLJPanel; +// import com.jogamp.opengl.awt.GLJPanel; import javax.swing.JFrame; import javax.swing.SwingUtilities; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TestSrgbFramebuffer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TestSrgbFramebuffer.java index 7edd66cb43..e2c0b55b76 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TestSrgbFramebuffer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/demo/TestSrgbFramebuffer.java @@ -1,12 +1,12 @@ package org.janelia.workstation.gui.opengl.demo; import java.awt.Dimension; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.awt.GLCanvas; -import javax.media.opengl.awt.GLJPanel; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.awt.GLCanvas; +import com.jogamp.opengl.awt.GLJPanel; import javax.swing.BoxLayout; import javax.swing.JFrame; import javax.swing.SwingUtilities; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/shader/BasicShader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/shader/BasicShader.java index 02aec8f46a..15e5c424d6 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/shader/BasicShader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/shader/BasicShader.java @@ -15,8 +15,8 @@ import java.nio.ByteBuffer; import java.nio.IntBuffer; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; public abstract class BasicShader { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphGreenMagentaStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphGreenMagentaStereoMode.java index 75eb380b1b..5fdf3aa5fc 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphGreenMagentaStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphGreenMagentaStereoMode.java @@ -3,8 +3,8 @@ import org.janelia.workstation.gui.opengl.GLActorContext; import org.janelia.workstation.gui.opengl.GLSceneComposer; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GLAutoDrawable; public class AnaglyphGreenMagentaStereoMode extends BasicStereoMode { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphRedCyanStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphRedCyanStereoMode.java index 590d8a05e3..fb0c02ac64 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphRedCyanStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/AnaglyphRedCyanStereoMode.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.opengl.stereo3d; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.gui.opengl.GLActorContext; import org.janelia.workstation.gui.opengl.GLSceneComposer; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/BasicStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/BasicStereoMode.java index 8f81ab2980..f3184d0874 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/BasicStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/BasicStereoMode.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.opengl.stereo3d; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.gui.camera.Camera3d; import org.janelia.workstation.gui.opengl.CameraScreenGeometry; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/HardwareStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/HardwareStereoMode.java index e4809d0801..5b3ac2ed5f 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/HardwareStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/HardwareStereoMode.java @@ -4,12 +4,12 @@ import org.janelia.workstation.gui.opengl.GLError; import org.janelia.workstation.gui.opengl.GLSceneComposer; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilitiesImmutable; -import javax.media.opengl.GLDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilitiesImmutable; +import com.jogamp.opengl.GLDrawable; public class HardwareStereoMode extends BasicStereoMode { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftEyeStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftEyeStereoMode.java index 1bc34a50f7..eb8a41f781 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftEyeStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftEyeStereoMode.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.opengl.stereo3d; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.gui.opengl.GLActorContext; import org.janelia.workstation.gui.opengl.GLSceneComposer; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftRightStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftRightStereoMode.java index d3089f41c6..7b354d70ef 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftRightStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/LeftRightStereoMode.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.opengl.stereo3d; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.gui.opengl.GLActorContext; import org.janelia.workstation.gui.opengl.GLSceneComposer; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RightEyeStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RightEyeStereoMode.java index c77a940a3b..3514bf50fa 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RightEyeStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RightEyeStereoMode.java @@ -3,7 +3,7 @@ import org.janelia.workstation.gui.opengl.GLActorContext; import org.janelia.workstation.gui.opengl.GLSceneComposer; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; public class RightEyeStereoMode extends BasicStereoMode { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RowInterleavedStereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RowInterleavedStereoMode.java index 3fff8a83ea..f339bdab33 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RowInterleavedStereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/RowInterleavedStereoMode.java @@ -4,13 +4,13 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; -import javax.media.nativewindow.NativeSurface; -import javax.media.nativewindow.NativeWindow; -import javax.media.nativewindow.util.Point; -import javax.media.opengl.GL; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLDrawable; +import com.jogamp.nativewindow.NativeSurface; +import com.jogamp.nativewindow.NativeWindow; +import com.jogamp.nativewindow.util.Point; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLDrawable; import org.janelia.workstation.gui.opengl.GL2Adapter; import org.janelia.workstation.gui.opengl.GLActorContext; @@ -53,8 +53,8 @@ public void display(GLActorContext actorContext, protected void init(GLActorContext context) { GLDrawable g = context.getGLAutoDrawable(); - int w = g.getWidth(); - int h = g.getHeight(); + int w = g.getSurfaceWidth(); + int h = g.getSurfaceHeight(); int top = 0; int left = 0; NativeSurface ns = g.getNativeSurface(); diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoMode.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoMode.java index cceeaf4561..af2b59f53a 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoMode.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoMode.java @@ -3,7 +3,7 @@ import org.janelia.workstation.gui.opengl.GLActorContext; import org.janelia.workstation.gui.opengl.GLSceneComposer; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; public interface StereoMode { diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoModeChooser.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoModeChooser.java index 04232d445b..47f9aa8c86 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoModeChooser.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/opengl/stereo3d/StereoModeChooser.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Vector; -import javax.media.opengl.GLDrawable; +import com.jogamp.opengl.GLDrawable; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ButtonGroup; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/AbstractVolumeBrick.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/AbstractVolumeBrick.java index e7dcfac06d..06375520a3 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/AbstractVolumeBrick.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/AbstractVolumeBrick.java @@ -6,10 +6,10 @@ import java.util.Collection; import java.util.Iterator; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLProfile; import org.janelia.workstation.gui.viewer3d.DirectionalAxis; import org.janelia.workstation.gui.viewer3d.OpenGLUtils; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/RGBExcludableVolumeBrick.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/RGBExcludableVolumeBrick.java index 4d9e20c4d8..a362969c09 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/RGBExcludableVolumeBrick.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/RGBExcludableVolumeBrick.java @@ -5,8 +5,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; /** * VolumeTexture class draws a transparent rectangular volume with a 3D opengl texture diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/shader/RGBExcludableShader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/shader/RGBExcludableShader.java index 5d48dc4b04..419db524cf 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/shader/RGBExcludableShader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/static_view/shader/RGBExcludableShader.java @@ -6,7 +6,7 @@ import org.janelia.workstation.gui.viewer3d.texture.TextureMediator; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.nio.IntBuffer; import org.janelia.workstation.gui.viewer3d.shader.TexturedShader; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ActorRenderer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ActorRenderer.java index 5dcec0374c..c229019e77 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ActorRenderer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ActorRenderer.java @@ -11,7 +11,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; import java.awt.Point; public abstract class ActorRenderer diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseGLViewer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseGLViewer.java index ae814fe88f..fc67d7773f 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseGLViewer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseGLViewer.java @@ -5,9 +5,9 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelListener; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; -import javax.media.opengl.awt.GLJPanel; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLProfile; +import com.jogamp.opengl.awt.GLJPanel; import javax.swing.JPopupMenu; import org.slf4j.Logger; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseRenderer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseRenderer.java index a3ea1bb650..fa000fe12e 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseRenderer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/BaseRenderer.java @@ -3,11 +3,11 @@ import java.awt.Color; import java.util.ArrayList; import java.util.List; -import javax.media.opengl.GL2; -// import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL2; +// import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.glu.GLU; import org.janelia.workstation.gui.camera.Camera3d; import org.janelia.workstation.gui.opengl.GLActor; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/MipRenderer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/MipRenderer.java index b963f62b29..3151b89590 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/MipRenderer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/MipRenderer.java @@ -2,8 +2,8 @@ import java.awt.Color; import java.util.ArrayList; -import javax.media.opengl.DebugGL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.DebugGL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.geom.Rotation3d; import org.janelia.workstation.geom.Vec3; import org.janelia.workstation.gui.opengl.GL2Adapter; @@ -26,8 +26,8 @@ public void display(GLAutoDrawable glDrawable) { this.backgroundColor = new Color( backgroundClrArr[ 0 ], backgroundClrArr[ 1 ], backgroundClrArr[ 2 ] ); super.display(glDrawable); // fills background - setWidthInPixels(glDrawable.getWidth()); - setHeightInPixels(glDrawable.getHeight()); + setWidthInPixels(glDrawable.getSurfaceWidth()); + setHeightInPixels(glDrawable.getSurfaceHeight()); resetOnFirstRedraw(); //final GL2 gl = glDrawable.getGL().getGL2(); @@ -39,7 +39,7 @@ public void display(GLAutoDrawable glDrawable) { gl.glPushMatrix(); gl.glLoadIdentity(); - glDrawable.getWidth(); + glDrawable.getSurfaceWidth(); Vec3 f = getVolumeModel().getCamera3d().getFocus(); // This is what allows (follows) drag in X and Y. Rotation3d rotation = getVolumeModel().getCamera3d().getRotation(); Vec3 u = rotation.times( UP_IN_CAMERA ); diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OcclusiveRenderer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OcclusiveRenderer.java index 966219f3e3..c51ef81001 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OcclusiveRenderer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OcclusiveRenderer.java @@ -2,11 +2,11 @@ import java.awt.Color; import java.util.ArrayList; -import javax.media.opengl.DebugGL2; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.DebugGL2; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLProfile; import org.janelia.workstation.geom.BoundingBox3d; import org.janelia.workstation.geom.Rotation3d; @@ -55,8 +55,8 @@ public void display(GLAutoDrawable glDrawable) { this.backgroundColor = new Color( backgroundClrArr[ 0 ], backgroundClrArr[ 1 ], backgroundClrArr[ 2 ] ); super.display(glDrawable); // fills background - setWidthInPixels(glDrawable.getWidth()); - setHeightInPixels(glDrawable.getHeight()); + setWidthInPixels(glDrawable.getSurfaceWidth()); + setHeightInPixels(glDrawable.getSurfaceHeight()); resetOnFirstRedraw(); //final GL2 gl = glDrawable.getGL().getGL2(); @@ -72,7 +72,7 @@ public void display(GLAutoDrawable glDrawable) { gl.glPushMatrix(); gl.glLoadIdentity(); - glDrawable.getWidth(); + glDrawable.getSurfaceWidth(); Vec3 f = getVolumeModel().getCamera3d().getFocus(); // This is what allows (follows) drag in X and Y. Rotation3d rotation = getVolumeModel().getCamera3d().getRotation(); Vec3 u = rotation.times( UP_IN_CAMERA ); diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OpenGLUtils.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OpenGLUtils.java index 8171cce415..96578ea8f1 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OpenGLUtils.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/OpenGLUtils.java @@ -4,8 +4,8 @@ import java.nio.IntBuffer; import java.util.Set; import java.util.TreeSet; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/TeapotActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/TeapotActor.java index 62c10204ab..b8e57102c5 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/TeapotActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/TeapotActor.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.viewer3d; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; import com.jogamp.opengl.util.gl2.GLUT; import org.janelia.workstation.geom.BoundingBox3d; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ViewportGL.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ViewportGL.java index 2e0b9ae43d..fa42338b6b 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ViewportGL.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/ViewportGL.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.viewer3d; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import org.janelia.workstation.gui.viewer3d.interfaces.Viewport; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/VolumeLoader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/VolumeLoader.java index 7739aca337..8e04e37037 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/VolumeLoader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/VolumeLoader.java @@ -16,7 +16,7 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import org.janelia.workstation.img_3d_loader.H265FileLoader; import org.janelia.workstation.gui.viewer3d.loader.LociTextureBuilder; import org.janelia.workstation.img_3d_loader.TifVolumeFileLoader; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/axes/AxesActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/axes/AxesActor.java index d346fd14ed..5fa0314035 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/axes/AxesActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/axes/AxesActor.java @@ -9,8 +9,8 @@ import java.util.ArrayList; import java.util.Collection; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.integration.util.FrameworkAccess; import org.janelia.workstation.geom.Vec3; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/buffering/VtxCoordBufMgr.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/buffering/VtxCoordBufMgr.java index 84c9db2ca3..8e238659ab 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/buffering/VtxCoordBufMgr.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/buffering/VtxCoordBufMgr.java @@ -6,7 +6,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/error_trap/JaneliaDebugGL2.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/error_trap/JaneliaDebugGL2.java index 57848b4b8c..58dca73975 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/error_trap/JaneliaDebugGL2.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/error_trap/JaneliaDebugGL2.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.viewer3d.error_trap; -import javax.media.opengl.*; +import com.jogamp.opengl.*; /** * Created with IntelliJ IDEA. diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/RectSolid.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/RectSolid.java index 282cdc742c..a180e82b2b 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/RectSolid.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/RectSolid.java @@ -7,9 +7,9 @@ import java.nio.ShortBuffer; import java.util.Date; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.geom.Vec3; import org.janelia.workstation.geom.BoundingBox3d; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/Rubics.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/Rubics.java index 074638641a..9133527d17 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/Rubics.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/learning/Rubics.java @@ -4,8 +4,8 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.geom.CoordinateAxis; import org.janelia.workstation.geom.Vec3; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/loader/TextureDataBuilder.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/loader/TextureDataBuilder.java index 26826a36b2..c7c85b2ebd 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/loader/TextureDataBuilder.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/loader/TextureDataBuilder.java @@ -5,7 +5,7 @@ import org.janelia.workstation.gui.viewer3d.VolumeDataAcceptor; import org.janelia.workstation.gui.viewer3d.texture.TextureDataI; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * Created with IntelliJ IDEA. diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/matrix_support/MatrixManager.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/matrix_support/MatrixManager.java index ef57360cf0..7630d1139c 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/matrix_support/MatrixManager.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/matrix_support/MatrixManager.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.viewer3d.matrix_support; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2GL3; import org.janelia.workstation.geom.Rotation3d; import org.janelia.workstation.geom.Vec3; import org.janelia.workstation.gui.viewer3d.MeshViewContext; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/MeshRenderer.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/MeshRenderer.java index 82af485674..3361388280 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/MeshRenderer.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/MeshRenderer.java @@ -2,9 +2,9 @@ import java.awt.Color; import java.util.ArrayList; -import javax.media.opengl.DebugGL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.DebugGL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.geom.Rotation3d; import org.janelia.workstation.geom.Vec3; import org.janelia.workstation.gui.opengl.GL2Adapter; @@ -49,8 +49,8 @@ public void display(GLAutoDrawable glDrawable) { float[] backgroundClrArr = getVolumeModel().getBackgroundColorFArr(); this.backgroundColor = new Color( backgroundClrArr[ 0 ], backgroundClrArr[ 1 ], backgroundClrArr[ 2 ] ); - setWidthInPixels(glDrawable.getWidth()); - setHeightInPixels(glDrawable.getHeight()); + setWidthInPixels(glDrawable.getSurfaceWidth()); + setHeightInPixels(glDrawable.getSurfaceHeight()); resetOnFirstRedraw(); final GL2Adapter gl = GL2AdapterFactory.createGL2Adapter( glDrawable ); diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/AttributeManagerBufferUploader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/AttributeManagerBufferUploader.java index 0009c97471..380afabf3d 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/AttributeManagerBufferUploader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/AttributeManagerBufferUploader.java @@ -3,7 +3,7 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.util.Map; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2GL3; import org.janelia.workstation.mesh_loader.RenderBuffersBean; import org.janelia.workstation.gui.viewer3d.OpenGLUtils; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/BufferUploader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/BufferUploader.java index d4ba90a318..3bcbb87337 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/BufferUploader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/BufferUploader.java @@ -1,6 +1,6 @@ package org.janelia.workstation.gui.viewer3d.mesh.actor; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2GL3; /** * Implement this to take on capability of pushing buffers to GPU. diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/MeshDrawActor.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/MeshDrawActor.java index cccf1c8ab3..aa17899882 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/MeshDrawActor.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/actor/MeshDrawActor.java @@ -4,9 +4,9 @@ import java.nio.IntBuffer; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GLAutoDrawable; import org.janelia.workstation.gui.opengl.GLActor; import org.janelia.workstation.gui.viewer3d.MeshViewContext; @@ -213,12 +213,12 @@ public void init(final GLAutoDrawable glDrawable) { MatrixManager.WindowDef windowDef = new MatrixManager.WindowDef() { @Override public int getWidthInPixels() { - return glDrawable.getWidth(); + return glDrawable.getSurfaceWidth(); } @Override public int getHeightInPixels() { - return glDrawable.getHeight(); + return glDrawable.getSurfaceHeight(); } }; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/shader/MeshDrawShader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/shader/MeshDrawShader.java index 049725320b..f3b36ee611 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/shader/MeshDrawShader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/mesh/shader/MeshDrawShader.java @@ -2,8 +2,8 @@ import org.janelia.workstation.gui.viewer3d.shader.AbstractShader; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/picking/RenderedIdPicker.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/picking/RenderedIdPicker.java index f0f3688f8e..de4b1ee8b9 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/picking/RenderedIdPicker.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/picking/RenderedIdPicker.java @@ -1,9 +1,9 @@ package org.janelia.workstation.gui.viewer3d.picking; -//import javax.media.opengl.GL2GL3; +//import com.jogamp.opengl.GL2GL3; import java.nio.ByteBuffer; -import javax.media.opengl.GL3; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLAutoDrawable; import java.nio.IntBuffer; import static org.janelia.workstation.gui.viewer3d.OpenGLUtils.reportError; @@ -51,8 +51,8 @@ public RenderedIdPicker(IdCoderProvider idCoderProvider) { * @param glDrawable */ public void init(GLAutoDrawable glDrawable) { - this.viewportWidth = glDrawable.getWidth(); - this.viewportHeight = glDrawable.getHeight(); + this.viewportWidth = glDrawable.getSurfaceWidth(); + this.viewportHeight = glDrawable.getSurfaceHeight(); logger.debug("Establishing width={}, and height={}.", viewportWidth, viewportHeight); GL3 gl = (GL3)glDrawable.getGL().getGL2(); diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/AbstractShader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/AbstractShader.java index a268a303bf..d9e592ffea 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/AbstractShader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/AbstractShader.java @@ -9,7 +9,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/VoxelRayShader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/VoxelRayShader.java index 378e21d1a4..79538784cc 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/VoxelRayShader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/shader/VoxelRayShader.java @@ -1,7 +1,7 @@ package org.janelia.workstation.gui.viewer3d.shader; import java.nio.IntBuffer; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; public class VoxelRayShader extends AbstractShader { public static final String VERTEX_SHADER = "VoxelRayVtx.glsl"; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/text/TextTextureMediator.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/text/TextTextureMediator.java index 31edcf7419..ee1ab9ac48 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/text/TextTextureMediator.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/text/TextTextureMediator.java @@ -4,7 +4,7 @@ import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.IntBuffer; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import org.apache.commons.io.IOUtils; import org.janelia.workstation.gui.viewer3d.OpenGLUtils; import org.slf4j.Logger; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/MaskTextureDataBean.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/MaskTextureDataBean.java index 250ab0baf0..c7a7687b9a 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/MaskTextureDataBean.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/MaskTextureDataBean.java @@ -14,7 +14,7 @@ import org.janelia.workstation.gui.viewer3d.renderable.RenderableBean; import org.janelia.workstation.gui.viewer3d.VolumeDataAcceptor; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.nio.ByteOrder; import java.util.Collection; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/RenderMapTextureBean.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/RenderMapTextureBean.java index a7c6e86814..d4bab93ebf 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/RenderMapTextureBean.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/RenderMapTextureBean.java @@ -6,7 +6,7 @@ import java.util.Collection; import java.util.Map; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import org.janelia.workstation.gui.viewer3d.VolumeDataAcceptor; import org.janelia.workstation.gui.viewer3d.VolumeModel; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureDataBean.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureDataBean.java index e763b711be..be1e4e4979 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureDataBean.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureDataBean.java @@ -15,7 +15,7 @@ import org.janelia.workstation.gui.viewer3d.volume_builder.VolumeDataBean; import org.janelia.workstation.gui.viewer3d.VolumeDataAcceptor; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureMediator.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureMediator.java index 7e0c5883ed..17c0bcd867 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureMediator.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/gui/viewer3d/texture/TextureMediator.java @@ -7,7 +7,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.HashMap; @@ -660,9 +660,9 @@ public static String getConstantName( Integer openGlEnumConstant ) { glConstantToName.put( GL2.GL_UNSIGNED_SHORT, "GL2.GL_UNSIGNED_SHORT" ); glConstantToName.put( GL2.GL_LUMINANCE16_ALPHA16, "GL2.GL_LUMINANCE16_ALPHA16"); - glConstantToName.put( javax.media.opengl.GL2GL3.GL_BGRA, "GL2GL3.GL_BGRA" ); - glConstantToName.put( javax.media.opengl.GL2GL3.GL_RGB, "GL2GL3.GL_RGB" ); - glConstantToName.put( javax.media.opengl.GL2GL3.GL_UNSIGNED_SHORT, "GL2GL3.GL_UNSIGNED_SHORT" ); + glConstantToName.put( com.jogamp.opengl.GL2GL3.GL_BGRA, "GL2GL3.GL_BGRA" ); + glConstantToName.put( com.jogamp.opengl.GL2GL3.GL_RGB, "GL2GL3.GL_RGB" ); + glConstantToName.put( com.jogamp.opengl.GL2GL3.GL_UNSIGNED_SHORT, "GL2GL3.GL_UNSIGNED_SHORT" ); } rtnVal = glConstantToName.get( openGlEnumConstant ); diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/img_3d_loader/TifVolumeFileLoader.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/img_3d_loader/TifVolumeFileLoader.java index e4422184c7..b60f1fe9c9 100644 --- a/modules/Viewer3D/src/main/java/org/janelia/workstation/img_3d_loader/TifVolumeFileLoader.java +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/img_3d_loader/TifVolumeFileLoader.java @@ -6,24 +6,21 @@ package org.janelia.workstation.img_3d_loader; -import com.sun.media.jai.codec.*; - -import javax.media.jai.NullOpImage; -import javax.media.jai.OpImage; -import javax.media.jai.RenderedImageAdapter; - +import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.awt.image.DataBufferByte; import java.awt.image.DataBufferUShort; import java.awt.image.RenderedImage; - import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; + import org.apache.log4j.Logger; import org.janelia.workstation.img_3d_loader.AbstractVolumeFileLoader; import org.janelia.workstation.img_3d_loader.LoaderSubsetHelper; @@ -37,13 +34,13 @@ public class TifVolumeFileLoader extends AbstractVolumeFileLoader { private LoaderSubsetHelper subsetHelper; private int sheetCountFromFile; - + private static final Logger logger = Logger.getLogger(TifVolumeFileLoader.class); public static final int LOAD_SIZE = 8 * 1024 * 1024; /** * Sets maximum size in all dimensions, to add to outgoing image. - * + * * @param dimensions how many voxels to use. */ public void setOutputDimensions( int[] dimensions ) { @@ -52,18 +49,18 @@ public void setOutputDimensions( int[] dimensions ) { } subsetHelper.setOutputDimensions(dimensions); } - + public void setConversionCharacteristics( double[][] fwdTransform, double[][] invTransform, int[] minCorner, int[] extent, List queryCoords ) { if ( subsetHelper == null ) { - subsetHelper = new LoaderSubsetHelper(); + subsetHelper = new LoaderSubsetHelper(); } subsetHelper.setTransformCharacteristics(fwdTransform, invTransform, minCorner, extent, queryCoords); } - + @Override public void loadVolumeFile( String fileName ) throws Exception { setUnCachedFileName(fileName); - + final File file = new File(fileName); logger.debug("Loading the subset of images."); Collection allImages = loadTIFF( file ); @@ -99,7 +96,7 @@ public void loadVolumeFile( String fileName ) throws Exception { setSx(subsetHelper.getSx()); setSy(subsetHelper.getSy()); setSz(subsetHelper.getSz()); - + sheetSize = subsetHelper.initializeStorage(file.length()); setPixelBytes( subsetHelper.getPixelBytes() ); setArgbTextureIntArray(subsetHelper.getArgbTextureIntArray()); @@ -115,7 +112,7 @@ public void loadVolumeFile( String fileName ) throws Exception { else { if ( expectedWidth != zSlice.getWidth() || expectedHeight != zSlice.getHeight() ) { throw new IllegalStateException( "Image number " + zOffset + - " with HEIGHT=" + zSlice.getHeight() + " and WIDTH=" + + " with HEIGHT=" + zSlice.getHeight() + " and WIDTH=" + zSlice.getWidth() + " has dimensions which do not match previous width * height of " + expectedWidth + " * " + expectedHeight ); } } @@ -130,7 +127,7 @@ public void loadVolumeFile( String fileName ) throws Exception { zOffset ++; } } - + public int initializeStorage(final long fileLength) { setPixelBytes((int)Math.floor( fileLength / ((getSx()*getSy()) * getSz()) )); if ( getPixelBytes() == 4 ) { @@ -141,7 +138,7 @@ public int initializeStorage(final long fileLength) { } return getSx() * getSy(); } - + private void storeToBuffer(int zOffset, int sheetSize, BufferedImage zSlice) { final int outputBufferOffset = zOffset * sheetSize; if ( getPixelBytes() == 1 ) { @@ -174,83 +171,73 @@ else if ( getPixelBytes() == 4 ) { } /** - * Load specified tiff page and return as buffered zSlice. - * From: http://opencapture.googlecode.com/svn/0.0.2/OpenCapture/src/net/filterlogic/util/imaging/ToTIFF.java - * - * @param file - * @param imageToLoad Page to load - * @return BufferedImage + * Load specified tiff pages and return as buffered images. + * + * @param file TIFF file to load + * @return collection of BufferedImages, one per page */ private Collection loadTIFF(File file) { Collection imageCollection = new ArrayList<>(); + ImageReader reader = TiffImageIOHelper.getTiffReader(); try { - BufferedImage wholeImage = null; - SeekableStream s = new FileSeekableStream(file); - - TIFFDecodeParam param = null; - logger.debug("In loadTIFF " + file + " create codec..."); - ImageDecoder dec = ImageCodec.createImageDecoder("tiff", s, param); + ImageInputStream iis = ImageIO.createImageInputStream(file); + reader.setInput(iis); logger.debug("In loadTIFF " + file + " getting number of pages..."); - int maxPage = dec.getNumPages(); - sheetCountFromFile = maxPage; + int maxPage = reader.getNumImages(true); + sheetCountFromFile = maxPage; if ( subsetHelper != null ) { subsetHelper.setSourceDepth( sheetCountFromFile ); subsetHelper.calculateBoundingZ( sheetCountFromFile ); } if ( logger.isDebugEnabled() ) - logger.debug("In loadTIFF " + file + " NullOpImage loop."); + logger.debug("In loadTIFF " + file + " reading pages loop."); for (int imageToLoad = 0; imageToLoad < maxPage; imageToLoad++) { if ( subsetHelper == null || subsetHelper.inZSubset( imageToLoad ) ) { - RenderedImage op - = new NullOpImage(dec.decodeAsRenderedImage(imageToLoad), - null, - OpImage.OP_IO_BOUND, - null); - wholeImage = renderedToBuffered(op); + RenderedImage ri = reader.readAsRenderedImage(imageToLoad, null); + BufferedImage wholeImage = renderedToBuffered(ri); imageCollection.add(wholeImage); } if ( logger.isDebugEnabled() ) - logger.debug("In loadTIFF " + file + " NullOpImage completed: " + imageToLoad); + logger.debug("In loadTIFF " + file + " page completed: " + imageToLoad); } logger.debug("In loadTIFF " + file + " returning image collection."); - s.close(); - + iis.close(); return imageCollection; - } catch (IOException e) { logger.error(e.toString()); - return null; + } finally { + reader.dispose(); } - } - + /** - * Convert RenderedImage to BufferedImage - * @param img - * @return BufferedImage + * Convert RenderedImage to BufferedImage, preserving sample model (e.g. 16-bit grayscale). + * + * @param img source image + * @return BufferedImage with the same pixel data */ private static BufferedImage renderedToBuffered(RenderedImage img) { - if (img instanceof BufferedImage) - { + if (img instanceof BufferedImage) { return (BufferedImage) img; } - - RenderedImageAdapter imageAdapter = new RenderedImageAdapter(img); - BufferedImage bufImage = imageAdapter.getAsBufferedImage(); - return bufImage; + // Copy to a new BufferedImage preserving the color model and sample model + BufferedImage bi = new BufferedImage( + img.getColorModel(), + img.getColorModel().createCompatibleWritableRaster(img.getWidth(), img.getHeight()), + img.getColorModel().isAlphaPremultiplied(), + null); + Graphics2D g = bi.createGraphics(); + g.drawRenderedImage(img, new java.awt.geom.AffineTransform()); + g.dispose(); + return bi; } - - private void getImage( ImageDecoder dec, int imageToLoad, Collection imageCollection ) throws IOException { - RenderedImage op - = new NullOpImage(dec.decodeAsRenderedImage(imageToLoad), - null, - OpImage.OP_IO_BOUND, - null); - BufferedImage wholeImage = renderedToBuffered(op); + private void getImage( ImageReader reader, int imageToLoad, Collection imageCollection ) throws IOException { + RenderedImage ri = reader.readAsRenderedImage(imageToLoad, null); + BufferedImage wholeImage = renderedToBuffered(ri); imageCollection.add(wholeImage); } diff --git a/modules/Viewer3D/src/main/java/org/janelia/workstation/img_3d_loader/TiffImageIOHelper.java b/modules/Viewer3D/src/main/java/org/janelia/workstation/img_3d_loader/TiffImageIOHelper.java new file mode 100644 index 0000000000..f41b2e5a95 --- /dev/null +++ b/modules/Viewer3D/src/main/java/org/janelia/workstation/img_3d_loader/TiffImageIOHelper.java @@ -0,0 +1,60 @@ +package org.janelia.workstation.img_3d_loader; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageWriter; +import java.util.Iterator; + +/** + * Helper for acquiring TIFF ImageReader/ImageWriter instances. + *

+ * Under NetBeans module isolation, {@link ImageIO} SPI discovery may fail to find + * TwelveMonkeys providers. This helper first tries the standard SPI route, then + * falls back to instantiating the TwelveMonkeys SPIs directly. + */ +public final class TiffImageIOHelper { + + private TiffImageIOHelper() {} + + /** + * Returns a TIFF {@link ImageReader}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageReaderSpi} directly. + * + * @return a ready-to-use TIFF ImageReader (caller must call {@code setInput}) + * @throws IllegalStateException if no TIFF reader is available + */ + public static ImageReader getTiffReader() { + Iterator readers = ImageIO.getImageReadersByFormatName("TIFF"); + if (readers.hasNext()) { + return readers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly (avoids NetBeans classloader issues) + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReaderSpi() + .createReaderInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageReader available", e); + } + } + + /** + * Returns a TIFF {@link ImageWriter}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageWriterSpi} directly. + * + * @return a ready-to-use TIFF ImageWriter (caller must call {@code setOutput}) + * @throws IllegalStateException if no TIFF writer is available + */ + public static ImageWriter getTiffWriter() { + Iterator writers = ImageIO.getImageWritersByFormatName("TIFF"); + if (writers.hasNext()) { + return writers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageWriterSpi() + .createWriterInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageWriter available", e); + } + } +} diff --git a/modules/ViewerController/pom.xml b/modules/ViewerController/pom.xml index 9e5856999f..cbb8fc561e 100644 --- a/modules/ViewerController/pom.xml +++ b/modules/ViewerController/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. ViewerController org.janelia.workstation viewercontroller - 9.21 + 10.0 nbm @@ -41,15 +41,10 @@ core + org.janelia.workstation - viewer3d - - - - - org.janelia.workstation - jogl213lib + jogl260lib @@ -145,18 +140,6 @@ org.janelia.workstation viewer3d - - org.janelia.workstation - viewer3d - - - org.janelia.workstation - viewer3d - - - org.janelia.workstation - viewer3d - org.janelia.workstation geometry3d @@ -168,7 +151,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/action/CreateWorkspaceAction.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/action/CreateWorkspaceAction.java index ccd83766f1..bc894a3ba4 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/action/CreateWorkspaceAction.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/action/CreateWorkspaceAction.java @@ -13,7 +13,7 @@ import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; -import org.openide.awt.ActionRegistration;; +import org.openide.awt.ActionRegistration; import org.openide.util.NbBundle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/task_workflow/TaskWorkflowViewTopComponent.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/task_workflow/TaskWorkflowViewTopComponent.java index 8d24dfb39c..1375103c36 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/task_workflow/TaskWorkflowViewTopComponent.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/task_workflow/TaskWorkflowViewTopComponent.java @@ -191,7 +191,7 @@ public TaskWorkflowViewTopComponent() { } - public static final TaskWorkflowViewTopComponent getInstance() { + public static TaskWorkflowViewTopComponent getInstance() { return (TaskWorkflowViewTopComponent)WindowManager.getDefault().findTopComponent(PREFERRED_ID); } diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/ExtractOctreeSubvolume.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/ExtractOctreeSubvolume.java index 3c6c8d2a89..4bb341442c 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/ExtractOctreeSubvolume.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/ExtractOctreeSubvolume.java @@ -4,14 +4,13 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStream; import java.net.MalformedURLException; -import java.util.Iterator; -import com.google.common.collect.Iterators; -import com.sun.media.jai.codec.ImageCodec; -import com.sun.media.jai.codec.ImageEncoder; -import com.sun.media.jai.codec.TIFFEncodeParam; +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageOutputStream; + import org.janelia.workstation.geom.Vec3; import org.janelia.workstation.integration.util.FrameworkAccess; @@ -19,7 +18,7 @@ public class ExtractOctreeSubvolume { /** * Creates a tiff file of a subvolume from an octree on-disk volume. - * + * * @param args */ public static void main(String[] args) { @@ -49,31 +48,34 @@ public static void main(String[] args) { FrameworkAccess.handleException(e); } } - + /** * Implementation with stronger type arguments than main() has... - * @throws IOException + * @throws IOException */ public static void extractSubvolume( Vec3 corner1, Vec3 corner2, double resolutionMicrometers, File inputOctreeFolder, - File outputTiff) throws IOException + File outputTiff) throws IOException { SharedVolumeImage wholeImage = new SharedVolumeImage(); wholeImage.loadURL(inputOctreeFolder.toURI().toURL()); Subvolume subvolume = new Subvolume(corner1, corner2, resolutionMicrometers, wholeImage); - // Write output tiff + // Write multi-page output tiff using ImageIO + TwelveMonkeys BufferedImage outSlices[] = subvolume.getAsBufferedImages(); - TIFFEncodeParam params = new TIFFEncodeParam(); - Iterator it = Iterators.forArray(outSlices); - if (it.hasNext()) it.next(); // Avoid duplicate first slice - params.setExtraImages(it); - OutputStream out = new FileOutputStream(outputTiff); - ImageEncoder encoder = ImageCodec.createImageEncoder("tiff", out, params); - encoder.encode(outSlices[0]); - out.close(); + try (FileOutputStream fos = new FileOutputStream(outputTiff); + ImageOutputStream ios = ImageIO.createImageOutputStream(fos)) { + ImageWriter writer = TiffImageIOHelper.getTiffWriter(); + writer.setOutput(ios); + writer.prepareWriteSequence(null); + for (BufferedImage outSlice : outSlices) { + writer.writeToSequence(new IIOImage(outSlice, null, null), null); + } + writer.endWriteSequence(); + writer.dispose(); + } } private static void usage(String [] args) { diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/FileBasedOctreeMetadataSniffer.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/FileBasedOctreeMetadataSniffer.java index 9081009a85..9507d4b671 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/FileBasedOctreeMetadataSniffer.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/FileBasedOctreeMetadataSniffer.java @@ -1,17 +1,15 @@ package org.janelia.workstation.controller.tileimagery; +import java.awt.image.RenderedImage; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; -import javax.media.jai.RenderedImageAdapter; - -import com.sun.media.jai.codec.FileSeekableStream; -import com.sun.media.jai.codec.ImageCodec; -import com.sun.media.jai.codec.ImageDecoder; -import com.sun.media.jai.codec.SeekableStream; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; import org.janelia.it.jacs.model.user_data.tiledMicroscope.CoordinateToRawTransform; import org.janelia.workstation.geom.CoordinateAxis; @@ -174,40 +172,45 @@ void retrieveMetadata() { // Deduce other parameters from first image file contents File tiff = new File(topFolder, CHANNEL_0_STD_TIFF_NAME); - SeekableStream s = new FileSeekableStream(tiff); - ImageDecoder decoder = ImageCodec.createImageDecoder("tiff", s, null); - // Z dimension is related to number of tiff pages - int sz = decoder.getNumPages(); - - // Get X/Y dimensions from first image - RenderedImageAdapter ria = new RenderedImageAdapter( - decoder.decodeAsRenderedImage(0)); - int sx = ria.getWidth(); - int sy = ria.getHeight(); - - log.info("SX={}, SY={}, SZ={}.", sx, sy, sz); - - // Full volume could be much larger than this downsampled tile - int[] tileSize = new int[3]; - tileSize[2] = sz; - if (sz < 1) { - return; + ImageReader reader = TiffImageIOHelper.getTiffReader(); + ImageInputStream iis = ImageIO.createImageInputStream(tiff); + reader.setInput(iis); + try { + // Z dimension is related to number of tiff pages + int sz = reader.getNumImages(true); + + // Get X/Y dimensions and color model from first image + RenderedImage firstImage = reader.readAsRenderedImage(0, null); + int sx = firstImage.getWidth(); + int sy = firstImage.getHeight(); + + log.info("SX={}, SY={}, SZ={}.", sx, sy, sz); + + // Full volume could be much larger than this downsampled tile + int[] tileSize = new int[3]; + tileSize[2] = sz; + if (sz < 1) { + return; + } + tileSize[0] = sx; + tileSize[1] = sy; + tileFormat.setTileSize(tileSize); + + int[] volumeSize = new int[3]; + volumeSize[2] = zoomFactor * sz; + volumeSize[0] = zoomFactor * sx; + volumeSize[1] = zoomFactor * sy; + tileFormat.setVolumeSize(volumeSize); + + int bitDepth = firstImage.getColorModel().getPixelSize(); + tileFormat.setBitDepth(bitDepth); + tileFormat.setIntensityMax((int) Math.pow(2, bitDepth) - 1); + + tileFormat.setSrgb(firstImage.getColorModel().getColorSpace().isCS_sRGB()); + } finally { + reader.dispose(); + iis.close(); } - tileSize[0] = sx; - tileSize[1] = sy; - tileFormat.setTileSize(tileSize); - - int[] volumeSize = new int[3]; - volumeSize[2] = zoomFactor * sz; - volumeSize[0] = zoomFactor * sx; - volumeSize[1] = zoomFactor * sy; - tileFormat.setVolumeSize(volumeSize); - - int bitDepth = ria.getColorModel().getPixelSize(); - tileFormat.setBitDepth(bitDepth); - tileFormat.setIntensityMax((int) Math.pow(2, bitDepth) - 1); - - tileFormat.setSrgb(ria.getColorModel().getColorSpace().isCS_sRGB()); // Setup the origin and the scale. updateOriginAndScale(); @@ -233,4 +236,3 @@ private void updateOriginAndScale() { } } - diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/PyramidTexture.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/PyramidTexture.java index 07961fafed..98a8d36f12 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/PyramidTexture.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/PyramidTexture.java @@ -1,6 +1,6 @@ package org.janelia.workstation.controller.tileimagery; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2GL3; import com.jogamp.opengl.util.texture.TextureCoords; diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Texture2dGL.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Texture2dGL.java index eed8ef869d..f377d98df2 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Texture2dGL.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Texture2dGL.java @@ -1,7 +1,7 @@ package org.janelia.workstation.controller.tileimagery; -// import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; +// import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; import com.jogamp.opengl.util.texture.TextureCoords; diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureData2dGL.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureData2dGL.java index dbe9fc1e52..b1b07ae032 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureData2dGL.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureData2dGL.java @@ -1,9 +1,9 @@ package org.janelia.workstation.controller.tileimagery; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.glu.GLU; import com.jogamp.opengl.util.texture.TextureCoords; diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureDataI.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureDataI.java index bbf29394a1..266c220d5d 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureDataI.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TextureDataI.java @@ -2,7 +2,7 @@ import org.janelia.workstation.controller.tileimagery.PyramidTexture; -import javax.media.opengl.GL2GL3; +import com.jogamp.opengl.GL2GL3; public interface TextureDataI { public PyramidTexture createTexture(GL2GL3 gl); diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TiffImageIOHelper.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TiffImageIOHelper.java new file mode 100644 index 0000000000..b1202b2961 --- /dev/null +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TiffImageIOHelper.java @@ -0,0 +1,60 @@ +package org.janelia.workstation.controller.tileimagery; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageWriter; +import java.util.Iterator; + +/** + * Helper for acquiring TIFF ImageReader/ImageWriter instances. + *

+ * Under NetBeans module isolation, {@link ImageIO} SPI discovery may fail to find + * TwelveMonkeys providers. This helper first tries the standard SPI route, then + * falls back to instantiating the TwelveMonkeys SPIs directly. + */ +public final class TiffImageIOHelper { + + private TiffImageIOHelper() {} + + /** + * Returns a TIFF {@link ImageReader}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageReaderSpi} directly. + * + * @return a ready-to-use TIFF ImageReader (caller must call {@code setInput}) + * @throws IllegalStateException if no TIFF reader is available + */ + public static ImageReader getTiffReader() { + Iterator readers = ImageIO.getImageReadersByFormatName("TIFF"); + if (readers.hasNext()) { + return readers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly (avoids NetBeans classloader issues) + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReaderSpi() + .createReaderInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageReader available", e); + } + } + + /** + * Returns a TIFF {@link ImageWriter}. Tries SPI discovery first; if that returns + * nothing, falls back to the TwelveMonkeys {@code TIFFImageWriterSpi} directly. + * + * @return a ready-to-use TIFF ImageWriter (caller must call {@code setOutput}) + * @throws IllegalStateException if no TIFF writer is available + */ + public static ImageWriter getTiffWriter() { + Iterator writers = ImageIO.getImageWritersByFormatName("TIFF"); + if (writers.hasNext()) { + return writers.next(); + } + // Fallback: instantiate TwelveMonkeys SPI directly + try { + return new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageWriterSpi() + .createWriterInstance(null); + } catch (Exception e) { + throw new IllegalStateException("No TIFF ImageWriter available", e); + } + } +} diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Tile2d.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Tile2d.java index 5e14f5786a..c6edb5644b 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Tile2d.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/Tile2d.java @@ -2,8 +2,8 @@ import java.awt.geom.Point2D; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; import com.google.common.base.Preconditions; import com.jogamp.opengl.util.texture.TextureCoords; diff --git a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TileTexture.java b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TileTexture.java index dddf1483ef..46464e36df 100644 --- a/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TileTexture.java +++ b/modules/ViewerController/src/main/java/org/janelia/workstation/controller/tileimagery/TileTexture.java @@ -1,6 +1,6 @@ package org.janelia.workstation.controller.tileimagery; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /* * Note the subtle distinction between Tile2d and TileTexture diff --git a/modules/ViewerInfoPanel/pom.xml b/modules/ViewerInfoPanel/pom.xml index aaa2198741..1ba490676d 100644 --- a/modules/ViewerInfoPanel/pom.xml +++ b/modules/ViewerInfoPanel/pom.xml @@ -5,14 +5,14 @@ org.janelia workstation - 9.21 + 10.0 ../.. ViewerInfoPanel org.janelia.workstation infopanel - 9.21 + 10.0 nbm @@ -125,7 +125,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/WoodstoxLib/pom.xml b/modules/WoodstoxLib/pom.xml new file mode 100644 index 0000000000..656aee420e --- /dev/null +++ b/modules/WoodstoxLib/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + org.janelia + workstation + 10.0 + ../.. + + + WoodstoxLib + org.janelia.workstation + woodstoxlib + 10.0 + nbm + + + + org.codehaus.woodstox + stax2-api + 4.2.1 + + + com.fasterxml.woodstox + woodstox-core + 6.2.7 + + + + + + + org.apache.netbeans.utilities + nbm-maven-plugin + + + com.ctc.wstx.** + org.codehaus.stax2.** + + + + + + + diff --git a/modules/application/pom.xml b/modules/application/pom.xml index 03f106c1fa..5d26efb312 100644 --- a/modules/application/pom.xml +++ b/modules/application/pom.xml @@ -5,18 +5,21 @@ org.janelia workstation - 9.21 + 10.0 ../.. Janelia Workstation org.janelia.workstation application - 9.21 + 10.0 nbm-application package + APP_IMAGE + ${basedir}/src/main/app-resources/janeliaws128.png + -Xmx8192m @@ -28,22 +31,22 @@ branding - + org.janelia.workstation - darcula + adminstration - + org.janelia.workstation - adminstration + common-gui - + org.janelia.workstation - common-gui + woodstoxlib @@ -205,10 +208,6 @@ org-netbeans-modules-junitlib org.netbeans.modules - - org-netbeans-api-htmlui - org.netbeans.api - org-netbeans-modules-templates org.netbeans.modules @@ -266,11 +265,26 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + compile-jpackage-launcher + compile + + compile + + + + + org.apache.maven.plugins maven-jar-plugin + launcher @@ -282,37 +296,17 @@ - + - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin ${clusterName} - ${clusterName} ${janeliaws.debug.args} ${basedir}/target/${brandingToken}.conf - - ${basedir}/src/main/app-resources/template.xml - - false - - ${project.name.capitalized} - ${clusterName} - ${basedir}/src/main/app-resources/build.xml - ${basedir}/src/main/app-resources/launcher.sh - ${basedir}/src/main/app-resources/janeliaws48.png - ${basedir}/src/main/app-resources/janeliaws.icns - ${basedir}/src/main/app-resources/janeliaws48.png - ${basedir}/src/main/app-resources/ConfigurationLogic.java - ${basedir}/src/main/app-resources/unix.launcher.properties - ${basedir}/src/main/app-resources/windows.launcher.properties - - + default-standalone-zip @@ -418,13 +412,12 @@ - + deployment - none + package @@ -442,7 +435,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin @@ -453,17 +446,16 @@ none - + default-standalone-zip package - + - installers-and-site + autoupdate-site - build-installers autoupdate @@ -481,6 +473,85 @@ replace-mac-executable none + + prepare-jpackage-input + package + + run + + + + + + + + + + + + + + org.panteleyev + jpackage-maven-plugin + + + jpackage-native-package + package + + jpackage + + + ${clusterName} + ${project.version} + Howard Hughes Medical Institute + ${project.description} + ${project.build.directory}/jpackage + true + ${jpackage.type} + ${project.build.directory}/jpackage-input + ${project.build.finalName}-launcher.jar + org.janelia.workstation.application.NetBeansJPackageLauncher + ${java.home} + ${jpackage.icon} + + ${project.build.directory}/${brandingToken} + + + -Dworkstation.brandingToken=${brandingToken} + -Dworkstation.clusterName=${clusterName} + -Dbranding.token=${brandingToken} + -Dapple.awt.brushMetalLook=false + -XX:+UseParallelGC + -Dhttp.maxConnections=20 + -Xms1024m + ${jpackage.max.heap} + -Dnetbeans.exception.alert.min.level=2000 + -Dnetbeans.exception.report.min.level=3000 + -Dplugin.manager.check.interval=10 + -Dplugin.manager.check.new.plugins=true + -Dplugin.manager.check.updates=true + --add-exports=java.desktop/sun.swing=ALL-UNNAMED + --add-opens=java.base/java.lang=ALL-UNNAMED + --add-opens=java.base/java.lang.reflect=ALL-UNNAMED + --add-opens=java.base/java.net=ALL-UNNAMED + --add-opens=java.base/java.nio=ALL-UNNAMED + --add-opens=java.base/java.util=ALL-UNNAMED + --add-opens=java.base/java.security=ALL-UNNAMED + --add-opens=java.desktop/javax.swing=ALL-UNNAMED + --add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED + --add-opens=java.desktop/java.awt=ALL-UNNAMED + --add-opens=java.desktop/sun.awt=ALL-UNNAMED + --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED + + ${janeliaws.appbundle.name} + org.janelia.workstation.${brandingToken} + ${brandingToken} + true + true + true + + @@ -488,6 +559,18 @@ + + macos-jpackage + + + mac + + + + ${basedir}/src/main/app-resources/janeliaws.icns + + + create-autoupdate @@ -495,7 +578,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/application/src/main/java/org/janelia/workstation/application/NetBeansJPackageLauncher.java b/modules/application/src/main/java/org/janelia/workstation/application/NetBeansJPackageLauncher.java new file mode 100644 index 0000000000..0732873f76 --- /dev/null +++ b/modules/application/src/main/java/org/janelia/workstation/application/NetBeansJPackageLauncher.java @@ -0,0 +1,99 @@ +package org.janelia.workstation.application; + +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +public final class NetBeansJPackageLauncher { + + private NetBeansJPackageLauncher() { + } + + public static void main(String[] args) throws Exception { + String brandingToken = System.getProperty("workstation.brandingToken", "janeliaws"); + String clusterName = System.getProperty("workstation.clusterName", "JaneliaWorkstation"); + + Path payloadRoot = findPayloadRoot(brandingToken); + Path platformRoot = payloadRoot.resolve("platform"); + Path bootJar = platformRoot.resolve("lib").resolve("boot.jar"); + + System.setProperty("netbeans.home", platformRoot.toString()); + + List netbeansArgs = new ArrayList<>(); + netbeansArgs.add("--branding"); + netbeansArgs.add(brandingToken); + netbeansArgs.add("--clusters"); + netbeansArgs.add(clusterPath(payloadRoot, brandingToken, clusterName)); + netbeansArgs.add("--userdir"); + netbeansArgs.add(defaultUserdir(clusterName)); + netbeansArgs.add("--laf"); + netbeansArgs.add("com.formdev.flatlaf.FlatDarkLaf"); + for (String arg : args) { + netbeansArgs.add(arg); + } + + try (URLClassLoader classLoader = new URLClassLoader(new URL[]{bootJar.toUri().toURL()}, + NetBeansJPackageLauncher.class.getClassLoader())) { + Thread.currentThread().setContextClassLoader(classLoader); + Class mainClass = Class.forName("org.netbeans.Main", true, classLoader); + Method main = mainClass.getMethod("main", String[].class); + main.invoke(null, (Object) netbeansArgs.toArray(new String[0])); + } + } + + private static Path findPayloadRoot(String brandingToken) throws Exception { + Path codeSource = Paths.get(NetBeansJPackageLauncher.class.getProtectionDomain() + .getCodeSource() + .getLocation() + .toURI()); + Path appDir = Files.isRegularFile(codeSource) ? codeSource.getParent() : codeSource; + + Path nestedPayload = appDir.resolve(brandingToken); + if (Files.isDirectory(nestedPayload.resolve("platform"))) { + return nestedPayload; + } + Path siblingPayload = appDir.getParent() == null ? null : appDir.getParent().resolve(brandingToken); + if (siblingPayload != null && Files.isDirectory(siblingPayload.resolve("platform"))) { + return siblingPayload; + } + if (Files.isDirectory(appDir.resolve("platform"))) { + return appDir; + } + throw new IllegalStateException("Cannot locate NetBeans platform payload under " + appDir); + } + + private static String clusterPath(Path payloadRoot, String brandingToken, String clusterName) throws Exception { + Path clustersFile = payloadRoot.resolve("etc").resolve(brandingToken + ".clusters"); + List clusterEntries = Files.exists(clustersFile) + ? Files.readAllLines(clustersFile) + : List.of("platform", "extra", clusterName); + + List clusters = new ArrayList<>(); + for (String entry : clusterEntries) { + String trimmed = entry.trim(); + if (trimmed.isEmpty() || trimmed.equals("bin") || trimmed.equals("etc")) { + continue; + } + Path cluster = payloadRoot.resolve(trimmed); + if (Files.isDirectory(cluster)) { + clusters.add(cluster.toString()); + } + } + return String.join(System.getProperty("path.separator"), clusters); + } + + private static String defaultUserdir(String clusterName) { + String home = System.getProperty("user.home"); + String os = System.getProperty("os.name", "").toLowerCase(Locale.ROOT); + if (os.contains("mac")) { + return home + "/Library/Application Support/" + clusterName + "/0.4"; + } + return home + "/." + clusterName + "/0.4"; + } +} diff --git a/modules/application/src/main/resources/janeliaws.conf b/modules/application/src/main/resources/janeliaws.conf index 7107b3eeea..77bc0e7004 100644 --- a/modules/application/src/main/resources/janeliaws.conf +++ b/modules/application/src/main/resources/janeliaws.conf @@ -5,7 +5,7 @@ default_mac_userdir="${HOME}/Library/Application Support/JaneliaWorkstation/0.4" # options used by the launcher by default, can be overridden by explicit # command line switches -default_options="--branding ${brandingToken} -J-Dbranding.token=${brandingToken} -J-Dapple.awt.brushMetalLook=false -J-XX:+UseParallelGC -J-Dhttp.maxConnections=20 -J-Xms1024m -J-Xmx8192m -J-Dnetbeans.exception.alert.min.level=2000 -J-Dnetbeans.exception.report.min.level=3000 -J-Dplugin.manager.check.interval=10 -J-Dplugin.manager.check.new.plugins=true -J-Dplugin.manager.check.updates=true -J-Djavax.xml.bind.JAXBContext=com.sun.xml.internal.bind.v2.ContextFactory" +default_options="--branding ${brandingToken} --laf com.formdev.flatlaf.FlatDarkLaf -J-Dbranding.token=${brandingToken} -J-Dapple.awt.brushMetalLook=false -J-XX:+UseParallelGC -J-Dhttp.maxConnections=20 -J-Xms1024m -J-Xmx8192m -J-Dnetbeans.exception.alert.min.level=2000 -J-Dnetbeans.exception.report.min.level=3000 -J-Dplugin.manager.check.interval=10 -J-Dplugin.manager.check.new.plugins=true -J-Dplugin.manager.check.updates=true -J--add-exports=java.desktop/sun.swing=ALL-UNNAMED -J--add-opens=java.base/java.lang=ALL-UNNAMED -J--add-opens=java.base/java.lang.reflect=ALL-UNNAMED -J--add-opens=java.base/java.net=ALL-UNNAMED -J--add-opens=java.base/java.nio=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -J--add-opens=java.base/java.security=ALL-UNNAMED -J--add-opens=java.desktop/javax.swing=ALL-UNNAMED -J--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED -J--add-opens=java.desktop/java.awt=ALL-UNNAMED -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED -J--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED" # for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea diff --git a/modules/application_horta/pom.xml b/modules/application_horta/pom.xml index 10bb694c39..2217780a89 100644 --- a/modules/application_horta/pom.xml +++ b/modules/application_horta/pom.xml @@ -5,18 +5,21 @@ org.janelia workstation - 9.21 + 10.0 ../.. Horta org.janelia.workstation application_horta - 9.21 + 10.0 nbm-application package + APP_IMAGE + ${basedir}/src/main/app-resources/horta128.png + -Xmx40960m @@ -28,22 +31,22 @@ branding - + org.janelia.workstation - darcula + adminstration - + org.janelia.workstation - adminstration + common-gui - + org.janelia.workstation - common-gui + woodstoxlib @@ -186,10 +189,6 @@ org-netbeans-modules-junitlib org.netbeans.modules - - org-netbeans-api-htmlui - org.netbeans.api - org-netbeans-modules-templates org.netbeans.modules @@ -247,11 +246,26 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + compile-jpackage-launcher + compile + + compile + + + + + org.apache.maven.plugins maven-jar-plugin + launcher @@ -263,37 +277,17 @@ - + - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin ${clusterName} - ${clusterName} ${janeliaws.debug.args} ${basedir}/target/${brandingToken}.conf - - ${basedir}/src/main/app-resources/template.xml - - false - - ${project.name.capitalized} - ${clusterName} - ${basedir}/src/main/app-resources/build.xml - ${basedir}/src/main/app-resources/launcher.sh - ${basedir}/src/main/app-resources/horta48.png - ${basedir}/src/main/app-resources/horta.icns - ${basedir}/src/main/app-resources/horta48.png - ${basedir}/src/main/app-resources/ConfigurationLogic.java - ${basedir}/src/main/app-resources/unix.launcher.properties - ${basedir}/src/main/app-resources/windows.launcher.properties - - + default-standalone-zip @@ -399,13 +393,12 @@ - + deployment - none + package @@ -423,7 +416,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin @@ -434,17 +427,16 @@ none - + default-standalone-zip package - + - installers-and-site + autoupdate-site - build-installers autoupdate @@ -462,6 +454,85 @@ replace-mac-executable none + + prepare-jpackage-input + package + + run + + + + + + + + + + + + + + org.panteleyev + jpackage-maven-plugin + + + jpackage-native-package + package + + jpackage + + + ${clusterName} + ${project.version} + Howard Hughes Medical Institute + ${project.description} + ${project.build.directory}/jpackage + true + ${jpackage.type} + ${project.build.directory}/jpackage-input + ${project.build.finalName}-launcher.jar + org.janelia.workstation.application.NetBeansJPackageLauncher + ${java.home} + ${jpackage.icon} + + ${project.build.directory}/${brandingToken} + + + -Dworkstation.brandingToken=${brandingToken} + -Dworkstation.clusterName=${clusterName} + -Dbranding.token=${brandingToken} + -Dapple.awt.brushMetalLook=false + -XX:+UseParallelGC + -Dhttp.maxConnections=20 + -Xms1024m + ${jpackage.max.heap} + -Dnetbeans.exception.alert.min.level=2000 + -Dnetbeans.exception.report.min.level=3000 + -Dplugin.manager.check.interval=10 + -Dplugin.manager.check.new.plugins=true + -Dplugin.manager.check.updates=true + --add-exports=java.desktop/sun.swing=ALL-UNNAMED + --add-opens=java.base/java.lang=ALL-UNNAMED + --add-opens=java.base/java.lang.reflect=ALL-UNNAMED + --add-opens=java.base/java.net=ALL-UNNAMED + --add-opens=java.base/java.nio=ALL-UNNAMED + --add-opens=java.base/java.util=ALL-UNNAMED + --add-opens=java.base/java.security=ALL-UNNAMED + --add-opens=java.desktop/javax.swing=ALL-UNNAMED + --add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED + --add-opens=java.desktop/java.awt=ALL-UNNAMED + --add-opens=java.desktop/sun.awt=ALL-UNNAMED + --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED + + ${janeliaws.appbundle.name} + org.janelia.workstation.${brandingToken} + ${brandingToken} + true + true + true + + @@ -469,6 +540,18 @@ + + macos-jpackage + + + mac + + + + ${basedir}/src/main/app-resources/horta.icns + + + create-autoupdate @@ -476,7 +559,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/application_horta/src/main/java/org/janelia/workstation/application/NetBeansJPackageLauncher.java b/modules/application_horta/src/main/java/org/janelia/workstation/application/NetBeansJPackageLauncher.java new file mode 100644 index 0000000000..0c06e4b88d --- /dev/null +++ b/modules/application_horta/src/main/java/org/janelia/workstation/application/NetBeansJPackageLauncher.java @@ -0,0 +1,99 @@ +package org.janelia.workstation.application; + +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +public final class NetBeansJPackageLauncher { + + private NetBeansJPackageLauncher() { + } + + public static void main(String[] args) throws Exception { + String brandingToken = System.getProperty("workstation.brandingToken", "horta"); + String clusterName = System.getProperty("workstation.clusterName", "Horta"); + + Path payloadRoot = findPayloadRoot(brandingToken); + Path platformRoot = payloadRoot.resolve("platform"); + Path bootJar = platformRoot.resolve("lib").resolve("boot.jar"); + + System.setProperty("netbeans.home", platformRoot.toString()); + + List netbeansArgs = new ArrayList<>(); + netbeansArgs.add("--branding"); + netbeansArgs.add(brandingToken); + netbeansArgs.add("--clusters"); + netbeansArgs.add(clusterPath(payloadRoot, brandingToken, clusterName)); + netbeansArgs.add("--userdir"); + netbeansArgs.add(defaultUserdir(clusterName)); + netbeansArgs.add("--laf"); + netbeansArgs.add("com.formdev.flatlaf.FlatDarkLaf"); + for (String arg : args) { + netbeansArgs.add(arg); + } + + try (URLClassLoader classLoader = new URLClassLoader(new URL[]{bootJar.toUri().toURL()}, + NetBeansJPackageLauncher.class.getClassLoader())) { + Thread.currentThread().setContextClassLoader(classLoader); + Class mainClass = Class.forName("org.netbeans.Main", true, classLoader); + Method main = mainClass.getMethod("main", String[].class); + main.invoke(null, (Object) netbeansArgs.toArray(new String[0])); + } + } + + private static Path findPayloadRoot(String brandingToken) throws Exception { + Path codeSource = Paths.get(NetBeansJPackageLauncher.class.getProtectionDomain() + .getCodeSource() + .getLocation() + .toURI()); + Path appDir = Files.isRegularFile(codeSource) ? codeSource.getParent() : codeSource; + + Path nestedPayload = appDir.resolve(brandingToken); + if (Files.isDirectory(nestedPayload.resolve("platform"))) { + return nestedPayload; + } + Path siblingPayload = appDir.getParent() == null ? null : appDir.getParent().resolve(brandingToken); + if (siblingPayload != null && Files.isDirectory(siblingPayload.resolve("platform"))) { + return siblingPayload; + } + if (Files.isDirectory(appDir.resolve("platform"))) { + return appDir; + } + throw new IllegalStateException("Cannot locate NetBeans platform payload under " + appDir); + } + + private static String clusterPath(Path payloadRoot, String brandingToken, String clusterName) throws Exception { + Path clustersFile = payloadRoot.resolve("etc").resolve(brandingToken + ".clusters"); + List clusterEntries = Files.exists(clustersFile) + ? Files.readAllLines(clustersFile) + : List.of("platform", "extra", clusterName); + + List clusters = new ArrayList<>(); + for (String entry : clusterEntries) { + String trimmed = entry.trim(); + if (trimmed.isEmpty() || trimmed.equals("bin") || trimmed.equals("etc")) { + continue; + } + Path cluster = payloadRoot.resolve(trimmed); + if (Files.isDirectory(cluster)) { + clusters.add(cluster.toString()); + } + } + return String.join(System.getProperty("path.separator"), clusters); + } + + private static String defaultUserdir(String clusterName) { + String home = System.getProperty("user.home"); + String os = System.getProperty("os.name", "").toLowerCase(Locale.ROOT); + if (os.contains("mac")) { + return home + "/Library/Application Support/" + clusterName + "/0.4"; + } + return home + "/." + clusterName + "/0.4"; + } +} diff --git a/modules/application_horta/src/main/resources/horta.conf b/modules/application_horta/src/main/resources/horta.conf index 356f40b9cf..b8b0cbfe00 100644 --- a/modules/application_horta/src/main/resources/horta.conf +++ b/modules/application_horta/src/main/resources/horta.conf @@ -5,7 +5,7 @@ default_mac_userdir="${HOME}/Library/Application Support/JaneliaWorkstation/0.4" # options used by the launcher by default, can be overridden by explicit # command line switches -default_options="--branding ${brandingToken} -J-Dbranding.token=${brandingToken} -J-Dapple.awt.brushMetalLook=false -J-XX:+UseParallelGC -J-Dhttp.maxConnections=20 -J-Xms1024m -J-Xmx40960m -J-Dnetbeans.exception.alert.min.level=2000 -J-Dnetbeans.exception.report.min.level=3000 -J-Dplugin.manager.check.interval=10 -J-Dplugin.manager.check.new.plugins=true -J-Dplugin.manager.check.updates=true -J-Djavax.xml.bind.JAXBContext=com.sun.xml.internal.bind.v2.ContextFactory" +default_options="--branding ${brandingToken} --laf com.formdev.flatlaf.FlatDarkLaf -J-Dbranding.token=${brandingToken} -J-Dapple.awt.brushMetalLook=false -J-XX:+UseParallelGC -J-Dhttp.maxConnections=20 -J-Xms1024m -J-Xmx40960m -J-Dnetbeans.exception.alert.min.level=2000 -J-Dnetbeans.exception.report.min.level=3000 -J-Dplugin.manager.check.interval=10 -J-Dplugin.manager.check.new.plugins=true -J-Dplugin.manager.check.updates=true -J--add-exports=java.desktop/sun.swing=ALL-UNNAMED -J--add-opens=java.base/java.lang=ALL-UNNAMED -J--add-opens=java.base/java.lang.reflect=ALL-UNNAMED -J--add-opens=java.base/java.net=ALL-UNNAMED -J--add-opens=java.base/java.nio=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -J--add-opens=java.base/java.security=ALL-UNNAMED -J--add-opens=java.desktop/javax.swing=ALL-UNNAMED -J--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED -J--add-opens=java.desktop/java.awt=ALL-UNNAMED -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED -J--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED" # for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea diff --git a/modules/branding/pom.xml b/modules/branding/pom.xml index 1461ae9c10..7f0999ba69 100644 --- a/modules/branding/pom.xml +++ b/modules/branding/pom.xml @@ -5,13 +5,13 @@ org.janelia workstation - 9.21 + 10.0 ../.. org.janelia.workstation branding - 9.21 + 10.0 nbm Branding @@ -25,7 +25,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index 3170d99f23..e5a5a399b9 100644 --- a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,9 +1,17 @@ currentVersion=Janelia Workstation {0} +AWT_AppClassName=Janelia Workstation LBL_splash_window_title=Starting Janelia Workstation +CTL_About_Title=About Janelia Workstation +CTL_About_Detail=Detail +SplashOnByDefault=true SPLASH_HEIGHT=169 SPLASH_WIDTH=358 +SplashShowProgressBar=true SplashProgressBarBounds=0,100,358,2 SplashProgressBarColor=0xFF0000 +SplashProgressBarEdgeColor=0xFF0000 +SplashProgressBarCornerColor=0xFF0000 SplashRunningTextBounds=250,88,100,9 SplashRunningTextColor=0x0 SplashRunningTextFontSize=8 +SplashRunningTextFontType=Dialog diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame1024.png b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame1024.png new file mode 100644 index 0000000000..dc1447bb67 Binary files /dev/null and b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame1024.png differ diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame256.png b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame256.png new file mode 100644 index 0000000000..4e271723a3 Binary files /dev/null and b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame256.png differ diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame32_dark.gif b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame32_dark.gif new file mode 100644 index 0000000000..26849ed591 Binary files /dev/null and b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame32_dark.gif differ diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame48_dark.gif b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame48_dark.gif new file mode 100644 index 0000000000..6004d6da09 Binary files /dev/null and b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame48_dark.gif differ diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame512.png b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame512.png new file mode 100644 index 0000000000..af64092e55 Binary files /dev/null and b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame512.png differ diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame_dark.gif b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame_dark.gif new file mode 100644 index 0000000000..2bfbcc521b Binary files /dev/null and b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/frame_dark.gif differ diff --git a/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/splash_dark.gif b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/splash_dark.gif new file mode 100644 index 0000000000..64c837102d Binary files /dev/null and b/modules/branding/src/main/nbm-branding/core/core.jar/org/netbeans/core/startup/splash_dark.gif differ diff --git a/pom.xml b/pom.xml index 1b55413d4e..abcaa8d971 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ Janelia Workstation org.janelia workstation - 9.21 + 10.0 pom @@ -72,14 +72,15 @@ ${netbeans.run.params.ide} - RELEASE82 + RELEASE300 - 3.79 + 4.00 - 1.8 - 1.8 + 21 + 21 + 21 -Xlint:-path -Xdoclint:none @@ -123,7 +124,7 @@ 3.1.0 - 3.8.0 + 3.13.0 3.1.1 @@ -149,11 +150,12 @@ 3.0.1 - 2.22.1 + 3.2.5 3.0.0 - 4.1 + 14.5 + 1.7.4 2.0.0 @@ -163,7 +165,7 @@ 2.7 - 3.0.0-M2 + 3.5.0 @@ -245,31 +247,31 @@ ${project.version} - + org.janelia.workstation - common-gui + woodstoxlib ${project.version} - + org.janelia.workstation - core + common-gui ${project.version} - + org.janelia.workstation - jogl213lib + core ${project.version} - + org.janelia.workstation - jogl224lib + jogl260lib ${project.version} @@ -653,21 +655,10 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin ${janeliaws.nbm-maven-plugin.version} true - - - - org.apache.maven.shared - maven-dependency-analyzer - 1.11.1 - - org.apache.maven.plugins @@ -722,7 +713,11 @@ - + + org.panteleyev + jpackage-maven-plugin + ${janeliaws.jpackage-maven-plugin.version} + org.apache.maven.plugins maven-jarsigner-plugin @@ -823,12 +818,81 @@ maven-compiler-plugin ${janeliaws.javac.debug} - ${janeliaws.javac.optimize} - ${janeliaws.javac.source} - ${janeliaws.javac.target} + ${maven.compiler.release} ${janeliaws.javac.showDeprecation} ${janeliaws.javac.showWarnings} ${janeliaws.javac.fork} + + + org.netbeans.api + org-netbeans-api-annotations-common + ${netbeans.version} + + + org.netbeans.api + org-netbeans-modules-options-api + ${netbeans.version} + + + org.netbeans.api + org-netbeans-modules-settings + ${netbeans.version} + + + org.netbeans.api + org-openide-awt + ${netbeans.version} + + + org.netbeans.api + org-openide-filesystems + ${netbeans.version} + + + org.netbeans.api + org-openide-loaders + ${netbeans.version} + + + org.netbeans.api + org-openide-modules + ${netbeans.version} + + + org.netbeans.api + org-openide-nodes + ${netbeans.version} + + + org.netbeans.api + org-openide-util + ${netbeans.version} + + + org.netbeans.api + org-openide-util-lookup + ${netbeans.version} + + + org.netbeans.api + org-openide-windows + ${netbeans.version} + + + + org.netbeans.api.annotations.common.proc.StaticResourceProcessor + org.netbeans.modules.options.OptionsPanelControllerProcessor + org.netbeans.modules.settings.convertors.ConvertorProcessor + org.netbeans.modules.openide.awt.ActionProcessor + org.netbeans.modules.openide.filesystems.declmime.MIMEResolverProcessor + org.netbeans.modules.openide.loaders.DataObjectFactoryProcessor + org.netbeans.modules.openide.modules.PatchedPublicProcessor + org.netbeans.modules.openide.nodes.NodesAnnotationProcessor + org.netbeans.modules.openide.util.NbBundleProcessor + org.netbeans.modules.openide.util.NamedServiceProcessor + org.netbeans.modules.openide.util.ServiceProviderProcessor + org.netbeans.modules.openide.windows.TopComponentProcessor + ${janeliaws.javac.xlint} ${janeliaws.javac.doclint} @@ -875,7 +939,7 @@ - org.codehaus.mojo + org.apache.netbeans.utilities nbm-maven-plugin true @@ -891,15 +955,7 @@ true Janelia Open Source License license.txt - - - ${clusterName} - false - true - true - true - - warn @@ -957,6 +1013,10 @@ 3.2 + + [21,) + This project requires at least JDK 21 (Apache NetBeans RELEASE300 does not support older JDKs). + @@ -1180,11 +1240,11 @@ modules/AdministrationGUI + modules/WoodstoxLib modules/CommonLibraries modules/IntegrationAPIs modules/Core modules/CommonGUI - modules/DarculaLAF modules/DataBrowser modules/LMDataBrowser modules/ColorDepthSearch @@ -1196,8 +1256,7 @@ modules/GLViewerTools modules/Geometry3d modules/SceneWindow - modules/Jogl213Lib - modules/Jogl224Lib + modules/Jogl260Lib modules/branding modules/N5Viewer