Jump to content
Software FX Community

Hi, trying to draw Fibonacci arc in java - chartFx - Selection points is erratic


rathinamsm

Recommended Posts

Hi ,

I'm New to chart Fx,

 I'm trying to create a sample to draw an arc ( Sample for the Fibonacci arc ) and making into a group.

I have taken the AnnotationView.java from the NetBeans trial and worked out for the sample code to draw an arc.

1. Press the Button Fibonacci arc button.

2. Press the Main Panel.

3. The arc gets drawn in the graph which is attached with the X-Axis.

4. Select the ARC.

5. Now the selection points sets in different location in the chart,

6. In the Tool Bar, the "Ungroup button" gets enabled.

If the objects are ungrouped. The selection and resize works properly. 

Let me know the problem and correction for it. 

Sample code :

/*

 * AnnotationView.java

 */

package annotation;

import java.awt.event.MouseEvent;

import org.jdesktop.application.Action;

import org.jdesktop.application.ResourceMap;

import org.jdesktop.application.SingleFrameApplication;

import org.jdesktop.application.FrameView;

import org.jdesktop.application.TaskMonitor;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.io.IOException;

import java.io.InputStream;

import java.util.logging.Level;

import java.util.logging.Logger;

import javax.swing.*;

/**

 * The application's main frame.

 */

public class AnnotationView extends FrameView {

