graph problem? in bioinformatics

Hi All,

I am a student of bioinformatics and i want to plot aminoAcid Sequence according to it's hydrophobicity values..

Alanine (A)1.8

Arginine (R) -4.5

Asparagine ( N)-3.5

Aspartic acid (D)-3.5

Cysteine (C)2.5

Glutamine (Q)-3.5

Glutamic acid(E)-3.5

Glycine(G)-0.4

Histidine(H)-3.2

Isoleucine (I) 4.5

Leucine (L)3.8

Lysine (K)-3.9

Methionine(M)1.9

Phenylalanine(F)2.8

Proline (P)-1.6

Serine (S)-0.8

Threonine(T)-0.7

Tryptophan (W)-0.9

Tyrosine (Y) -1.3

Valine(V)4.2

My sequence is for example:AITHYSTRAGETNMVAFSRDEA...

I want to plot this sequence or any other sequence like this on a graph to show it's hydrophobicity values...I tried and my code is as follows:

/*

* HydrophobicityViewer.java

*

* Created on December 16, 2006, 10:05 PM

*

* To change this template, choose Tools | Template Manager

* and open the template in the editor.

*/

package myapplics;

import java.awt.geom.Point2D;

import javax.swing.*;

import biomolecule.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JLabel;

import javax.swing.JFrame;

import javax.swing.JPanel;

import javax.swing.JTextField;

import java.awt.GridLayout;

import java.awt.geom.Line2D;

import java.util.*;

import java.lang.Float;

import java.io.*;

public class HydrophobicityViewer extends JFrame implements ActionListener{

JButton plot=new JButton("PLOT");

JTextArea Sequence=new JTextArea(10,30);

JScrollPane scroll=new JScrollPane(Sequence,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,

ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

private Object action;

/** Creates a new instance of HydrophobicityViewer */

public HydrophobicityViewer() {

super("Hydrophobicity Frame");

setSize(600,800);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

plot.addActionListener(this);

JPanel pane=new JPanel();

JLabel SequenceLabel=new JLabel("Sequence");

RectangleComponent component = new RectangleComponent();

setLayout(new BorderLayout());

Sequence.setLineWrap(true);

Sequence.setWrapStyleWord(true);

pane.add(SequenceLabel);

pane.add(Sequence);

pane.add(scroll);

pane.add(plot);

add(pane,BorderLayout.NORTH);

add(component,BorderLayout.CENTER);

setVisible(true);

}

public void actionPerformed(ActionEvent evt)

{

Object source=evt.getSource();

if (source==plot)

{

}

repaint();

}

public static void main(String []args)

{

HydrophobicityViewer hydro=new HydrophobicityViewer();

}

}

/*

* RectangleComponent.java

*

* Created on December 16, 2006, 10:11 PM

*

* To change this template, choose Tools | Template Manager

* and open the template in the editor.

*/

package biomolecule;

import java.awt.Graphics;

import java.awt.Graphics2D;

import java.awt.Color;

import java.awt.Rectangle;

import java.awt.geom.Line2D;

import javax.swing.JPanel;

import javax.swing.JComponent;

import java.awt.geom.Line2D;

import java.awt.geom.Point2D;

import java.io.*;

/**

*

* @author rupesh

*/

public class RectangleComponent extends JComponent{

/** Creates a new instance of RectangleComponent */

protected String seq="aminoacid";

int x1,y1,x2,y2=0;

public RectangleComponent() {

}

public int length(){

int len=0;

len=seq.length();

return len;

}

public void paintComponent(Graphics g)

{

Graphics2D g2=(Graphics2D)g;

Rectangle box=new Rectangle(100,200,400,35);

g2.draw(box);

g2.setColor(Color.BLACK);

g2.draw(box);

g2.drawString("4.0",100,200);

Rectangle box1=new Rectangle(100,235,400,35);

g2.draw(box1);

g2.setColor(Color.BLACK);

g2.draw(box1);

g2.drawString("3.0",100,235);

Rectangle box2=new Rectangle(100,270,400,35);

g2.draw(box2);

g2.setColor(Color.BLACK);

g2.draw(box2);

g2.drawString("2.0",100,270);

Rectangle box3=new Rectangle(100,305,400,35);

g2.draw(box3);

g2.setColor(Color.BLACK);

g2.draw(box3);

g2.drawString("1.0",100,305);

Rectangle box4=new Rectangle(100,340,400,35);

g2.draw(box4);

g2.setColor(Color.BLACK);

g2.draw(box4);

g2.drawString("0.0",100,340);

Rectangle box5=new Rectangle(100,375,400,35);

g2.draw(box5);

g2.setColor(Color.BLACK);

g2.draw(box5);

g2.drawString("-1.0",100,375);

Rectangle box6=new Rectangle(100,410,400,35);

g2.draw(box6);

g2.setColor(Color.BLACK);

g2.draw(box6);

g2.drawString("-2.0",100,410);

Rectangle box7=new Rectangle(100,445,400,35);

g2.draw(box7);

g2.setColor(Color.BLACK);

g2.draw(box7);

g2.drawString("-3.0",100,445);

g2.drawString("-4.0",100,470);

}

}

I am not able to imagine anything more than this.....Also i am totally new to Java itself and it's a tall order for me to solve this..So i need some help...Assignments,Assignments!!!!!!!!

Rupesh...

[5567 byte] By [rupeshgadea] at [2007-11-26 13:05:09]
# 1
You need to repost your code between [code]...[/code] tags. You also need to tell us what you are having problems with.
CaptainMorgan08a at 2007-7-7 17:11:55 > top of Java-index,Security,Cryptography...