Open Source Radar Graph

odaboval Messages postés 10 Date d'inscription mardi 8 février 2005 Statut Membre Dernière intervention 13 novembre 2008 - 2 mai 2007 à 11:09
satamoni1982 Messages postés 37 Date d'inscription vendredi 24 mars 2006 Statut Membre Dernière intervention 27 janvier 2011 - 22 janv. 2011 à 02:50
Bonjour à tous,

Je suis à la recherche du code source java d'un graphe radar. J'ai trouvé des applications qui font cela... mais, il me faudrait le code source.

Est-ce possible, car je ne pense pas avoir suffisamment de connaissance java pour le créer moi même?

Merci,
   Olivier

3 réponses

alagrine Messages postés 1 Date d'inscription jeudi 12 juillet 2007 Statut Membre Dernière intervention 13 juillet 2007
13 juil. 2007 à 14:52
quelle antennes?
0
satamoni1982 Messages postés 37 Date d'inscription vendredi 24 mars 2006 Statut Membre Dernière intervention 27 janvier 2011
21 janv. 2011 à 16:57
moi aussi a la recherche de mem sujet
j'ai trouvé un code qui permet de dessiné un la 3Circle+ line qui tourne avec division de Couleur vert Comme le radar mais il tourne just 120 degré et il change le sence
vous tu que je t'envoyer ce code?
0
satamoni1982 Messages postés 37 Date d'inscription vendredi 24 mars 2006 Statut Membre Dernière intervention 27 janvier 2011
22 janv. 2011 à 02:50
COPIE CE CODE DANS UN NOUVEAU CLASS


import java.applet.*;
import java.awt.*;
import java.net.*;

