public class Series_Labeler extends Object implements ij.plugin.filter.ExtendedPlugInFilter, DialogListener, ij.ImageListener
Modifier and Type | Class and Description |
---|---|
protected class |
Series_Labeler.AbstractStampFormat
A class representing a supported label format
It relates supported format units/suffixes to a format
name.
|
protected class |
Series_Labeler.CustomLabelFormat
Represents a label format that is essentially the same as a decimal
format, but allows custom suffixes.
|
protected class |
Series_Labeler.DecimalLabelFormat
Represents a decimal label format, e.
|
protected class |
Series_Labeler.DigitalLabelFormat
Represents a digital label format, e.
|
protected class |
Series_Labeler.ExtendedFonts
This class extends Fonts so we can listen to the changes in the
imageJ fonts GUI that we reuse for font settings
and update the preview accordingly.
|
protected class |
Series_Labeler.FontPropertiesPanel
Class for a panel containing several font manipulation items.
|
protected class |
Series_Labeler.StackType
A class representing a type of stack.
|
protected class |
Series_Labeler.TimeStackType |
protected class |
Series_Labeler.ZStackType |
Modifier and Type | Field and Description |
---|---|
protected static boolean |
antiAliasedText |
protected static boolean |
backgroundEnabled |
protected boolean |
canceled |
protected static String |
chosenSuffix |
protected int |
currentSlice |
protected static int |
CUSTOM |
protected static String |
customFormat |
protected static boolean |
customIntervalEntered |
protected Panel |
customLabelFormatPanel |
protected static String |
customSuffix |
protected Panel |
customSuffixPanel |
protected static boolean |
customUnitSelected |
protected static int |
decimalPlaces |
protected Panel |
decimalPlacesPanel |
protected static int |
first |
protected int |
flags |
protected static Font |
font |
protected Panel |
fontPropertiesContainer |
protected Choice |
formatsComboBox |
protected int |
frame |
protected static int |
frameMask |
protected GenericDialog |
gd |
protected Panel |
generalSettingsContainer |
protected ij.ImagePlus |
imp |
protected static double |
interval |
protected TextField |
intervalTextField |
protected Choice |
labelUnitsComboBox |
protected Panel |
labelUnitsPanel |
protected static int |
last |
protected Panel |
locationFontContainer |
protected static int |
locationPreset |
protected Choice |
locationPresetsComboBox |
protected static String[] |
locations |
protected TextField |
locationXTextField |
protected TextField |
locationYTextField |
protected static int |
LOWER_LEFT |
protected static int |
LOWER_RIGHT |
protected ij.plugin.filter.PlugInFilterRunner |
pluginFilterRunner |
protected static String |
PREF_KEY |
protected boolean |
preview |
protected boolean |
previewCheckState |
protected static Series_Labeler.AbstractStampFormat |
selectedFormat |
protected static Series_Labeler.StackType |
selectedStackType |
protected Series_Labeler.AbstractStampFormat[] |
spectralFormats |
protected Series_Labeler.StackType[] |
stackTypes |
protected static double |
start |
protected Panel |
startStopIntervalsContainer |
protected TextField |
suffixTextField |
protected Series_Labeler.AbstractStampFormat[] |
timeFormats |
protected Panel |
unitsFormattingContainer |
protected static int |
UPPER_LEFT |
protected static int |
UPPER_RIGHT |
protected static int |
x |
protected static int |
y |
protected Series_Labeler.AbstractStampFormat[] |
zFormats |
CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, KEEP_THRESHOLD, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, NO_UNDO_RESET, PARALLELIZE_IMAGES, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING
Constructor and Description |
---|
Series_Labeler() |
Modifier and Type | Method and Description |
---|---|
protected void |
addPanelIntoDialog(Panel container)
The container Panel is added to the generic dialog.
|
protected void |
addPanelsToDialog(Panel container,
Panel[] panels)
Adds different Panels to a container Panel.
|
protected String[] |
convertFormatsToStrings(Series_Labeler.AbstractStampFormat[] formats)
Creates a string array out of the names of the available formats.
|
protected String[] |
convertStackTypesToStrings(Series_Labeler.StackType[] types)
Creates a string array out of the names of the available formats.
|
protected Panel |
createComboBoxPanel(String labelText,
String[] values,
int defaultIndex)
drop down selection with a text label
|
protected Panel |
createComboBoxPanel(String labelText,
String[] values,
int defaultIndex,
int labelWidth,
int comboboxWidth)
generate gd drop down selections for use in a
different container later
|
protected Panel |
createContainerPanel(int height,
String label)
container panel for gui items to be put in, with a border.
|
protected Panel |
createContainerPanel(int height,
String label,
boolean border)
container panel for gui items to be put in.
|
protected Component |
createMessage(String labelText)
generate gd message for use in a different container later.
|
protected Panel |
createNumericFieldPanel(String labelText,
double defaultValue,
int digits)
A numeric field for the GUI
|
protected Panel |
createNumericFieldPanel(String labelText,
double defaultValue,
int digits,
int labelWidth,
int textFieldWidth)
Generates gd awt numeric fields for use in a
different container later
|
protected Panel |
createTextFieldPanel(String labelText,
String defaultText)
This is a text field panel for use in the GUI
|
protected Panel |
createTextFieldPanel(String labelText,
String defaultText,
int labelWidth,
int textFieldWidth)
Generates gd awt string fields for use in a
different container later
|
boolean |
dialogItemChanged(GenericDialog gd,
AWTEvent e)
This method deals with changes the user makes in the GUI
|
void |
imageClosed(ij.ImagePlus imp) |
void |
imageOpened(ij.ImagePlus imp) |
void |
imageUpdated(ij.ImagePlus imp) |
void |
run(ij.process.ImageProcessor ip)
Run the plug-in on the ip object, which is the ImageProcessor object
associated with the open/selected image.
|
protected void |
selectCustomFormat()
A method for selecting the custom unit format
of the currently selected stack type.
|
void |
setNPasses(int nPasses)
This is part of the preview functionality.
|
int |
setup(String arg,
ij.ImagePlus imp)
Setup the plug-in and tell ImageJ it needs to work on
a stack by returning the flags
|
int |
showDialog(ij.ImagePlus imp,
String command,
ij.plugin.filter.PlugInFilterRunner pfr)
Make the GUI for the plug-in, with fields to fill all
the variables we need.
|
protected void |
updatePreview()
Updates the label preview.
|
protected void |
updateUI()
Shows and Hides relevant GUI components,
based on the current state of the selected label format.
|
protected static String PREF_KEY
protected static int x
protected static int y
protected static Font font
protected static double start
protected static double interval
protected static String customSuffix
protected static String chosenSuffix
protected static int decimalPlaces
protected static String customFormat
protected static boolean antiAliasedText
protected static int first
protected static int last
protected static int frameMask
protected static boolean backgroundEnabled
protected static Series_Labeler.AbstractStampFormat selectedFormat
protected static Series_Labeler.StackType selectedStackType
protected static int locationPreset
protected ij.ImagePlus imp
protected boolean canceled
protected boolean preview
protected boolean previewCheckState
protected int frame
protected int currentSlice
protected ij.plugin.filter.PlugInFilterRunner pluginFilterRunner
protected int flags
protected GenericDialog gd
protected static final String[] locations
protected static final int UPPER_RIGHT
protected static final int LOWER_RIGHT
protected static final int LOWER_LEFT
protected static final int UPPER_LEFT
protected static final int CUSTOM
protected final Series_Labeler.AbstractStampFormat[] timeFormats
protected final Series_Labeler.AbstractStampFormat[] zFormats
protected final Series_Labeler.AbstractStampFormat[] spectralFormats
protected final Series_Labeler.StackType[] stackTypes
protected Choice labelUnitsComboBox
protected Choice formatsComboBox
protected Choice locationPresetsComboBox
protected Panel generalSettingsContainer
protected Panel unitsFormattingContainer
protected Panel startStopIntervalsContainer
protected Panel locationFontContainer
protected Panel fontPropertiesContainer
protected TextField locationXTextField
protected TextField locationYTextField
protected TextField intervalTextField
protected TextField suffixTextField
protected Panel labelUnitsPanel
protected Panel customSuffixPanel
protected Panel customLabelFormatPanel
protected Panel decimalPlacesPanel
protected static boolean customIntervalEntered
protected static boolean customUnitSelected
public int setup(String arg, ij.ImagePlus imp)
setup
in interface ij.plugin.filter.PlugInFilter
public int showDialog(ij.ImagePlus imp, String command, ij.plugin.filter.PlugInFilterRunner pfr)
showDialog
in interface ij.plugin.filter.ExtendedPlugInFilter
public void setNPasses(int nPasses)
setNPasses
in interface ij.plugin.filter.ExtendedPlugInFilter
public void run(ij.process.ImageProcessor ip)
run
in interface ij.plugin.filter.PlugInFilter
protected Panel createContainerPanel(int height, String label, boolean border)
protected Panel createContainerPanel(int height, String label)
protected Panel createComboBoxPanel(String labelText, String[] values, int defaultIndex)
protected Panel createComboBoxPanel(String labelText, String[] values, int defaultIndex, int labelWidth, int comboboxWidth)
protected Component createMessage(String labelText)
protected Panel createTextFieldPanel(String labelText, String defaultText)
protected Panel createTextFieldPanel(String labelText, String defaultText, int labelWidth, int textFieldWidth)
protected Panel createNumericFieldPanel(String labelText, double defaultValue, int digits)
protected Panel createNumericFieldPanel(String labelText, double defaultValue, int digits, int labelWidth, int textFieldWidth)
protected void selectCustomFormat()
protected void addPanelsToDialog(Panel container, Panel[] panels)
protected void addPanelIntoDialog(Panel container)
protected void updatePreview()
protected void updateUI()
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e)
dialogItemChanged
in interface DialogListener
public void imageClosed(ij.ImagePlus imp)
imageClosed
in interface ij.ImageListener
public void imageOpened(ij.ImagePlus imp)
imageOpened
in interface ij.ImageListener
public void imageUpdated(ij.ImagePlus imp)
imageUpdated
in interface ij.ImageListener
protected String[] convertFormatsToStrings(Series_Labeler.AbstractStampFormat[] formats)
protected String[] convertStackTypesToStrings(Series_Labeler.StackType[] types)
Copyright © 2015–2021 Fiji. All rights reserved.