public class CacheComponent extends JPanel implements ActionListener, CacheListener, ChangeListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private Cache |
cache
The cache that this component controls.
|
private 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 JComboBox[] |
order
Combo boxes for choosing planar ordering.
|
protected static int[] |
ORDER_VALUES |
protected static String[] |
ORDERS |
protected static String[] |
PRIORITIES |
private JComboBox[] |
priority
Combo boxes for choosing axis priority.
|
protected static int[] |
PRIORITY_VALUES |
private JSpinner[] |
range
Spinners for choosing range of slices to cache.
|
protected static Class[] |
SOURCE_PARAMS |
protected static Class[] |
SOURCE_VALUES |
private JComboBox |
sourceChooser
Combo box for choosing cache source.
|
protected static String[] |
SOURCES |
protected static String[] |
STRATEGIES |
protected static Class[] |
STRATEGY_PARAMS |
protected static Class[] |
STRATEGY_VALUES |
private 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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
CacheComponent(Cache cache,
String[] axisLabels)
Creates a cache GUI component.
|
CacheComponent(Cache cache,
String[] axisLabels,
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(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(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 String[] SOURCES
protected static final Class[] SOURCE_VALUES
protected static final Class[] SOURCE_PARAMS
protected static final String[] STRATEGIES
protected static final Class[] STRATEGY_VALUES
protected static final Class[] STRATEGY_PARAMS
protected static final String[] PRIORITIES
protected static final int[] PRIORITY_VALUES
protected static final String[] ORDERS
protected static final int[] ORDER_VALUES
private Cache cache
private JComboBox sourceChooser
private JComboBox strategyChooser
private JSpinner[] range
private JComboBox[] priority
private JComboBox[] order
private String id
private int[] lengths
public CacheComponent(Cache cache, String[] axisLabels)
public Cache getCache()
public void dispose()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void cacheUpdated(CacheEvent e)
cacheUpdated
in interface CacheListener
public void stateChanged(ChangeEvent e)
stateChanged
in interface 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