Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tferr committed Nov 4, 2024
1 parent 84908a2 commit 03e9999
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 784 deletions.
5 changes: 2 additions & 3 deletions src/main/java/sc/fiji/snt/FillManagerUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import java.util.stream.IntStream;

import javax.swing.*;
import javax.swing.border.BevelBorder;

import ij.ImagePlus;
import net.imagej.ImageJ;
Expand Down Expand Up @@ -308,8 +307,8 @@ private JPanel statusPanel() {
statusPanel.setLayout(new BorderLayout());
statusPanel.setBorder(BorderFactory.createEmptyBorder(STATUS_MARGIN, STATUS_MARGIN, STATUS_MARGIN, STATUS_MARGIN));
statusText = new JLabel("Loading Fill Manager...");
statusText.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED),
BorderFactory.createEmptyBorder(STATUS_MARGIN, STATUS_MARGIN, STATUS_MARGIN, STATUS_MARGIN)));
statusText.setBorder(BorderFactory.createEmptyBorder(SNTUI.InternalUtils.MARGIN * 3,
SNTUI.InternalUtils.MARGIN * 2, SNTUI.InternalUtils.MARGIN * 2, 0));
statusPanel.add(statusText, BorderLayout.CENTER);
startFill = GuiUtils.smallButton("Start");
startFill.addActionListener(this);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/sc/fiji/snt/SNTUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

import javax.swing.Timer;
import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeListener;
import java.awt.*;
Expand Down Expand Up @@ -2228,8 +2227,7 @@ private JPanel statusPanel() {
final JPanel statusPanel = new JPanel();
statusPanel.setLayout(new BorderLayout());
statusText = new JLabel("Loading SNT...");
statusText.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED),
BorderFactory.createEmptyBorder(InternalUtils.MARGIN, InternalUtils.MARGIN, InternalUtils.MARGIN, InternalUtils.MARGIN)));
statusText.setBorder(BorderFactory.createEmptyBorder(InternalUtils.MARGIN * 2, InternalUtils.MARGIN * 2, InternalUtils.MARGIN * 2, 0));
statusPanel.add(statusText, BorderLayout.CENTER);
statusPanel.add(statusButtonPanel(), BorderLayout.SOUTH);
statusPanel.setBorder(BorderFactory.createEmptyBorder(InternalUtils.MARGIN, InternalUtils.MARGIN, InternalUtils.MARGIN * InternalUtils.MARGIN, InternalUtils.MARGIN));
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/sc/fiji/snt/gui/GuiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,15 @@ protected void paintComponent(final java.awt.Graphics g) {
}
}

public static Color getSelectionColor() {
try {
return UIManager.getColor("Tree.selectionBackground");
}
catch (final Exception ignored) {
return new Color(75, 110, 175);
}
}

public static Color getDisabledComponentColor() {
try {
return UIManager.getColor("MenuItem.disabledForeground");
Expand Down
Loading

0 comments on commit 03e9999

Please sign in to comment.