# Class: Frame

### Extends: modelit.layout.Node & matlab.mixin.SetGet & handle & matlab.mixin.Heterogeneous

## DESCRIPTION:

Container with a layout manager.

#

## Properties

active | If false: This frame is invisible |
      Visibility of this frame.
      Boolean, default value: true
      If true: This frame is visible
allowsChildren | Boolean, default value: true |
      True if the node is able to have children.
backgroundcolor | RGB triple, default value [] |
      The background of the frame.
border | A modelit.layout.AbstractPainter implementation |
      The frame's border.
children (Read-only) | Array, default value: [] |
      Array of children,
      May be [] if this node has no children.
      Children are ordered according to their rank.
      NOTE:
       get.children(obj) returns children sorted in rank order.
clipframe | A modelit.layout.Frame, default value [] |
      The clipframe.
      Components outside this frame are hidden
clipping | Boolean, default value false |
      The clipping mode.
      If true, clip components to clipframe, if false do not clip.
enable | If false: This frame is disabled |
      The enable status of this frame.
      Boolean, default value: true
      If true: This frame is enabled
exitfunction | Function handle, default value: []. |
      Function that is called when frame becomes inactive.
foregroundcolor | RGB triple, default value [] |
      The foreground color (text color) of the frame.
lineprops | Struct, default value: []. |
      Property of line, if used as border.
      See Matlab - line for more information.
      Example:
       lm_lineprops('color','k','shadowed',0 ),...
      set 'shadowed' to true for a shadow effect created by drawing a second line.
maxpixelsize | 1x2 array, default value: [Inf Inf] |
      Maximum pixelsize of this frame.
minmarges | 1x4 array: default value: [0 0 0 0] |
      Margin in pixels for this frame [LEFT LOWER RIGHT UPPER].
      The margin is relative to the parent frame
normposition | Note: Only for the root frame |
      Normalized position of the root frame [x y width height].
      1x4 array, default value: []
normsize | this case the normalized size will be computed form the active siblings. |
      Normalized size of the frame.
      1x2 array: Default value: [1 1]
      NOTE: One may specify NaN for 1 or both dimensions. In
outborderpos | The outer limits of this Frame. |
painter | A modelit.layout.AbstractPainter implementation |
      A background painter.
parent | modelit.layout.Node or [], default value: [] |
      This node's parent, or empty if this node has no parent.
patchprops | Struct, default value: []. |
      Property of background patch.
      See Matlab - patch for more information.
      Example:
       lm_patchprops('facecolor',C.WINCOLOR,'linewidth',1)
pixelposition | Note: Only for the root frame |
      Pixelposition of the root frame [x y width height].
      1x4 array: default value: []
pixelsize | this case the pixelsize will be computed form the active siblings. |
      Size of the frame in pixels.
      1x2 array, Default value: [0 0]
      NOTE: One may specify NaN for one or both dimensions. In
rank | Integer, default value: 0 |
      Relative position of the node.
      When ordering horizontally: Low rank goes left. High rank goes right.
      When ordering vertically. Low rank goes on top. High rank goes below.
      NOTE: only the relative ranks are important.
signature (Read-only) | Unique numeric signature (within objects of class Node) |
splithor | If false: Children will be stacked vertically. |
      Orientation of this frame.
      Boolean: default value: true.
      If true: Children will be stacked horizontally.
tag | String, default value: ''. |
      String with user specified object identifier.
      Use this tag i.c.w. gch('tag', parent) to find a modelit.layout.Frame
title | modelit.layout.Title, default value: '' |
      Frame title.
userdata | Array, default value: [] |
      User specified data for this frame.

# Public Constructor: Frame

## DESCRIPTION:

modelit.layout.Frame constructor

## CALL:

obj = modelit.layout.Frame No input arguments ==> create frame with gcf as parent obj = modelit.layout.Frame(PARENT, varargin) First arguments obj = modelit.layout.Frame(HANDLE) 1 input argument that defines parent frame

## INPUT:

parent | any |
    parent frame or figure (presumably other types of parent
    not allowed)
varargin | any |
    parameter-value pairs, see the component properties for a
    description of the parameters and their values

## OUTPUT:

obj | any |
    modelit.layout.Frame
    Documentation for Frame/Frame
       doc Frame

# Public Method: removeComponents

## DESCRIPTION:

Removes all components in this frame.

## CALL:

removeComponents(obj, excepted)

## INPUT:

