From f561211268f7b4f25c05c92abb9c0b35a639ca3f Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 18 Jun 2010 20:35:47 +0000 Subject: [PATCH] Start of new thorough code documentation effort git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1607 eee81c28-f429-11dd-99c0-75d572ba1ddd --- docs/files/svgcanvas-js.html | 74 +++++++++++++++++++++-------------- docs/index/Files.html | 8 +++- docs/index/Functions.html | 30 ++++++++------ docs/index/General.html | 54 ++++++++++++++----------- docs/javascript/searchdata.js | 24 ++++++------ docs/search/FilesS.html | 2 +- docs/search/FunctionsA.html | 2 +- docs/search/FunctionsC.html | 2 +- docs/search/FunctionsD.html | 2 +- docs/search/FunctionsG.html | 2 +- docs/search/FunctionsM.html | 2 +- docs/search/FunctionsR.html | 2 +- docs/search/FunctionsS.html | 2 +- docs/search/GeneralA.html | 2 +- docs/search/GeneralC.html | 2 +- docs/search/GeneralD.html | 2 +- docs/search/GeneralF.html | 2 +- docs/search/GeneralG.html | 2 +- docs/search/GeneralL.html | 2 +- docs/search/GeneralM.html | 2 +- docs/search/GeneralR.html | 2 +- docs/search/GeneralS.html | 2 +- editor/svgcanvas.js | 49 +++++++++++++++++------ 23 files changed, 166 insertions(+), 107 deletions(-) diff --git a/docs/files/svgcanvas-js.html b/docs/files/svgcanvas-js.html index a6375c28..78b6f5a7 100644 --- a/docs/files/svgcanvas-js.html +++ b/docs/files/svgcanvas-js.html @@ -1,6 +1,6 @@ -/Users/jschill1/Documents/svg-edit/editor/svgcanvas.js @@ -11,57 +11,71 @@ if (browserType) {document.write("
");if (browserV -

svgcanvas.js

Summary
svgcanvas.js
Selection
clearSelectionClears the selection.
addToSelectionAdds a list of elements to the selection.
removeFromSelectionRemoves elements from the selection.
Serialization
openCalls the ‘opened’ handler and sends the SVG XML text.
saveSerializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
getSvgStringReturns the current drawing as raw SVG XML text.
setSvgStringThis function sets the current drawing as the input SVG XML.
Layers
createLayerCreates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
deleteCurrentLayerDeletes the current layer from the drawing and then clears the selection.
getNumLayersReturns the number of layers in the current drawing.
getLayerReturns the name of the ith layer.
getCurrentLayerReturns the name of the currently selected layer.
setCurrentLayerSets the current layer.
renameCurrentLayerRenames the current layer.
setCurrentLayerPositionChanges the position of the current layer to the new value.
getLayerVisibilityReturns whether the layer is visible.
setLayerVisibilitySets the visibility of the layer.
moveSelectedToLayerMoves the selected elements to layername.
getLayerOpacityReturns the opacity of the given layer.
setLayerOpacitySets the opacity of the given layer.
clearClears the current document.
Fill and Stroke
+

SvgCanvas

The main SvgCanvas class that manages all SVG-related functions

Parameters

containerThe container HTML element that should hold the SVG root element
configAn object that contains configuration data
Summary
SvgCanvasThe main SvgCanvas class that manages all SVG-related functions
toXmlConverts characters in a string to XML-friendly entities.
fromXmlConverts XML entities in a string to single characters.
Undo/Redo history management
ChangeElementCommandHistory command to make a change to an element.
ChangeElementCommand.applyPerforms the stored change action
Selection
clearSelectionClears the selection.
addToSelectionAdds a list of elements to the selection.
removeFromSelectionRemoves elements from the selection.
Serialization
saveSerializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
getSvgStringReturns the current drawing as raw SVG XML text.
setSvgStringThis function sets the current drawing as the input SVG XML.
importSvgStringThis function imports the input SVG XML into the current layer in the drawing
Layers
createLayerCreates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
deleteCurrentLayerDeletes the current layer from the drawing and then clears the selection.
getNumLayersReturns the number of layers in the current drawing.
getLayerReturns the name of the ith layer.
getCurrentLayerReturns the name of the currently selected layer.
setCurrentLayerSets the current layer.
renameCurrentLayerRenames the current layer.
setCurrentLayerPositionChanges the position of the current layer to the new value.
getLayerVisibilityReturns whether the layer is visible.
setLayerVisibilitySets the visibility of the layer.
moveSelectedToLayerMoves the selected elements to layername.
getLayerOpacityReturns the opacity of the given layer.
setLayerOpacitySets the opacity of the given layer.
selectAllInCurrentLayerClears the selection, then adds all elements in the current layer to the selection.
clearClears the current document.
Fill and Stroke
getVersionReturns a string which describes the revision number of SvgCanvas.
-

Selection

+

toXml

toXml = function(str)

Converts characters in a string to XML-friendly entities.

Example: “&” becomes “&” Parameters: str - The string to be converted Returns: The converted string

-

clearSelection

this.clearSelection = function()

Clears the selection.  The ‘selected’ handler is then called.

+

fromXml

fromXml = function(str)

Converts XML entities in a string to single characters.  Example: “&” becomes “&” Parameters: str - The string to be converted Returns: The converted string

-

addToSelection

this.addToSelection = function(elemsToAdd,
showGrips)

Adds a list of elements to the selection.  The ‘selected’ handler is then called.

Parameters

elemsToAddan array of DOM elements to add to the selection
showGripsa boolean flag indicating whether the resize grips should be shown
+

Undo/Redo history management

-

removeFromSelection

this.removeFromSelection = function(elemsToRemove)

Removes elements from the selection.

Parameters

elemsToRemovean array of elements to remove from selection
+

ChangeElementCommand

function ChangeElementCommand(elem,
attrs,
text)

History command to make a change to an element.  Usually an attribute change, but can also be textcontent.

Parameters

elemThe DOM element to be changed
attrsAn object with the attributes to be changed and the values they had before the change
textAn optional string visible to user related to this change
-

Serialization

+

ChangeElementCommand.apply

Performs the stored change action

-

open

this.open = function(str)

Calls the ‘opened’ handler and sends the SVG XML text.  Clients of the SvgCanvas bind their load function (typically calls to setSvgString() to the ‘opened’ event.

+

Selection

-

save

this.save = function()

Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.  This function also includes the XML prolog.  Clients of the SvgCanvas bind their save function to the ‘saved’ event.

Returns

Nothing

+

clearSelection

this.clearSelection = function(noCall)

Clears the selection.  The ‘selected’ handler is then called.

-

getSvgString

this.getSvgString = function()

Returns the current drawing as raw SVG XML text.

Returns

The current drawing as raw SVG XML text.

+

addToSelection

this.addToSelection = function(elemsToAdd,
showGrips)

Adds a list of elements to the selection.  The ‘selected’ handler is then called.

Parameters

elemsToAddan array of DOM elements to add to the selection
showGripsa boolean flag indicating whether the resize grips should be shown
-

setSvgString

this.setSvgString = function(xmlString)

This function sets the current drawing as the input SVG XML.

Parameters

xmlStringThe SVG as XML text.

Returns

This function returns false if the set was unsuccessful, true otherwise.

+

removeFromSelection

this.removeFromSelection = function(elemsToRemove)

Removes elements from the selection.

Parameters

elemsToRemovean array of elements to remove from selection
-

Layers

+

Serialization

-

createLayer

this.createLayer = function(name)

Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.  This is an undoable action.

Parameters

nameThe given name
+

save

this.save = function(opts)

Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.  This function also includes the XML prolog.  Clients of the SvgCanvas bind their save function to the ‘saved’ event.

Returns

Nothing

-

deleteCurrentLayer

this.deleteCurrentLayer = function()

Deletes the current layer from the drawing and then clears the selection.  This function then calls the ‘changed’ handler.  This is an undoable action.

+

getSvgString

this.getSvgString = function()

Returns the current drawing as raw SVG XML text.

Returns

The current drawing as raw SVG XML text.

-

getNumLayers

this.getNumLayers = function()

Returns the number of layers in the current drawing.

Returns

The number of layers in the current drawing.

+

setSvgString

this.setSvgString = function(xmlString)

This function sets the current drawing as the input SVG XML.

Parameters

xmlStringThe SVG as XML text.

Returns

This function returns false if the set was unsuccessful, true otherwise.

-

getLayer

this.getLayer = function(i)

Returns the name of the ith layer.  If the index is out of range, an empty string is returned.

Parameters

ithe zero-based index of the layer you are querying.

Returns

The name of the ith layer

+

importSvgString

This function imports the input SVG XML into the current layer in the drawing

Parameters

xmlStringThe SVG as XML text.

Returns

This function returns false if the import was unsuccessful, true otherwise.

-

getCurrentLayer

this.getCurrentLayer = function()

Returns the name of the currently selected layer.  If an error occurs, an empty string is returned.

Returns

The name of the currently active layer.

+

Layers

-

setCurrentLayer

this.setCurrentLayer = function(name)

Sets the current layer.  If the name is not a valid layer name, then this function returns false.  Otherwise it returns true.  This is not an undo-able action.

Parameters

namethe name of the layer you want to switch to.

Returns

true if the current layer was switched, otherwise false

+

createLayer

this.createLayer = function(name)

Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.  This is an undoable action.

Parameters

nameThe given name
-

renameCurrentLayer

this.renameCurrentLayer = function(newname)

Renames the current layer.  If the layer name is not valid (i.e. unique), then this function does nothing and returns false, otherwise it returns true.  This is an undo-able action.

Parameters

newnamethe new name you want to give the current layer.  This name must be unique among all layer names.

Returns

true if the rename succeeded, false otherwise.

+

deleteCurrentLayer

this.deleteCurrentLayer = function()

Deletes the current layer from the drawing and then clears the selection.  This function then calls the ‘changed’ handler.  This is an undoable action.

-

setCurrentLayerPosition

this.setCurrentLayerPosition = function(newpos)

Changes the position of the current layer to the new value.  If the new index is not valid, this function does nothing and returns false, otherwise it returns true.  This is an undo-able action.

Parameters

newposThe zero-based index of the new position of the layer.  This should be between
0 and (number of layers1)

Returns

true if the current layer position was changed, false otherwise.

+

getNumLayers

this.getNumLayers = function()

Returns the number of layers in the current drawing.

Returns

The number of layers in the current drawing.

-

getLayerVisibility

this.getLayerVisibility = function(layername)

Returns whether the layer is visible.  If the layer name is not valid, then this function returns false.

Parameters

layernamethe name of the layer which you want to query.

Returns

The visibility state of the layer, or false if the layer name was invalid.

+

getLayer

this.getLayer = function(i)

Returns the name of the ith layer.  If the index is out of range, an empty string is returned.

Parameters

ithe zero-based index of the layer you are querying.

Returns

The name of the ith layer

-

setLayerVisibility

this.setLayerVisibility = function(layername,
bVisible)

Sets the visibility of the layer.  If the layer name is not valid, this function return false, otherwise it returns true.  This is an undo-able action.

Parameters

layernamethe name of the layer to change the visibility
bVisibletrue/false, whether the layer should be visible

Returns

true if the layer’s visibility was set, false otherwise

+

getCurrentLayer

this.getCurrentLayer = function()

Returns the name of the currently selected layer.  If an error occurs, an empty string is returned.

Returns

The name of the currently active layer.

-

moveSelectedToLayer

this.moveSelectedToLayer = function(layername)

Moves the selected elements to layername.  If the name is not a valid layer name, then false is returned.  Otherwise it returns true.  This is an undo-able action.

Parameters

layernamethe name of the layer you want to which you want to move the selected elements

Returns

true if the selected elements were moved to the layer, false otherwise.

+

setCurrentLayer

this.setCurrentLayer = function(name)

Sets the current layer.  If the name is not a valid layer name, then this function returns false.  Otherwise it returns true.  This is not an undo-able action.

Parameters

namethe name of the layer you want to switch to.

Returns

true if the current layer was switched, otherwise false

-

getLayerOpacity

this.getLayerOpacity = function(layername)

Returns the opacity of the given layer.  If the input name is not a layer, null is returned.

Parameters

layernamename of the layer on which to get the opacity

Returns

The opacity value of the given layer.  This will be a value between 0.0 and 1.0, or null if layername is not a valid layer

+

renameCurrentLayer

this.renameCurrentLayer = function(newname)

Renames the current layer.  If the layer name is not valid (i.e. unique), then this function does nothing and returns false, otherwise it returns true.  This is an undo-able action.

Parameters

newnamethe new name you want to give the current layer.  This name must be unique among all layer names.

Returns

true if the rename succeeded, false otherwise.

-

setLayerOpacity

this.setLayerOpacity = function(layername,
opacity)

Sets the opacity of the given layer.  If the input name is not a layer, nothing happens.  This is not an undo-able action.  NOTE: this function exists solely to apply a highlighting/de-emphasis effect to a layer, when it is possible for a user to affect the opacity of a layer, we will need to allow this function to produce an undo-able action.  If opacity is not a value between 0.0 and 1.0, then nothing happens.

Parameters

layernamename of the layer on which to set the opacity
opacitya float value in the range 0.0-1.0
+

setCurrentLayerPosition

this.setCurrentLayerPosition = function(newpos)

Changes the position of the current layer to the new value.  If the new index is not valid, this function does nothing and returns false, otherwise it returns true.  This is an undo-able action.

Parameters

newposThe zero-based index of the new position of the layer.  This should be between
0 and (number of layers1)

Returns

true if the current layer position was changed, false otherwise.

-

clear

this.clear = function()

Clears the current document.  This is not an undoable action.

+

getLayerVisibility

this.getLayerVisibility = function(layername)

Returns whether the layer is visible.  If the layer name is not valid, then this function returns false.

Parameters

layernamethe name of the layer which you want to query.

Returns

The visibility state of the layer, or false if the layer name was invalid.

-

Fill and Stroke

+

setLayerVisibility

this.setLayerVisibility = function(layername,
bVisible)

Sets the visibility of the layer.  If the layer name is not valid, this function return false, otherwise it returns true.  This is an undo-able action.

Parameters

layernamethe name of the layer to change the visibility
bVisibletrue/false, whether the layer should be visible

Returns

true if the layer’s visibility was set, false otherwise

+ +

moveSelectedToLayer

this.moveSelectedToLayer = function(layername)

Moves the selected elements to layername.  If the name is not a valid layer name, then false is returned.  Otherwise it returns true.  This is an undo-able action.

Parameters

layernamethe name of the layer you want to which you want to move the selected elements

Returns

true if the selected elements were moved to the layer, false otherwise.

+ +

getLayerOpacity

this.getLayerOpacity = function(layername)

Returns the opacity of the given layer.  If the input name is not a layer, null is returned.

Parameters

layernamename of the layer on which to get the opacity

Returns

The opacity value of the given layer.  This will be a value between 0.0 and 1.0, or null if layername is not a valid layer

+ +

setLayerOpacity

this.setLayerOpacity = function(layername,
opacity)

Sets the opacity of the given layer.  If the input name is not a layer, nothing happens.  This is not an undo-able action.  NOTE: this function exists solely to apply a highlighting/de-emphasis effect to a layer, when it is possible for a user to affect the opacity of a layer, we will need to allow this function to produce an undo-able action.  If opacity is not a value between 0.0 and 1.0, then nothing happens.

Parameters

layernamename of the layer on which to set the opacity
opacitya float value in the range 0.0-1.0
+ +

selectAllInCurrentLayer

this.selectAllInCurrentLayer = function()

Clears the selection, then adds all elements in the current layer to the selection.  This function then fires the selected event.

+ +

clear

this.clear = function()

Clears the current document.  This is not an undoable action.

+ +

Fill and Stroke

+ +

getVersion

this.getVersion = function()

Returns a string which describes the revision number of SvgCanvas.

@@ -69,14 +83,14 @@ if (browserType) {document.write("
");if (browserV - +-->
-
this.clearSelection = function()
Clears the selection.
this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
this.open = function(str)
Calls the ‘opened’ handler and sends the SVG XML text.
this.save = function()
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
this.setSvgString = function(xmlString)
This function sets the current drawing as the input SVG XML.
this.createLayer = function(name)
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
this.getNumLayers = function()
Returns the number of layers in the current drawing.
this.getLayer = function(i)
Returns the name of the ith layer.
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.setCurrentLayer = function(name)
Sets the current layer.
this.renameCurrentLayer = function(newname)
Renames the current layer.
this.setCurrentLayerPosition = function(newpos)
Changes the position of the current layer to the new value.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
this.setLayerVisibility = function(layername,
bVisible)
Sets the visibility of the layer.
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.setLayerOpacity = function(layername,
opacity)
Sets the opacity of the given layer.
this.clear = function()
Clears the current document.
+
toXml = function(str)
Converts characters in a string to XML-friendly entities.
fromXml = function(str)
Converts XML entities in a string to single characters.
function ChangeElementCommand(elem,
attrs,
text)
History command to make a change to an element.
this.clearSelection = function(noCall)
Clears the selection.
this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
this.save = function(opts)
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
this.setSvgString = function(xmlString)
This function sets the current drawing as the input SVG XML.
this.createLayer = function(name)
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
this.getNumLayers = function()
Returns the number of layers in the current drawing.
this.getLayer = function(i)
Returns the name of the ith layer.
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.setCurrentLayer = function(name)
Sets the current layer.
this.renameCurrentLayer = function(newname)
Renames the current layer.
this.setCurrentLayerPosition = function(newpos)
Changes the position of the current layer to the new value.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
this.setLayerVisibility = function(layername,
bVisible)
Sets the visibility of the layer.
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.setLayerOpacity = function(layername,
opacity)
Sets the opacity of the given layer.
this.selectAllInCurrentLayer = function()
Clears the selection, then adds all elements in the current layer to the selection.
this.clear = function()
Clears the current document.
this.getVersion = function()
Returns a string which describes the revision number of SvgCanvas.
diff --git a/docs/index/Files.html b/docs/index/Files.html index 6be68e67..9ebbb55f 100644 --- a/docs/index/Files.html +++ b/docs/index/Files.html @@ -11,7 +11,11 @@ if (browserType) {document.write("
");if (browserV -
File Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
S
 svgcanvas.js
+
File Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
M
 my_svgcanvas.js
S
 svgcanvas-latest copy.js
 svgcanvas-mine.js
 svgcanvas-textanchor-experiment.js
 svgcanvas.js
 svgcanvas_subpaths.js
 svgcanvas_temp.js
+ + + + @@ -21,7 +25,7 @@ if (browserType) {document.write("
");if (browserV - diff --git a/docs/index/Functions.html b/docs/index/Functions.html index 05017936..c6a1b5ea 100644 --- a/docs/index/Functions.html +++ b/docs/index/Functions.html @@ -11,37 +11,45 @@ if (browserType) {document.write("
");if (browserV -
Function Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addToSelection
C
 clear
 clearSelection
 createLayer
D
 deleteCurrentLayer
G
 getCurrentLayer
 getLayer
 getLayerOpacity
 getLayerVisibility
 getNumLayers
 getSvgString
M
 moveSelectedToLayer
O
 open
R
 removeFromSelection
 renameCurrentLayer
S
 save
 setCurrentLayer
 setCurrentLayerPosition
 setLayerOpacity
 setLayerVisibility
 setSvgString
+
Function Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addToSelection, SvgCanvas
 apply, SvgCanvas.ChangeElementCommand
C
 ChangeElementCommand, SvgCanvas
 clear, SvgCanvas
 clearSelection, SvgCanvas
 createLayer, SvgCanvas
D
 deleteCurrentLayer, SvgCanvas
F
 fromXml, SvgCanvas
G
 getCurrentLayer, SvgCanvas
 getLayer, SvgCanvas
 getLayerOpacity, SvgCanvas
 getLayerVisibility, SvgCanvas
 getNumLayers, SvgCanvas
 getSvgString, SvgCanvas
 getVersion, SvgCanvas
I
 importSvgString, SvgCanvas
M
 moveSelectedToLayer, SvgCanvas
R
 removeFromSelection, SvgCanvas
 renameCurrentLayer, SvgCanvas
S
 save, SvgCanvas
 selectAllInCurrentLayer, SvgCanvas
 setCurrentLayer, SvgCanvas
 setCurrentLayerPosition, SvgCanvas
 setForeignString(xmlString,elt)
 setLayerOpacity, SvgCanvas
 setLayerVisibility, SvgCanvas
 setSvgString, SvgCanvas
T
 toXml, SvgCanvas
-
this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
+
this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
Performs the stored change action
-
this.clear = function()
Clears the current document.
this.clearSelection = function()
Clears the selection.
this.createLayer = function(name)
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
+
function ChangeElementCommand(elem,
attrs,
text)
History command to make a change to an element.
this.clear = function()
Clears the current document.
this.clearSelection = function(noCall)
Clears the selection.
this.createLayer = function(name)
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
-
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
+
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
-
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.getLayer = function(i)
Returns the name of the ith layer.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
this.getNumLayers = function()
Returns the number of layers in the current drawing.
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
+
fromXml = function(str)
Converts XML entities in a string to single characters.
-
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
+
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.getLayer = function(i)
Returns the name of the ith layer.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
this.getNumLayers = function()
Returns the number of layers in the current drawing.
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
this.getVersion = function()
Returns a string which describes the revision number of SvgCanvas.
-
this.open = function(str)
Calls the ‘opened’ handler and sends the SVG XML text.
+
This function imports the input SVG XML into the current layer in the drawing
-
this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
this.renameCurrentLayer = function(newname)
Renames the current layer.
+
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
-
this.save = function()
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.setCurrentLayer = function(name)
Sets the current layer.
this.setCurrentLayerPosition = function(newpos)
Changes the position of the current layer to the new value.
this.setLayerOpacity = function(layername,
opacity)
Sets the opacity of the given layer.
this.setLayerVisibility = function(layername,
bVisible)
Sets the visibility of the layer.
this.setSvgString = function(xmlString)
This function sets the current drawing as the input SVG XML.
+
this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
this.renameCurrentLayer = function(newname)
Renames the current layer.
+ + + +
this.save = function(opts)
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.selectAllInCurrentLayer = function()
Clears the selection, then adds all elements in the current layer to the selection.
this.setCurrentLayer = function(name)
Sets the current layer.
this.setCurrentLayerPosition = function(newpos)
Changes the position of the current layer to the new value.
function setForeignString(xmlString)
This function sets the content of element elt to the input XML.
this.setLayerOpacity = function(layername,
opacity)
Sets the opacity of the given layer.
this.setLayerVisibility = function(layername,
bVisible)
Sets the visibility of the layer.
this.setSvgString = function(xmlString)
This function sets the current drawing as the input SVG XML.
+ + + +
toXml = function(str)
Converts characters in a string to XML-friendly entities.
@@ -49,9 +57,9 @@ if (browserType) {document.write("
");if (browserV - +-->
diff --git a/docs/index/General.html b/docs/index/General.html index f929ee07..4939d6e6 100644 --- a/docs/index/General.html +++ b/docs/index/General.html @@ -11,17 +11,29 @@ if (browserType) {document.write("
");if (browserV -
Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addToSelection
C
 clear
 clearSelection
 createLayer
D
 deleteCurrentLayer
F
 Fill and Stroke
G
 getCurrentLayer
 getLayer
 getLayerOpacity
 getLayerVisibility
 getNumLayers
 getSvgString
L
 Layers
M
 moveSelectedToLayer
O
 open
R
 removeFromSelection
 renameCurrentLayer
S
 save
 Selection
 Serialization
 setCurrentLayer
 setCurrentLayerPosition
 setLayerOpacity
 setLayerVisibility
 setSvgString
 svgcanvas.js
+
Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addToSelection, SvgCanvas
 apply, SvgCanvas.ChangeElementCommand
C
 ChangeElementCommand, SvgCanvas
 clear, SvgCanvas
 clearSelection, SvgCanvas
 createLayer, SvgCanvas
D
 deleteCurrentLayer, SvgCanvas
F
 Fill and Stroke, SvgCanvas
 fromXml, SvgCanvas
G
 getCurrentLayer, SvgCanvas
 getLayer, SvgCanvas
 getLayerOpacity, SvgCanvas
 getLayerVisibility, SvgCanvas
 getNumLayers, SvgCanvas
 getSvgString, SvgCanvas
 getVersion, SvgCanvas
I
 importSvgString, SvgCanvas
L
 Layers, SvgCanvas
M
 moveSelectedToLayer, SvgCanvas
R
 removeFromSelection, SvgCanvas
 renameCurrentLayer, SvgCanvas
S
 save, SvgCanvas
 selectAllInCurrentLayer, SvgCanvas
 Selection, SvgCanvas
 Serialization, SvgCanvas
 setCurrentLayer, SvgCanvas
 setCurrentLayerPosition, SvgCanvas
 setForeignString(xmlString,elt)
 setLayerOpacity, SvgCanvas
 setLayerVisibility, SvgCanvas
 setSvgString, SvgCanvas
 SvgCanvas
T
 toXml, SvgCanvas
U
 Undo/Redo history management, SvgCanvas
-
this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
+
this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
Performs the stored change action
-
this.clear = function()
Clears the current document.
this.clearSelection = function()
Clears the selection.
this.createLayer = function(name)
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
+
function ChangeElementCommand(elem,
attrs,
text)
History command to make a change to an element.
this.clear = function()
Clears the current document.
this.clearSelection = function(noCall)
Clears the selection.
this.createLayer = function(name)
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
-
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
+
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
+ + + +
fromXml = function(str)
Converts XML entities in a string to single characters.
+ + + +
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.getLayer = function(i)
Returns the name of the ith layer.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
this.getNumLayers = function()
Returns the number of layers in the current drawing.
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
this.getVersion = function()
Returns a string which describes the revision number of SvgCanvas.
+ + + +
This function imports the input SVG XML into the current layer in the drawing
@@ -29,37 +41,33 @@ if (browserType) {document.write("
");if (browserV -
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.getLayer = function(i)
Returns the name of the ith layer.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
this.getNumLayers = function()
Returns the number of layers in the current drawing.
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
+
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
+ + + +
this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
this.renameCurrentLayer = function(newname)
Renames the current layer.
+ + + +
this.save = function(opts)
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.selectAllInCurrentLayer = function()
Clears the selection, then adds all elements in the current layer to the selection.
this.setCurrentLayer = function(name)
Sets the current layer.
this.setCurrentLayerPosition = function(newpos)
Changes the position of the current layer to the new value.
function setForeignString(xmlString)
This function sets the content of element elt to the input XML.
this.setLayerOpacity = function(layername,
opacity)
Sets the opacity of the given layer.
this.setLayerVisibility = function(layername,
bVisible)
Sets the visibility of the layer.
this.setSvgString = function(xmlString)
This function sets the current drawing as the input SVG XML.
The main SvgCanvas class that manages all SVG-related functions
+ + + +
toXml = function(str)
Converts characters in a string to XML-friendly entities.
- - -
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
- - - -
this.open = function(str)
Calls the ‘opened’ handler and sends the SVG XML text.
- - - -
this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
this.renameCurrentLayer = function(newname)
Renames the current layer.
- - - -
this.save = function()
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.setCurrentLayer = function(name)
Sets the current layer.
this.setCurrentLayerPosition = function(newpos)
Changes the position of the current layer to the new value.
this.setLayerOpacity = function(layername,
opacity)
Sets the opacity of the given layer.
this.setLayerVisibility = function(layername,
bVisible)
Sets the visibility of the layer.
this.setSvgString = function(xmlString)
This function sets the current drawing as the input SVG XML.
-
- +-->
diff --git a/docs/javascript/searchdata.js b/docs/javascript/searchdata.js index ba97c181..27bb0708 100644 --- a/docs/javascript/searchdata.js +++ b/docs/javascript/searchdata.js @@ -2,24 +2,24 @@ var indexSectionsWithContent = { "General": { "Symbols": false, "Numbers": false, - "A": false, + "A": true, "B": false, "C": true, "D": true, "E": false, "F": true, "G": true, - "H": false, - "I": false, + "H": true, + "I": true, "J": false, "K": false, - "L": false, - "M": false, + "L": true, + "M": true, "N": false, - "O": false, + "O": true, "P": false, "Q": false, - "R": false, + "R": true, "S": true, "T": false, "U": false, @@ -37,21 +37,21 @@ var indexSectionsWithContent = { "C": true, "D": true, "E": false, - "F": false, + "F": true, "G": true, "H": false, - "I": false, + "I": true, "J": false, "K": false, "L": false, "M": true, "N": false, - "O": true, + "O": false, "P": false, "Q": false, "R": true, "S": true, - "T": false, + "T": true, "U": false, "V": false, "W": false, @@ -59,7 +59,7 @@ var indexSectionsWithContent = { "Y": false, "Z": false }, - "Files": { + "Classes": { "Symbols": false, "Numbers": false, "A": false, diff --git a/docs/search/FilesS.html b/docs/search/FilesS.html index a8c4e958..690d961d 100644 --- a/docs/search/FilesS.html +++ b/docs/search/FilesS.html @@ -11,7 +11,7 @@ if (browserType) {document.write("
");if (browserV -
Loading...
Searching...
No Matches