  public AnnotationView(SingleFrameApplication app) {

  super(app);

  initComponents();

  addListeners();

jTextArea1.setBackground(fMainPanel.getBackground());

  initializeChart();

 

  // status bar initialization - message timeout, idle icon and busy animation, etc

  ResourceMap resourceMap = getResourceMap();

  int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");

  messageTimer = new Timer(messageTimeout, new ActionListener() {

  public void actionPerformed(ActionEvent e) {

  statusMessageLabel.setText("");

  }

  });

  messageTimer.setRepeats(false);

  int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");

  for (int i = 0; i < busyIcons.length; i++) {

  busyIcons = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");

  }

  busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {

  public void actionPerformed(ActionEvent e) {

  busyIconIndex = (busyIconIndex + 1) % busyIcons.length;

  statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);

  }

  });

  idleIcon = resourceMap.getIcon("StatusBar.idleIcon");

  statusAnimationLabel.setIcon(idleIcon);

  progressBar.setVisible(false);

  // connecting action tasks to status bar via TaskMonitor

  TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());

  taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

  public void propertyChange(java.beans.PropertyChangeEvent evt) {

  String propertyName = evt.getPropertyName();

  if ("started".equals(propertyName)) {

  if (!busyIconTimer.isRunning()) {

  statusAnimationLabel.setIcon(busyIcons[0]);

  busyIconIndex = 0;

  busyIconTimer.start();

  }

  progressBar.setVisible(true);

  progressBar.setIndeterminate(true);

  } else if ("done".equals(propertyName)) {

  busyIconTimer.stop();

  statusAnimationLabel.setIcon(idleIcon);

  progressBar.setVisible(false);

  progressBar.setValue(0);

  } else if ("message".equals(propertyName)) {

  String text = (String)(evt.getNewValue());

  statusMessageLabel.setText((text == null) ? "" : text);

  messageTimer.restart();

  } else if ("progress".equals(propertyName)) {

  int value = (Integer)(evt.getNewValue());

  progressBar.setVisible(true);

  progressBar.setIndeterminate(false);

  progressBar.setValue(value);

  }

  }

  });

  }

  public void initializeChart(){

 

  ResourceMap resourceMap = getResourceMap();

 

  chart1.setGallery(com.softwarefx.chartfx.desktop.Gallery.OPEN_HIGH_LOW_CLOSE);

  chart1.getAxisY().setForceZero(false);

  chart1.getAxisX().setAutoScroll(true);

 

  InputStream myFileStream = null;

  try {

  myFileStream = this.getClass().getResource("/Annotation/Resources/FinancialData.txt").openStream();

  } catch (IOException ex) {

  Logger.getLogger(AnnotationView.class.getName()).log(Level.SEVERE, null, ex);

  }

 

  com.softwarefx.chartfx.desktop.dataproviders.XmlDataProvider cfxXML = new com.softwarefx.chartfx.desktop.dataproviders.XmlDataProvider();

  cfxXML.setDateFormat("yyyy-MM-dd");

  cfxXML.load(myFileStream);

  chart1.setDataSource(cfxXML);

  fAnnotationDrawings = new com.softwarefx.chartfx.desktop.annotation.Annotations();

  chart1.getExtensions().add(fAnnotationDrawings);

 

  fAnnotationDrawings.setEnableUI(true);

  fAnnotationDrawings.getToolBar().setVisible(true);

 

 

  // Create new annotation objects and attach them to the X axis. Since these objects are

  // attached, they will scroll with the chart

  com.softwarefx.chartfx.desktop.annotation.AnnotationBalloon balloon =  new com.softwarefx.chartfx.desktop.annotation.AnnotationBalloon();

  balloon.setText("$0.08 Cash Dividend");

  balloon.setColor(java.awt.Color.CYAN);

  balloon.setTailCorner(com.softwarefx.chartfx.desktop.annotation.BalloonTailCorner.BOTTOM_LEFT);

  balloon.sizeToFit();

  balloon.attach(com.softwarefx.StringAlignment.NEAR, getXAxisPosition("08/15/2005"), com.softwarefx.StringAlignment.FAR, 27.05);

  balloon.setPlotAreaOnly(true);

  balloon.setAllowMove(true);

  balloon.setAllowModify(true);

  fAnnotationDrawings.getList().add(balloon);

 

  balloon = new com.softwarefx.chartfx.desktop.annotation.AnnotationBalloon();

  balloon.setText("$0.08 Cash Dividend");

  balloon.setColor(java.awt.Color.CYAN);

  balloon.setTailCorner(com.softwarefx.chartfx.desktop.annotation.BalloonTailCorner.BOTTOM_LEFT);

  balloon.sizeToFit();

  balloon.attach(com.softwarefx.StringAlignment.NEAR, getXAxisPosition("05/16/2005"), com.softwarefx.StringAlignment.FAR, 25.30);

  balloon.setPlotAreaOnly(true);

  balloon.setAllowMove(false);

  balloon.setAllowModify(false);

  fAnnotationDrawings.getList().add(balloon);  

 

  com.softwarefx.chartfx.desktop.annotation.AnnotationArrow arrow = new com.softwarefx.chartfx.desktop.annotation.AnnotationArrow();

  arrow.attach(com.softwarefx.StringAlignment.FAR, getXAxisPosition("11/15/2004"), com.softwarefx.StringAlignment.FAR, 30.16);

  arrow.setHeight(-100);

  arrow.setWidth(30);

  arrow.setPlotAreaOnly(true);

  arrow.setAllowMove(true);

  arrow.setAllowModify(true);

 

  fAnnotationDrawings.getList().add(arrow);

 

  com.softwarefx.chartfx.desktop.annotation.AnnotationText text = new com.softwarefx.chartfx.desktop.annotation.AnnotationText("52 Week High");

  text.attach(getXAxisPosition("11/15/2004"), 27.8);

  text.setColor(java.awt.Color.RED);

  text.setPlotAreaOnly(true);

  text.setAllowMove(true);

  fAnnotationDrawings.getList().add(text);

 

 

  // Create a logo annotation image bu do not attach it to any specific point but rather

  // to a fixed position. This will not scroll with the chart

  javax.swing.ImageIcon icn = resourceMap.getImageIcon("chartImage");

  java.awt.Image chartImg = icn.getImage();  

  com.softwarefx.chartfx.desktop.annotation.AnnotationPicture pict = new com.softwarefx.chartfx.desktop.annotation.AnnotationPicture(chartImg);

  pict.setTop(40);

  pict.setLeft(40);

  pict.setWidth(137);

  pict.setHeight(19);

  pict.setMode(com.softwarefx.chartfx.desktop.annotation.AnnImageMode.STRETCH);

  java.awt.Color transparentColor = new java.awt.Color(0,0,0,0);

  pict.getBorder().setColor(transparentColor);

  fAnnotationDrawings.getList().add(pict);

 

 

  }

 

  public double getXAxisPosition(String date){

  java.text.ParsePosition pos = new java.text.ParsePosition(0);

  java.util.Date data = new java.text.SimpleDateFormat("MM/dd/yyyy").parse(date, pos);

 

  double dateAsDouble = com.softwarefx.chartfx.desktop.Chart.dateToNumber(data);

 

  for(int i=0; i < chart1.getData().getPoints(); i++){

  if (chart1.getData().getX().get(i) == dateAsDouble)

  return i;

  }

 

  return 0;

  }

 

  @Action

  public void showAboutBox() {

  if (aboutBox == null) {

  JFrame mainFrame = AnnotationApp.getApplication().getMainFrame();

  aboutBox = new AnnotationAboutBox(mainFrame);

  aboutBox.setLocationRelativeTo(mainFrame);

  }

  AnnotationApp.getApplication().show(aboutBox);

  }

  private void addListeners() {

 

fMainPanel.addMouseListener(new java.awt.event.MouseAdapter() {

  @Override

public void mouseClicked(MouseEvent e) {

  super.mouseClicked(e);

  System.out.println("----------->>>>>>>>>><<<<<<<<<<<<<<<");

 

  if ( fReadyToDrawFibonacciArc ){

  chart1MouseClicked(e);

  }

  }

 

  });

  }

 

  private void chart1MouseClicked(MouseEvent event){

  drawFibonacciArcs();

}

  private void drawCircles() {

  com.softwarefx.chartfx.desktop.annotation.AnnotationCircle circle1 = new com.softwarefx.chartfx.desktop.annotation.AnnotationCircle();

  circle1.setHeight(30);

  circle1.setWidth(30);

  circle1.getBorder().setColor(java.awt.Color.black);

  circle1.attach(getXAxisPosition("10/12/2004"), 27.8);

  com.softwarefx.chartfx.desktop.annotation.AnnotationCircle circle2 = new com.softwarefx.chartfx.desktop.annotation.AnnotationCircle();

  circle2.setHeight(30);

  circle2.setWidth(30);

  circle2.getBorder().setColor(java.awt.Color.black);

  circle2.attach(getXAxisPosition("10/13/2004"), 27.8);

  com.softwarefx.chartfx.desktop.annotation.AnnotationCircle circle3 = new com.softwarefx.chartfx.desktop.annotation.AnnotationCircle();

  circle3.setHeight(30);

  circle3.setWidth(30);

  circle3.getBorder().setColor(java.awt.Color.black);

  circle3.attach(getXAxisPosition("10/15/2004"), 27.8);

  com.softwarefx.chartfx.desktop.annotation.AnnotationGroup group = new com.softwarefx.chartfx.desktop.annotation.AnnotationGroup();

  fAnnotationDrawings.getList().add(group);

  group.getList().add(circle1);

  group.getList().add(circle2);

  group.getList().add(circle3);

  group.setColor(java.awt.Color.yellow);

  group.recalcBounds();  

  }

 

  private void drawFibonacciArcs() {

  com.softwarefx.chartfx.desktop.annotation.AnnotationArc arc1 = new com.softwarefx.chartfx.desktop.annotation.AnnotationArc();

  arc1.setHeight(30);

  arc1.setWidth(30);

  arc1.getBorder().setColor(java.awt.Color.black);

  arc1.attach(getXAxisPosition("10/12/2004"), 27.8);

  com.softwarefx.chartfx.desktop.annotation.AnnotationArc arc2 = new com.softwarefx.chartfx.desktop.annotation.AnnotationArc();

  arc2.setHeight(50);

  arc2.setWidth(30);

  arc2.getBorder().setColor(java.awt.Color.black);

  arc2.attach(getXAxisPosition("10/13/2004"), 27.8);

  com.softwarefx.chartfx.desktop.annotation.AnnotationArc arc3 = new com.softwarefx.chartfx.desktop.annotation.AnnotationArc();

  arc3.setHeight(30);

  arc3.setWidth(30);

  arc3.getBorder().setColor(java.awt.Color.black);

  arc3.attach(getXAxisPosition("10/15/2004"), 27.8);

  com.softwarefx.chartfx.desktop.annotation.AnnotationGroup group = new com.softwarefx.chartfx.desktop.annotation.AnnotationGroup();

 

  group.getList().add(arc1);

  group.getList().add(arc2);

  group.getList().add(arc3);

// group.setColor(java.awt.Color.yellow);

  group.recalcBounds();

  fAnnotationDrawings.getList().add(group);

  fAnnotationDrawings.getChart().refresh();

  }

  private void drawLines() {

  com.softwarefx.chartfx.desktop.annotation.AnnotationArrow arrow = new com.softwarefx.chartfx.desktop.annotation.AnnotationArrow();

  arrow.attach(com.softwarefx.StringAlignment.FAR, getXAxisPosition("10/15/2004"), com.softwarefx.StringAlignment.FAR, 30.16);

  arrow.setHeight(-100);

  arrow.setWidth(30);

  arrow.setPlotAreaOnly(true);

  arrow.setAllowMove(true);

  arrow.setAllowModify(true);

  fAnnotationDrawings.getList().add(arrow);

  }

  /** This method is called from within the constructor to

* initialize the form.

* WARNING: Do NOT modify this code. The content of this method is

* always regenerated by the Form Editor.

*/

  @SuppressWarnings("unchecked")

  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents

  private void initComponents() {

  fMainPanel = new javax.swing.JPanel();

  jScrollPane1 = new javax.swing.JScrollPane();

  jTextArea1 = new javax.swing.JTextArea();

  chart1 = new com.softwarefx.chartfx.desktop.Chart();

  menuBar = new javax.swing.JMenuBar();

  javax.swing.JMenu fileMenu = new javax.swing.JMenu();

  javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();

  javax.swing.JMenu helpMenu = new javax.swing.JMenu();

  javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();

  statusPanel = new javax.swing.JPanel();

  javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();

  statusMessageLabel = new javax.swing.JLabel();

  statusAnimationLabel = new javax.swing.JLabel();

  progressBar = new javax.swing.JProgressBar();

  fFibonacciArcs = new javax.swing.JButton();

  jButton1 = new javax.swing.JButton();

  fMainPanel.setMaximumSize(new java.awt.Dimension(750, 610));

  fMainPanel.setMinimumSize(new java.awt.Dimension(750, 610));

  fMainPanel.setName("fMainPanel"); // NOI18N

  fMainPanel.setPreferredSize(new java.awt.Dimension(750, 610));

  fMainPanel.setLayout(null);

  jScrollPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));

  jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

  jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

  jScrollPane1.setName("jScrollPane1"); // NOI18N

  org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(annotation.AnnotationApp.class).getContext().getResourceMap(AnnotationView.class);

  jTextArea1.setBackground(resourceMap.getColor("jTextArea1.background")); // NOI18N

  jTextArea1.setColumns(20);

  jTextArea1.setEditable(false);

  jTextArea1.setFont(resourceMap.getFont("jTextArea1.font")); // NOI18N

  jTextArea1.setLineWrap(true);

  jTextArea1.setRows(5);

  jTextArea1.setText(resourceMap.getString("jTextArea1.text")); // NOI18N

  jTextArea1.setWrapStyleWord(true);

  jTextArea1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));

  jTextArea1.setName("jTextArea1"); // NOI18N

  jScrollPane1.setViewportView(jTextArea1);

  fMainPanel.add(jScrollPane1);

  jScrollPane1.setBounds(20, 0, 850, 100);

  chart1.setPanes(new com.softwarefx.chartfx.desktop.PaneCollection((com.softwarefx.chartfx.desktop.Pane)com.softwarefx.Serializer.loadObject(new java.lang.String("H4sIAAAAAAAAAL0Ze2wT5/2znTBYA6RQCl1HJSBFpQM7PFdwWeIkGDskkJzDI0lHe7HP9jln+3L3Ob6gqcCmVtv+Qf2jkzptrEPrg1KxTVO7rmMse0gT0Vqx7qFpagdKNamaxB5smrqBxL7fd3ff+S5n5y7qdlJyv7v7fr/v9358fvUGalYVtCFdLobVchZXeUXIauF0nlcwuWcEdRyX5fAAXxLukOv6D774SggF+lBQO4ZRuI+gRSy0iIEWMdAiYgkLSomXIoAf1WSy0+Z5djJR2JbfbP7prRBqIVvyZYw+5XnL8ShBKcQw2uhEUbNaScCR1JSKhWKkq1yWBL5EVxcxamu8OlnC27fBWpms3eyZmTylL5cwinjGGRKx")+

  new java.lang.String("JFC08gR6Ei0CSGbQBEYPNma1p1wZMwgoDE1lEMZot2deYpqoDneXJUlIY7GsC1Pxo4AxHNUUtM5hfJ1hy+Z88dHpr55Z+aXMRBAhba5bGut1AcOHxgqEnennR949tfwZDjDkagARH3vYq4/lS+Bhr51+63wIBYlMXcMuMjm0qvBVsZSLEGWUFdBDiuD0etZD0gT2SUJRKGFKpu1wKSMo0hSh60VL2clb3Kq3DieuvgQyg0GXusttV5fBeZhuiciVevvFmSAKjqBgJUcEqWQxau0r8JN8hK9iQ0BKfkWAEF8GX8Lki04g8MLqL7Se2V4JouY4WpTlJTnPJ1HzJC9VBEIsrWJ0v0UsDSg6yZTMp4XoKFqSVXJjdDlGwdH4")+

  new java.lang.String("KCFCn2DD+zQZGZcsQ9ZIeLWoqd9wHf22Blbd/srJp7YEUSCJFhWPwI71VW5obl+pUjzVUZ353p9e2GmqfAXhLagR1rZ4ZY3GM/jbbe5XV0LoXqKlRNxPDKVpSjtwxAzhYZLc9nrG7imnx2OKwNc6GyEyQhLJI95cPoUVcotJYq4Eqm3jKT7NLesAIibv8Jfd4hKfU50MkcS0oQ5DDDun0qVV2LsZIM0DUl6M0ioCSE0EyuTmzaG6yIAmch52kCW6NOVlaZkuxb6qSIFWqYKfytsnlvRKOG7aqSAxqGi6UoFq8mMEknpNqOirwmXTNZWGRkgLSUqyXnCWQ34C4J4Ava2ujW54cT+B79K8r22ByNvlKd3N8doNExsvn3vv")+

  new java.lang.String("ya/ZUgAQ/iTsQrfYYYMCNZCCol7j3SXgjp9cG71eKRZctw74qlwFYDGx/LtRvR2L8y69kXsYx8slbOR1sBBocq+vHOaM2paW3Vzg4ZfP15VqfUND0ZbqsQuJ2d+8+9pf5tCgeZYaoJM6gTp/fcypK9eNVtdcu9wepLrJE0e+x6pFHGka+FKOtEb6BoTiClbb2MeffafQ/ImZAg6iJsJQXhBzeUzqW1XM4HwSBTTyN2VVKfPSGYUkT8tWW0PBjc7zxprY+b2H/riEMDviEF2zBK+B5uuL9Mbv52f4W2c+MxggZHvsZDv+5mTWRvzTXp3B0RQC+lTHc826Q2ZpIQ9oc8O0IT07uY9/ObAmRDvBXt8NACdMVERFUGPFMVFv")+

  new java.lang.String("BAzCIPC/j988GKJFYDBp1pDB3gU1cpwg8+StWymzSo1EOv8djcPTYlCNxBSFn+oTVSNOW/T2bltDq9fghxn+5tDL19sGl96kgRAg89MqPQ4qWJScuywlW6ykgQBfLRra6XfWPvcL/ushCM0mVTwhUL8PVpvAQn46IOowYNfixbOPO93E82AIVIDI6vD1N0JknkLB3mEgMkQgLgbQEoC6GNTNoB4G7fMzStKqzsUZ8n4GJcwCyiUZRNyoZwHzQHFMyGSETCqtEEN28XS24A6Yzsn1sT37MdrpmT4N+3hZKfKYEjwIZJ4A6BAjOMCgQSYE52US3rqL0kwx/CGGf7h+a8V4E3m9heSO+Gk0eBpa3FHYKg3QMT9tJzhPSg8T")+

  new java.lang.String("+zjLkTGuyzOZ7oqKy8X9ipgh/ZXgoDTCtDDBzKf47Nno3M6RjjrmS7SBsioCH45ExGHGSMW3tvCUJDgzGzfJbF5lkMagKQadMKEUb2olNWYyk0qbXzNlExJpLdpAe2OAHrL1qXIJoMVWpzmKgphMMBtHPZ2FaH46rAwkmfXprgdClNmBYT+HN+AadEYZYN5gVYOCaPbYhQJAm6ws77kDXuxr9qTsAInj7509p8tjsaMRybb5ksx0UI0KpxBoijdFmtLNW3su0e6HTaANJfrSH1bdCaEQodgtmQ7TXfQz8Q6J6fF+Xhl3+G4hpjPoo+QAT6C9z74e6AhRYyYGTLMmBk3JEyRpPuqtBzfu23oiPbyapyGm58IEmR27/dKg")+

  new java.lang.String("OYiXHXImaDbWLFPbvayTTTae/K0J/G2Pp4mLMRauEW7m8oG7n4rhra5DQpDQjvmkPVfoD++99OOzH1x4tsFgdxogzZQ3GTBvPsY6F6/652+vtVe3vHnFfQDSm3i8cL0DeNIugpswttvT1s6etmnWDGxNtoYBp6KsQSSqT44ATv6vBCNG6fDTE7rUvgu/jJ6/tP9fZxt4BHDdZGpuIQeNdfr/J9rvexzfPX6q7lDseeZ2LcI/7Jg9/o8//yg8l/yyD954iMrTbxtK+zuPnKp5Wui3ziZUdyV78lNlRcj1M7dbV+pz3iaviFOA963I726EaDvAYz8NFqg0ams7MrKfHlSkh12ZCYbNfmDJqOwd67kyFfrVqog2bcGDJLvo")+

  new java.lang.String("s7OOnpPIHqF6HPVP76i1xXSbm2VkB+FO62VyrhG3e7VFzZABVpnNf3uTbpVeUs36FjKrtOk3t6G6d8hvB2uQdJA5DOI+CBA7UO89yqBjvs4+6YBoTaG19dZogTyfX8yvhNnFL4k773r+UJ2k5jOzzFHOxd49b3b+/eL365JvfPikH7c+o/7k4LrZz52j5w4GEYxW6IcPEs9+TDBOHjAKZtudvkkPpnykkqwEuEv2fmNaP1rIxef9ZWO/VB7jJfEED3WDDHUSrihCspQt285HAXwFsrZRG/ttB2j2p05DSfMeeW7d9f7a7NX/7P41FKeU88jToPyhg3KmvvqZGmCqfvbmI8f2bHp9qbsNZdmsw45MQKFu+j9OHmfJ33oj")+

  new java.lang.String("HTxgSxInDcYg/cCLZbqSHvM7wQA4Ya79CDqkYOMOKVB7e7rGoh9tixT4/7VIAL6Iak/IWS9jeq0OvWq1BSf/euf20ZnPX9Sf7tieGn1jlcHlyR4R7ivdalzDpQ7vrFOn4OmKqc232aurDHqnfnYB6Pf2IEeegxygaw1CFaD3DZN6ijfbNU+8abVOR/hujdBWgH137pcMaNp/AReaOS7sIwAA"))));

