Documentation of 'medusa.graph.Node' Java class
Node
medusa.graph

Class Node

  • All Implemented Interfaces:
    java.io.Serializable


    public class Node
    extends java.lang.Object
    implements java.io.Serializable
    The Node object
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      Node()
      Empty constructor
      Node(java.lang.String name)
      Constructor
      Node(java.lang.String name, double x, double y)
      Constructor
      Node(java.lang.String name, double x, double y, int shape)
      Constructor
      Node(java.lang.String name, java.lang.Double x, java.lang.Double y, java.lang.Integer shape, java.awt.Color color) 
    • Constructor Detail

      • Node

        public Node()
        Empty constructor
      • Node

        public Node(java.lang.String name)
        Constructor
        Parameters:
        name - Label of node
      • Node

        public Node(java.lang.String name,
                    double x,
                    double y)
        Constructor
        Parameters:
        name - label
        x - x position (0.0-1.0)
        y - y position (0.0-1.0)
      • Node

        public Node(java.lang.String name,
                    double x,
                    double y,
                    int shape)
        Constructor
        Parameters:
        name -
        x -
        y -
        shape - Shape of node
      • Node

        public Node(java.lang.String name,
                    java.lang.Double x,
                    java.lang.Double y,
                    java.lang.Integer shape,
                    java.awt.Color color)
    • Method Detail

      • toString

        public java.lang.String toString()
        String representation of node
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of node
      • report

        public java.lang.String report()
        Reports the label, colors and annotation. Mostly for debugging
        Returns:
        debug info
      • getX

        public double getX()
        Get x position
        Returns:
        x position
      • rescale

        public void rescale(int scale)
        Rescales the x and y positions.
        Parameters:
        scale - the scaling factor
      • rescale

        public void rescale(int xScale,
                            int yScale)
      • setX

        public void setX(double x)
        Sets x position
        Parameters:
        x - position
      • getY

        public double getY()
        Get y position
        Returns:
        y position
      • setY

        public void setY(double y)
        Sets y position
        Parameters:
        y - position
      • getDX

        public double getDX()
        Get delta x. This is the current velocity of the node
        Returns:
        dX
      • setDX

        public void setDX(double dx)
        Sets velocity
        Parameters:
        dx - velocity
      • getDY

        public double getDY()
        Get y velocity
        Returns:
        velocity
      • setDY

        public void setDY(double dy)
        Set velocity
        Parameters:
        dy - y velocity
      • getColor

        public java.awt.Color getColor()
        get primary color
        Returns:
        Color
      • getColor

        public java.awt.Color getColor(int i)
      • setColor

        public void setColor(java.awt.Color color)
        Set primary color
        Parameters:
        color - primary color
      • setColor

        public void setColor(int i,
                             java.awt.Color color)
      • getColor2

        public java.awt.Color getColor2()
        Secondary color. To make use of this color, you have to extend the node drawing method of the BasicGraphPanel. You can set the secondary and tertiary color by the switches c2 and c3 in the graph data file
        Returns:
        secondary color
      • setColor2

        public void setColor2(java.awt.Color color)
        Set secondary color
        Parameters:
        color - seconday color
      • getClusteringColor

        public java.awt.Color getClusteringColor()
      • setClusteringColor

        public void setClusteringColor(java.awt.Color color)
        Set secondary color
        Parameters:
        color - seconday color
      • getColor3

        public java.awt.Color getColor3()
        Get tertiary color
        Returns:
        tertiary color
      • setColor3

        public void setColor3(java.awt.Color color)
        Set tertiary color. See getColor2 for details on how to use this color
      • isFixed

        public boolean isFixed()
      • setFixed

        public void setFixed(boolean fixed)
      • getShape

        public int getShape()
        Get the current shape integer of the node
        Returns:
      • setShape

        public void setShape(int shape)
        Sets the shape
        Parameters:
        shape -
      • manipulateColorElement

        public void manipulateColorElement(int a,
                                           int b,
                                           boolean doSwitch)
        Changes the color channels. Channels are R, G and B, channels can be copied or switched
        Parameters:
        a - channel to copy to. 0: red 1: green 2: blue
        b - channel to copy from.
        doSwitch - select true to switch channels a and b, false to copy intensity from channel b to channel a.
      • manipulateChannel

        public void manipulateChannel(int channel,
                                      int value)
        Parameters:
        channel -
        value -
      • equals

        public boolean equals(java.lang.Object o)
        Compare two nodes
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - object node
        Returns:
        true if nodes are equal
      • getLabel

        public java.lang.String getLabel()
        Get node label
        Returns:
        current label
      • setLabel

        public void setLabel(java.lang.String lbl)
        Sets the node label. This should not be used directly on nodes that are connected in a graph. Use the methods in Graph to rename nodes.
        Parameters:
        lbl - new label
      • setXY

        public void setXY(double x,
                          double y)
      • getConnections

        public int getConnections()
        Get number of nodes connected to this node
        Returns:
        number of nodes
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • copyPosition

        public void copyPosition(Node n)
        Copies x and y parameters from node n.
        Parameters:
        n - node position to copy
      • getColorEntry

        public java.lang.String getColorEntry()
      • getAppletColorEntry

        public java.lang.String getAppletColorEntry()
      • getColor2Entry

        public java.lang.String getColor2Entry()
      • getColor3Entry

        public java.lang.String getColor3Entry()
      • getColor4Entry

        public java.lang.String getColor4Entry()
      • setDataSpace1

        public void setDataSpace1(int space)
        Additional data. Should be overridden if you need more data
        Parameters:
        space - any integer
      • getDataSpace1

        public int getDataSpace1()
        Gets the optional data
        Returns:
        data integer
      • setAnnotation

        public void setAnnotation(java.lang.String ann)
        Sets the annotation string
        Parameters:
        ann - annotation
      • getAnnotation

        public java.lang.String getAnnotation()
        Gets the current annotation
        Returns:
        annotation
      • setURL

        public void setURL(java.lang.String ann)
      • getURL

        public java.lang.String getURL()
      • setCluster

        public void setCluster(java.lang.String ann)
      • getCLuster

        public int getCLuster()

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.