Package diva.gui

Class AbstractView

  • All Implemented Interfaces:
    View
    Direct Known Subclasses:
    TextView

    public abstract class AbstractView
    extends java.lang.Object
    implements View
    An abstract implementation of the View interface that consists of mostly empty methods to be filled in by concrete subclasses.
    Version:
    $Id$
    Author:
    Michael Shilman
    Pt.AcceptedRating:
    Red
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractView​(Document doc)
      Construct a view of the given document.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the view.
      void copy​(java.awt.datatransfer.Clipboard c)
      Get the currently selected objects from this view, if any, and place them on the given clipboard.
      void cut​(java.awt.datatransfer.Clipboard c)
      Remove the currently selected objects from this view, if any, and place them on the given clipboard.
      abstract javax.swing.JComponent getComponent()
      Return the component that implements the display of this view.
      Document getDocument()
      Get the document that this view is viewing.
      abstract java.lang.String getShortTitle()
      Get the short title of this document.
      abstract java.lang.String getTitle()
      Get the title of this document
      void paste​(java.awt.datatransfer.Clipboard c)
      Clone the objects currently on the clipboard, if any, and place them in the given view.
      • Methods inherited from class java.lang.Object

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

      • AbstractView

        public AbstractView​(Document doc)
        Construct a view of the given document.
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Close the view.
        Specified by:
        close in interface View
        Throws:
        java.lang.Exception - If the close operation fails.
      • copy

        public void copy​(java.awt.datatransfer.Clipboard c)
        Get the currently selected objects from this view, if any, and place them on the given clipboard. If the view does not support such an operation, then do nothing.
        Specified by:
        copy in interface View
      • cut

        public void cut​(java.awt.datatransfer.Clipboard c)
        Remove the currently selected objects from this view, if any, and place them on the given clipboard. If the view does not support such an operation, then do nothing.
        Specified by:
        cut in interface View
      • getComponent

        public abstract javax.swing.JComponent getComponent()
        Return the component that implements the display of this view. The returned object should be a unique object that corresponds to this view.
        Specified by:
        getComponent in interface View
      • getDocument

        public Document getDocument()
        Get the document that this view is viewing.
        Specified by:
        getDocument in interface View
      • getTitle

        public abstract java.lang.String getTitle()
        Get the title of this document
        Specified by:
        getTitle in interface View
      • getShortTitle

        public abstract java.lang.String getShortTitle()
        Get the short title of this document. The short title is used in situations where the regular title is likely to be too long, such as iconified windows, menus, and so on.
        Specified by:
        getShortTitle in interface View
      • paste

        public void paste​(java.awt.datatransfer.Clipboard c)
        Clone the objects currently on the clipboard, if any, and place them in the given view. If the document does not support such an operation, then do nothing. This method is responsible for copying the data.
        Specified by:
        paste in interface View