public class OverlayWidget extends JPanel implements ActionListener, DocumentListener, ListSelectionListener, Runnable, TransformListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected ButtonGroup |
buttonGroup
Button group ensuring only one tool can be selected at a time.
|
protected Vector |
buttons
List of buttons for each overlay tool.
|
protected JButton |
chooseFont
Button for bringing up font chooser.
|
protected JButton |
color
Button for choosing overlay color.
|
protected JButton |
copy
Button for copying selected overlays to the clipboard.
|
protected JTextField |
currentFont
Text field indicating current font.
|
protected JButton |
dist
Button for distributing an overlay across all positions between the copied
position and the one selected.
|
protected JButton |
export
Button for exporting overlays to .xls on disk.
|
protected JCheckBox |
filled
Check box indicating whether overlay should be filled or hollow.
|
protected BioComboBox |
groupList
Combo box for selecting an overlay group.
|
protected boolean |
ignoreEvents
Flag indicating AWT/Swing events should be ignored, used for programmatic
update of GUI components.
|
protected JButton |
load
Button for loading overlays from disk.
|
protected boolean |
needRefresh
Flag indicating widget components need to be refreshed.
|
protected JButton |
newGroup
Button for creating a new overlay group.
|
protected JTextField |
notes
Text field for miscellaneous notes.
|
protected OverlayTransform |
overlay
Associated overlay object.
|
protected JList |
overlayList
List of overlays.
|
protected DefaultListModel |
overlayListModel
List model for overlay list.
|
protected JFileChooser |
overlayLoadBox
File chooser for loading overlays.
|
protected JFileChooser |
overlaySaveBox
File chooser for saving overlays.
|
protected JFileChooser |
overlayXLSBox
File chooser for exporting overlays to .xls format.
|
protected JButton |
paste
Button for pasting copied overlays onto the current position.
|
protected Timer |
refreshTimer
Timer for refreshing widget components 5 times per second.
|
protected JButton |
remove
Button for removing selected overlays.
|
protected JButton |
save
Button for saving overlays to disk.
|
protected JTextArea |
stats
Text area for overlay statistics.
|
protected JTextField |
text
Text field for text labels.
|
protected Vector |
tools
List of overlay tools.
|
protected JTextField |
x1
Text fields for (X, Y) coordinate pairs.
|
protected JTextField |
x2
Text fields for (X, Y) coordinate pairs.
|
protected JTextField |
y1
Text fields for (X, Y) coordinate pairs.
|
protected JTextField |
y2
Text fields for (X, Y) coordinate pairs.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
OverlayWidget(OverlayTransform overlay)
Creates overlay GUI controls.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Handles button presses.
|
void |
addTool(OverlayTool tool)
Adds the given overlay tool to the overlay widget.
|
void |
changedUpdate(DocumentEvent e) |
protected void |
displayErrorMessage(String message)
Displays an error message.
|
void |
documentUpdate(DocumentEvent e)
Handles text field changes.
|
Color |
getActiveColor()
Gets currently active overlay color.
|
String |
getActiveGroup()
Gets currently active overlay group.
|
OverlayTool |
getActiveTool()
Gets the currently selected overlay tool.
|
String |
getNotes()
Gets notes for current overlay.
|
String |
getStatistics()
Gets statistics for current overlay.
|
String |
getText()
Gets text string for current overlay.
|
float |
getX1()
Gets X1 coordinate value for current overlay.
|
float |
getX2()
Gets X2 coordinate value for current overlay.
|
float |
getY1()
Gets Y1 coordinate value for current overlay.
|
float |
getY2()
Gets Y2 coordinate value for current overlay.
|
void |
insertUpdate(DocumentEvent e) |
boolean |
isFilled()
Gets whether current overlay is filled.
|
protected void |
launchSpreadsheet(File file)
Launches the spreadsheet.
|
protected void |
notifyListeners(boolean updateGUI)
Sends a TransformEvent to the overlay transform's listeners.
|
protected void |
refreshCurrentFont()
Sets the font text field to reflect the currently chosen font.
|
void |
refreshListObjects()
Updates items on overlay list based on current transform state.
|
void |
refreshListSelection()
Updates overlay list's selection based on current transform state.
|
void |
refreshPasteComponent(boolean enabled)
Updates copy and paste widget components to display data relevant to
currently selected overlays.
|
void |
refreshWidgetComponents()
Updates right-hand widget components to display data relevant to currently
selected overlays.
|
void |
removeUpdate(DocumentEvent e) |
void |
run()
Refreshes the list selection.
|
void |
setActiveColor(Color c)
Sets currently active overlay color.
|
void |
setActiveGroup(String group)
Sets currently active overlay group.
|
void |
setFilled(boolean fill)
Sets whether current overlay is filled.
|
void |
setNotes(String newText)
Sets notes for current overlay.
|
void |
setStatistics(String newText)
Sets statistics for current overlay.
|
void |
transformChanged(TransformEvent e)
Handles font changes.
|
void |
valueChanged(ListSelectionEvent e)
Handles list selection changes.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected OverlayTransform overlay
protected ButtonGroup buttonGroup
protected Vector tools
protected Vector buttons
protected Timer refreshTimer
protected boolean needRefresh
protected boolean ignoreEvents
protected JFileChooser overlaySaveBox
protected JFileChooser overlayLoadBox
protected JFileChooser overlayXLSBox
protected JTextField currentFont
protected JButton chooseFont
protected JList overlayList
protected DefaultListModel overlayListModel
protected JButton remove
protected JButton copy
protected JButton paste
protected JButton dist
protected JButton load
protected JButton save
protected JButton export
protected JTextField x1
protected JTextField y1
protected JTextField x2
protected JTextField y2
protected JTextField text
protected JButton color
protected JCheckBox filled
protected BioComboBox groupList
protected JButton newGroup
protected JTextField notes
protected JTextArea stats
public OverlayWidget(OverlayTransform overlay)
public void addTool(OverlayTool tool)
public OverlayTool getActiveTool()
public float getX1()
public float getY1()
public float getX2()
public float getY2()
public String getText()
public void setActiveColor(Color c)
public Color getActiveColor()
public void setFilled(boolean fill)
public boolean isFilled()
public void setActiveGroup(String group)
public String getActiveGroup()
public void setNotes(String newText)
public String getNotes()
public void setStatistics(String newText)
public String getStatistics()
public void refreshListObjects()
public void refreshListSelection()
public void refreshWidgetComponents()
public void refreshPasteComponent(boolean enabled)
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void changedUpdate(DocumentEvent e)
changedUpdate
in interface DocumentListener
public void insertUpdate(DocumentEvent e)
insertUpdate
in interface DocumentListener
public void removeUpdate(DocumentEvent e)
removeUpdate
in interface DocumentListener
public void documentUpdate(DocumentEvent e)
public void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
public void transformChanged(TransformEvent e)
transformChanged
in interface TransformListener
protected void refreshCurrentFont()
protected void notifyListeners(boolean updateGUI)
protected void launchSpreadsheet(File file)
protected void displayErrorMessage(String message)
Copyright © 2015–2022 SciJava. All rights reserved.