fMainPanel.add(chart1);

chart1.setBounds(20, 110, 840, 460);

menuBar.setName("menuBar"); // NOI18N

fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N

fileMenu.setName("fileMenu"); // NOI18N

javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(annotation.AnnotationApp.class).getContext().getActionMap(AnnotationView.class, this);

exitMenuItem.setAction(actionMap.get("quit")); // NOI18N

exitMenuItem.setName("exitMenuItem"); // NOI18N

fileMenu.add(exitMenuItem);

menuBar.add(fileMenu);

helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N

helpMenu.setName("helpMenu"); // NOI18N

aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N

aboutMenuItem.setName("aboutMenuItem"); // NOI18N

helpMenu.add(aboutMenuItem);

menuBar.add(helpMenu);

statusPanel.setName("statusPanel"); // NOI18N

statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

statusMessageLabel.setName("statusMessageLabel"); // NOI18N

statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);

statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

progressBar.setName("progressBar"); // NOI18N

fFibonacciArcs.setText(resourceMap.getString("FibonacciArcs.text")); // NOI18N

fFibonacciArcs.setToolTipText(resourceMap.getString("FibonacciArcs.toolTipText")); // NOI18N

fFibonacciArcs.setActionCommand(resourceMap.getString("FibonacciArcs.actionCommand")); // NOI18N