obj | any |
      modelit.layout.Frame
    excepted (optional, default value: []):
      array with handles of components that should not be removed

## OUTPUT:

       No output

# Public Method: removeContent

## DESCRIPTION:

ZIJPP 20171019: method added

# Public Method: remove

## DESCRIPTION:

Remove this frame from the tree.

## CALL:

remove(obj)

## INPUT:

obj | any |
    modelit.layout.Frame

## OUTPUT:

       No output

# Public Method: getComponentCount

## DESCRIPTION:

Returns the number of components in this frame.

## CALL:

value = getComponentCount(obj)

## INPUT:

obj | any |
    modelit.layout.Frame

## OUTPUT:

value | any |
    integer with the number of components in this frame

# Public Method: getComponents

## DESCRIPTION:

Returns this frame's components.

## CALL:

value = getComponents(obj)

## INPUT:

obj | any |
    modelit.layout.Frame

## OUTPUT:

value | any |
    list of handles with this frame's components.

# Public Method: stackdisp

## DESCRIPTION:

Show debug information on the console.

## CALL:

stackdisp(obj)

## INPUT:

obj | any |
    <modelit.layout.Frame>

## OUTPUT:

       The source code line and filename that creates this frame is
       plotted on the console, inclusing stack and hyperlinks.

# Public Method: ancestor

## DESCRIPTION:

Returns the handle of the closest ancestor of the frame that matches one of the types in type,

## CALL:

p = ancestor(obj, type)

## INPUT:

obj | any |
    modelit.layout.Frame
type | any |
    String or cell array of strings (types)

## OUTPUT:

p | any |
    handle of the closest ancestor of the frame that matches one of the types in type

# Public Method: getappdata

## DESCRIPTION:

Get application data of this frame.

## CALL:

value = getappdata(obj, property)

## INPUT:

obj | any |
    modelit.layout.Frame
property | any |
    string of application data field

## OUTPUT:

value | any |
    application data stored in application data field

# Public Method: setappdata

## DESCRIPTION:

Set application data of this frame.

## CALL:

value = getappdata(obj, property)

## INPUT:

obj | any |
    modelit.layout.Frame
property | any |
    string of application data field
value | any |
    application data to be stored in application data field

## OUTPUT:

        No output

# Public Method: innerMargins

## DESCRIPTION:

Calculate inner margins. There are the margins as specified by the user corrected with the space required for the title and border.

## CALL:

[lineMargin, contentMargin] = innerMargins(obj)

## INPUT:

obj | any |
    <modelit.layout.Frame>

## OUTPUT:

lineMargin | any |
    <1x4 array>
contentMargin | any |
    <1x4 array>

# Public Method: innerBorders

## DESCRIPTION:

Calculate the inner border. This is the outborderpos corrected with the innerMargins.

## CALL:

[lineBorder, contentBorder] = innerBorders(obj)

## INPUT:

obj | any |
    <modelit.layout.Frame>

## OUTPUT:

lineBorder | any |
    <1x4 array>
contentBorder | any |
    <1x4 array>

# Public Sealed Method: addComponent

## DESCRIPTION:

Add a component to a modelit.layout.Frame

## CALL:

addComponent(hframe, hobj, varargin)

## INPUT:

          hobj  :
     object or array of handles or jacontrol object

hframe | any |
    frame to link to
property | any |
    char string containg property name
value | any |
    corresponding property value. Note: property/value
                combinations may als be passed on as a tructure.

        <propertye, value>
               clipframe
                      see lm_resize
               clipping [0 or 1]
                      clip object if out of frame borders
               enable
                      Default: enable status is copied from application data
                      "enable" from frame.
                      Note
                      <on> and <off> is supported. <inactive> is not supported.
                           Object  |          Frame
                           enabled |       enabled status
                                    'Frame=on' 'Frame=off' 'Frame=inactive'
                           ==========================================
                           0  ==>   'off'      'off'       <not supported>
                           1  ==>   'on'       'off'       <not supported>
                           2  ==>   'inactive' 'off'       <not supported>
                           3  ==>   'off'      'off'       <not supported>
                           4  ==>   'on'       'on'        <not supported>
                           5  ==>   'inactive' 'inactive'  <not supported>
               keeppixelsize : is 1 maintain pixel height and width while alignigning in matrix
               keepypos: if 1 ==> position of slider has no effect on this
                                  object
               normpos [X,Y,WIDTH,HEIGHT]
                      normalized position relative to LL corner of frame
               pixelpos [X,Y,WIDTH,HEIGHT]
                      pixel position relative to LL corner of frame
               visible
                           0  ==> do not show
                           1  ==> show
               row: align on position (row,col) in matrix
               col: align on position (row,col) in matrix

