asposediagram.api

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
methodgetActive()
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.
methodgetColor()
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
methodgetColorTrans()
Determines the degree of transparency for a layer or shape's text color, from 0 (completely opaque) to 1 (completely transparent).
methodgetDel()
method
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.
methodgetGlue()
Specifies whether shapes belonging to the layer can be glued to.
methodisColorChecked()
method
           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.
methodgetIX()
method
setIX(value)
           The zero-based index of the element within its parent element.
methodgetLock()
Specifies whether shapes belonging to the layer are locked against being selected or edited.
methodgetName()
Name element specifies the name of a layer.
methodgetNameUniv()
Specifies the universal name of a layer.
methodgetPrint()
Specifies whether shapes belonging to the layer are printed when the drawing is printed.
methodgetSnap()
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.
methodgetStatus()
Specifies whether the layer is a valid layer for a document.
methodgetVisible()
Specifies whether shapes belonging to the layer are visible on the drawing page.
 

    • Constructor Detail

      • Layer

        Layer()
        Constructor.
    • Property Getters/Setters Detail

      • getIX/setIX : int 

        int getIX() / setIX(value)
        
        The zero-based index of the element within its parent element.
      • getDel/setDel : int 

        int getDel() / 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.
      • getColor : ColorValue 

        ColorValue 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 : int 

        int isColorChecked() / 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 

        BoolValue getStatus()
        
        Specifies whether the layer is a valid layer for a document.
      • getVisible : BoolValue 

        BoolValue getVisible()
        
        Specifies whether shapes belonging to the layer are visible on the drawing page.
      • getPrint : BoolValue 

        BoolValue getPrint()
        
        Specifies whether shapes belonging to the layer are printed when the drawing is printed.
      • getActive : BoolValue 

        BoolValue 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 

        BoolValue getLock()
        
        Specifies whether shapes belonging to the layer are locked against being selected or edited.
      • getSnap : BoolValue 

        BoolValue 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 

        BoolValue getGlue()
        
        Specifies whether shapes belonging to the layer can be glued to.
      • getNameUniv : Str2Value 

        Str2Value getNameUniv()
        
        Specifies the universal name of a layer.
      • getColorTrans : DoubleValue 

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