fFibonacciArcs.setFocusTraversalPolicyProvider(true);

fFibonacciArcs.setName("FibonacciArcs"); // NOI18N

fFibonacciArcs.addActionListener(new java.awt.event.ActionListener() {

  public void actionPerformed(java.awt.event.ActionEvent evt) {

  fFibonacciArcsActionPerformed(evt);

  }

  });

  jButton1.setText(resourceMap.getString("SampleButton.text")); // NOI18N

  jButton1.setName("SampleButton"); // NOI18N

  jButton1.addActionListener(new java.awt.event.ActionListener() {

  public void actionPerformed(java.awt.event.ActionEvent evt) {

  fSampleButtonActionPerformed(evt);

  }

  });

  javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);

  statusPanel.setLayout(statusPanelLayout);

  statusPanelLayout.setHorizontalGroup(

  statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

  .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 890, Short.MAX_VALUE)

  .addGroup(statusPanelLayout.createSequentialGroup()

  .addContainerGap()

  .addComponent(statusMessageLabel)

  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 479, Short.MAX_VALUE)

  .addComponent(jButton1)

  .addGap(48, 48, 48)

  .addComponent(fFibonacciArcs)

  .addGap(45, 45, 45)

  .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

  .addComponent(statusAnimationLabel)

  .addContainerGap())

  );

  statusPanelLayout.setVerticalGroup(

  statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

  .addGroup(statusPanelLayout.createSequentialGroup()

  .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)

  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

  .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

  .addGroup(statusPanelLayout.createSequentialGroup()

  .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

  .addComponent(statusMessageLabel)

  .addComponent(statusAnimationLabel)

  .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

  .addGap(3, 3, 3))

  .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

  .addComponent(fFibonacciArcs)

  .addComponent(jButton1))))

  );

  setComponent(fMainPanel);

  setMenuBar(menuBar);

  setStatusBar(statusPanel);

  }// </editor-fold>//GEN-END:initComponents

  private void fFibonacciArcsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fFibonacciArcsActionPerformed

  System.out.println("Sucesssssssssss arc button pressed");