## OUTPUT:

            none

        AFFECTED OBJECTS
            -1- affected application data of frame:
                when an object is linked to a frame, this will affect the following
                fields of application data of this frame:
                  uichildren
                  textchildren
                  children
                  javachildren
            -2- affected properties of object:
                  parent: when object-parent differs from frame-parent
                  units : set to "pixel" when object is of type
                          text,uicontainer,hgjavacomponent
            -3- affected application data of object, required:
                  normpos
                  pixelpos
                  visible
                  enable
                  clipping
                  keepypos
            -4- affected application data of object, optional:
                  clipframe
                  row
                  col
                  keeppixelsize

# Public Sealed Method: getClipRectangle

## DESCRIPTION:

Compute the clipping rectangle.

## CALL:

rect = getClipRectangle(obj)

## INPUT:

obj | any |
    <modelit.layout.Frame>

## OUTPUT:

rect | any |

# Public Sealed Method: initializeTreetopsNew

## DESCRIPTION:

Initialise de variabele 'inborderpos' voor de frames die geen parent hebben In tegenstelling tot frames met een parent, wordt hier de positie bepaald door de elementen normpos en normpix, waarbij met broers en zussen geen rekening wordt gehouden normpix wordt vermenigvuldigd met de afmetingen van het scherm pixelsize wordt daarbij opgeteld

## CALL:

[FrameData, hax] = initializeTreetops(FrameData, hfig)

## INPUT:

FrameData | any |
    modelit.layout.Frame
hfig | any |
    handle of figure

## OUTPUT:

FrameData | any |
hax | any |

# Public Sealed Method: hide

## DESCRIPTION:

Hide all components and decorators of this frame

## CALL:

hide(obj)

## INPUT:

obj | any |
    modelit.layout.Frame

## OUTPUT:

       No output

# Public Sealed Method: plotFrame

## DESCRIPTION:

Position and plot all components in this frame.

## CALL:

plotFrame(frame)

## INPUT:

frame | any |
    modelit.layout.Frame

## OUTPUT:

       No output

# Public Sealed Method: splitFrameFast

## DESCRIPTION:

Calculate position of frame. - Set slider attributes for kth frame. - Set outborder positions for all children of kth frame.

## CALL:

splitFrameFast(FrameData, FrameDataParentIndx, pixelsizes, k)

## INPUT:

obj | any |
    <modelit.layout.Frame>

## OUTPUT:

       No direct output

ChildFrames | any |
    sub-frames met bijgewerkte eigenschappen:
        activenode
        inborderpos
        outborderpos
showslider | any |
    true wanneer hoogte viewport<required
VERTICALSHIFT | any |
    verticale verschuiving oiv slider

# Public Sealed Method: pixelsizeFast

## DESCRIPTION:

Get the implied pixelsizes of all frame. Note that another methods computes the implied size of a single frame (method: impliedpixelsize)

## CALL:

pixelsizes = pixelsizeFast(FrameData, FrameDataParentIndx)

## INPUT:

FrameData | any |
        Nx1 list of frames. Sorted with root first.
    FrameDataParentIndx
        Nx1 list of indices in Framedata

# Public Sealed Method: impliedpixelsize

## DESCRIPTION:

Compute implied pixel size of frame or frames. Note that method "pixelsizeFast" does the same faster if all pixelsizes are required.

## CALL:

value = impliedpixelsize(obj)

# Protected Method: updateHgProps

## DESCRIPTION:

Update handle graphics properties of object and frame

# Protected Method: isActivenode

## DESCRIPTION:

Determines if this node is active. This method is used by the activenode property getter and can be overridden by subclasses.

## CALL:

value = isActivenode(obj)

## INPUT:

obj | any |
    <modelit.layout.Frame>

## OUTPUT:

value | any |
    <boolean>, if true this frame if active (visible)

# Protected Method: removeAll

## DESCRIPTION:

Removes all components in this frame

## CALL:

removeAll(obj)

## INPUT:

obj | any |
      modelit.layout.Frame
    excepted (optional, default value: []):
      array with handles of components that should not be removed

## OUTPUT:

       No output

# Public Static Sealed Method: find

