Class DrawGraph

    • Constructor Detail

      • DrawGraph

        public DrawGraph​(int[][] Graph)
        Consructor for the class
        Parameters:
        Graph - - Adjacency matrix for the network/graph
    • Method Detail

      • main

        public static void main​(String[] args)
      • saveImage

        public void saveImage()
        Used for saving the image as a JPEG file.
        Parameters:
        None -
      • getTargetNodes

        public ArrayList<Integer> getTargetNodes​(int Node)
        Gets the list of all nodes (children) to which the node Node points.
        Parameters:
        Node - - Node in the Graph
        Returns:
        An ArrayList of integers which are the indices of the target nodes
      • drawCenteredCircle

        public void drawCenteredCircle​(Graphics2D g,
                                       int x,
                                       int y,
                                       int r)
        Draws a circle with radius r and center (x,y)
        Parameters:
        g - - Graphics2D object
        x - - x coordinate of circle center
        y - - y coordinate of circle center
        r - - radius of circle