|
Webnote | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Note
A class that acts as a wrapper to the actual html div that is a note. Rather than operating directly on the html object, use this class instead. TODO: attach these methods directly to the html objects.
Defined in webnote.js
Field Summary | |
boolean |
editable
Whether or not we can double click and edit a note |
string |
id
The html id of the note |
workspace |
parent
TODO: fix references to workspace with this.parent |
boolean |
selectable
Whether or not is it possible to click on a note and select it |
Point |
size
The height and width of the note |
Constructor Summary | |
Note
(<HtmlElement> note, <workspace> p, <string> text)
Create a new note object. |
Method Summary | |
void
|
destroy(<boolean> addToHistory)
Destroy the note (user clicked on the X). |
void
|
disable()
Disable a note (can't be moved or edited). |
void
|
enable()
Enable a note (can be moved and edited). |
Point
|
getCorrectedSize()
Get the size of the note including border and padding. |
string
|
getHTML()
Convert the text of a note to html. |
Point
|
getPosition()
Get the coordinates of the upper left corner of the note. |
Point
|
getSize()
Get the size of the note according to the dom object (this varies on browser). |
void
|
keyDown(ev)
Note keyboard events. |
void
|
miniMouseDown(ev)
User clicked on one of the mini notes at the top of the page. |
void
|
mouseDblClick()
Double-click event on a note (try to toggle edit mode). |
Object
|
mouseDown(ev)
User clicked on a note. |
void
|
mouseMove(ev)
Moving the mouse while over a note (changes cursor). |
void
|
mouseOut()
Mouse leaves a note (restore original background color). |
void
|
mouseOver()
Mouse moves over a note (darken the background color). |
void
|
mouseUp()
User deselected a note (stopped dragging). |
void
|
move(<Point> delta)
Move the note relative to its current position. |
void
|
select()
When a note is selected from the mini note toolbar, we bring it to the front and flash the background. |
void
|
sendToBack()
Send a note to the back of the workspace. |
void
|
setColor(<string> hex, <boolean> ignoreHistory)
Set the color of a note. |
void
|
setText(<string> str)
Change the text of a note. |
string
|
toXML()
Generate the xml representing a note (used when we save notes). |
void
|
updateSize()
We keep track of the size of the note internally; this method updates that value. |
Field Detail |
boolean editable
string id
workspace parent
boolean selectable
Point size
Constructor Detail |
Note(<HtmlElement> note, <workspace> p, <string> text)
note
- a reference to the actual note or a string that is the id of the note
p
- a reference to the parent workspace
text
- the text of the note
Method Detail |
void destroy(<boolean> addToHistory)
addToHistory
- should we add information to the undo stack?
void disable()
void enable()
Point getCorrectedSize()
string getHTML()
Point getPosition()
Point getSize()
void keyDown(ev)
void miniMouseDown(ev)
void mouseDblClick()
Object mouseDown(ev)
void mouseMove(ev)
void mouseOut()
void mouseOver()
void mouseUp()
void move(<Point> delta)
delta
- a point object
void select()
void sendToBack()
void setColor(<string> hex, <boolean> ignoreHistory)
hex
- the color in hex
ignoreHistory
- should we add it to the history? Different default values makes this inconsistent with destroy()
void setText(<string> str)
str
- the text for the note.
string toXML()
void updateSize()
|
Webnote | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |