Package geomss.ui

Class DialogItem

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class DialogItem
    extends java.lang.Object
    implements java.lang.Cloneable
    A container for for items to display in a dialog.

    Modified by: Joseph A. Huwaldt

    Version:
    February 22, 2025
    Author:
    Joseph A. Huwaldt, Date: May 5, 2009
    • Constructor Summary

      Constructors 
      Constructor Description
      DialogItem()
      Construct a new and empty DialogItem.
      DialogItem​(java.lang.String prefix, java.lang.Object element)
      Construct a new DialogItem with the specified elements.
      DialogItem​(java.lang.String prefix, java.lang.Object element, java.lang.String suffix)
      Construct a new DialogItem with the specified elements.
      DialogItem​(java.lang.String prefix, java.lang.Object element, javax.measure.unit.Unit[] unitList)
      Construct a new DialogItem with the specified elements.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Returns a shallow copy of this DialogItem instance.
      java.lang.Object getElement()
      Return the element to be edited.
      java.lang.String getFileExtension()
      Returns the file extension requested for saving a file (or null if none has been set).
      java.lang.String getPrefix()
      Return the prefix String.
      java.lang.String getSuffix()
      Return the suffix String.
      javax.measure.unit.Unit[] getUnitList()
      Return the array of units.
      boolean isLoadFile()
      Returns the load/save option (true to use a load file dialog and false to use a save file dialog).
      void setElement​(java.lang.Object element)
      Set the element to be edited.
      void setFileExtension​(java.lang.String extension)
      Set the file extension to enforce when selecting a file for saving.
      void setLoadFile​(boolean load)
      Set the file load/save option (if the element is of type File).
      void setPrefix​(java.lang.String prefix)
      Set the prefix String.
      void setSuffix​(java.lang.String suffix)
      Set the suffix string.
      void setUnitList​(javax.measure.unit.Unit[] units)
      Set the array of units.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DialogItem

        public DialogItem()
        Construct a new and empty DialogItem.
      • DialogItem

        public DialogItem​(java.lang.String prefix,
                          java.lang.Object element)
        Construct a new DialogItem with the specified elements.
        Parameters:
        prefix - The prefix for the dialog to display.
        element - The the item to display in the dialog.
      • DialogItem

        public DialogItem​(java.lang.String prefix,
                          java.lang.Object element,
                          java.lang.String suffix)
        Construct a new DialogItem with the specified elements.
        Parameters:
        prefix - The prefix for the item displayed.
        element - The item to display in the dialog.
        suffix - The suffix for the item displayed.
      • DialogItem

        public DialogItem​(java.lang.String prefix,
                          java.lang.Object element,
                          javax.measure.unit.Unit[] unitList)
        Construct a new DialogItem with the specified elements.
        Parameters:
        prefix - The prefix for the item displayed.
        element - The item to display in the dialog.
        unitList - The list of units to display with the item.
    • Method Detail

      • getPrefix

        public java.lang.String getPrefix()
        Return the prefix String.
        Returns:
        the prefix
      • setPrefix

        public void setPrefix​(java.lang.String prefix)
        Set the prefix String.
        Parameters:
        prefix - the prefix to display with the item.
      • getElement

        public java.lang.Object getElement()
        Return the element to be edited.
        Returns:
        the element or item
      • setElement

        public void setElement​(java.lang.Object element)
        Set the element to be edited.
        Parameters:
        element - the item to display in the dialog.
      • getSuffix

        public java.lang.String getSuffix()
        Return the suffix String.
        Returns:
        the suffix
      • setSuffix

        public void setSuffix​(java.lang.String suffix)
        Set the suffix string.
        Parameters:
        suffix - the suffix to place after the item in the dialog.
      • getUnitList

        public javax.measure.unit.Unit[] getUnitList()
        Return the array of units.
        Returns:
        the array of units displayed with the item in the dialog.
      • setUnitList

        public void setUnitList​(javax.measure.unit.Unit[] units)
        Set the array of units.
        Parameters:
        units - the array of units to display with the item.
      • setLoadFile

        public void setLoadFile​(boolean load)
        Set the file load/save option (if the element is of type File).
        Parameters:
        load - Set to true to use a "load file" dialog and false to use a "save file" dialog.
      • isLoadFile

        public boolean isLoadFile()
        Returns the load/save option (true to use a load file dialog and false to use a save file dialog).
        Returns:
        The value true to use a load file dialog and false to use a save file dialog.
      • setFileExtension

        public void setFileExtension​(java.lang.String extension)
        Set the file extension to enforce when selecting a file for saving.
        Parameters:
        extension - The file extension to enforce when selecting a file for saving.
      • getFileExtension

        public java.lang.String getFileExtension()
        Returns the file extension requested for saving a file (or null if none has been set).
        Returns:
        The file extension requested for saving a file or null if none has been set.
      • clone

        public java.lang.Object clone()
        Returns a shallow copy of this DialogItem instance.
        Returns:
        a clone of this DialogItem instance