## DESCRIPTION:

Find a Frame with the specified tag

## CALL:

h = find(tag, HWIN)

## INPUT:

tag | any |
    string with tag of Frame to look for
HWIN | any |
    handle of figure in which to look for the Frame

## OUTPUT:

h | any |
    Array of modelit.layout.Frame, possible empty if no Frame with
    specified tag exists

# Public Static Sealed Method: storeTree

## DESCRIPTION:

Stores the tree (root node) in the specified figure

## CALL:

layout = storeTree(HWIN)

## INPUT:

HWIN | any |
    handle of figure in which to store the tree.
layout | any |
    modelit.layout.Frame with the root of the tree

## OUTPUT:

        No output

# Public Static Sealed Method: retrieveTree

## DESCRIPTION:

Retrieves the tree (root node) from the specified figure

## CALL:

layout = retrieveTree(HWIN)

## INPUT:

HWIN | any |
    handle of figure in which the tree is stored.

## OUTPUT:

layout | any |
    modelit.layout.Frame with the root of the tree

# Public Method: lm_get

## DESCRIPTION:

Helper for migration to new layout manager

# Public Method: lm_set

## DESCRIPTION:

Helper for migration to new layout manager

# Public Sealed Method: getPathToRoot

### Inherited from modelit.layout.Node

## DESCRIPTION:

Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.

## CALL:

