Package gov.nih.mipav.view
Class JPanelChecklist
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gov.nih.mipav.view.JPanelChecklist
- All Implemented Interfaces:
ActionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
- Direct Known Subclasses:
JPanelAnonymizeImage,JPanelStatisticsList
Creates a JPanel to hold a scrolling list of checkboxes. Extending class must include implementation of the method
makeCheckBoxList().- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]must be same size as listLength.protected JCheckBox[]DOCUMENT ME!protected JPanelDOCUMENT ME!protected JButtonDOCUMENT ME!protected JPanelDOCUMENT ME!protected boolean[]the list of the choices that can be selected.protected intmust be given a nonzero number on instantiation. must be of same size as checkboxLabels.protected boolean[]notice that for the next two lists, ith entry on one corresponds to the ith entry on the other. the entire list of choices possible.protected JScrollPaneDOCUMENT ME!private static final longUse serialVersionUID for interoperability.protected JButtonDOCUMENT ME!Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionConstructor to build a panel allowing user to find which tags are available to anonymize. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Closes dialog box when the OK button is pressed and does the routine.voidDOCUMENT ME!intDOCUMENT ME!intDOCUMENT ME!String[]Returns a new list of the tag names of all checkboxes selected.intThis method finds the number of checked checkboxes in the list.intThis method finds the number of enabled checkboxes in the list.intDOCUMENT ME!boolean[]Returns a new list of all checkboxes selected.booleangetSelectedList(int i) Returns whether or not a particular checkbox has been selected.booleangetSelectedList(String label) Returns whether or not a particular checkbox has been selected.boolean[]Gets the values of which boxes are visible.intDOCUMENT ME!protected abstract String[]Creates the list of labels to use in the checkboxes.protected JCheckBox[]Builds all checkboxes; prepare for this step by having an array of Strings with the names to use.protected ContainerBuilds the display of the container which holds the display of checkboxes.protected JPanelBuilds the panel with the invalid input: '"check' all"/"uncheck all" buttons.voidDOCUMENT ME!voidSet the checkboxes to be clickable.voidsetCheckBoxesEnabled(int i, boolean enabled) Set the checkboxes to be clickable.voidsetCheckBoxesEnabled(String label, boolean enabled) Set the checkboxes to be clickable.voidsetEnabledList(boolean isSet) Sets whether or not all checkboxes are enabled.voidsetEnabledList(boolean[] list) Sets the boxes which are enabled.voidsetEnabledList(int i, boolean visible) Sets a particular box which to be visible.booleansetEnabledList(String label, boolean visible) Sets a particular box which to be visible by specifying the name of the label.protected abstract voidAbstract to ensure the variablelistLengthhas a value.voidsetSelectedList(boolean isSet) Sets whether or not aall checkboxes have been selected.voidsetSelectedList(boolean[] _list) Set the the checkbox list from the script dialog.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
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, updateMethods inherited from class java.awt.Container
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, validateTreeMethods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
checkboxLabels
must be same size as listLength. -
checkboxList
DOCUMENT ME! -
checkboxPanel
DOCUMENT ME! -
checkButton
DOCUMENT ME! -
chkUnchkPanel
DOCUMENT ME! -
listLength
protected int listLengthmust be given a nonzero number on instantiation. must be of same size as checkboxLabels. -
removeList
protected boolean[] removeListnotice that for the next two lists, ith entry on one corresponds to the ith entry on the other. the entire list of choices possible. -
scrollPane
DOCUMENT ME! -
unCheckButton
DOCUMENT ME! -
enabledList
protected boolean[] enabledListthe list of the choices that can be selected.
-
-
Constructor Details
-
JPanelChecklist
public JPanelChecklist()Constructor to build a panel allowing user to find which tags are available to anonymize.By defualt, sets all checkboxes to enabled. To set the checkboxes to image-specific enabled, use setDicomInfo.
- See Also:
-
-
Method Details
-
actionPerformed
Closes dialog box when the OK button is pressed and does the routine.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
event- event that triggers function
-
buildLayout
public void buildLayout()DOCUMENT ME! -
getCheckboxLength
public int getCheckboxLength()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getListLength
public int getListLength()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getNameList
Returns a new list of the tag names of all checkboxes selected.- Returns:
- String[] array of tag names
-
getNumberSelected
public int getNumberSelected()This method finds the number of checked checkboxes in the list.- Returns:
- int numChecked
-
getNumberVisible
public int getNumberVisible()This method finds the number of enabled checkboxes in the list.- Returns:
- int numChecked
-
getRemoveLength
public int getRemoveLength()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getSelectedList
public boolean[] getSelectedList()Returns a new list of all checkboxes selected.- Returns:
- boolean[] array containing selection status
-
getSelectedList
public boolean getSelectedList(int i) Returns whether or not a particular checkbox has been selected.- Parameters:
i- the index of the checkbox in question- Returns:
- boolean status of checkbox
-
getSelectedList
Returns whether or not a particular checkbox has been selected.- Parameters:
label- the text of the checkbox that we wish to know about.- Returns:
- boolean status of checkbox
- Throws:
IllegalArgumentException- is thrown whenlabelis is not found in the list of check boxes.
-
getVisible
public boolean[] getVisible()Gets the values of which boxes are visible.- Returns:
- boolean[] visibleTags
-
getVisibleLength
public int getVisibleLength()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
setBorder
DOCUMENT ME!- Parameters:
title- DOCUMENT ME!
-
setCheckBoxesEnabled
public void setCheckBoxesEnabled()Set the checkboxes to be clickable. Only useful in applications where the tags which are available to be used are known before-hand.The visible tags must be set first.
-
setCheckBoxesEnabled
public void setCheckBoxesEnabled(int i, boolean enabled) Set the checkboxes to be clickable. Only useful in applications where the tags which are availble to be used are known before-hand.The visible tags must be set first.
- Parameters:
i- the index of the checkbox in questionenabled- DOCUMENT ME!
-
setCheckBoxesEnabled
Set the checkboxes to be clickable. Only useful in applications where the tags which are availble to be used are known before-hand.The visible tags must be set first.
- Parameters:
label- the text of the checkbox in questionenabled- DOCUMENT ME!- Throws:
IllegalArgumentException- is thrown whenlabelis not found in any of the checkboxes
-
setSelectedList
public void setSelectedList(boolean[] _list) Set the the checkbox list from the script dialog.- Parameters:
_list- checkbox select list array
-
setSelectedList
public void setSelectedList(boolean isSet) Sets whether or not aall checkboxes have been selected.- Parameters:
isSet- the preselected value of all checkboxes in the list.- Throws:
NullPointerException- if no checkboxes exist when called- See Also:
-
setEnabledList
public void setEnabledList(boolean[] list) Sets the boxes which are enabled.- Parameters:
list- DOCUMENT ME!
-
setEnabledList
public void setEnabledList(boolean isSet) Sets whether or not all checkboxes are enabled.- Parameters:
isSet- the preselected value of all checkboxes in the list.- Throws:
NullPointerException- if no checkboxes exist when called- See Also:
-
setEnabledList
public void setEnabledList(int i, boolean visible) Sets a particular box which to be visible.- Parameters:
i- the index of the checkbox in questionvisible- whether the checkbox should be enabled
-
setEnabledList
Sets a particular box which to be visible by specifying the name of the label.- Parameters:
visible- whether the checkbox should be enabledi- the index of the checkbox in question
-
makeCheckboxLabels
Creates the list of labels to use in the checkboxes.- Returns:
- DOCUMENT ME!
-
setListLength
protected abstract void setListLength()Abstract to ensure the variablelistLengthhas a value. -
makeCheckBoxList
Builds all checkboxes; prepare for this step by having an array of Strings with the names to use. CalledcheckboxLabelsone for each of the dicom tags that may be sanitized. Also sets the properties of all check boxes.- Returns:
- JCheckBox[] array of new check boxes
-
makeCheckContainer
Builds the display of the container which holds the display of checkboxes. This box can then be displayed anywhere.- Returns:
- Container the new container
-
makeCheckUncheckPanel
Builds the panel with the invalid input: '"check' all"/"uncheck all" buttons.- Returns:
- JPanel the new panel
-