/*
* Title: japlot.jaxodraw
* Description: Graphical user interface for drawing Feynman diagrams
* @author Daniele Binosi
* @author Lukas Theussl
Copyright (C) 2003-2006, Daniele Binosi and Lukas Theussl
See the file LICENSE in the source distribution home directory
for a full copy of the GPL (GNU General Public License).
This file is part of japlot.jaxodraw.
japlot.jaxodraw is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
japlot.jaxodraw is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package japlot;
import japlot.jaxodraw.*;
import java.awt.*;
import java.util.Random;
import jhplot.H1D;
import jhplot.HPlotJa;
import jhplot.P1D;
import jhplot.jadraw.JaFLine;
import jhplot.jadraw.JaTextBox;
/** The main class of the japlot.jaxodraw program. */
public class Test {
public static void main(String[] args) {
String inputFile=null;
if (args.length>0 && args[0].endsWith(".xml")) {
System.out.println("Reading_file" + args[0]);
inputFile = args[0];
};
HPlotJa c1 = new HPlotJa("test",2,1);
c1.cd(1,1);
c1.setAutoRange();
// c1.setRangeX(-6,6.);
// c1.setRangeY(0, 400.);
H1D h1 = new H1D("My Test 1",20, -3.0, 3.0);
h1.setPenWidthErr(2);
h1.setColor(Color.blue);
Random rand = new Random();
for (int i = 0; i < 10; i++) h1.fill(7*rand.nextGaussian());
for (int i = 0; i < 10; i++) h1.fill(0.4*rand.nextGaussian());
c1.draw(h1);
c1.cd(2,1);
c1.setAutoRange();
P1D p1 = new P1D("test");
p1.add(10,20);
p1.add(20,23);
p1.add(2,44);
p1.add(40,21,10,10);
p1.setSymbol(1);
c1.draw(p1);
// jd.getPad().setLogScale(0,true);
// jd.getPad().setLogScale(1,true);
JaFLine temp= new JaFLine();
temp.setLocation(0.2, 0.3, "NDC");
temp.setColor(Color.red);
temp.setRelWH(0.3,0.4, "NDC");
temp.setStroke(2.0f);
c1.add(temp);
temp= new JaFLine();
temp.setLocation(0.8, 0.5, "NDC");
temp.setColor(Color.blue);
temp.setRelWH(0.3,0.3,"NDC");
temp.setStroke(2.0f);
c1.add(temp);
JaTextBox temp2= new JaTextBox();
temp2.setLocation(0.4, 0.2, "NDC");
temp2.setColor(Color.blue);
temp2.setRelWH(0.2,0.2,"NDC");
temp2.setStroke(2.0f);
c1.add(temp2);
/*
JaGlLoop newGlLoop = new JaGlLoop();
newGlLoop.setLocation(0.5,0.6);
newGlLoop.setAmp(40);
newGlLoop.setFreq(20.0f);
newGlLoop.setColor(Color.blue);
newGlLoop.setStroke(2.0f);
newGlLoop.setDoubleLine(false);
newGlLoop.setDLSeparation(2.0f);
jd.add(newGlLoop);
*/
JaTextBox newText = new JaTextBox();
newText.setText("Test string");
newText.setLocation(0.5,0.4, "NDC");
newText.setRotAngle(0);
newText.setColor(Color.blue);
c1.add(newText);
/*
JaText newText = new JaText();
newText.setText("Test string");
newText.setLocation(0.1,0.2, "NDC");
// newText.setX(200);
// newText.setY(200);
// newText.updateNDC();
newText.setRotAngle(0);
newText.setColor(Color.blue);
newText.print();
c1.add(newText);
*/
c1.update();
}
}
Ads help maintain this website.