public class CacheComponent extends javax.swing.JPanel implements java.awt.event.ActionListener, CacheListener, javax.swing.event.ChangeListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private Cache |
cache
The cache that this component controls.
|
private java.lang.String |
id
File name that the cache is working with (debugging only).
|
private int[] |
lengths
Length of each dimensional axis, obtained from cache strategy.
|
private static org.slf4j.Logger |
LOGGER |
private javax.swing.JComboBox[] |
order
Combo boxes for choosing planar ordering.
|
protected static int[] |
ORDER_VALUES |
protected static java.lang.String[] |
ORDERS |
protected static java.lang.String[] |
PRIORITIES |
private javax.swing.JComboBox[] |
priority
Combo boxes for choosing axis priority.
|
protected static int[] |
PRIORITY_VALUES |
private javax.swing.JSpinner[] |
range
Spinners for choosing range of slices to cache.
|
protected static java.lang.Class[] |
SOURCE_PARAMS |
protected static java.lang.Class[] |
SOURCE_VALUES |
private javax.swing.JComboBox |
sourceChooser
Combo box for choosing cache source.
|
protected static java.lang.String[] |
SOURCES |
protected static java.lang.String[] |
STRATEGIES |
protected static java.lang.Class[] |
STRATEGY_PARAMS |
protected static java.lang.Class[] |
STRATEGY_VALUES |
private javax.swing.JComboBox |
strategyChooser
Combo box for choosing cache strategy.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
CacheComponent(Cache cache,
java.lang.String[] axisLabels)
Creates a cache GUI component.
|
CacheComponent(Cache cache,
java.lang.String[] axisLabels,
java.lang.String id)
Creates a cache GUI component with the ability to change between the
various source types (mainly for debugging purposes).
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Handles combo box changes.
|
void |
cacheUpdated(CacheEvent e)
Updates GUI to match latest cache state.
|
void |
dispose() |
Cache |
getCache() |
private int |
orderIndex(int ord)
Converts enumerated order value to order chooser index.
|
private int |
orderValue(int index)
Converts order chooser index to enumerated order value.
|
private int |
priorityIndex(int prio)
Converts enumerated priority value to priority chooser index.
|
private int |
priorityValue(int index)
Converts priority chooser index to enumerated priority value.
|
private int |
sourceIndex(ICacheSource s)
Converts cache source to source chooser index.
|
private ICacheSource |
sourceValue(int index)
Generates a new cache source matching the source chooser index.
|
void |
stateChanged(javax.swing.event.ChangeEvent e)
Handles range spinner changes.
|
private int |
strategyIndex(ICacheStrategy s)
Converts cache strategy to strategy chooser index.
|
private ICacheStrategy |
strategyValue(int index)
Generates a new cache strategy matching the strategy chooser index.
|
private void |
updateOrder(int index)
Updates cache order to match the state of the GUI.
|
private void |
updatePriority(int index)
Updates cache priority to match the state of the GUI.
|
private void |
updateRange(int index)
Updates cache range to match the state of the GUI.
|
private void |
updateSource()
Updates cache source to match the state of the GUI.
|
private void |
updateStrategy()
Updates cache strategy to match the state of the GUI.
|
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
private static final org.slf4j.Logger LOGGER
protected static final java.lang.String[] SOURCES
protected static final java.lang.Class[] SOURCE_VALUES
protected static final java.lang.Class[] SOURCE_PARAMS
protected static final java.lang.String[] STRATEGIES
protected static final java.lang.Class[] STRATEGY_VALUES
protected static final java.lang.Class[] STRATEGY_PARAMS
protected static final java.lang.String[] PRIORITIES
protected static final int[] PRIORITY_VALUES
protected static final java.lang.String[] ORDERS
protected static final int[] ORDER_VALUES
private Cache cache
private javax.swing.JComboBox sourceChooser
private javax.swing.JComboBox strategyChooser
private javax.swing.JSpinner[] range
private javax.swing.JComboBox[] priority
private javax.swing.JComboBox[] order
private java.lang.String id
private int[] lengths
public CacheComponent(Cache cache, java.lang.String[] axisLabels)
public CacheComponent(Cache cache, java.lang.String[] axisLabels, java.lang.String id)
public Cache getCache()
public void dispose()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void cacheUpdated(CacheEvent e)
cacheUpdated
in interface CacheListener
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
private void updateSource()
private void updateStrategy()
private void updateRange(int index)
private void updatePriority(int index)
private void updateOrder(int index)
private int sourceIndex(ICacheSource s)
private ICacheSource sourceValue(int index)
private int strategyIndex(ICacheStrategy s)
private ICacheStrategy strategyValue(int index)
private int priorityIndex(int prio)
private int priorityValue(int index)
private int orderIndex(int ord)
private int orderValue(int index)
Copyright © 2017 Open Microscopy Environment