kieker.webgui.service.impl.utility.model
Class Node

java.lang.Object
  extended by kieker.webgui.service.impl.utility.model.Node

public class Node
extends Object

Objects of this class represent nodes within a Graph, that may or may not have any number of Ports. These Ports are divided into input Ports, positioned to the left of the node; repository Ports, positioned to the right of the node; and output ports that are positioned below repository Ports. Any of these Ports are optional. If the Node has no Ports, KIELER will generate it's own Ports, where it sees fit.

Author:
Robin Weiss, Florian Fittkau

Constructor Summary
Node(Graph graph, String id, int width, int height, boolean hasPorts)
          Class constructor.
 
Method Summary
 void addInputPorts(Graph graph, int portStartY, int portCount)
          Creates a set of input Ports to the node.
 void addOutputPorts(Graph graph, int portStartY, int portCount)
          Creates a set of output Ports to the node.
 void addRepositoryPorts(Graph graph, int portStartY, int portCount)
          Creates a set of repository Ports to the node.
 int getHeight()
           
 String getId()
           
 List<Port> getInputPorts()
           
 de.cau.cs.kieler.core.kgraph.KNode getKielerNode()
           
 List<Port> getOutputPorts()
           
 Port getPort(int portIndex)
          Looks for a port with the specified index.
 Point getPosition()
           
 List<Port> getRepoPorts()
           
 int getWidth()
           
 boolean isNodeFamily()
           
 void setDimensions(int w, int h)
          Resizes the Node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(Graph graph,
            String id,
            int width,
            int height,
            boolean hasPorts)
Class constructor. Creates a Node and assigns a generated KNode to the graph.

Parameters:
graph - the graph that contains the node
id - a unique string representing the node
width - the width of the node
height - the height of the node
hasPorts - true if at least one port exists
Method Detail

addInputPorts

public void addInputPorts(Graph graph,
                          int portStartY,
                          int portCount)
Creates a set of input Ports to the node.

Parameters:
graph - the graph that contains the node
portStartY - the y-coordinate of the first Port, relative to the top border of the Node
portCount - the number of ports that are added

addRepositoryPorts

public void addRepositoryPorts(Graph graph,
                               int portStartY,
                               int portCount)
Creates a set of repository Ports to the node.

Parameters:
graph - the graph that contains the node
portStartY - the y-coordinate of the first Port, relative to the top border of the Node
portCount - the number of ports that are added

addOutputPorts

public void addOutputPorts(Graph graph,
                           int portStartY,
                           int portCount)
Creates a set of output Ports to the node.

Parameters:
graph - the graph that contains the node
portStartY - the y-coordinate of the first Port, relative to the top border of the Node
portCount - the number of ports that are added

getPort

public Port getPort(int portIndex)
Looks for a port with the specified index. Port indices should start at 0 for the first input Port, progress through input Ports, then repository Ports and finally through outputPorts.

Parameters:
portIndex - the index of the Port
Returns:
the Port with the specified index if it exists or null if it does not

getKielerNode

public de.cau.cs.kieler.core.kgraph.KNode getKielerNode()

getId

public String getId()

isNodeFamily

public boolean isNodeFamily()

getInputPorts

public List<Port> getInputPorts()

getRepoPorts

public List<Port> getRepoPorts()

getOutputPorts

public List<Port> getOutputPorts()

getPosition

public Point getPosition()

setDimensions

public void setDimensions(int w,
                          int h)
Resizes the Node.

Parameters:
w - the new width of the Node
h - the new height of the Node

getWidth

public int getWidth()
Returns:
the width of the Node

getHeight

public int getHeight()
Returns:
the height of the node


Copyright © 2015. All rights reserved.