aspose.diagram
Class Layer

Contains elements that define a single layer and its properties for a page.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("Layers.vsdx");
// get Visio page
page = diagram.getPages().getPage("Page-1");
// initialize a new Layer class object
layer = new aspose.diagram.Layer();
// set Layer name
layer.getName().setValue("Layer1");
// set Layer Visibility
layer.getVisible().setValue(aspose.diagram.BOOL.TRUE);
// set the color checkbox of Layer
layer.setColorChecked(aspose.diagram.BOOL.TRUE);
// add Layer to the particular page sheet
page.getPageSheet().getLayers().add(layer);

// get shape by ID
shape = page.getShapes().getShape(3);
// assign shape to this new Layer
shape.getLayerMem().getLayerMember().setValue((layer.getIX()).toString());
diagram.save("out-AddLayer.vsdx", aspose.diagram.SaveFileFormat.VSDX);

Constructor Summary
Layer()
           Constructor.
 
Property Getters/Setters Summary
functiongetActive()
           Specifies whether a layer is active. Shapes that are not preassigned to layers are assigned to the active layer(s) when dropped on the drawing page.
functiongetColor()
           The index of the color in the color table used toThe index of the color in the color table used to display the layer or An RGB value specifying a custom color not in the color table (for example, #ff9900 ). display the layer
functiongetColorTrans()
           Determines the degree of transparency for a layer or shape's text color, from 0 (completely opaque) to 1 (completely transparent).
functiongetDel()
functionsetDel(value)
           A flag indicating whether the element has been deleted locally. A value of 1 indicates that the element was deleted locally. The value of the property is BOOL integer constant.
functiongetGlue()
           Specifies whether shapes belonging to the layer can be glued to.
functionisColorChecked()
functionsetColorChecked(value)
           A flag indicating whether the element has been checked locally. A value of 1 indicates that the element was checked locally. The value of the property is BOOL integer constant.
functiongetIX()
functionsetIX(value)
           The zero-based index of the element within its parent element.
functiongetLock()
           Specifies whether shapes belonging to the layer are locked against being selected or edited.
functiongetName()
           Name element specifies the name of a layer.
functiongetNameUniv()
           Specifies the universal name of a layer.
functiongetPrint()
           Specifies whether shapes belonging to the layer are printed when the drawing is printed.
functiongetSnap()
           Specifies whether other shapes can snap to shapes assigned to the layer. Shapes assigned to the layer can snap to other shapes, but other shapes cannot snap to them.
functiongetStatus()
           Specifies whether the layer is a valid layer for a document.
functiongetVisible()
           Specifies whether shapes belonging to the layer are visible on the drawing page.
 

Constructor Detail

Layer

function Layer()
Constructor.

Property Getters/Setters Detail

getIX/setIX : Number 

function getIX() / function setIX(value)
The zero-based index of the element within its parent element.

getDel/setDel : Number 

function getDel() / function setDel(value)
A flag indicating whether the element has been deleted locally. A value of 1 indicates that the element was deleted locally. The value of the property is BOOL integer constant.

getName : Str2Value 

function getName()
Name element specifies the name of a layer.

getColor : ColorValue 

function getColor()
The index of the color in the color table used toThe index of the color in the color table used to display the layer or An RGB value specifying a custom color not in the color table (for example, #ff9900 ). display the layer

isColorChecked/setColorChecked : Number 

function isColorChecked() / function setColorChecked(value)
A flag indicating whether the element has been checked locally. A value of 1 indicates that the element was checked locally. The value of the property is BOOL integer constant.

getStatus : BoolValue 

function getStatus()
Specifies whether the layer is a valid layer for a document.

getVisible : BoolValue 

function getVisible()
Specifies whether shapes belonging to the layer are visible on the drawing page.

getPrint : BoolValue 

function getPrint()
Specifies whether shapes belonging to the layer are printed when the drawing is printed.

getActive : BoolValue 

function getActive()
Specifies whether a layer is active. Shapes that are not preassigned to layers are assigned to the active layer(s) when dropped on the drawing page.

getLock : BoolValue 

function getLock()
Specifies whether shapes belonging to the layer are locked against being selected or edited.

getSnap : BoolValue 

function getSnap()
Specifies whether other shapes can snap to shapes assigned to the layer. Shapes assigned to the layer can snap to other shapes, but other shapes cannot snap to them.

getGlue : BoolValue 

function getGlue()
Specifies whether shapes belonging to the layer can be glued to.

getNameUniv : Str2Value 

function getNameUniv()
Specifies the universal name of a layer.

getColorTrans : DoubleValue 

function getColorTrans()
Determines the degree of transparency for a layer or shape's text color, from 0 (completely opaque) to 1 (completely transparent).

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.