diva.whiteboard
Class WhiteboardView

java.lang.Object
  extended by diva.gui.AbstractView
      extended by diva.whiteboard.WhiteboardView
All Implemented Interfaces:
View, ClipboardOwner, Printable

public class WhiteboardView
extends AbstractView
implements Printable, ClipboardOwner

WhiteboardView is responsible for view-specific operations on the document (cut, paste, print, etc.) It also keeps track of the multi-page aspect of the whiteboard documents.

Version:
$Revision: 1.33 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu), Heloise Hse (hwawen@eecs.berkeley.edu)

Nested Class Summary
protected  class WhiteboardView.LocalPageListener
           
protected  class WhiteboardView.LocalSketchListener
           
 class WhiteboardView.SketchInterpreter
           
protected  class WhiteboardView.WBVStateListener
           
 
Field Summary
protected  JSketch _jsketch
           
protected  HashMap _sketchPanes
          A mapping from document pages to sketch panes.
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
WhiteboardView(MultipageDocument d, WhiteboardState state)
           
 
Method Summary
 void close()
          Close the view.
 void copy(Clipboard c)
          Get the currently selected objects from this document, if any, and place them on the given clipboard.
protected  SketchPane createPane(Page page, JSketch jsketch)
          Called by LocalPageListener::intervalAdded
 JButton createThumbnail(Page page)
          Return a thumbnail component for the thumbnail view.
 void cut(Clipboard c)
          Get the currently selected objects from this document, if any, and place them on the given clipboard.
 void destroyThumbnail(JButton but)
          Invert whatever was done in createThumbnail().
 JComponent getComponent()
          Invoked when a new document has been created or opened.
protected  DesktopContext getDesktopContext()
           
 SketchModel getGestureModel()
          Return a sketch model of the sketched gestures, for debugging.
 String getShortTitle()
          Get the short title of this document.
 String getTitle()
          Get the title of this document
 void groupSelected()
           
 void lostOwnership(Clipboard clipboard, Transferable transferable)
          Do nothing.
 void nextPage()
           
 Iterator panes()
           
 void paste(Clipboard c)
          Clone the objects currently on the clipboard, if any, and place them in the given document.
 void playGestureModel(SketchModel model)
          Return a sketch model of the sketched gestures, for debugging.
 void previousPage()
           
 int print(Graphics graphics, PageFormat format, int index)
          Print the document to a printer, represented by the specified graphics object.
protected  void saveAsGIF(File outputFile)
          Save the current page of the specified document to the file in GIF format.
 void ungroupSelected()
           
 
Methods inherited from class diva.gui.AbstractView
getDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_jsketch

protected JSketch _jsketch

_sketchPanes

protected HashMap _sketchPanes
A mapping from document pages to sketch panes.

Constructor Detail

WhiteboardView

public WhiteboardView(MultipageDocument d,
                      WhiteboardState state)
Method Detail

close

public void close()
Description copied from class: AbstractView
Close the view.

Specified by:
close in interface View
Overrides:
close in class AbstractView

panes

public Iterator panes()

createThumbnail

public JButton createThumbnail(Page page)
Return a thumbnail component for the thumbnail view.


destroyThumbnail

public void destroyThumbnail(JButton but)
Invert whatever was done in createThumbnail().


getComponent

public JComponent getComponent()
Invoked when a new document has been created or opened.

Specified by:
getComponent in interface View
Specified by:
getComponent in class AbstractView

getGestureModel

public SketchModel getGestureModel()
Return a sketch model of the sketched gestures, for debugging.


playGestureModel

public void playGestureModel(SketchModel model)
Return a sketch model of the sketched gestures, for debugging.


createPane

protected SketchPane createPane(Page page,
                                JSketch jsketch)
Called by LocalPageListener::intervalAdded


saveAsGIF

protected void saveAsGIF(File outputFile)
Save the current page of the specified document to the file in GIF format.


print

public int print(Graphics graphics,
                 PageFormat format,
                 int index)
          throws PrinterException
Print the document to a printer, represented by the specified graphics object. This method assumes that a view exists of the this document in the application.

Specified by:
print in interface Printable
Parameters:
graphics - The context into which the page is drawn.
format - The size and orientation of the page being drawn.
index - The zero based index of the page to be drawn.
Throws:
PrinterException - If the print job is terminated.

cut

public void cut(Clipboard c)
Get the currently selected objects from this document, if any, and place them on the given clipboard.

Specified by:
cut in interface View
Overrides:
cut in class AbstractView

copy

public void copy(Clipboard c)
Get the currently selected objects from this document, if any, and place them on the given clipboard.

Specified by:
copy in interface View
Overrides:
copy in class AbstractView

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable transferable)
Do nothing.

Specified by:
lostOwnership in interface ClipboardOwner

paste

public void paste(Clipboard c)
Clone the objects currently on the clipboard, if any, and place them in the given document. 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
Overrides:
paste in class AbstractView

getDesktopContext

protected DesktopContext getDesktopContext()

getTitle

public String getTitle()
Description copied from class: AbstractView
Get the title of this document

Specified by:
getTitle in interface View
Specified by:
getTitle in class AbstractView

getShortTitle

public String getShortTitle()
Description copied from class: AbstractView
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
Specified by:
getShortTitle in class AbstractView

groupSelected

public void groupSelected()

ungroupSelected

public void ungroupSelected()

nextPage

public void nextPage()

previousPage

public void previousPage()


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.