//==========

//drawCircles();

//drawLines();

//fAnnotationDrawings.getChart().refresh();

  fReadyToDrawFibonacciArc = true;

  //==========

  }//GEN-LAST:event_fFibonacciArcsActionPerformed

  private void fSampleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fSampleButtonActionPerformed

System.out.println("Sucess sample button pressed");

  }//GEN-LAST:event_fSampleButtonActionPerformed

  // Variables declaration - do not modify//GEN-BEGIN:variables

  private com.softwarefx.chartfx.desktop.Chart chart1;

  private javax.swing.JButton fFibonacciArcs;

  private javax.swing.JPanel fMainPanel;

  private javax.swing.JButton jButton1;

  private javax.swing.JScrollPane jScrollPane1;

  private javax.swing.JTextArea jTextArea1;

  private javax.swing.JMenuBar menuBar;

  private javax.swing.JProgressBar progressBar;

  private javax.swing.JLabel statusAnimationLabel;

  private javax.swing.JLabel statusMessageLabel;

  private javax.swing.JPanel statusPanel;

  // End of variables declaration//GEN-END:variables

  private final Timer messageTimer;

  private final Timer busyIconTimer;

  private final Icon idleIcon;

  private final Icon[] busyIcons = new Icon[15];

  private int busyIconIndex = 0;

  private JDialog aboutBox;

 

  private com.softwarefx.chartfx.desktop.annotation.Annotations fAnnotationDrawings;

  private boolean fReadyToDrawFibonacciArc = false;

}

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...