Alpha Framework 3.0.0 API Documentation
  • Namespace
  • Class

Namespaces

  • Alpha
    • Controller
      • Front
    • Exception
    • Model
      • Type
    • Task
    • Util
      • Backup
      • Cache
      • Code
        • Highlight
        • Metric
      • Config
      • Convertor
      • Email
      • Extension
      • Feed
      • File
      • Graph
      • Helper
      • Http
        • Filter
        • Session
      • Image
      • Logging
      • Search
      • Security
      • Service
    • View
      • Renderer
        • Html
        • Json
      • Widget

Classes

  • GraphNode
  • TreeGraph

Class GraphNode

Maintains the geometry for a tree node.

Namespace: Alpha\Util\Graph
Copyright:

Copyright (c) 2018, John Collins (founder of Alpha Framework). All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:

* Redistributions of source code must retain the above
  copyright notice, this list of conditions and the
  following disclaimer.
* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the
  following disclaimer in the documentation and/or other
  materials provided with the distribution.
* Neither the name of the Alpha Framework nor the names
  of its contributors may be used to endorse or promote
  products derived from this software without specific
  prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

License: The BSD License
Author: John Collins dev@alphaframework.org
Since: 1.0
Located at Util/Graph/GraphNode.php

Methods summary

public
# __construct( integer $id, integer $width, integer $height, string $message = '', array $nodeColour = array(), string $URL = null )

Constructor.

Constructor.

Parameters

$id
$width
$height
$message
$nodeColour
$URL
public array
# getNodeColour( )

Get the node colour array.

Get the node colour array.

Returns

array

Since

1.0
public
# setNodeColour( array $nodeColour )

Set the node colour array.

Set the node colour array.

Parameters

$nodeColour

Throws

Alpha\Exception\IllegalArguementException

Since

1.0
public string
# getURL( )

Get the node URL.

Get the node URL.

Returns

string

Since

1.0
public
# setURL( string $URL )

Set the node URL.

Set the node URL.

Parameters

$URL

Since

1.0
public string
# getMessage( )

Get the node text message.

Get the node text message.

Returns

string

Since

1.0
public
# setMessage( string $message )

Set the node text message.

Set the node text message.

Parameters

$message

Since

1.0
public integer
# getOffset( )

Get the node offset.

Get the node offset.

Returns

integer

Since

1.0
public
# setOffset( integer $offset )

Set the node offset.

Set the node offset.

Parameters

$offset

Since

1.0
public integer
# getModifier( )

Get the node modifier.

Get the node modifier.

Returns

integer

Since

1.0
public
# setModifier( integer $modifier )

Set the node modifier.

Set the node modifier.

Parameters

$modifier

Since

1.0
public integer
# childCount( )

Get the number of child nodes attached to this node.

Get the number of child nodes attached to this node.

Returns

integer

Since

1.0
public Alpha\Util\Graph\GraphNode
# getParentNode( )

Get the parent node of this node (if any).

Get the parent node of this node (if any).

Returns

Alpha\Util\Graph\GraphNode

Since

1.0
public
# setParentNode( Alpha\Util\Graph\GraphNode $node )

Set the parent node.

Set the parent node.

Parameters

$node

Throws

Alpha\Exception\IllegalArguementException

Since

1.0
public Alpha\Util\Graph\GraphNode
# getLeftSibling( )

Get the node to the left of this one (if any).

Get the node to the left of this one (if any).

Returns

Alpha\Util\Graph\GraphNode

Since

1.0
public
# setLeftSibling( Alpha\Util\Graph\GraphNode $node )

Sets the node to the left of this node.

Sets the node to the left of this node.

Parameters

$node

Throws

Alpha\Exception\IllegalArguementException

Since

1.0
public Alpha\Util\Graph\GraphNode
# getRightSibling( )

Get the node to the right of this one (if any).

Get the node to the right of this one (if any).

Returns

Alpha\Util\Graph\GraphNode

Since

1.0
public
# setRightSibling( Alpha\Util\Graph\GraphNode $node )

Sets the node to the right of this node.

Sets the node to the right of this node.

Parameters

$node

Throws

Alpha\Exception\IllegalArguementException

Since

1.0
public mixed
# getChildAt( integer $i )

Gets the child node at the index provided, or returns false if none is found.

Gets the child node at the index provided, or returns false if none is found.

Parameters

$i

Returns

mixed

Since

1.0
public float
# getChildrenCenter( )

Calculates and returns the midpoint X coordinate of the children of this node.

Calculates and returns the midpoint X coordinate of the children of this node.

Returns

float

Since

1.0
public array
# getChildren( )

Returns the array of child GraphNode objects.

Returns the array of child GraphNode objects.

Returns

array

Since

1.0
public
# addChild( Alpha\Util\Graph\GraphNode $node )

Add a new node to the children array of this node.

Add a new node to the children array of this node.

Parameters

$node

Throws

ALpha\Exception\IllegalArguementException

Since

1.0
public array
# getLinks( )

Returns the links array.

Returns the links array.

Returns

array

Since

1.0
public
# setUpLinks( )

Sets up the array of connector endpoints.

Sets up the array of connector endpoints.

Since

1.0
public integer
# getHeight( )

Returns the node height.

Returns the node height.

Returns

integer

Since

1.0
public integer
# getWidth( )

Returns the node width.

Returns the node width.

Returns

integer

Since

1.0
public integer
# getX( )

Returns the node X-coordinate.

Returns the node X-coordinate.

Returns

integer

Since

1.0
public integer
# getY( )

Returns the node Y-coordinate.

Returns the node Y-coordinate.

Returns

integer

Since

1.0
public
# setX( integer $x )

Sets the node X-coordinate.

Sets the node X-coordinate.

Parameters

$x

Since

1.0
public
# setY( integer $y )

Sets the node Y-coordinate.

Sets the node Y-coordinate.

Parameters

$y

Since

1.0
Alpha Framework 3.0.0 API Documentation API documentation generated by ApiGen