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:
java.awt.event.ActionListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
- Direct Known Subclasses:
JPanelAnonymizeImage
,JPanelStatisticsList
public abstract class JPanelChecklist extends javax.swing.JPanel implements java.awt.event.ActionListener
Creates a JPanel to hold a scrolling list of checkboxes. Extending class must include implementation of the methodmakeCheckBoxList()
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
checkboxLabels
must be same size as listLength.protected javax.swing.JCheckBox[]
checkboxList
DOCUMENT ME!protected javax.swing.JPanel
checkboxPanel
DOCUMENT ME!protected javax.swing.JButton
checkButton
DOCUMENT ME!protected javax.swing.JPanel
chkUnchkPanel
DOCUMENT ME!protected boolean[]
enabledList
the list of the choices that can be selected.protected int
listLength
must be given a nonzero number on instantiation. must be of same size as checkboxLabels.protected boolean[]
removeList
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 javax.swing.JScrollPane
scrollPane
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.protected javax.swing.JButton
unCheckButton
DOCUMENT 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_WINDOW
-
-
Constructor Summary
Constructors Constructor Description JPanelChecklist()
Constructor to build a panel allowing user to find which tags are available to anonymize.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent event)
Closes dialog box when the OK button is pressed and does the routine.void
buildLayout()
DOCUMENT ME!int
getCheckboxLength()
DOCUMENT ME!int
getListLength()
DOCUMENT ME!java.lang.String[]
getNameList()
Returns a new list of the tag names of all checkboxes selected.int
getNumberSelected()
This method finds the number of checked checkboxes in the list.int
getNumberVisible()
This method finds the number of enabled checkboxes in the list.int
getRemoveLength()
DOCUMENT ME!boolean[]
getSelectedList()
Returns a new list of all checkboxes selected.boolean
getSelectedList(int i)
Returns whether or not a particular checkbox has been selected.boolean
getSelectedList(java.lang.String label)
Returns whether or not a particular checkbox has been selected.boolean[]
getVisible()
Gets the values of which boxes are visible.int
getVisibleLength()
DOCUMENT ME!protected abstract java.lang.String[]
makeCheckboxLabels()
Creates the list of labels to use in the checkboxes.protected javax.swing.JCheckBox[]
makeCheckBoxList()
Builds all checkboxes; prepare for this step by having an array of Strings with the names to use.protected java.awt.Container
makeCheckContainer()
Builds the display of the container which holds the display of checkboxes.protected javax.swing.JPanel
makeCheckUncheckPanel()
Builds the panel with the "check all"/"uncheck all" buttons.void
setBorder(java.lang.String title)
DOCUMENT ME!void
setCheckBoxesEnabled()
Set the checkboxes to be clickable.void
setCheckBoxesEnabled(int i, boolean enabled)
Set the checkboxes to be clickable.void
setCheckBoxesEnabled(java.lang.String label, boolean enabled)
Set the checkboxes to be clickable.void
setEnabledList(boolean isSet)
Sets whether or not all checkboxes are enabled.void
setEnabledList(boolean[] list)
Sets the boxes which are enabled.void
setEnabledList(int i, boolean visible)
Sets a particular box which to be visible.boolean
setEnabledList(java.lang.String label, boolean visible)
Sets a particular box which to be visible by specifying the name of the label.protected abstract void
setListLength()
Abstract to ensure the variablelistLength
has a value.void
setSelectedList(boolean isSet)
Sets whether or not aall checkboxes have been selected.void
setSelectedList(boolean[] _list)
Set the the checkbox list from the script dialog.-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods 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, update
-
Methods 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, validateTree
-
Methods 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 Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
checkboxLabels
protected java.lang.String[] checkboxLabels
must be same size as listLength.
-
checkboxList
protected javax.swing.JCheckBox[] checkboxList
DOCUMENT ME!
-
checkboxPanel
protected javax.swing.JPanel checkboxPanel
DOCUMENT ME!
-
checkButton
protected javax.swing.JButton checkButton
DOCUMENT ME!
-
chkUnchkPanel
protected javax.swing.JPanel chkUnchkPanel
DOCUMENT ME!
-
listLength
protected int listLength
must be given a nonzero number on instantiation. must be of same size as checkboxLabels.
-
removeList
protected boolean[] removeList
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.
-
scrollPane
protected javax.swing.JScrollPane scrollPane
DOCUMENT ME!
-
unCheckButton
protected javax.swing.JButton unCheckButton
DOCUMENT ME!
-
enabledList
protected boolean[] enabledList
the list of the choices that can be selected.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Closes dialog box when the OK button is pressed and does the routine.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- 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
public java.lang.String[] 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
public boolean getSelectedList(java.lang.String label)
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:
java.lang.IllegalArgumentException
- is thrown whenlabel
is 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
public void setBorder(java.lang.String title)
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
public void setCheckBoxesEnabled(java.lang.String label, 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:
label
- the text of the checkbox in questionenabled
- DOCUMENT ME!- Throws:
java.lang.IllegalArgumentException
- is thrown whenlabel
is 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:
java.lang.NullPointerException
- if no checkboxes exist when called- See Also:
getSelectedList()
-
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:
java.lang.NullPointerException
- if no checkboxes exist when called- See Also:
getSelectedList()
-
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
public boolean setEnabledList(java.lang.String label, boolean visible)
Sets a particular box which to be visible by specifying the name of the label.- Parameters:
i
- the index of the checkbox in questionvisible
- whether the checkbox should be enabled
-
makeCheckboxLabels
protected abstract java.lang.String[] makeCheckboxLabels()
Creates the list of labels to use in the checkboxes.- Returns:
- DOCUMENT ME!
-
setListLength
protected abstract void setListLength()
Abstract to ensure the variablelistLength
has a value.
-
makeCheckBoxList
protected javax.swing.JCheckBox[] makeCheckBoxList()
Builds all checkboxes; prepare for this step by having an array of Strings with the names to use. CalledcheckboxLabels
one 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
protected java.awt.Container 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
protected javax.swing.JPanel makeCheckUncheckPanel()
Builds the panel with the "check all"/"uncheck all" buttons.- Returns:
- JPanel the new panel
-
-