Java Graph ADT

I need some help and I am quite lost. I need to develop a Graph in java.
I understand that the graph has vertices and edges. I developed two classes of vertex and edge. I just don't understand how to implement them in the class Graph.
This is homework, but i am so very confused...

An edge has exactly two vertices.
A vertex can have an arbitrary number of edges.
A graph is a collection of edges and a collection of vertices, and they have to make sense.
If I recall my data structures classes from long ago, graphs don't necessarily need to be connected. You can have standalone vertices or bunches of vertices which don't necessarily interconnect.

Similar Messages

  • Invoking Sample Java Graphs thro Oracle Express 6.3.2

    We have installed Oracle Express 6.3.2 to develop OLAP web application.
    At the outset we tried to invoke sample Java Graph Pages created
    using the samples.db after setting the page as JAVATABLE type through the link http:\machineid\oew-install\sample\index.html.
    oew-install is the virtual directory that points the path -
    oxhome\olap\oes632\owa632
    We could only view the OLAP cube as HTMLTABLE type.
    Where are we wrong in not viewing the Graphs???
    Have we missed anything during installation??

    Hi Aneel
    Thanks for your support.
    As per your sugessions We have checked the browser options, we could not find the Java 2 option but we had three options under microsoft VM which are as given below
    1. Java Console Enable
    2. Java Login Enable
    3. JIT compiler for virtual macine enabled.
    We have checked 1 and 3 options and restarted the IE browser still we could not succed in getting the Java Graphs in Sample appication.
    More over as asked by you the version of Java console is "Microsoft (R) VM for Java, 5.0 Release 5.0.0.3234"
    With netscape it was showing "Applet owagraph can't start : Error"
    Hi Can I have your mailId?
    Thanks
    Nanda Kishore

  • Java Graph code explanation

    Hi all,
    im new to java and have some trouble drawing a graph i looked up some code but dont quite understand it
    can someone explain the following code please. I understand swing and painting and basic java.
    Q1) Can please explain the flow of execution ?
    Q2)
    What i would also specifically like to understand about the code
    is how does the graph keep going and looks like it scrolls across and not off the frame and how can i add this to a frame i already have
    without covering over my other objects i have displayed.
    Any help would be greatly appreciated.
    Thanks
    import java.awt.*;*
    *import javax.swing.*;
    import java.awt.event.*;*
    *import javax.swing.event.*;
    import java.awt.image.BufferedImage;
    import java.awt.geom.*;*
    *import java.math.*;
    import java.util.*;*
    *public class ecg extends JFrame*
    *     myView view = new myView();*
    *     Vector vr   = new Vector();*
    *     int    ho   = 0;*
    *public ecg()* 
    *     addWindowListener(new WindowAdapter()*
        *{     public void windowClosing(WindowEvent ev)*
    *          {     dispose();*
    *               System.exit(0);}});*
    *     for (int i=0; i < 5000; i++)*
    *          int p = (int)(Math.random()*  260);
              vr.add(new Point(0,p-130));
         setBounds(3,10,625,350);
         view.setBounds(10,10,600,300);
         getContentPane().add(view);
         getContentPane().setLayout(null);
         setVisible(true);
         while (ho < 500-300)
              try
                   Thread.sleep(110);
                   ho = ho  +1;+
    +               repaint();+
    +          } catch (InterruptedException e) {}+
    +     }+
    +}+
    +public class myView extends JPanel+
    +{+
    +     BufferedImage I;+
    +     Graphics2D    G;+
    +public myView()+
    +{+ 
    +}+
    +public void paint(Graphics g)+
    +{+
    +     if (I == null)+
    +     {+
    +          I = new BufferedImage(getWidth(),getHeight(),BufferedImage.TYPE_INT_ARGB);+
    +          G = I.createGraphics();+
    +     }+
    +     G.setColor(Color.white);+
    +     G.fillRect(0,0,getWidth(),getHeight());+
    +     G.setColor(Color.gray);+
    +     Point p1,p2;+
    +     p1 = (Point)vr.get(ho);+
    +     int x = 0;+
    +     for (int y=1; y < 600; y++)
              p2 = (Point)vr.get(y+ho);
              G.drawLine(x,p1.y+150,x+6,p2.y+150);
              p1 = (Point)vr.get(y+ho);
              x = x + 6;
         g.drawImage(I,0,0,null);
    public static void main (String[] args) 
         new ecg();
    }

    Compiling your posted code gives a compiler warning:
    C:\jexp>javac ecg.java
    Note: ecg.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    C:\jexp>javac -Xlint:unchecked ecg.java
    ecg.java:31: warning: [unchecked] unchecked call to add(E) as a member of the raw type jav
    a.util.Vector
                vr.add(new Point(0,p-130));
                      ^
    1 warningWe can eliminate this by changing this
        Vector vr   = new Vector();to this
        Vector<Point> vr   = new Vector<Point>();The best way to understand things like this is to start a new file and slowly build it up so you can see what's going on, step-by-step. I've put in some comments and print statements to give you a start.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.awt.image.BufferedImage;
    import java.awt.geom.*;
    import java.math.*;
    import java.util.*;
    public class ECG extends JFrame
        myView view = new myView();
        Vector<Point> vr = new Vector<Point>();
        int    ho   = 0;
        public ECG()
            addWindowListener(new WindowAdapter()
                @Override
                public void windowClosing(WindowEvent ev)
                    dispose();
                    System.exit(0);
            // Initialize data in Vector.
            for (int i=0; i < 5000; i++)
                int p = (int)(Math.random() * 260); // range: (0    - 260]
                vr.add(new Point(0, p-130));        // range: (-130 - 130]
            System.out.println("Total number of data points: " + vr.size());
            setBounds(3,10,625,350);
            // Component drawing space is 600 wide by 300 high.
            view.setBounds(10,10,600,300);
            getContentPane().add(view);
            getContentPane().setLayout(null);
            setVisible(true);
            // Animate up thru the first 200 of 5000 data points.
            int millisPerSecond = 1000;
            long delay = 110;
            long framesPerSecond = millisPerSecond/delay;
            System.out.printf("Frames per second: %d%n", framesPerSecond);
            int paintSteps = 600;
            int dataIndex = 200;
                            //5000 -1 - paintSteps;  // max possible index
            System.out.printf("Expected animation time: %f seconds%n",
                               (double)dataIndex/framesPerSecond);
            long start = System.currentTimeMillis();
            // Animation loop.
            while (ho < dataIndex)
                try
                    Thread.sleep(delay);
                    // Increment "ho" which will step us through the Vector data.
                    // Each new value draws the Vector graph data starting at
                    // index "ho" placed at the left edge of the image/component.
                    ho = ho + 1;
                    long end = System.currentTimeMillis();
                    double elapsedTime = (double)(end - start)/millisPerSecond;
                    if(ho % 100 == 0)
                        System.out.printf("ho: %d  time: %.2f%n", ho, elapsedTime);
                    // Update the image in the paint method.
                    repaint();
                } catch (InterruptedException e) {
                    System.out.println("animation interrupted");
            long end = System.currentTimeMillis();
            double elapsedTime = (double)(end - start)/millisPerSecond;
            System.out.printf("Total animation loop time: %f%n", elapsedTime);
        public class myView extends JPanel
            BufferedImage I;
            Graphics2D    G;
            public void paint(Graphics g)
                if (I == null)  // initializw image
                    I = new BufferedImage(getWidth(),getHeight(),
                                          BufferedImage.TYPE_INT_ARGB);
                    G = I.createGraphics();
                // Update image to show current state of animating graph.
                // Fill Background color.
                G.setColor(Color.white);
                G.fillRect(0,0,getWidth(),getHeight());
                // Set graph line color.
                G.setColor(Color.gray);
                // Draw next data segment to newly-erased image.
                // Get two points in data to draw the next line.
                Point p1,p2;
                // "ho" is a simple counter with range [0 - n-1]
                // [0 - 200-1] in the animation loop above.
                // Get the next data point at "ho" which will be drawn at
                // the beginning, ie, left edge (x = 0), of the image.
                p1 = vr.get(ho);
                int x = 0;
                // Since each frame starts at zero_x relative to the image:
                // x = 0.
                // Draw all graph data for this one 600 by 300 image frame
                // with data beginning at index "ho".
                for (int y=1; y < 600; y++)
                    // Get the next point out ahead.
                    p2 = vr.get(y+ho);
                    // Draw a line from the last point, p1, to the next point, p2,
                    // which will be spaced (x +=) 6 apart along the image/component
                    // width of 600 (setBounds). Translate the y values down onto
                    // the component by 150 pixels (the range of y values from
                    // above is from -129 to 130). The "+150" shifts the y values
                    // to the approximate center of the component.
                    G.drawLine(x, p1.y+150, x+6, p2.y+150);
                    // Save the current point to/in p1 for the next iteration.
                    p1 = vr.get(y+ho);
                    // Move along to the right in the image.
                    x = x + 6;
                // Draw image in component.
                g.drawImage(I,0,0,null);
        public static void main (String[] args)
            new ECG();
    }

  • [Graphs in Java] Graphs library

    Hi there,
    my name is roberto...i want to know if exists a library to construct a graph in java....
    please answer me .. tks

    Sorry--I guess I misinterpreted "graphs".
    Tried googling (neural net java):
    First hit:
    http://rfhs8012.fh-regensburg.de/~saj39122/jfroehl/diplom/e-index.html
    Lots (418,000) of other hits, too. Probably one of them will suit your purposes.

  • Java & graphs?

    Hi is there anyway to create a graph in java without having to build one with shapes etc or using 3rd party programs? If not can anyone recommend any good free 3rd party programs please?

    Umm, yep. There's heaps of them. I've played with JFreeChart, and seemed fairly straight forward, if it's somewhat limited in it's capabilities.
    It might be worth looking at... but I'd also be interested to see what others recommend.

  • Java graph

    Hi all
    I am developing a GUI in java where the user answers a selection of multiple choice questions.
    I would like to give some feedback to the user in the form of graphs or charts.
    Does anyone have an ideas how i might be able to do this? Does java have any tolls included to help or would I maybe have to use a third party library.
    Thanks for youre help

    Get yourself a copy of JFreeChart. It's a 3rd party library for graphs and charts.

  • Java graph library

    Hi all,
    I am developing a web application.In one of the jsp pages i need to display a tree with some nodes.
    Is there any library (preferrably open source) which will take inputs and construct a tree and capable of creating a image file.
    Hashin

    Hi,
    You can use Java Applet with JTree object. Look at this tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    or JavaScript based solution like this:
    http://www.treeview.net/treemenu/demos.asp
    or even Ajax solutions. For example:
    http://www.twinhelix.com/
    Good luck!

  • Saving the Java Graphis Object to JPEG File Format

    Hi,
    I created many java graphics objects on my applet (standalone) and would like to save it in one jpg format.
    Any idea how to do this??.
    I would appreciate for any hints.
    regards
    Paulus

    It is easy in Java.
    See com.sun.image.codec.jpeg.* package document
    good luck!
    Louis
    INT

  • Bipartite graph ADT

    Is it possible to represent a bipartite graph in a single adjacency list using a hashmap? Or would I need to use two hashmaps for each disjoint set?

    I don't see what difference it makes if the graph is bipartite, or connected, or complete, or not connected, or anything else.
    And the Wikipedia article "adjacency list" says there's a representation of an adjacency list in the form of a hash table, so I would say Yes.

  • Create the graph using java applet

    Hi friends,
    I have one urgent requirement.I need to create the flowchart by using java code.I have data in database.based on that i need to create the parent child relationchip graph..plase anybody help me .
    Thanks&Regards,
    Yousuf alam.A

    malcolmmc wrote:
    JFreeChart has been the favourite Java graph drawing library but, last time I looked, it didn't do flowcharts. If I were you I'd fire up Google and hunt around for a 3rd party library that does. Of course it's a pain if you have to use such libraries in an Applet. It's generally better to generate an image file on a server and display it as part of your html page.Sorry Malcolm but I don't think JFreeChart is applicable. The OP is asking for Flowcharts which are a graph as in nodes and edges. JGraph (Google) is probably what the OP wants but he is in for a shock when it comes to using it.

  • Creating graphs with Java

    Hi,
    I want to display the data in a reprot in graphical form using bar graph.
    Can anybody suggest me of any free third party tools that creates graphs (bar/pie graphs etc).

    Google for: java graph
    Here is one worth looking at:
    http://www.jfree.org/jfreechart/index.php

  • Web Agent Graph propeties

    Hi
    We are using Oracle Express Web Agent.
    In Java graph if we move the cursor on the grapgh it displays the exact measure value for that dimension value where the cursor is left.
    Is it possible to show all the values by default on the graph with out moving the cursor like what we get in a excel sheet graph.

    sorry for the confusion..
    after the mouse has stopped over a bar or line section it displays the value
    i want the values for all the bars to be displayed without even moving the mouse
    is there any such property to arrive at this

  • OLAP JAVA API - JDev

    hi all!
    i want to develop an olap application with JDeveloper and i´ve followed the steps of the tutorials on bibeans tech site (create and format bi objects). Now i´ve got a graph and a crosstab formatted etc. which i can show in JDeveloper.
    My question: is it possible to produce the crosstab and graph with the java graph api on my own or to get the java-code behind the produced crosstab/graph? First of all is there a java code behind?
    I´ve recognized the oracle.dss.* package but i can´t find a api guide or sth. like that on the oracle site...
    Can anyone help me?
    greetz pm

    As far as I know there isn't any detailed guid or help doc. The best you can get is the help doc inside JDeveloper.
    To answer your question, yes its possible to create presentations using java api.
    There are some code fragments inside of the help doc - but its very minimal - you have to find your way through it!!
    For a web app - you could use a combination of bi bean tags (for std. features ) & java API ( for any customaization if neded) .
    EG: Use the presentation tag to build the presentation in a JSP
    And then add some custom java code inside if needed for any customization...
    <%
    Presentation crossTab = (Presentation)pageContext.findAttribute("MyWorkspace_pres1");
    ThinCrosstab thinCrosstab = (ThinCrosstab)crossTab.getView();
    DataDirector dd = thinCrosstab.getModel().getDataDirector();
    DataAccess da = thinCrosstab.getModel().getDataAccess();
    %>
    Good Luck!

  • Resizing a window containing a graph

    I have created a class that plots points on a graph using two arrays passed to the class. One array is for the x-values, the other is for the y-values. Initially, the graph is fine. When I minimize or maximize the window, the values in the arrays change and causes the points to disappear. If I restore the window to the original size, the points are still gone. Why are the values in my array changing? Here is the code:
    //Graph_Lin.java
    //Graphs thermodynamic properties
    import java.util.Scanner;
    import java.awt.Graphics;
    import javax.swing.JPanel;
    public class Graph_Lin extends JPanel
      private int x1, y1, x2, y2;
      public double x[], y[];
      public double xpoint[], ypoint[];
      private double xmax = 0;
      private double ymax = 0;
      private double xmin, ymin, xrange, yrange;
      //constructor sets coordinates of axes
      public Graph_Lin( double xdata[], double ydata[] )
        x = xdata;
        y = ydata;
        xpoint = xdata;
        ypoint = ydata;
          xmin = x[0];
          ymin = y[0];
          int j = 0;
          while ( x[j] > 0)
            if ( x[j] > xmax)
           xmax = x[j];
         if ( y[j] > ymax)
             ymax = y[j];
            if ( x[j] < xmin)
           xmin = x[j];
         if ( y[j] < ymin)
             ymin = y[j];
         j++;
          yrange = ymax - ymin;
          xrange = xmax - xmin;
        public void paintComponent( Graphics g )
          super.paintComponent( g );
          x1 = getx1();
          x2 = getx2();
          y1 = gety1();
          y2 = gety2();
          g.drawLine(x1, y1, x2, y1);
          g.drawLine(x1, y1, x1, y2);
    //*****create the points for plotting*************
          int diam = 10;  //diameter of data point in pixels, should be an even number
          for ( int i = 0; i < x.length; i++ )
         xpoint[i] = (x[i]-xmin)/xrange*(x2-x1)+x1 - diam/2;
         ypoint[i] = y1 - (y[i]-ymin)/yrange*(y1-y2) - diam/2;
          for ( int i = 0; i < x.length; i++ )
           g.drawOval( ((int) xpoint),((int) ypoint[i]),diam,diam);
    //*****get values for the x and y axes****************
    public int getx1()
    return x1 = (int) (.05 * getWidth());
    public int gety1()
    return y1 = (int) (.95 * getHeight());
    public int getx2()
    return x2 = (int) (.95 * getWidth());
    public int gety2()
    return y2 = (int) (.05 * getHeight());
    //*****end get values for the x and y axes************

    What is an SSCCE? Here are the other files. I think I got them all.
    //LiquidDensity.java
    //This class calculates and returns density for water vapor
    //First, it calculates specific volume.  Then it returns the reciprocal as density
    public class LiquidDensity
      public double getv(double T)
          double kv = 1;          //kv represents specific volume x 10^3
          double Th, Tl, kh, kl;     //kh is spec vol at Th, kl is spec vol at Tl
         if (T >= 645 && T <= 647.3)
              Th = 647.3;
              Tl = 645;
                kh = 3.170;
              kl = 2.351;
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 640 && T <= 645)
              Tl = 640;
              Th = Tl+5;
                kl = 2.075;
              kh = 2.351;
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 635 && T <= 640)
              Tl = 635;
              Th = Tl+5;
                kl = 1.935;
              kh = 2.075;
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 630 && T <= 635)
              Tl = 630;     //mod
              Th = Tl+5;
                kl = 1.856;     //mod
              kh = 1.935;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 625 && T <= 630)
              Tl = 625;     //mod
              Th = Tl+5;
                kl = 1.778;     //mod
              kh = 1.856;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 620 && T <= 625)
              Tl = 620;     //mod
              Th = Tl+5;
                kl = 1.705;     //mod
              kh = 1.778;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 610 && T <= 620)
              Tl = 610;     //mod
              Th = Tl+10;
                kl = 1.612;     //mod
              kh = 1.705;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 600 && T <= 610)
              Tl = 600;     //mod
              Th = Tl+10;
                kl = 1.541;     //mod
              kh = 1.612;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 590 && T <= 600)
              Tl = 590;     //mod
              Th = Tl+10;
                kl = 1.482;     //mod
              kh = 1.541;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 580 && T <= 590)
              Tl = 580;     //mod
              Th = Tl+10;
                kl = 1.433;     //mod
              kh = 1.482;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 570 && T <= 580)
              Tl = 570;     //mod
              Th = Tl+10;
                kl = 1.392;     //mod
              kh = 1.433;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 560 && T <= 570)
              Tl = 560;     //mod
              Th = Tl+10;
                kl = 1.355;     //mod
              kh = 1.392;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 550 && T <= 560)
              Tl = 550;     //mod
              Th = Tl+10;
                kl = 1.323;     //mod
              kh = 1.355;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 540 && T <= 550)
              Tl = 540;     //mod
              Th = Tl+10;
                kl = 1.294;     //mod
              kh = 1.323;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 530 && T <= 540)
              Tl = 530;     //mod
              Th = Tl+10;
                kl = 1.268;     //mod
              kh = 1.294;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 520 && T <= 530)
              Tl = 520;     //mod
              Th = Tl+10;
                kl = 1.244;     //mod
              kh = 1.268;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 510 && T <= 520)
              Tl = 510;     //mod
              Th = Tl+10;
                kl = 1.222;     //mod
              kh = 1.244;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 500 && T <= 510)
              Tl = 500;     //mod
              Th = Tl+10;
                kl = 1.203;     //mod
              kh = 1.222;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 490 && T <= 500)
              Tl = 490;     //mod
              Th = Tl+10;
                kl = 1.184;     //mod
              kh = 1.203;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 480 && T <= 490)
              Tl = 480;     //mod
              Th = Tl+10;
                kl = 1.167;     //mod
              kh = 1.184;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 470 && T <= 480)
              Tl = 470;     //mod
              Th = Tl+10;
                kl = 1.152;     //mod
              kh = 1.167;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 460 && T <= 470)
              Tl = 460;     //mod
              Th = Tl+10;
                kl = 1.137;     //mod
              kh = 1.152;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 450 && T <= 460)
              Tl = 450;     //mod
              Th = Tl+10;
                kl = 1.123;     //mod
              kh = 1.137;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 440 && T <= 450)
              Tl = 440;     //mod
              Th = Tl+10;
                kl = 1.110;     //mod
              kh = 1.123;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 430 && T <= 440)
              Tl = 430;     //mod
              Th = Tl+10;
                kl = 1.099;     //mod
              kh = 1.110;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 420 && T <= 430)
              Tl = 420;     //mod
              Th = Tl+10;
                kl = 1.088;     //mod
              kh = 1.099;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 410 && T <= 420)
              Tl = 410;     //mod
              Th = Tl+10;
                kl = 1.077;     //mod
              kh = 1.088;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 400 && T <= 410)
              Tl = 400;     //mod
              Th = Tl+10;
                kl = 1.067;     //mod
              kh = 1.077;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 390 && T <= 400)
              Tl = 390;     //mod
              Th = Tl+10;
                kl = 1.058;     //mod
              kh = 1.067;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 385 && T <= 390)
              Tl = 385;     //mod
              Th = Tl+5;
                kl = 1.053;     //mod
              kh = 1.058;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 380 && T <= 385)
              Tl = 380;     //mod
              Th = Tl+5;
                kl = 1.049;     //mod
              kh = 1.053;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 375 && T <= 380)
              Tl = 375;     //mod
              Th = Tl+5;
                kl = 1.045;     //mod
              kh = 1.049;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 373.15 && T <= 375)
              Tl = 373.15;     //mod
              Th = 375;
                kl = 1.044;     //mod
              kh = 1.045;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         else if (T >= 370 && T <= 373.15)
              Tl = 370;     //mod
              Th = 373.15;
                kl = 1.041;     //mod
              kh = 1.044;     //mod
              kv = (((kh-kl)/(Th-Tl))*(T-Th)+kh)*Math.pow(10, -3);
         return 1/kv;          //returns liquid density for specified temperature
    }Next file
    //A Test program
    //John Abbitt
    //November 29, 2006
    import javax.swing.JFrame;     //import class JOptionPane
    public class Test
      public static void main( String args[] )
        double array1[] = new double[200];
        double array2[] = new double[200];
        LiquidDensity dl = new LiquidDensity();
        //Conductivity c = new Conductivity();
        //SpecificVolumeG g = new SpecificVolumeG();
        double T = 370;
        for (int i = 0; i <56; i++)
          array1[i] = T;
          array2[i] = dl.getv(T)  ;
          T=T+5;
        //Test the graph
        JTabbedPaneSetUp application = new JTabbedPaneSetUp(array1, array2);
        application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        application.setSize( 400, 400 );
        application.setVisible( true );
    }Next file
    //A Test program
    //John Abbitt
    //November 29, 2006
    import javax.swing.*;     //import class JOptionPane
    public class JTabbedPaneSetUp extends JFrame
      public double x[], y[];
      public JTabbedPaneSetUp(double array1[], double array2[])
        super( "Graph Program" );
        x = array1;
        y = array2;
        Graph_Lin graph1 = new Graph_Lin(x, y);
        Graph_Log graph2 = new Graph_Log(x, y);
        JTabbedPane tabbedPane = new JTabbedPane();
        //set up panel1 and add it to JTabbedPane
        JPanel panel1 = new JPanel();
        tabbedPane.addTab( "Linear", null, graph1, "Displays a liner graph");
        //set up panel2 and add it to JTabbedPane
        JPanel panel2 = new JPanel();
        tabbedPane.addTab( "Semi-log", null, graph2, "Displays a semi-log graph");
        add( tabbedPane );
    }

  • Any one who knows that use adt  to compile flex mobile projcet with air sdk 3.4 crash

      [java] # A fatal error has been detected by the Java Runtime Environment:
         [java] #
         [java] #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x101a9871, pid=5004, tid=7544
         [java] #
         [java] # JRE version: 6.0_16-b01
         [java] # Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode windows-x86 )
         [java] # Problematic frame:
         [java] # C  [llvm.dll+0x1a9871]
         [java] #
         [java] # An error report file with more information is saved as:
         [java] # E:\custom\build\deploy\ios\hs_err_pid5004.log
         [java] #
         [java] # If you would like to submit a bug report, please visit:
         [java] #   http://java.sun.com/webapps/bugreport/crash.jsp
         [java] # The crash happened outside the Java Virtual Machine in native code.
         [java] # See problematic frame for where to report the bug.
         [java] #
         [java] Undefined symbols for architecture armv7:
         [java]   "_abcMethod_AOTBuildOutput-0000000001_9708_9708_function spark.components.supportClasses::SkinnableTextBase.isOurFocus", referenced from:
         [java]       _ug_11903 in AOTBuildOutput-0.o
         [java]   "_abcMethod_AOTBuildOutput-0000000001_9465_9465_function spark.components::List.itemRemoved", referenced from:
         [java]       _ug_11903 in AOTBuildOutput-0.o
    my adt command like that
    <target name="7. Package for IOS" depends="6 Collect IOS">
                        <echo message="Packaging for IOS"/>
                        <java jar="${ADT}" fork="true" failonerror="true" dir="${publish_dir}/ios">
                                  <arg value="-package"/>
                                  <arg value="-target"/>
                                  <arg value="ipa-test"/>
                                  <arg value="-provisioning-profile"/>
                                  <arg value="${ios_provisioning}"/>
                              <arg value="-storetype"/>
                                  <arg value="pkcs12"/>
                                  <arg value="-keystore"/>
                                  <arg value="${ios_keystore}"/>
                                  <arg value="-storepass"/>
                                  <arg value="${ios_pass}"/>
                                  <arg value="${ipa_file}"/>
                                  <arg value="${app_name}-app.xml"/>
                                  <arg value="Default.png"/>
                                  <arg value="[email protected]"/>
                                  <arg value="Default-Portrait.png"/>
                                  <arg value="[email protected]"/>
                                  <arg value="${assets_dir_name}/." />
                                  <arg value="${swf_file}" />
                                  <arg line="-platformsdk F:/ios/iPhoneOS6.0.sdk/"/>
                        </java>
              </target>
    wating for help, thanks very much

    Could you please share your swf and app.xml, packaging, your project (if possible) at [email protected]
    I will get a bug logged for this.

Maybe you are looking for

  • How Do I Know If My Contact Is On A Skype Call?

    How Do I Know If My Contact Is On A Skype Call?

  • Ipod 4th generation will not charge or play on any of our docking stations

    Hi my son has an ipod touch and it will not charge or play on any of our docking stations. We had an appointment today at the 'genius' bar and i was told there is not a problem with his device!, I am at a loss as my daughters ipod plays on all our do

  • How do I eject a blank DVD....

    ....that is NOT showing up on the desktop?? I had the same problem with iDVD '08 that many others were having and found the solution in this forum and thanks a lot for that fix! It worked like a charm! But I still have work to do on a video in iMovie

  • Migration of J2EE application in JDI Infrastructure

    Hi, Can anybody please let me know where would i find a good document on this migration of J2EE in JDI. Any, elearning lesson or maybe a pdf or something. Also, i am planning to make this as my masters project, would you guys think it is possible ???

  • I have a Ipad safari not working.

    I have a Ipad safari not working, was workingthis am.  It goes to web sites but partial greyed out and can not navigate.  Other internet connections appear to be working correctly.