Exemplo n.º 1
0
 void exit_mouseReleased(MouseEvent e) {
   exit.setBounds(new Rectangle(15, 340, 129, 36));
   System.exit(0);
 }
Exemplo n.º 2
0
 void exit_mousePressed(MouseEvent e) {
   exit.setBounds(new Rectangle(16, 341, 129, 36));
 }
Exemplo n.º 3
0
  /**
   * Initialize frame
   *
   * @throws java.lang.Exception
   */
  private void initializeModulesFrame() throws Exception {
    // frame initialization
    this.setFont(new java.awt.Font("Arial", 0, 11));
    this.setIconImage(
        Toolkit.getDefaultToolkit()
            .getImage(
                this.getClass().getResource("/keel/GraphInterKeel/resources/ico/logo/logo.gif")));
    this.setSize(new Dimension(640, 480));
    this.setTitle("Keel");
    this.setResizable(false);

    // Create panel
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(null);

    // panel background
    fondo.setText("");
    fondo.setBounds(new Rectangle(0, 0, 640, 480));
    fondo.setFont(new java.awt.Font("Arial", 0, 11));
    fondo.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/fondo.gif")));

    exit.setText("Exit KEEL");
    exit.setBounds(new Rectangle(294, 327, 129, 36));
    exit.setFont(new java.awt.Font("Arial", 0, 11));

    // labels associated to buttons
    labelSalir.setFont(new java.awt.Font("Arial", 1, 18));
    labelSalir.setForeground(Color.white);
    labelSalir.setText("Exit KEEL");
    labelSalir.setBounds(new Rectangle(40, 412, 595, 27));
    labelSalir.setVisible(false);

    labelBack.setFont(new java.awt.Font("Arial", 1, 18));
    labelBack.setForeground(Color.white);
    labelBack.setText("Back to Keel Suite Menu");
    labelBack.setBounds(new Rectangle(40, 412, 595, 27));
    labelBack.setVisible(false);

    labelLQD.setFont(new java.awt.Font("Arial", 1, 18));
    labelLQD.setForeground(Color.white);
    labelLQD.setText("Experiments Design with Low Quality Data");
    labelLQD.setBounds(new Rectangle(40, 412, 465, 27));
    labelLQD.setVisible(false);

    labelImbalance.setFont(new java.awt.Font("Arial", 1, 18));
    labelImbalance.setForeground(Color.white);
    labelImbalance.setText("Experiments with Imbalanced Datasets");
    labelImbalance.setBounds(new Rectangle(40, 412, 465, 27));
    labelImbalance.setVisible(false);

    labelNonParametric.setFont(new java.awt.Font("Arial", 1, 18));
    labelNonParametric.setForeground(Color.white);
    labelNonParametric.setText("Non-Parametric Statistical Analysis");
    labelNonParametric.setBounds(new Rectangle(40, 412, 465, 27));
    labelNonParametric.setVisible(false);

    labelSSL.setFont(new java.awt.Font("Arial", 1, 18));
    labelSSL.setForeground(Color.white);
    labelSSL.setText("Semi-Supervised Learning");
    labelSSL.setBounds(new Rectangle(40, 412, 465, 27));
    labelSSL.setVisible(false);

    labelMil.setFont(new java.awt.Font("Arial", 1, 17));
    labelMil.setForeground(Color.white);
    labelMil.setText("Experiments with Multiple Instance Learning");
    labelMil.setBounds(new Rectangle(40, 412, 465, 27));
    labelMil.setVisible(false);

    contentPane.setFont(new java.awt.Font("Arial", 0, 11));

    keel.setText("");
    keel.setBounds(new Rectangle(160, 13, 336, 33));
    keel.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/mod.png")));
    logotipo.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/logotipo.png")));
    logotipo.setBounds(new Rectangle(550, 13, 65, 43));
    logotipo.addMouseListener(new FrameModules_logotipo_mouseAdapter(this));

    logotipoSoft.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/Software.png")));
    logotipoSoft.setBounds(new Rectangle(30, 13, 75, 43));
    logotipoSoft.addMouseListener(new FrameModules_logotipoSoft_mouseAdapter(this));

    barraExit.setBounds(new Rectangle(0, 401, 751, 50));
    barraExit.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/exit.png")));
    accionExit.setText("jLabel2");
    accionExit.setBounds(new Rectangle(536, 409, 94, 38));
    accionExit.addMouseListener(new FrameModules_accionExit_mouseAdapter(this));

    back.setBounds(new Rectangle(406, 409, 110, 38));
    back.addMouseListener(new FrameModules_back_mouseAdapter(this));

    // lqd.setBounds(new Rectangle(50, 140, 244, 40));
    lqd.setBounds(new Rectangle(50, 120, 244, 40));
    lqd.addMouseListener(new Frame_lqd_mouseAdapter(this));

    // imbalance.setBounds(new Rectangle(50, 200, 264, 38));
    imbalance.setBounds(new Rectangle(50, 180, 264, 38));
    imbalance.addMouseListener(new Frame_imbalance_mouseAdapter(this));

    // nonParametric.setBounds(new Rectangle(50, 260, 400, 42));
    nonParametric.setBounds(new Rectangle(50, 240, 400, 42));
    nonParametric.addMouseListener(new Frame_nonParametric_mouseAdapter(this));

    SSL.setBounds(new Rectangle(50, 300, 400, 42));
    SSL.addMouseListener(new Frame_SSL_mouseAdapter(this));

    //  mil.setBounds(new Rectangle(50, 320, 400, 42));
    mil.setBounds(new Rectangle(50, 360, 400, 42));
    mil.addMouseListener(new Frame_mil_mouseAdapter(this));

    lqd.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/lqd.png")));
    imbalance.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/imbalance.png")));
    nonParametric.setIcon(
        new ImageIcon(
            this.getClass()
                .getResource("/keel/GraphInterKeel/resources/imag/menu/nonParametric.png")));
    SSL.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/SSL.png")));
    mil.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/mil.png")));
    back.setIcon(
        new ImageIcon(
            this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/back.png")));

    contentPane.add(back, null);
    contentPane.add(labelBack, null);

    contentPane.add(labelSalir, null);
    contentPane.add(labelLQD2, null);
    contentPane.add(labelLQD, null);
    contentPane.add(labelImbalance, null);
    contentPane.add(labelNonParametric, null);
    contentPane.add(labelSSL, null);
    contentPane.add(labelMil, null);
    // contentPane.add(lqd);
    contentPane.add(mil);
    contentPane.add(imbalance);
    contentPane.add(nonParametric);
    contentPane.add(SSL);
    contentPane.add(keel);
    contentPane.add(logotipo);
    contentPane.add(logotipoSoft);
    contentPane.add(barraExit);
    contentPane.add(fondo, null);
    contentPane.add(accionExit);
  }
Exemplo n.º 4
0
 void exit_mouseExited(MouseEvent e) {
   labelSalir.setVisible(false);
   exit.setBounds(new Rectangle(15, 340, 129, 36));
 }
Exemplo n.º 5
0
  public OrderTrans2() {
    super(windowTitle);
    int i;
    int currentPanel; // Value to specify which is the current panel in the vector
    JPanel subPanel = new JPanel(); // value used when adding sliders to the frame
    Runtime program = Runtime.getRuntime();
    Container content = getContentPane();

    createSliderVector();
    createPanelVector();
    getCodeSwapString();
    /** Set code-swap strings' value. */

    /** Get current OS of the system. */
    if (System.getProperty("os.name").startsWith("Windows")) isWindows = true;
    else isWindows = false;

    /** Add the radio buttons to the group */
    radioGrp.add(firstBox);
    radioGrp.add(secondBox);
    /** Set interactive buttons for the user interface */
    JButton exeButton = new JButton("Execute");
    exeButton.setToolTipText("Re-execute the program");
    JButton resetButton = new JButton("Reset");
    resetButton.setToolTipText("Reset Value");
    JButton exitButton = new JButton("Exit");
    exitButton.setToolTipText("Exit the Program");

    // Create the main panel that contains everything.
    JPanel mainPanel = new JPanel();
    // Create the panel that contains the sliders
    JPanel subPanel1 = new JPanel();
    // Create the panel that contains the checkboxes
    JPanel subPanel2 = new JPanel();
    // Create the panel that contains the buttons
    JPanel subPanel3 = new JPanel();

    // JScrollPane scrollPane = new JScrollPane(); // main text pane with scroll bars
    content.add(mainPanel, BorderLayout.SOUTH);
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    content.add(scrollPane, BorderLayout.CENTER);
    scrollPane.setBorder(BorderFactory.createLoweredBevelBorder());
    scrollPane.getViewport().add(textPane);

    mainPanel.add(subPanel1);
    mainPanel.add(subPanel2);
    mainPanel.add(subPanel3);
    subPanel1.setLayout(new GridLayout(0, 1));
    /** Add subPanel elements to the subPanel1, each would be a row of sliders */
    for (i = 0; i < ROWS; i++) subPanel1.add((JPanel) vSubPanel.elementAt(i));
    /** Set the first element in the Panel Vector as the current subPanel. */
    currentPanel = 0;
    subPanel = (JPanel) vSubPanel.elementAt(currentPanel);
    /** Allocate sliders to the sub-panels. */
    for (i = 0; i < COMPONENTS; i++) {
      PSlider slider = (PSlider) vSlider.elementAt(i);
      if (slider.getResideValue() == 'n') {
        currentPanel += 1;
        subPanel = (JPanel) vSubPanel.elementAt(currentPanel);
      }
      subPanel.add((PSlider) vSlider.elementAt(i));
    }

    /** Set and view the source code on the frame */
    textPane.setEditable(false);
    textPane.setContentType("text/html; charset=EUC-JP");

    subPanel2.setLayout(new GridLayout(0, 2));
    subPanel2.add(firstBox);
    subPanel2.add(secondBox);
    subPanel3.setLayout(new GridLayout(0, 3));
    subPanel3.add(exeButton);
    exeButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doExeCommand();
          }
        });
    subPanel3.add(resetButton);
    resetButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doResetCommand();
          }
        });
    subPanel3.add(exitButton);
    exitButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doExitCommand();
          }
        });

    /** Run the illustrated program */
    try {
      pid = program.exec(cmd);
      if (isWindows == false) {
        Process pid2 = null;
        pid2 = program.exec("getpid " + cmd.substring(4));
      }
    } catch (IOException ie) {
      System.err.println("Couldn't run " + ie);
      // System.exit(-1);;
    }
    /** Set the initial status for the window */
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            File fp = new File(dataFile);
            doResetCommand();
            boolean delete = fp.delete();
            pid.destroy();
          }
        });

    doExeCommand();
    setSize(WIDTH, HEIGHT);
    setLocation(500, 0);
    setVisible(true);
  }