software products and customization
Contact: support@xuebrothers.net Home page

The OCMatrix Interface of ActiveOC


Methods

GetNode
Purpose: Retrieve a OCNode object from the OCMatrix array
Arguments: 1.row(number), 2.column(number)
Return Value: OCNode object
Example:
var a=mat.GetNode(0, 0);
InitNodeImageRectangle
Purpose: Initialize node images of rectangle shape
Arguments:
  • width(number): inner width of the image
  • height(number): inner height of the image
  • roundCorner(true/false): round-cornered rectangle
  • borderWidth(number): border line width
  • borderRGB(number): border line color
  • fillingStartRGB(number): filling color 1
  • fillingEndRGB(number): filling color 2
  • fillingVertical(true/false) filling vertically
Return Value: true(success)/false(faiure)
Example:
//200 x 120 round-corner rectangle with blue border and filled gradiently from white to blue
var w=mat.Color(255,255,255);
var b=mat.Color(0, 119,224);
mat.InitNodeImageRectangle(200, 120, true, 1, b, w, b, true);
InitNodeImageOval
Purpose: Initialize node images of oval shape
Arguments:
  • width(number): inner width of the image
  • height(number): inner height of the image
  • borderWidth(number): border line width
  • borderRGB(number): border line color
  • fillingStartRGB(number): filling color 1
  • fillingEndRGB(number): filling color 2
  • fillingVertical(true/false) filling vertically
  • Return Value: true(success)/false(faiure)
    Example:
    //200 x 120 oval with blue border and filled gradiently from white to blue
    var w=mat.Color(255,255,255);
    var b=mat.Color(0, 119,224);
    mat.InitNodeImageRectangle(200, 120, true, 1, b, w, b, true);
    
    InitNodeImageFromFile
    Purpose: Initialize node images based on a picture specified by application.
    Arguments: path(string): file name of a picture file
    Return Value: true(success)/false(faiure)
    Example:
    mat.InitNodeImageFromFile("my.jpg");
    
    Color
    Purpose: Combine red, green and blue to make a 24-bit color value
    Arguments: 1.red, 2.green, 3.blue
    Return Value: 24-bit color value (number)
    Example:
    var blue=mat.Color(0,0,255);
    mat.LineColor=blue;
    
    TranslateColor
    Purpose: Translate web-page-style color to 24-bit color
    Arguments: color(string)
    Return Value: 24-bit color value
    Example:
    var blue=mat.TranslateColor("#0000ff");
    mat.LineColor=blue;
    
    SaveMatrixImage
    Purpose: Combine node images to make a complete picture and save it to a file
    Arguments: path(string): picture file name
    Return Value: true/false
    Example:
    mat.SaveMatrixImage("my.png");
    
    SaveNodeImages
    Purpose: Save node images to a folder
    Arguments: folder(string): name of the folder where the node images are to be saved.
    Return Value: true/false
    Example:
    mat.SaveNodeImages("myfolder");
    
    CleanUp
    Purpose: Release resources allocated by OCMatrix. The array becomes empty after this method is called
    Arguments:
    Return Value:
    Example:
    mat.CleanUp();
    

    Properties

    Rows
    Type: number
    Notes: Number of rows of the OCMatrix array
    Columns
    Type: number
    Notes: Number of columns of the OCMatrix array
    LineWidth
    Type: number
    Notes: Width of the connection lines between nodes
    LineColor
    Type: number (24-bit color value)
    Notes: 24-bit color value of the connection lines between nodes
    MarginLeft, MarginRight, MarginTop, MarginBottom
    Type: number
    Notes: Image Name Conventions
    MarginLeft = length of line B
    MarginRight = length of line D
    MarginTop = length of line C
    MarginBottom = lenth of line E
    
    NodeWidth
    Type: number
    Notes: Overall width of the node image, including MarginLeft and MarginRight
    NodeHeight
    Type: number
    Notes: Overall height of the node image, including MarginTop and MarginBottom
    Width
    Type: number
    Notes: Overall width of the OCMatrix image
    Height
    Type: number
    Notes: Overall height of the OCMatrix image
    License
    Type: String
    Notes: License information about the current copy of ActiveOC.
    LastError
    Type: String
    Notes: The information of last error. ActiveOC does not throw an exception when error occurs. Check this value when a method returns false or a value not expected.