Package weka.classifiers.timeseries.core

Examples of weka.classifiers.timeseries.core.CustomPeriodicTest


    add(m_day_of_yr); add(m_day_of_month); add(m_day_of_week);
    add(m_hour_of_day); add(m_min_of_hour); add(m_second);
   
    m_right = right;
    if (m_right) {
      m_testToEdit = new CustomPeriodicTest("<*:*:*:*:*:*:*:*:*:*");
    }
    m_partToEdit = (m_right) ? m_testToEdit.getUpperTest() : m_testToEdit.getLowerTest();
   
    setupCombos();
   
View Full Code Here


   * @param args
   */
  public static void main(String[] args) {
    try {
      CustomPeriodicTestEditor ed = new CustomPeriodicTestEditor(false);
      final CustomPeriodicTest test = new CustomPeriodicTest(">1965:aug:*:*:*:28:*:*:*:*");
      ed.setTestToEdit(test);
      final javax.swing.JFrame jf =
        new javax.swing.JFrame("Periodic test editor");
      jf.getContentPane().setLayout(new BorderLayout());
      jf.getContentPane().add(ed, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
          System.out.println(test.toString());
          jf.dispose();
          System.exit(0);
        }
      });
      jf.pack();
View Full Code Here

          withinCustom = true;

        } else if (withinCustom) {
          // process custom part
          try {
            CustomPeriodicTest t = new CustomPeriodicTest(line);
            testList.add(t);
          } catch (IllegalArgumentException ex) {
            ex.printStackTrace();
            JOptionPane.showConfirmDialog(this, "A problem occurred while parsing\n" +
                "the following custom periodic test:\n"
View Full Code Here

            m_deleteBut.setEnabled(true);
          }
         
          Object test = m_testsToEditList.getSelectedValue();
          if (test != null) {
            CustomPeriodicTest t = (CustomPeriodicTest)test;
            m_lowerBoundEditor.setTestToEdit(t);
            m_upperBoundEditor.setTestToEdit(t);
            if (t.getLabel() != null && t.getLabel().length() > 0) {
              m_labelField.setText(t.getLabel());
            } else {
              m_labelField.setText("");
            }
          }
        }
      }     
    });
   
    m_newBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        CustomPeriodicTest newTest =
          new CustomPeriodicTest(">*:*:*:*:*:*:*:*:*:* <*:*:*:*:*:*:*:*:*:*");
        m_lowerBoundEditor.setTestToEdit(newTest);
        m_upperBoundEditor.setTestToEdit(newTest);
        testVec.addElement(newTest);
        m_testsToEdit.add(newTest);
        m_labelField.setText("");
        m_testsToEditList.setSelectedIndex(m_testsToEdit.size() - 1);
      }
    });
   
    m_deleteBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        int selected = m_testsToEditList.getSelectedIndex();
        if (selected >= 0) {
          testVec.removeElementAt(selected);
          m_testsToEdit.remove(selected);
        }
      }
    });
   
    m_lowerBoundEditor.addPropertyChangeListener(new PropertyChangeListener() {

      public void propertyChange(PropertyChangeEvent e) {
        /*m_testsToEditList.revalidate();
        m_testsToEditList.invalidate(); */
        m_testsToEditList.repaint();
        if (m_lowerBoundEditor.getTestBeingEdited().getLowerTest().m_boundOperator ==
          CustomPeriodicTest.Operator.EQUALS) {
          m_upperBoundEditor.setEnabled(false);
        } else {
          m_upperBoundEditor.setEnabled(true);
        }
      }     
    });
   
    m_upperBoundEditor.addPropertyChangeListener(new PropertyChangeListener() {

      public void propertyChange(PropertyChangeEvent e) {
        /*m_testsToEditList.revalidate();
        m_testsToEditList.invalidate(); */
        m_testsToEditList.repaint();
      }     
    });
   
    m_labelField.addKeyListener(new KeyAdapter() {
      public void keyReleased(KeyEvent e) {
        Object test = m_testsToEditList.getSelectedValue();
        if (test != null) {
          CustomPeriodicTest t = (CustomPeriodicTest)test;
          t.setLabel(m_labelField.getText());
          m_testsToEditList.repaint();
        }
      }
    });
    /*m_labelField.addFocusListener(new FocusAdapter() {
View Full Code Here

TOP

Related Classes of weka.classifiers.timeseries.core.CustomPeriodicTest

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.