public class radar extends Applet implements Runnable
{

private Thread Animation = null;
private Image Buffer;
private Graphics gBuffer;
int br, ho, w, w1, i, backR, backG, backB, verz, xx, yy;
boolean vert, klick;
String Adresse;
int l[] = new int[6];
int schriftX[] = new int[6];
int schriftY[] = new int[6];
int schriftgr[] = new int[6];
int textbr[] = new int[6];
String target[] = new String[6];
String text[] = new String[6];
Color farbe[] = new Color[51];
Color c[] = new Color[6];
URL url[] = new URL[6];
Font font[] = new Font[6];

public void start()
{
if (Animation==null)
{
Animation = new Thread (this);
Animation.start();
}
}

public void stop()
{
if (Animation != null)
{
Animation.stop();
Animation=null;
}
}

public void run()
{
while (true)
{
repaint();
try
{
Thread.sleep (verz);
} catch (Exception e) {}
}
}

public void update(Graphics g)
{
paint(g);
}

// Funktion zum Auslesen von Integer-Parametern
private String getStringParam(String name, String standartWert)
{
String param=getParameter(name);
if (param==null) return standartWert;
return param;
}

// Funktion zum Auslesen von String-Parametern
private int getIntParam(String name, int standartWert)
{
String param=getParameter(name);
if (param==null) return standartWert;
return (Integer.parseInt(param,10));
}

public void init()
{
Buffer=createImage(size().width,size().height);
gBuffer=Buffer.getGraphics();
// Höhe und Breite des Applets, die mit HEIGHT und WIDTH übergeben wurden
br = size().width;
ho = size().height;
//
verz = getIntParam("Verzoeger",10);
w=91;
// Auslesen der Parameter mit gleichzeitiger Übergabe von Standardwerten
text[1] = getStringParam("Text1","Herzlich Willkommen!");
textbr[1] = getIntParam("TextBreite1",105);
schriftX[1] = getIntParam("X1",50);
schriftY[1] = getIntParam("Y1",50);
schriftgr[1] = getIntParam("Schriftgroesse1",10);
text[2] = getStringParam("Text2","Welcome!");
textbr[2] = getIntParam("TextBreite2",55);
schriftX[2] = getIntParam("X2",130);
schriftY[2] = getIntParam("Y2",70);
schriftgr[2] = getIntParam("Schriftgroesse2",12);
text[3] = getStringParam("Text3","Accueil!");
textbr[3] = getIntParam("TextBreite3",60);
schriftX[3] = getIntParam("X3",20);
schriftY[3] = getIntParam("Y3",90);
schriftgr[3] = getIntParam("Schriftgroesse3",18);
text[4] = getStringParam("Text4","");
textbr[4] = getIntParam("TextBreite4",120);
schriftX[4] = getIntParam("X4",50);
schriftY[4] = getIntParam("Y4",150);
schriftgr[4] = getIntParam("Schriftgroesse4",12);
text[5] = getStringParam("Text5","© 1998 Sebastian Wallroth");
textbr[5] = getIntParam("TextBreite5",100);
schriftX[5] = getIntParam("X5",60);
schriftY[5] = getIntParam("Y5",170);
schriftgr[5] = getIntParam("Schriftgroesse5",8);
backR = getIntParam("R",0);
backG = getIntParam("G",0);
backB = getIntParam("B",0);
font[1] = new Font(getStringParam("Schriftart1","Helvetica"),Font.PLAIN,schriftgr[1]);
font[2] = new Font(getStringParam("Schriftart2","Courier"),Font.PLAIN,schriftgr[2]);
font[3] = new Font(getStringParam("Schriftart3","TimesRoman"),Font.PLAIN,schriftgr[3]);
font[4] = new Font(getStringParam("Schriftart4","Dialog"),Font.PLAIN,schriftgr[4]);
font[5] = new Font(getStringParam("Schriftart5","Helvetica"),Font.PLAIN,schriftgr[5]);
//
// Die Adresse der HTML-Seite, die die class-Datei aufruft wird abgefragt
String hilfsstring = getDocumentBase().toExternalForm();
// Da nach dem letzten Schrägstrich der Dateiname steht,
// wird alles nach dem letzten Schrägstrich abgeschnitten,
// womit das Verzeichnis übrigbleibt, in dem die Datei steht.
String Adresse = hilfsstring.substring(0, hilfsstring.lastIndexOf("/")+1);
//
try {url[1]=new URL(getStringParam("url1",Adresse+"deutsch/index.html"));}
catch(MalformedURLException mal){}
try {url[2]=new URL(getStringParam("url2",Adresse+"english/index.html"));}
catch(MalformedURLException mal){}
try {url[3]=new URL(getStringParam("url3",Adresse+"francais/index.html"));}
catch(MalformedURLException mal){}
try {url[4]=new URL(getStringParam("url4",Adresse+"polska/index.html"));}
catch(MalformedURLException mal){}
try {url[5]=new URL(getStringParam("url5","http://members.aol.com/frankfurto/wu.html"));}
catch(MalformedURLException mal){}

for(int i=1;i<6;i++)
{
// Wenn die Sprungadresse nicht mit http:, file:, ftp oder mailto: beginnt,
// wird das Verzeichnis 'Adresse' vor das Sprungziel geschrieben
if (url[i].toExternalForm().startsWith("http:")||url[i].toExternalForm().startsWith("file:")||url[i].toExternalForm().startsWith("ftp:")||url[i].toExternalForm().startsWith("mailto:")) {}
else try {url[i]=new URL(Adresse+url[1].toExternalForm());}
catch(MalformedURLException mal){}
//
target[i]=getStringParam("target"+Integer.toString(i),"_top");
}
// Rand
gBuffer.setColor(new Color(backR,backG,backB));
gBuffer.fillRect(0, 0, size().width, size().height);
// Armaturkreis
gBuffer.setColor(Color.black);
gBuffer.fillOval(0, 0, size().width, size().height);
// Grundfarbe der Links
c[1] = c[2] = c[3] = c[4] = c[5] = Color.black;
// Erzeugen der 50 abgestuften Farben
for(int i=1;i<51;i++)
{
int j = i*5;
farbe[i] = new Color(0,250-j,0);
}
//
}

public boolean mouseMove(Event evt,int x,int y)
{
xx=x;
yy=y;
repaint();
return true;
}

public boolean mouseDown(Event evt,int x,int y)
{
klick=true;
l[1]=l[2]=l[3]=l[4]=l[5]=0;
repaint();
return true;
}

public boolean mouseUp(Event evt,int x,int y)
{
klick==false;
for(int i=1;i<6;i++)
{
if(l[i]==1)getAppletContext().showDocument(url[i],target[i]);
}
repaint();
return true;
}



public void paint(Graphics g)
{
for(int i=1;i<6;i++)
{
if (xx>schriftX[i]&&xx<schriftX[i]+textbr[i]&&yy>schriftY[i]-schriftgr[i]&&yy<schriftY[i])
{
c[i] = Color.green;
l[i]=1;
}
else c[i] = Color.black;
gBuffer.setColor(c[i]);
gBuffer.setFont(font[i]);
gBuffer.drawString(text[i], schriftX[i], schriftY[i]);
}
g.drawImage (Buffer,0,0,this);
w--;
if (w==0) w=360;
for(int i=1;i<51;i++)
{
gBuffer.setColor(farbe[i]);
gBuffer.fillArc(0, 0, br, ho, w+i*5, 5);
}
}
}
0
Rejoignez-nous