Class DrawingView

All Implemented Interfaces:
IFeedbackProvider, IFileDropHandler, ComponentListener, FocusListener, MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class DrawingView extends BaseView
A simple view used to test the tool bar.
Author:
heddle
See Also:
  • Constructor Details

  • Method Details

    • createDrawingView

      public static DrawingView createDrawingView()
      Convenience factory for creating a DrawingView with the default key-value configuration (see defaults()).

      Equivalent to new DrawingView((Object[]) null).

      Returns:
      a new DrawingView configured with the default properties
    • getViewInfo

      public AbstractViewInfo getViewInfo()
      Description copied from class: BaseView
      Override to supply structured information for the info dialog. The default returns null (no info available).
      Overrides:
      getViewInfo in class BaseView
      Returns:
      view info, or null
    • filesDropped

      public void filesDropped(List<File> files)
      Handle image files dropped onto this view.

      Only the first file in the list is used; multi-file drops are accepted by the framework but silently truncated here because a drawing view has a single canvas and loading several images simultaneously would require an explicit layout policy that does not yet exist.

      The dropped image is placed on the annotation layer so it is always rendered above other items. If the file cannot be decoded (ImageIO.read(java.io.File) returns null or throws), an error is logged through the framework logger and the view is left unchanged.

      This method is called on the EDT by FileDropHandler after the filter set in the constructor (ImageFilters.isActualImage) has already accepted the file, so no second format check is needed here.

      Specified by:
      filesDropped in interface IFileDropHandler
      Overrides:
      filesDropped in class BaseView
      Parameters:
      files - the accepted dropped files; never null, never empty