Class MeshChooserDialog

All Implemented Interfaces:
ItemAddedListener<Mesh>, ItemRemovedListener<Mesh>, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class MeshChooserDialog extends JPanel implements ItemAddedListener<Mesh>, ItemRemovedListener<Mesh>

The MeshChooserDialog class allows for selecting a Mesh that has been previously loaded by the MeshFactory. This class also provides access to the MeshFactoryDialog for loading additional meshes.

TODO In the future it would be nice to count references and unload it when no longer needed.

See Also:
  • Constructor Details

    • MeshChooserDialog

      public MeshChooserDialog()
  • Method Details

    • setSelectedItem

      public void setSelectedItem(Mesh mesh)
    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class JComponent
    • getSelectedItem

      public Mesh getSelectedItem()
    • itemAdded

      public void itemAdded(Object source, Mesh item)
      Description copied from interface: ItemAddedListener
      Called when an item is added to the list.
      Specified by:
      itemAdded in interface ItemAddedListener<Mesh>
      Parameters:
      source - the list that was modified
      item - the item that was added
    • itemRemoved

      public void itemRemoved(Object source, Mesh item)
      Description copied from interface: ItemRemovedListener
      Called when an item is removed from the list.
      Specified by:
      itemRemoved in interface ItemRemovedListener<Mesh>
      Parameters:
      source - the list that was modified
      item - the item that was removed
    • run

      public int run(JComponent parent)
      Run the selection as a dialog.
      Parameters:
      parent - the parent component for the dialog.
      Returns:
      JFileChooser.APPROVE_OPTION or JFileChooser.CANCEL_OPTION. return type is int because this is a JFileChooser replacement. It is consistent with MeshFactoryDialog and TextureFactoryDialog.