value = getPathToRoot(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
         list of modelit.layout.Node
    Help for Frame/getPathToRoot is inherited from superclass modelit.layout.Node

# Public Sealed Method: getLevel

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the number of levels above this node, i.e. the distance from the root to this node.

## CALL:

value = getLevel(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
         integer
    Help for Frame/getLevel is inherited from superclass modelit.layout.Node

# Public Sealed Method: getDepthFirstList

### Inherited from modelit.layout.Node

## DESCRIPTION:

Creates a list on nodes in depth-first order for the subtree starting at the specified node.

## CALL:

list = getDepthFirstList(obj, list)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

list | any |
         array of modelit.layout.Node in depth-first order
    Help for Frame/getDepthFirstList is inherited from superclass modelit.layout.Node

# Public Sealed Method: getBreadthFirstList

### Inherited from modelit.layout.Node

## DESCRIPTION:

Creates a list on nodes in breadth-first order for the subtree starting at the specified node.

## CALL:

list = getBreadthFirstList(obj)

## INPUT:

obj | any |
    <modelit.layout.Node>

## OUTPUT:

list | any |
         <array of modelit.layout.Node> in breadth-first order
    Help for Frame/getBreadthFirstList is inherited from superclass modelit.layout.Node

# Public Sealed Method: isactivenode

### Inherited from modelit.layout.Node

## DESCRIPTION:

Determine if a node is active.

## CALL:

selectindx = isactivenode(list, parentIndex)

## INPUT:

list | any |
    Nx1 array of Frames
parentIndex | any |
    Nx1 array of parent index

## OUTPUT:

selectindx | any |
              Mx1 array, index in list, sorted according to parent
              and rank. Sorting is essential for correct display.
    Help for Frame/isactivenode is inherited from superclass modelit.layout.Node

# Public Sealed Method: getBreadthFirstListActive

### Inherited from modelit.layout.Node

## DESCRIPTION:

Create list of active frames only, see getBreadthFirstList.

## CALL:

list = getBreadthFirstList(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

list | any |
         array of modelit.layout.Node in breadth-first order
    Help for Frame/getBreadthFirstListActive is inherited from superclass modelit.layout.Node

# Public Sealed Method: getPreviousSibling

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the previous sibling of this node. Returns [] if this node has no parent or if it is the parent's first child.

## CALL:

value = getPreviousSibling(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
         modelit.layout.Node or []
    Help for Frame/getPreviousSibling is inherited from superclass modelit.layout.Node

# Public Sealed Method: getNextSibling

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the next sibling of this node. Returns [] if this node has no parent or if it is the parent's last child.

## CALL:

value = getNextSibling(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
         modelit.layout.Node or []
    Help for Frame/getNextSibling is inherited from superclass modelit.layout.Node

# Public Sealed Method: getSiblings

### Inherited from modelit.layout.Node

## DESCRIPTION:

Gets the siblings (nodes with the same parent) of this node. Note that this node is its own sibling

## CALL:

value = getSiblings(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
         modelit.layout.Node
    Help for Frame/getSiblings is inherited from superclass modelit.layout.Node

# Public Sealed Method: moveChild

### Inherited from modelit.layout.Node

## DESCRIPTION:

Move a child of this frame to another frame.

## CALL:

moveChild(obj, child, newparent)

## INPUT:

obj | any |
    modelit.layout.Node
child | any |
    modelit.layout.Node
newparent | any |
    modelit.layout.Node

## OUTPUT:

       Child is removed from this frame and add as a child to the
       new parent frame.

    Help for Frame/moveChild is inherited from superclass modelit.layout.Node

# Public Sealed Method: removeAllChildren

### Inherited from modelit.layout.Node

## DESCRIPTION:

Removes all of this node's children.

## CALL:

removeAllChildren(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

       No output

    Help for Frame/removeAllChildren is inherited from superclass modelit.layout.Node

# Public Sealed Method: isRoot

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns true if this node is the root of the tree.

## CALL:

obj = isRoot(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
        boolean, true if this node is a root node
    Help for Frame/isRoot is inherited from superclass modelit.layout.Node

# Public Sealed Method: isLeaf

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns true if this node is a leaf.

## CALL:

value = isLeaf(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
        boolean, true if this node is a leaf (has no children)
    Help for Frame/isLeaf is inherited from superclass modelit.layout.Node

# Public Sealed Method: getRoot

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the root of this node.

## CALL:

obj = getRoot(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

obj | any |
         modelit.layout.Node
    Help for Frame/getRoot is inherited from superclass modelit.layout.Node

# Public Sealed Method: getIndex

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the index of this node in its parent's children.

## CALL:

value = getIndex(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
         integer with index of this node in its parent's children, 0 if this node is a root
    Help for Frame/getIndex is inherited from superclass modelit.layout.Node

# Public Sealed Method: getChildCount

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the number of children of this node.

## CALL:

value = getChildCount(obj)

## INPUT:

obj | any |
    modelit.layout.Node

## OUTPUT:

value | any |
         integer with number of children of this node
    Help for Frame/getChildCount is inherited from superclass modelit.layout.Node

# Public Sealed Method: getChildAt

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the child of obj at index childIndex.

## CALL:

value = getChildAt(obj, childIndex)

## INPUT:

obj | any |
    modelit.layout.Node
childIndex | any |
    integer

## OUTPUT:

obj | any |
         modelit.layout.Node or [] if index exceeds number of children
    Help for Frame/getChildAt is inherited from superclass modelit.layout.Node

# Public Sealed Method: getSortedChildren

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the childs in sorted order.

## CALL:

value = getChildAt(obj, childIndex)

## INPUT:

obj | any |
    modelit.layout.Node
childIndex | any |
    integer

## OUTPUT:

obj | any |
         modelit.layout.Node or [] if index exceeds number of children
    Help for Frame/getSortedChildren is inherited from superclass modelit.layout.Node

# Public Sealed Method: eq

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the objects whose property values match those passed as param-value pairs to the findobj command. Help for Frame/eq is inherited from superclass modelit.layout.Node

# Public Sealed Method: findobj

### Inherited from modelit.layout.Node

## DESCRIPTION:

Returns the objects whose property values match those passed as param-value pairs to the findobj command. Help for Frame/findobj is inherited from superclass modelit.layout.Node

# Public Sealed Method: ismember

### Inherited from modelit.layout.Node

## DESCRIPTION:

Each node has its own unique numeric signature Help for Frame/ismember is inherited from superclass modelit.layout.Node

# Public Sealed Method: double

### Inherited from modelit.layout.Node

## DESCRIPTION:

DOUBLE Convert to double precision. DOUBLE(X) returns the double precision value for X. If X is already a double precision array, DOUBLE has no effect. DOUBLE is called for the expressions in FOR, IF, and WHILE loops if the expression isn't already double precision. DOUBLE should be overloaded for all objects where it makes sense to convert it into a double precision value. See also SINGLE, DATATYPES, ISFLOAT, ISNUMERIC.

# Public Method: add

### Inherited from modelit.layout.Node

## DESCRIPTION:

Removes newChild from its parent and makes it a child of this node by adding it to the end of this node's child array.

## CALL:

add(obj, newChild)

## INPUT:

obj | any |
    modelit.layout.Node
newChild | any |
    modelit.layout.Node, node to be added as a child of obj

## OUTPUT:

       No output

    Help for Frame/add is inherited from superclass modelit.layout.Node