Package nodes

Examples of nodes.MileStone


  /**
   * Save clicked action handler
   */
  private void saveButton_Clicked()
  {
    MileStone m = null;

    try
    {
      m = new MileStone(Integer.parseInt(fromYearTextField.getText()),
          Integer.parseInt(toYearTextField.getText()),
          new MileStonePlace((String) mileStonePlaceComboBox
              .getSelectedItem()),
          mileStoneComboBox.getSelectedItem().toString());

      ((MainFrame) caller).addMileStone(m);

      // JOptionPane.showMessageDialog(this, "Added successfully");

      caller.setEnabled(true);
      this.dispose();
    }
    catch (NumberFormatException e)
    {
      JOptionPane.showMessageDialog(this, "Bad year input");
    }
    catch (Exception e)
    {
      JOptionPane.showMessageDialog(this, e.getMessage());
    }
    finally
    {
      if (m != null)
        System.out.println(m.toString());
    }
  }
View Full Code Here


   *            The description of this milestone
   */
  public void addMilestone(int low, int high, MileStonePlace place,
      String description)
  {
    lifeHistory.insert(new MileStone(low, high, place, description));
  }
View Full Code Here

   *            The end of the interval
   */
  public void insert(String summary, MileStonePlace place,
      String description, Comparable begining, Comparable end)
  {
    insert(new MileStone(begining, end, place, description));
  }
View Full Code Here

   *
   * @return stack of lists of strings that hold each of the nodes
   */
  public Vector<MileStone> returnNodes()
  {
    MileStone current = (MileStone) this.root;
    Stack<MileStone> stack = new Stack<MileStone>();
    Vector<MileStone> mileStoneList = new Vector<MileStone>();

    while (stack.isEmpty() == false || current != null)
    {
      if (current != null)
      {
        stack.push(current);
        current = (MileStone) current.getLeft();
      }
      else
      {
        current = stack.pop();
        mileStoneList.add(current);
        current = (MileStone) current.getRight();
      }
    }

    return mileStoneList;
  }
View Full Code Here

    Person p = null;

    try
    {
      p = new Person(firstNameTextField.getText(), lastNameTextField.getText(),
          new MileStone(Integer.parseInt(fromYearTextField.getText()),
              Integer.parseInt(toYearTextField.getText()),
              new MileStonePlace(mileStonePlaceComboBox.getSelectedItem().toString()),
              mileStoneComboBox.getSelectedItem().toString())
      );
      caller.setEnabled(true);
View Full Code Here

TOP

Related Classes of nodes.MileStone

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.