Class JPanelChecklist

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
JPanelAnonymizeImage, JPanelStatisticsList

public abstract class JPanelChecklist extends JPanel implements ActionListener
Creates a JPanel to hold a scrolling list of checkboxes. Extending class must include implementation of the method makeCheckBoxList().
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • checkboxLabels

      protected String[] checkboxLabels
      must be same size as listLength.
    • checkboxList

      protected JCheckBox[] checkboxList
      DOCUMENT ME!
    • checkboxPanel

      protected JPanel checkboxPanel
      DOCUMENT ME!
    • checkButton

      protected JButton checkButton
      DOCUMENT ME!
    • chkUnchkPanel

      protected 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 JScrollPane scrollPane
      DOCUMENT ME!
    • unCheckButton

      protected JButton unCheckButton
      DOCUMENT ME!
    • enabledList

      protected boolean[] enabledList
      the 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

      public void actionPerformed(ActionEvent event)
      Closes dialog box when the OK button is pressed and does the routine.
      Specified by:
      actionPerformed in interface 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 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(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:
      IllegalArgumentException - is thrown when label 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(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 question
      enabled - DOCUMENT ME!
    • setCheckBoxesEnabled

      public void setCheckBoxesEnabled(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 question
      enabled - DOCUMENT ME!
      Throws:
      IllegalArgumentException - is thrown when label 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:
      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 question
      visible - whether the checkbox should be enabled
    • setEnabledList

      public boolean setEnabledList(String label, boolean visible)
      Sets a particular box which to be visible by specifying the name of the label.
      Parameters:
      visible - whether the checkbox should be enabled
      i - the index of the checkbox in question
    • makeCheckboxLabels

      protected abstract String[] makeCheckboxLabels()
      Creates the list of labels to use in the checkboxes.
      Returns:
      DOCUMENT ME!
    • setListLength

      protected abstract void setListLength()
      Abstract to ensure the variable listLength has a value.
    • makeCheckBoxList

      protected JCheckBox[] makeCheckBoxList()
      Builds all checkboxes; prepare for this step by having an array of Strings with the names to use. Called checkboxLabels 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 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 JPanel makeCheckUncheckPanel()
      Builds the panel with the invalid input: '&quotcheck' all"/"uncheck all" buttons.
      Returns:
      JPanel the new panel