Class EditableResizableImagePanel

All Implemented Interfaces:
ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, URIDrop.Listener, URIDrop.ListenerExt

See Also:
  • Constructor Details

    • EditableResizableImagePanel

      Default constructor.
    • EditableResizableImagePanel

      Constructor with initial image file path as parameter. Component will be (preferred) sized to image sized
      Parameters:
      imagePath - Path to image to display
    • EditableResizableImagePanel

      public EditableResizableImagePanel(String imagePath, int w, int h)
      Constructor for DnDImagePanel with forced initial size
      Parameters:
      imagePath - Path to image to display
      w - Panel width
      h - Panel height
  • Method Details

    • removeDnd

      public void removeDnd()
      Cleanup the DnD from this component
    • setDnd

      public final void setDnd(boolean dnd)
      Enable or disable drag'n drop, dropped files will be copied in latest used image path top folder when dnd enabled, also enable contextual menu with remove entry.
      Parameters:
      dnd - true to enable, false to disable
    • addMenuItemBrowseFolder

      public JMenuItem addMenuItemBrowseFolder(String menuEntry, String path)
      Add a "open system file browser to path" menu item to the contextual menu
      Parameters:
      menuEntry - the menu entry string
      path - the path to browse to
      Returns:
      the added menu item
    • removeMenuItemBrowseFolder

      Remove a given menu item from the contextual menu
      Parameters:
      mi - the JMenuItem to remove
    • setDropFolder

      public void setDropFolder(String s)
    • getDropFolder

    • URIsDropped

      public void URIsDropped(URI[] uris)
      Callback for the dnd listener
      Specified by:
      URIsDropped in interface URIDrop.Listener
      Parameters:
      uris - An array of URIs that were dropped.
    • imageDropped

      public void imageDropped(BufferedImage image)
      Callback for the dnd listener
      Specified by:
      imageDropped in interface URIDrop.ListenerExt
      Parameters:
      image - The BufferedImage that has been dropped