InkPanel Class Reference

List of all members.

Public Member Functions

 InkPanel ()
 Default Catmull-Rom method.
 InkPanel (InkRenderer inkRenderer, Color bgColor)
 Choose your own renderer.
void addInk (Ink ink)
Ink addNewInk ()
void clear ()
 Remove all the ink from the ink panel.
void displayInvertedInkColor ()
List< InkgetAllInk ()
double getScale ()
void removeLastBatchOfInk ()
 Used to remove the most-recently added ink object.
void setAllInk (List< Ink > theInk)
void setRenderer (InkRenderer r)
void setScale (double theScale)

Protected Member Functions

Override void paintComponent (Graphics g)
 Redraw the ink strokes.

Protected Attributes

List< InkinkWell = Collections.synchronizedList(new LinkedList<Ink>())
 A collection of ink objects that have been added to this JPanel.

Detailed Description

Renders Ink in a JPanel using catmull-rom splines. You may swap in simpler renderers if this becomes slow. Also, this provides some customization that allows you to zoom in and out, pan, and align the ink with imagery. =)

This software is distributed under the BSD License.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 30 of file InkPanel.java.


Constructor & Destructor Documentation

InkPanel ( InkRenderer  inkRenderer,
Color  bgColor 
)

Choose your own renderer.

Parameters:
inkRenderer 
bgColor 

Definition at line 65 of file InkPanel.java.


Member Function Documentation

void addInk ( Ink  ink  ) 

Parameters:
ink 

Definition at line 73 of file InkPanel.java.

References InkPanel.inkWell.

Referenced by GestureDatabase.display().

Ink addNewInk (  ) 

Returns:
the newly added Ink object.

Definition at line 82 of file InkPanel.java.

References InkPanel.inkWell.

Referenced by PenSimulator.mouseReleased().

List<Ink> getAllInk (  ) 

Returns:
the reference to the ink. This is NOT a copy!

Definition at line 107 of file InkPanel.java.

References InkPanel.inkWell.

Override void paintComponent ( Graphics  g  )  [protected]

Redraw the ink strokes.

See also:
javax.swing.JComponent.paintComponent(java.awt.Graphics)

Definition at line 121 of file InkPanel.java.

References InkPanel.inkWell, InkRenderer.renderToG2D(), InkRenderer.setInk(), and InkRenderer.useInvertedInkColors().

void setAllInk ( List< Ink theInk  ) 

Parameters:
theInk 

Definition at line 156 of file InkPanel.java.

References InkPanel.inkWell.

void setRenderer ( InkRenderer  r  ) 

Parameters:
r 

Definition at line 164 of file InkPanel.java.

void setScale ( double  theScale  ) 

Parameters:
theScale 

Definition at line 171 of file InkPanel.java.


Member Data Documentation

List<Ink> inkWell = Collections.synchronizedList(new LinkedList<Ink>()) [protected]

A collection of ink objects that have been added to this JPanel.

Feel free to access it, if you are a subclass. Make sure to call repaint though!

Definition at line 43 of file InkPanel.java.

Referenced by InkPanel.addInk(), InkPanel.addNewInk(), InkPanel.clear(), InkPanel.getAllInk(), InkPanel.paintComponent(), InkPanel.removeLastBatchOfInk(), and InkPanel.setAllInk().


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:41 2007 for R3 Paper Toolkit by  doxygen 1.4.7