1   /*
2    * Created on Dec 19, 2003
3    *
4    * To change the template for this generated file go to
5    * Window>Preferences>Java>Code Generation>Code and Comments
6    */
7   package AcopTestPack;
8   
9   import java.awt.event.ActionEvent;
10  import java.awt.event.ActionListener;
11  
12  import javax.swing.JFrame;
13  import javax.swing.JMenuItem;
14  import javax.swing.JPopupMenu;
15  import javax.swing.Timer;
16  
17  import de.desy.acop.chart.Acop;
18  import de.desy.acop.chart.AcopEvent;
19  import de.desy.acop.chart.AcopListener;
20  import de.desy.acop.transport.AccessMode;
21  import javax.swing.JButton;
22  
23  /**
24   * @author wu
25   *
26   * To change the template for this generated type comment go to
27   * Window>Preferences>Java>Code Generation>Code and Comments
28   */
29  public class AcopTestGUIApp extends JFrame implements ActionListener{
30  
31    double[] testData = new double[8];
32  	double ytmp[] = new double[1];
33  	double xtmp[] = new double[1];
34      int appenstart = 0;
35    int calls=0, nn=0, timerCounter=0;    
36    double[] ppvdata = new double[1024];
37    double[] g_rdata = new double[1024];
38    double[] g_data = new double[1024];
39    double[] g_tdata = new double[1024];
40    float[] xdata = new float[1024];
41    String[] xlabel = new String[1024];
42    String[] xname = new String[1024];
43    long t1=0,t2=0;
44    Timer secondTimer = new Timer(100,this);
45    boolean markerFlag = false;
46    boolean refFlag = false;
47      
48    int cline=0;
49    double[] left = new double[2];
50    double[] siz = new double[2];
51    double[] pos = new double[2];
52    java.lang.String txt = new String("Aa");
53  
54  	private javax.swing.JPanel jPanel = null;
55  	private Acop acop = null;
56  	private javax.swing.JButton jButtonDraw = null;
57  	private javax.swing.JButton jButtonTimer = null;
58  	private javax.swing.JButton jButton = null;
59  	private javax.swing.JButton jButtonClearText = null;
60  	private javax.swing.JButton jButtonRecallText = null;
61  	private javax.swing.JButton jButtonRefreshText = null;
62  	private javax.swing.JButton jButtonAppendScreen = null;
63  	private javax.swing.JButton jButton1 = null;
64  	private javax.swing.JTextField jTextFieldOuputText = null;
65  	private javax.swing.JButton jButton2 = null;
66  	private javax.swing.JMenuBar jJMenuBar = null;
67  	private javax.swing.JMenu jMenu = null;
68  	private javax.swing.JMenu jMenu1 = null;
69  	private javax.swing.JMenu jMenu2 = null;
70  	private java.awt.Button button = null;
71  	private javax.swing.JButton jButton3 = null;
72  	private javax.swing.JButton jButton4 = null;
73    private JButton jButton5 = null;
74  	/**
75     * This method initializes jButton5	
76     * 	
77     * @return javax.swing.JButton	
78     */
79    private JButton getJButton5()
80    {
81      if (jButton5 == null)
82      {
83        jButton5 = new JButton();
84        jButton5.setBounds(new java.awt.Rectangle(609,351,97,26));
85        jButton5.setText("autoScale");
86        jButton5.addMouseListener(new java.awt.event.MouseAdapter()
87        {
88          public void mouseClicked(java.awt.event.MouseEvent e)
89          {
90            System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
91  //          acop.autoScale(true,true,true,true);
92            acop.getDrawnData(null,xname,100,0,0);
93            System.out.println(xname[2]); // TODO Auto-generated Event stub mouseClicked()
94            System.out.println(xname[6]); // TODO Auto-generated Event stub mouseClicked()
95            acop.setBackground(java.awt.Color.gray);
96          }
97        });
98      }
99      return jButton5;
100   }
101   public static void main(String[] args) {
102 		new AcopTestGUIApp();			
103 	}
104 	/**
105 	 * This is the default constructor
106 	 */
107 	public AcopTestGUIApp() {
108 		super();
109 		initialize();
110 //		acop.setCaption("Acop First Test");
111 	}
112 	/**
113 	 * This method initializes this
114 	 * 
115 	 * @return void
116 	 */
117 	private void initialize() {
118 		this.setContentPane(getJPanel());
119     JPopupMenu.setDefaultLightWeightPopupEnabled(false);
120 		this.setJMenuBar(getJJMenuBar());
121 		this.setSize(752, 458);
122 		this.setVisible(true);
123 		this.setTitle("Testing Acop");
124 //    	this.getContentPane().setLayout(null);
125 		this.addWindowListener(new java.awt.event.WindowAdapter() { 
126 			public void windowClosing(java.awt.event.WindowEvent e) {    
127 				System.exit(0);
128         System.out.println("windowClosing()"); // TODO Auto-generated Event stub windowClosing()
129 			}
130 		});
131 	}
132   public void actionPerformed(ActionEvent e)
133   { int ret;
134 
135     if ( calls % 2 == 1 )
136       ret = acop.refreshScreen(g_rdata, 0, -1, -1, null);
137     else
138       ret = acop.refreshScreen(g_data, 0, -1, -1, null);
139       
140     calls++;
141   }
142 
143 	/**
144 	 * This method initializes jPanel
145 	 * 
146 	 * @return javax.swing.JPanel
147 	 */
148 	private javax.swing.JPanel getJPanel() {
149 		if(jPanel == null) {
150 			jPanel = new javax.swing.JPanel();
151 			jPanel.setLayout(null);
152 			jPanel.add(getAcop(), null);
153 			jPanel.add(getJButtonDraw(), null);
154 			jPanel.add(getJButtonTimer(), null);
155 			jPanel.add(getJButton(), null);
156 			jPanel.add(getJButtonClearText(), null);
157 			jPanel.add(getJButtonRecallText(), null);
158 			jPanel.add(getJButtonRefreshText(), null);
159 			jPanel.add(getJButtonAppendScreen(), null);
160 			jPanel.add(getJButton1(), null);
161 			jPanel.add(getJTextFieldOuputText(), null);
162 			jPanel.add(getJButton3(), null);
163 			jPanel.add(getJButton4(), null);
164 			jPanel.add(getButton(), null);
165 			jPanel.add(getJButton5(), null);
166 		}
167 		return jPanel;
168 	}
169 	/**
170 	 * This method initializes acop
171 	 * 
172 	 * @return acop.Acop
173 	 */
174 	private Acop getAcop() {
175 		if(acop == null) {
176 			acop = new Acop();
177 			acop.getAcopTransport().setAccessRate("900");
178 			acop.setErrorColor(new java.awt.Color(204,0,204));
179 			acop.setForeground(java.awt.Color.black);
180 			acop.setYExtent(0.4D);
181 			acop.setXExtent(0.4D);
182 			acop.setDisplayMode(8);
183 			acop.setGraphStyle(4);
184 			acop.add(getJButton2(), null);
185 			acop.setBounds(21, 26, 558, 293);
186 			acop.setYAxisLabel("qwertyui");
187 			acop.setFrameBottomOffset(10);
188 			acop.setXAxisLabel("abcdefghrwetre");
189 			acop.setFrameLeftOffset(20);
190 			acop.setYMin(-100.0D);
191 			acop.setYMax(100.0D);
192 			acop.setBackground(new java.awt.Color(255,204,204));
193 			acop.setLeftYLabel(true);
194 			acop.setYTicksLeft(true);
195 			acop.setYTickText(true);
196 			acop.setFrameRightOffset(20);
197 			acop.setXTicksBottom(true);
198 			acop.setXTickText(true);
199 			acop.setDrawStyle(0);
200 			acop.setLeftTimeLabel(true);
201 			acop.setCaptionLocation(1);
202 			acop.setXGrid(true);
203 			acop.setGridStyle(2);
204 			acop.setGridWidth(1);
205 			acop.setBottomXLabel(true);
206 			acop.setYGrid(true);
207 			acop.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 28));
208 			acop.setPrintTextLocation(0);
209 			acop.setPrintTextStickyAttribute(3);
210 			acop.setPrintTextRotation(0);
211 			acop.setXMax(150.0D);
212 			acop.setWrapAround(false);
213 			acop.setTagging(true);
214 			acop.setTagColor(java.awt.Color.green);
215 			acop.setZooming(7);
216 			acop.setXTicks(-1);
217       acop.setFrameBottomOffset(30);
218 			acop.setXlabelRotation(260);
219 			acop.setXTickLabelColor(java.awt.Color.gray);
220 			acop.setFrameTopOffset(20);
221 			acop.setYTickLabelColor(java.awt.Color.gray);
222 			acop.setXBestScale(false);
223 			acop.setSecondaryYAxisOn(true);
224 			acop.setFrameForeColor(new java.awt.Color(153,153,153));
225 			acop.getAcopTransport().setAccessMode(AccessMode.READ);
226       acop.setDisplayGap(10);
227       acop.setSecondaryYTickText(true);
228       acop.setSecondaryYAxisLabel("Hallo");
229 //     setBackground();
230 //   setBackgroundImage();
231 
232       setBackgroundColorImages();
233       
234 			acop.addAcopListener(new AcopListener() { 
235 				public void acopMouseClick(AcopEvent e) {    
236 					System.out.println("  AcopMouseClick()"); // TODO Auto-generated Event stub AcopMouseClick()
237           int index = e.getHistoIndex();
238           double x = e.getMousePositionX();
239           double y = e.getMousePositionY();
240           double [] xar = new double [1];
241           double [] yar = new double [1];
242           int num = acop.getDrawnData(yar,xar,0,x,y);
243           java.lang.String txt = new String(index +  "  "  + x + "   " + y + "   " + num  + "   " + xar[0]+ "   " + yar[0]);
244           jTextFieldOuputText.setText(txt);
245           boolean a = acop.isTagged(index,-1,0);
246           acop.isTagged(index,a ? 0 : 1,0);
247           
248           //acop.clearScreen();
249         }
250         public void acopMouseDoubleClick(AcopEvent e) {}    
251         public void acopReceive(AcopEvent e) {} 
252 				public void acopMouseMove(AcopEvent e) {
253           System.out.println("  AcopMouseMove event!!!"); // TODO Auto-generated Event stub AcopMouseClick()        
254           int ind = e.getHistoIndex();
255           java.lang.String txtt = new String("histo:  " + ind);
256           jTextFieldOuputText.setText(txtt);
257         } 
258 				public void acopMouseZoom(AcopEvent e) {} 
259 				public void acopMouseEnter(AcopEvent e) {} 
260 				public void acopMouseExit(AcopEvent e) {}
261 				public void acopMousePressed(AcopEvent pressed) {
262 					// TODO Auto-generated method stub
263 					
264 				} 
265 			});
266 		}
267 		return acop;
268 	}
269   
270   private void setBackgroundImage()
271   {
272     java.awt.geom.Rectangle2D.Double[] rect = new java.awt.geom.Rectangle2D.Double[2];
273     String [] imageFile = new String[2];
274     double x, y, xsize, ysize;
275     x=acop.getXMin();
276     y=acop.getYMin();
277     xsize=(acop.getXMax()-acop.getXMin());
278     ysize=(acop.getYMax()-acop.getYMin())/2;
279     rect[0] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
280 
281     imageFile[0] = "3raind.JPG";
282     rect[1] = new java.awt.geom.Rectangle2D.Double(x,y+ysize,xsize,ysize);
283     imageFile[1] = "snowmonst.JPG";
284     acop.setBackgroundRegion(rect,imageFile, true);
285   }
286   private void setBackground()
287   {
288     java.awt.geom.Rectangle2D.Double[] rect = new java.awt.geom.Rectangle2D.Double[4];
289     java.awt.Color[] colo = new java.awt.Color[4];
290     
291     colo[0] = java.awt.Color.white;
292     colo[1] = java.awt.Color.orange;
293     colo[2] = java.awt.Color.yellow;
294     colo[3] = java.awt.Color.lightGray;
295 
296     double x, y, xsize, ysize;
297     x=acop.getXMin();
298     y=acop.getYMin();
299     xsize=(acop.getXMax()-acop.getXMin())/2;
300     ysize=(acop.getYMax()-acop.getYMin())/2;
301     rect[0] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
302 
303     x+=xsize;
304     rect[1] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
305 
306     y+=ysize;
307     rect[2] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
308 
309     x=acop.getXMin();
310     rect[3] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
311     acop.setBackgroundRegion(rect,colo, false);
312   }
313   
314   private void setBackgroundColorImages()
315   {
316     java.awt.geom.Rectangle2D.Double[] rect = new java.awt.geom.Rectangle2D.Double[2];
317     java.awt.Color[] colo = new java.awt.Color[2];
318     java.awt.geom.Rectangle2D.Double[] rect2 = new java.awt.geom.Rectangle2D.Double[2];
319     String [] imageFile = new String[2];
320     
321     colo[0] = java.awt.Color.white;
322     colo[1] = java.awt.Color.orange;
323     imageFile[0] = "3raind.JPG";
324     imageFile[1] = "snowmonst.JPG";
325 
326     double x, y, xsize, ysize;
327     x=acop.getXMin();
328     y=acop.getYMin();
329     xsize=(acop.getXMax()-acop.getXMin())/2;
330     ysize=(acop.getYMax()-acop.getYMin())/2;
331     rect[0] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
332 
333     x+=xsize;
334     rect2[0] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
335 
336     y+=ysize;
337     rect[1] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
338 
339     x=acop.getXMin();
340     rect2[1] = new java.awt.geom.Rectangle2D.Double(x,y,xsize,ysize);
341     acop.setBackgroundRegion(rect,colo, rect2, imageFile,false);
342   }
343 
344   private void draw()
345   {
346     int i;
347     int j = 1024;
348     int ret;
349 
350     for (i=0; i<1024; i++) g_rdata[i] = Math.cos( i*6.2832/64. ) - 0.3 + Math.random() * 90;
351     for (i=0; i<1024; i++) g_data[i] = Math.sin( i*6.2832/64. ) - 0.3 + Math.random() * 80.3;
352     for (i=0; i<1024; i++) g_tdata[i] = 0;
353     
354     for ( i=0; i<j; i++)
355     {
356       ppvdata[i] =(-0.1 *calls) -1 + ( 1 + g_rdata[j>=512 ? i%512 : (int)(i*512/512)%512])*(1+1)/2;
357       xdata[i] = (float)(0.2 * i);
358       xlabel[i] = "bpm " + i;
359     }
360 //    acop.errorWindow(80,20,0.5,0);
361 //    acop.isErrorWindowOn(true);
362 
363     double[] pos = new double[4];
364     int[] wid = new int[4];
365     int[] mod = new int[4];
366     java.awt.Color[] col = new java.awt.Color[4];
367     
368     pos[0] = -10.;
369     pos[1] = 12.;
370     pos[2] = 34.;
371     pos[3] = 120.;
372 
373     mod[0] = wid[0] = 1;
374     mod[1] = wid[1] = 8;
375     mod[2] = wid[2] = 4;
376     mod[3] = wid[3] = 3;
377     col[0] = java.awt.Color.black;  
378     col[1] = java.awt.Color.blue;
379     col[2] = java.awt.Color.darkGray;
380     col[3] = java.awt.Color.green;
381 //    acop.YAxis(true,pos,4,col,mod,wid);
382 //    acop.setXMax(1024);
383 
384 //    ret = acop.draw(g_tdata, null, null, xlabel, 150 , 0 ); 
385     acop.setForeground(java.awt.Color.blue);
386 //    ret = acop.draw(g_rdata, null, null, xlabel, 150 , 0 ); 
387 
388        ret = acop.draw(g_rdata); 
389 
390     double[] posTest = new double[10];
391     int[] disa = new int[10];
392     for ( i=0; i<10; i++)
393     {
394       posTest[i] = (double)(10 * i);
395       disa[i]= 1;
396     }
397 //  test Leading adge
398 /*
399     acop.setLeadingEdgeColor(java.awt.Color.blue);
400     acop.setLeadingEdgeGapSize(0);
401     acop.setLeadingEdgeMode(2);
402     acop.setLeadingEdgeMotion(1);
403     acop.setLeadingEdgeStyle(1);
404     acop.setLeadingEdgeWidth(4);
405     acop.setLeadingEdgeXExtent(15);
406     acop.setLeadingEdgeYExtent(40);
407 
408     acop.setDisplayMode(0);
409     acop.Draw(g_rdata, posTest,disa,null,10,10);
410 */
411 
412 //  test FFT
413 /*
414     testData[0]= 12;
415     testData[1]= 2;
416     testData[2]= 16;
417     testData[3]= 1;
418     testData[4]= -12;
419     testData[5]= 32;
420     testData[6]= 22;
421     testData[7]= 1;
422     acop.setDisplayMode(7);
423     acop.setFFT(0x7);
424     ret = acop.Draw(testData, null, null, null,  8 , 0 ); 
425 */
426 
427 // test automatic append time data
428     /*
429     acop.setXMin(0);
430     acop.setXMax(10);
431     acop.setGraphStyle(4);
432     acop.setleftTimeLabel(false);
433     ret = acop.Draw(testData, null, null, null,  8 , 11); 
434 */
435   }
436 	/**
437 	 * This method initializes jButtonDraw
438 	 * 
439 	 * @return javax.swing.JButton
440 	 */
441 	private javax.swing.JButton getJButtonDraw() {
442 		if(jButtonDraw == null) {
443 			jButtonDraw = new javax.swing.JButton();
444 			jButtonDraw.setBounds(599, 35, 64, 24);
445 			jButtonDraw.setText("Draw");
446 			jButtonDraw.addMouseListener(new java.awt.event.MouseAdapter() { 
447 				public void mouseClicked(java.awt.event.MouseEvent e) {    
448 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
449           draw();
450         }
451 			});
452 		}
453 		return jButtonDraw;
454 	}
455 	/**
456 	 * This method initializes jButtonTimer
457 	 * 
458 	 * @return javax.swing.JButton
459 	 */
460 	private javax.swing.JButton getJButtonTimer() {
461 		if(jButtonTimer == null) {
462 			jButtonTimer = new javax.swing.JButton();
463 			jButtonTimer.setBounds(598, 68, 72, 23);
464 			jButtonTimer.setText("Timer");
465 			jButtonTimer.addMouseListener(new java.awt.event.MouseAdapter() { 
466 				public void mouseClicked(java.awt.event.MouseEvent e) {    
467           System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
468 				  if (timerCounter % 2 == 0 ) secondTimer.start();
469           else secondTimer.stop();
470           timerCounter++;
471         }
472 			});
473 		}
474 		return jButtonTimer;
475 	}
476 	/**
477 	 * This method initializes jButton
478 	 * 
479 	 * @return javax.swing.JButton
480 	 */
481 	private javax.swing.JButton getJButton() {   
482 		if(jButton == null) {
483 			jButton = new javax.swing.JButton();
484 			jButton.setBounds(601, 98, 62, 24);
485 			jButton.setText("Text");
486 			jButton.addMouseListener(new java.awt.event.MouseAdapter() { 
487 				public void mouseClicked(java.awt.event.MouseEvent e) {    
488 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
489           acop.printText("Hallo Worldgjf!",100,0.2);
490           txt = acop.getPrintedText(left,siz,pos,0);
491 				}
492 			});
493 		}
494 		return jButton;
495 	}
496 	/**
497 	 * This method initializes jButtonClearText
498 	 * 
499 	 * @return javax.swing.JButton
500 	 */
501 	private javax.swing.JButton getJButtonClearText() {
502 		if(jButtonClearText == null) {
503 			jButtonClearText = new javax.swing.JButton();
504 			jButtonClearText.setBounds(598, 125, 89, 24);
505 			jButtonClearText.setText("ClearText");
506 			jButtonClearText.addMouseListener(new java.awt.event.MouseAdapter() { 
507 				public void mouseClicked(java.awt.event.MouseEvent e) {    
508 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
509           acop.clearText(0);
510 				}
511 			});
512 		}
513 		return jButtonClearText;
514 	}
515 	/**
516 	 * This method initializes jButtonRecallText
517 	 * 
518 	 * @return javax.swing.JButton
519 	 */
520 	private javax.swing.JButton getJButtonRecallText() {
521 		if(jButtonRecallText == null) {
522 			jButtonRecallText = new javax.swing.JButton();
523 			jButtonRecallText.setBounds(600, 156, 94, 22);
524 			jButtonRecallText.setText("RecallText");
525 			jButtonRecallText.addMouseListener(new java.awt.event.MouseAdapter() { 
526 				public void mouseClicked(java.awt.event.MouseEvent e) {    
527 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
528   			  acop.recallText(0);
529         }
530 			});
531 		}
532 		return jButtonRecallText;
533 	}
534 	/**
535 	 * This method initializes jButtonRefreshText
536 	 * 
537 	 * @return javax.swing.JButton
538 	 */
539 	private javax.swing.JButton getJButtonRefreshText() {
540 		if(jButtonRefreshText == null) {
541 			jButtonRefreshText = new javax.swing.JButton();
542 			jButtonRefreshText.setBounds(601, 187, 108, 22);
543 			jButtonRefreshText.setText("RefreshText");
544 			jButtonRefreshText.addMouseListener(new java.awt.event.MouseAdapter() { 
545 				public void mouseClicked(java.awt.event.MouseEvent e) {    
546 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
547           acop.refreshText("Ag",0);
548 				}
549 			});
550 		}
551 		return jButtonRefreshText;
552 	}
553 	/**
554 	 * This method initializes jButtonAppendScreen
555 	 * 
556 	 * @return javax.swing.JButton
557 	 */
558 	private javax.swing.JButton getJButtonAppendScreen() {
559 		if(jButtonAppendScreen == null) {
560 			jButtonAppendScreen = new javax.swing.JButton();
561 			jButtonAppendScreen.setBounds(601, 218, 122, 25);
562 			jButtonAppendScreen.setText("Append Screen");
563 			jButtonAppendScreen.addMouseListener(new java.awt.event.MouseAdapter() { 
564 				public void mouseClicked(java.awt.event.MouseEvent e) {    
565 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
566 //          acop.AppendScreen(g_rdata, 0, 10, 30, null);
567 					ytmp[0]= appenstart - 40;
568 					xtmp[0] = appenstart++ + 8;
569 					acop.appendScreen(ytmp, 0, xtmp);
570 				}
571 			});
572 		}
573 		return jButtonAppendScreen;
574 	}
575 	/**
576 	 * This method initializes jButton1
577 	 * 
578 	 * @return javax.swing.JButton
579 	 */
580 	private javax.swing.JButton getJButton1() {
581 		if(jButton1 == null) {
582 			jButton1 = new javax.swing.JButton();
583 			jButton1.setBounds(601, 249, 86, 24);
584 			jButton1.setText("print");
585 			jButton1.addMouseListener(new java.awt.event.MouseAdapter() { 
586 				public void mouseClicked(java.awt.event.MouseEvent e) {    
587 					System.out.println("test mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
588 
589           double[] dtmp = new double[1];
590           dtmp[0] =  Math.random() * 180 - 90;
591 //          acop.appendScreen(dtmp,0);
592           if ( ++cline % 2 == 1 )
593             acop.lockCursorMarker(true,40,-40);
594           else
595             acop.lockCursorMarker(false);
596             
597 //          acop.setCursorMarkerColor(java.awt.Color.green);
598    
599 //          acop.setYTickLabelColor(java.awt.Color.green);
600 //          acop.setXAxisLabel("abcdefghrwetreASDAKLS");
601 //          acop.PrintScreen(0);
602 
603 //				  acop.Marker(true);
604         }
605 			});
606 		}
607 		return jButton1;
608 	}
609 	/**
610 	 * This method initializes jTextFieldOuputText
611 	 * 
612 	 * @return javax.swing.JTextField
613 	 */
614 	private javax.swing.JTextField getJTextFieldOuputText() {
615 		if(jTextFieldOuputText == null) {
616 			jTextFieldOuputText = new javax.swing.JTextField();
617 			jTextFieldOuputText.setBounds(85, 344, 437, 23);
618     }
619 		return jTextFieldOuputText;
620 	}
621 	/**
622 	 * This method initializes jButton2
623 	 * 
624 	 * @return javax.swing.JButton
625 	 */
626 	private javax.swing.JButton getJButton2() {
627 		if(jButton2 == null) {
628 			jButton2 = new javax.swing.JButton();
629 			jButton2.setBounds(190, 14, 81, 28);
630 			jButton2.setText("Button");
631 		}
632 		return jButton2;
633 	}
634 	/**
635 	 * This method initializes jJMenuBar
636 	 * 
637 	 * @return javax.swing.JMenuBar
638 	 */
639 	private javax.swing.JMenuBar getJJMenuBar() {
640 		if(jJMenuBar == null) {
641 			jJMenuBar = new javax.swing.JMenuBar();
642 			jJMenuBar.add(getJMenu());
643 			jJMenuBar.add(getJMenu1());
644 			jJMenuBar.add(getJMenu2());
645 		}
646 		return jJMenuBar;
647 	}
648 	/**
649 	 * This method initializes jMenu
650 	 * 
651 	 * @return javax.swing.JMenu
652 	 */
653 	private javax.swing.JMenu getJMenu() {
654 		if(jMenu == null) {
655 			jMenu = new javax.swing.JMenu();
656 			jMenu.setText("File");
657       jMenu.add(new JMenuItem("Test1"));
658       jMenu.add(new JMenuItem("Test2"));
659       jMenu.add(new JMenuItem("Test3"));
660 		}
661 		return jMenu;
662 	}
663 	/**
664 	 * This method initializes jMenu1
665 	 * 
666 	 * @return javax.swing.JMenu
667 	 */
668 	private javax.swing.JMenu getJMenu1() {
669 		if(jMenu1 == null) {
670 			jMenu1 = new javax.swing.JMenu();
671 			jMenu1.setText("File1");
672 		}
673 		return jMenu1;
674 	}
675 	/**
676 	 * This method initializes jMenu2
677 	 * 
678 	 * @return javax.swing.JMenu
679 	 */
680 	private javax.swing.JMenu getJMenu2() {
681 		if(jMenu2 == null) {
682 			jMenu2 = new javax.swing.JMenu();
683 			jMenu2.setText("file2");
684 		}
685 		return jMenu2;
686 	}
687 	/**
688 	 * This method initializes button
689 	 * 
690 	 * @return java.awt.Button
691 	 */
692 	private java.awt.Button getButton() {
693 		if(button == null) {
694 			button = new java.awt.Button();
695       button.setLabel("wieuriow");
696       button.setBounds(new java.awt.Rectangle(10,8,78,18));
697       button.addMouseListener(new java.awt.event.MouseAdapter() { 
698       	public void mouseClicked(java.awt.event.MouseEvent e) {    
699       		System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
700           if ( refFlag == false )
701           {
702             acop.refreshScreen(g_data, 0); 
703             refFlag = true;
704             acop.setXMax(50);
705           }
706           else
707           {
708              acop.refreshScreen(g_rdata, 0); 
709             refFlag = false;
710             acop.setXMax(150);
711           }
712         }
713       });
714 		}
715 		return button;
716 	}
717 	/**
718 	 * This method initializes jButton3
719 	 * 
720 	 * @return javax.swing.JButton
721 	 */
722 	private javax.swing.JButton getJButton3() {
723 		if(jButton3 == null) {
724 			jButton3 = new javax.swing.JButton();
725 			jButton3.setBounds(605, 288, 100, 22);
726 			jButton3.setText("CursorLine");
727 			jButton3.addMouseListener(new java.awt.event.MouseAdapter() { 
728 				public void mouseClicked(java.awt.event.MouseEvent e) {    
729 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
730           acop.setCursorMarkerColor(java.awt.Color.orange);
731           acop.setCursorMarkerStyle(cline+1);
732           acop.setCursorMarkerWidth(cline+1);
733           acop.setCursorMarkerXExtent((cline+1)*10);
734           acop.setCursorMarkerYExtent((cline+1)*10+5);
735           acop.setCursorMarkerMode(3);
736  /*         
737           if ( cline == 0 )
738             acop.setCursorMarkerColor(java.awt.Color.green);
739           else if ( cline == 1 )
740             acop.setCursorMarkerColor(java.awt.Color.blue);
741           else if ( cline == 2 )
742             acop.setCursorMarkerColor(java.awt.Color.black);
743           else if ( cline == 3 )
744             acop.setCursorMarkerColor(java.awt.Color.orange);
745           
746           acop.setCursorMarkerStyle(cline+1);
747           acop.setCursorMarkerWidth(cline+1);
748           acop.setCursorMarkerXExtent((cline+1)*10);
749           acop.setCursorMarkerYExtent((cline+1)*10+5);
750           if ( ++cline  > 3 ) cline = 0;          
751 */          
752           if ( cline == 3 ) cline = 0;          
753           else cline = 3;
754 				}
755 			});
756 		}
757 		return jButton3;
758 	}
759 	/**
760 	 * This method initializes jButton4
761 	 * 
762 	 * @return javax.swing.JButton
763 	 */
764 	private javax.swing.JButton getJButton4() {
765 		if(jButton4 == null) {
766 			jButton4 = new javax.swing.JButton();
767 			jButton4.setBounds(606, 323, 77, 22);
768 			jButton4.setText("Marker");
769 			jButton4.addMouseListener(new java.awt.event.MouseAdapter() { 
770 				public void mouseClicked(java.awt.event.MouseEvent e) {    
771 					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
772           if ( markerFlag ) markerFlag = false;
773           else markerFlag = true; 
774 //        acop.Marker(markerFlag, 0);
775           acop.marker(true, 0);
776 				}
777 			});
778 		}
779 		return jButton4;
780 	}
781 }  //  @jve:decl-index=0:visual-constraint="13,9"