edu.stanford.hci.r3.paper
Class Bundle

java.lang.Object
  extended by edu.stanford.hci.r3.paper.Bundle
Direct Known Subclasses:
PDFBundle

public class Bundle
extends java.lang.Object

A Collection of Sheets (see Sheet.java). A collection of pages/sheets of interactive paper. A bundle contains multiple Sheets. Bundles are one of the data types that can be added to an Application.

One benefit of bundles is that they can manage page numbers... If you want to create a notebook, or multiple data sheets, you will want a bundle. In the future, we will allow adding regions to a Bundle. This means that you can have one region duplicated across sheets. Whenever a person interacts with ANY sheet in the area occupied by that region, the region's event handler will be notified.

This software is distributed under the BSD License.


Constructor Summary
Bundle(java.lang.String bundleName)
          A bunch of sheets that are related to each other in some way.
 
Method Summary
 void addGlobalRegion(Region gr)
          Deprecated. because it is incomplete! It doesn't work yet...
 void addSheet(Sheet sheetToAdd)
           
 void addSheets(Sheet... sheetsToAdd)
           
 void createAndAddSheets(int numSheets, java.lang.String sheetNameRoot, Units w, Units h)
          Convenience function to add a bunch of sheets to this bundle.
 java.util.List<Region> getGlobalRegions()
           
 java.lang.String getName()
           
 Sheet getSheet(int index)
           
 int getSheetNumber(Sheet s)
          Allows you to identify a sheet by its index in the list.
 java.util.List<Sheet> getSheets()
          WARNING: returns the reference to the sheet.
 void removeSheets(Sheet... sheetsToRemove)
          Remove all of the specified sheets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bundle

public Bundle(java.lang.String bundleName)
A bunch of sheets that are related to each other in some way. Usually, the sheets look the same (or similar).

Method Detail

addGlobalRegion

public void addGlobalRegion(Region gr)
Deprecated. because it is incomplete! It doesn't work yet...

These regions will be placed in a master list that applies to ALL sheets. Thus, whenever a person writes on Sheet S within the region specified by R, it will call R's event handler. This would act like a button that is placed on every sheet (e.g., a share with group button on notebook pages). Plus, for rendering purposes, the global region will ensure that pattern will exist on every sheet in the coordinates specified by the region.

Parameters:
r - the global region to add

addSheet

public void addSheet(Sheet sheetToAdd)
Parameters:
sheetToAdd -

addSheets

public void addSheets(Sheet... sheetsToAdd)
Parameters:
sheetsToAdd -

createAndAddSheets

public void createAndAddSheets(int numSheets,
                               java.lang.String sheetNameRoot,
                               Units w,
                               Units h)
Convenience function to add a bunch of sheets to this bundle. Afterward, you can add regions to each sheet... or add global regions that span all sheets.

Parameters:
numSheets -
sheetNameRoot -

getGlobalRegions

public java.util.List<Region> getGlobalRegions()
Returns:

getName

public java.lang.String getName()
Returns:
the name of this Bundle

getSheet

public Sheet getSheet(int index)
Parameters:
index - starting from 0
Returns:

getSheetNumber

public int getSheetNumber(Sheet s)
Allows you to identify a sheet by its index in the list.

Parameters:
s -
Returns:
a sheet number (starting from 0). Depends on the order in which you added the sheets. Currently, there is no facility to reorganize sheets within a bundle.

getSheets

public java.util.List<Sheet> getSheets()
WARNING: returns the reference to the sheet. Use at your own risk! =)

Returns:

removeSheets

public void removeSheets(Sheet... sheetsToRemove)
Remove all of the specified sheets.

Parameters:
sheetsToRemove -

Copyright 2006 Stanford University