public void mouseMoved(MouseEvent e) {
      EditorImpl.MyScrollBar scrollBar = myEditor.getVerticalScrollBar();
      int buttonHeight = scrollBar.getDecScrollButtonHeight();
      int lineCount =
          getDocument().getLineCount() + myEditor.getSettings().getAdditionalLinesCount();
      if (lineCount == 0) {
        return;
      }

      if (e.getY() < buttonHeight && myErrorStripeRenderer != null) {
        showTrafficLightTooltip(e);
        return;
      }

      if (showToolTipByMouseMove(e, getWidth())) {
        scrollbar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        return;
      }

      cancelMyToolTips(e, false);

      if (scrollbar.getCursor().equals(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR))) {
        scrollbar.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      }
    }
  public RoboticonManagerView(
      final RoboticonManagerModel roboticonManagerModel,
      final RoboticonManagerModel publicRoboticonManagerModel) {
    privateSortedRoboticonModel =
        new SortedRoboticonManagerModel(roboticonManagerModel, SortOrder.TYPE);

    privateList = new DragAndDropJList(privateSortedRoboticonModel);
    privateList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    privateList.setLayoutOrientation(DragAndDropJList.VERTICAL);
    privateList.setCellRenderer(new MyListCellRenderer());
    privateList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    privateList.setDragEnabled(true);
    privateList.setSelectionBackground(Color.orange);
    privateList.setSelectionForeground(Color.white);

    publicSortedRoboticonModel =
        new SortedRoboticonManagerModel(publicRoboticonManagerModel, SortOrder.NAME);

    publicList = new DragAndDropJList(publicSortedRoboticonModel);
    publicList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    publicList.setLayoutOrientation(DragAndDropJList.VERTICAL);
    publicList.setCellRenderer(new MyListCellRenderer());
    publicList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    publicList.setDragEnabled(true);
    publicList.setSelectionBackground(Color.orange);
    publicList.setSelectionForeground(Color.white);
    getListPanel();
  }
  private void readEvents() {

    frame
        .getGlassPane()
        .setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));

    // run event reader
    runEventReader(currentEventFile);

    // initialize map viewer
    if (this.jMapViewer == null) loadMapView();

    // get data from eventhandler (if not null)
    if (eventHandler != null) {
      eventHandler.setColorationMode(this.colorationMode);
      eventHandler.setTransparency(this.cellTransparency);
      eventHandler.setK(k);

      // get data
      EventData data = eventHandler.getData();

      // update data in both the map viewer and the graphs
      jMapViewer.updateEventData(data);
      graphPanel.updateData(data);
      keyPanel.updateData(data);
    }

    frame
        .getGlassPane()
        .setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
  }
Ejemplo n.º 4
0
  // Audio recording\mixing
  private void audioEditor() {
    audioStudio.setLayout(null);

    record = new JButton("Record");
    record.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    record.setToolTipText("Record Audio");
    record.setBounds((width / 2) - 160, 0, 80, 25);
    audioStudio.add(record);

    audioStudio.add(audioformat);
    audioformat.setBounds(0, 0, 80, 25);
    audioformat.add("Wav");
    audioformat.add("AIFC");
    audioformat.add("AIFF");
    audioformat.add("AU");
    audioformat.add("SND");

    audioStudio.add(sampleRate);
    sampleRate.setBounds(80, 0, 80, 25);
    sampleRate.add("8000");
    sampleRate.add("11025");
    sampleRate.add("16000");
    sampleRate.add("22050");
    sampleRate.add("44100");

    audioStudio.add(channels);
    channels.setBounds(160, 0, 80, 25);
    channels.add("Mono");
    channels.add("Stereo");

    playaudio = new JButton("Play");
    playaudio.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    playaudio.setToolTipText("Play recording");
    playaudio.setBounds((width / 2), 0, 80, 25);
    audioStudio.add(playaudio);

    stopBtn = new JButton("Stop");
    stopBtn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    stopBtn.setToolTipText("Stop Recording");
    stopBtn.setBounds((width / 2) - 80, 0, 80, 25);
    audioStudio.add(stopBtn);

    record.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            audio.captureAudio();
            System.out.println(audio.getAudioFormat().getSampleRate());
            System.out.println(audio.getAudioFormat().getChannels());
            audio.audnum++;
          }
        });

    stopBtn.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            audio.targetDataLine.stop();
            audio.targetDataLine.close();
          }
        });
  }
Ejemplo n.º 5
0
  public boolean mostrarJInternalFrame(JInternalFrame internalFrame) {
    try {
      desktopPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

      int numInternalFrames = desktopPane.getAllFrames().length;
      if (numInternalFrames == 0) {
        ClassLoader cl = this.getClass().getClassLoader();
        internalFrame.setFrameIcon(new javax.swing.ImageIcon(cl.getResource("img/geopista.gif")));
        desktopPane.add(internalFrame);
        internalFrame.setMaximum(true);
        internalFrame.show();
        try {
          iFrame = (JInternalFrame) internalFrame;
        } catch (Exception e) {
          iFrame = null;
        }
      } else {
        logger.info("cannot open another JInternalFrame");
      }

      desktopPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));

    } catch (Exception ex) {
      logger.warn("Exception: " + ex.toString());
    }

    return true;
  }
 /**
  * Respond to selections within the left list.
  *
  * @throws InvocationTargetException
  * @throws InterruptedException
  */
 private void respondToListClick() {
   this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   enableOrDisableActions();
   int idx = archetypeList.getSelectedIndex();
   if (idx == -1 || idx >= listData.size()) {
     // no selection
     if (archetypeControl == null) {
       return;
     }
     archetypeControl.removeNameChangeListener(this);
     rightPanel.removeAll();
     archetypeControl = null;
     rightPanel.add(selectLeftLabel);
     rightPanel.repaint();
     return;
   }
   if (archetypeControl == null) {
     archetypeControl = new ArchetypeControl(listData.get(idx));
     setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
     rightPanel.removeAll();
     rightPanel.add(archetypeControl, BorderLayout.CENTER);
     rightPanel.repaint();
     rightPanel.revalidate();
     setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
     archetypeControl.addNameChangeListener(this);
   } else {
     archetypeControl.setArchetype(listData.get(idx));
     archetypeControl.repaint();
   }
   this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 }
Ejemplo n.º 7
0
  @Override
  public void setCursor(Cursor cursor) {
    super.setCursor(cursor);

    final java.awt.Cursor awtPredefinedCursor;
    if (cursor != null
        && (cursor.equals(CursorFactory.getCursor(SWT.CURSOR_WAIT))
            || cursor.equals(CursorFactory.getCursor(SWT.CURSOR_APPSTARTING))
            || cursor.equals(CursorFactory.getCursor(SWT.CURSOR_SIZENS)))) {

      if (cursor.equals(CursorFactory.getCursor(SWT.CURSOR_APPSTARTING))) {
        awtPredefinedCursor = java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR);
      } else if (cursor.equals(CursorFactory.getCursor(SWT.CURSOR_SIZENS))) {
        awtPredefinedCursor = java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.HAND_CURSOR);
      } else {
        awtPredefinedCursor = java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR);
      }

    } else {
      awtPredefinedCursor = java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR);
    }

    final Frame frame = SWT_AWT.getFrame(mainChartComposite);
    Runnable runnable =
        new Runnable() {
          public void run() {
            frame.setCursor(awtPredefinedCursor);
            if (mainChartPanel.getComponents().length > 0) {
              mainChartPanel.getComponent(0).setCursor(awtPredefinedCursor);
            }
          }
        };
    EventQueue.invokeLater(runnable);
  }
  /** Performs the update. */
  private boolean doUpdate() {
    try {
      setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

      Map<String, Object> properties = new HashMap<String, Object>();
      for (PropertyInputPanel propertyPanel : propertyPanels) {
        if (propertyPanel.includeInUpdate()) {
          properties.put(propertyPanel.getId(), propertyPanel.getValue());
        }
      }

      if (properties.isEmpty()) {
        return false;
      }

      ObjectId newId = object.updateProperties(properties, false);

      if ((newId != null) && newId.getId().equals(model.getCurrentObject().getId())) {
        try {
          model.reloadObject();
          model.reloadFolder();
        } catch (Exception ex) {
          ClientHelper.showError(null, ex);
        }
      }

      return true;
    } catch (Exception ex) {
      ClientHelper.showError(this, ex);
      return false;
    } finally {
      setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }
  }
Ejemplo n.º 9
0
  // region Private Methods
  private void onOK() {
    this.connectionDetails =
        new ConnectionDetails() {
          {
            setZookeeper(
                new ServerDetails(
                    ConnectionDetailsDialog.this.zooKeeperServer.getText(),
                    ConnectionDetailsDialog.this.zooKeeperPort.getValue().toString()));
          }
        };

    this.contentPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

    boolean canConnect = false;

    try {
      canConnect = this.connectionDetails.canConnect();
    } finally {
      this.contentPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }

    if (canConnect) {
      dispose();
    } else {
      JOptionPane.showMessageDialog(
          ConnectionDetailsDialog.this,
          "Failed to connect to hbase.\n\nMake sure you have access to all hadoop nodes\nIn case you don't, map the nodes in your hosts file.",
          "Connection failed...",
          JOptionPane.ERROR_MESSAGE);

      ConnectionManager.release(connectionDetails);
      connectionDetails = null;
    }
  }
Ejemplo n.º 10
0
  protected boolean refreshFeatureSelection(String layerName, String id) {

    try {
      if (id == null || geopistaEditor == null) return false;
      this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      geopistaEditor.getSelectionManager().clear();
      GeopistaLayer geopistaLayer =
          (GeopistaLayer) geopistaEditor.getLayerManager().getLayer(layerName);
      Collection collection = searchByAttribute(geopistaLayer, 0, id);
      Iterator it = collection.iterator();
      if (it.hasNext()) {
        Feature feature = (Feature) it.next();
        geopistaEditor.select(geopistaLayer, feature);
      }
      geopistaEditor.zoomToSelected();
      this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      return true;
    } catch (Exception ex) {
      this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      ex.printStackTrace(pw);
      logger.error("Exception: " + sw.toString());
      return false;
    }
  }
Ejemplo n.º 11
0
  protected void save(String text) {
    String title = "Save " + textType + " File";
    TextFileFilter fileFilter = getTextFileFilter(textType);
    chooser.setFileFilter(fileFilter);

    if (chooser.showSaveDialog(editor.getFrame()) == JFileChooser.APPROVE_OPTION) {
      String name = chooser.getSelectedFile().toString();
      if (!name.endsWith(fileFilter.getExtension())) {
        name = name + "." + fileFilter.getExtension();
      }
      try {
        editor.getFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        FileOutputStream fos = new FileOutputStream(new File(name));
        fos.write(text.getBytes());
        fos.close();
        JOptionPane.showMessageDialog(
            editor.getFrame(),
            textType + " saved successfully to " + name,
            title,
            JOptionPane.INFORMATION_MESSAGE);
      } catch (Exception ex) {
        Logger.getLogger(FileMenuAction.class.getName()).log(Level.SEVERE, null, ex);
        ExceptionHandler.handleException(ex);
        return;
      } finally {
        editor.getFrame().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      }
    }
  }
  /*

  public void printData() {

  getJMenuBar().repaint();

  try {

  PrinterJob prnJob = PrinterJob.getPrinterJob();

  prnJob.setPrintable(m_panel);

  if (!prnJob.printDialog())

  return;

  setCursor( Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

  prnJob.print();

  setCursor( Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));

  JOptionPane.showMessageDialog(this, "Printing completed successfully", "JPEGEditor2",

  JOptionPane.INFORMATION_MESSAGE);

  }

  catch (PrinterException e) {

  e.printStackTrace();

  System.err.println("Printing error: "+e.toString());

  }

  }

  */
  public void printData(Image im) {

    Printer p = new Printer(im);

    try {

      java.awt.print.PrinterJob prnJob = java.awt.print.PrinterJob.getPrinterJob();

      prnJob.setPrintable(p);

      if (!prnJob.printDialog()) {
        return;
      }

      setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));

      prnJob.print();

      setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));

      javax.swing.JOptionPane.showMessageDialog(
          this,
          "Printing completed successfully",
          "JPEGEditor2",
          javax.swing.JOptionPane.INFORMATION_MESSAGE);

    } catch (java.awt.print.PrinterException e) {

      e.printStackTrace();

      System.err.println("Printing_error:_" + e.toString());
    }
  }
Ejemplo n.º 13
0
  /*
   * Atualiza a tabela a cada 5 minutos
   */
  public void atualizacaoAutomaticaTabela() {

    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

    ActionListener acao =
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent ae) {

            final Progress p = new Progress();
            p.setVisible(true);
            SwingWorker worker =
                new SwingWorker() {

                  @Override
                  protected Object doInBackground() throws Exception {
                    atualizaTabela();
                    return null;
                  }

                  @Override
                  protected void done() {
                    p.setVisible(false);
                  }
                };
            worker.execute();
          }
        };

    timer = new Timer(5000 * 60, acao); // a cada 5 minutos executa o metodo
    timer.start();
    this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
  /**
   * Constructor de la clase. Inicializa todos los paneles de la pantalla y asocia los eventos para
   * ser tratados. Se le pasa por parametro un JFrame y la lista de expedientes a mostrar.
   *
   * @param desktop JFrame
   * @param exp lista de expedientes
   */
  public BusquedaExportacionMasiva(final JFrame desktop, ArrayList exp) {
    this.desktop = desktop;
    this.expedientes = exp;
    this.expedienteFiltrados = exp;
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    UtilRegistroExp.menuBarSetEnabled(false, this.desktop);
    inicializaElementos();
    addInternalFrameListener(
        new javax.swing.event.InternalFrameListener() {
          public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            cierraInternalFrame();
          }

          public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {}
        });
    this.setTitle(
        I18N.get(
            "RegistroExpedientes",
            "Catastro.RegistroExpedientes.ExportacionMasiva.tituloBusqueda"));
    setClosable(true);
    this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
Ejemplo n.º 15
0
  /** deletes the chosen attributes */
  public void deleteAttributes() {
    ListSelectorDialog dialog;
    ArffSortedTableModel model;
    Object[] atts;
    int[] indices;
    int i;
    JList list;
    int result;

    list = new JList(getAttributes());
    dialog = new ListSelectorDialog(null, list);
    result = dialog.showDialog();

    if (result != ListSelectorDialog.APPROVE_OPTION) return;

    atts = list.getSelectedValues();

    // really?
    if (ComponentHelper.showMessageBox(
            getParent(),
            "Confirm...",
            "Do you really want to delete these " + atts.length + " attributes?",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE)
        != JOptionPane.YES_OPTION) return;

    model = (ArffSortedTableModel) m_TableArff.getModel();
    indices = new int[atts.length];
    for (i = 0; i < atts.length; i++) indices[i] = model.getAttributeColumn(atts[i].toString());

    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    model.deleteAttributes(indices);
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
Ejemplo n.º 16
0
  /** deletes the currently selected attribute */
  public void deleteAttribute() {
    ArffSortedTableModel model;

    // no column selected?
    if (m_CurrentCol == -1) return;

    model = (ArffSortedTableModel) m_TableArff.getModel();

    // really an attribute column?
    if (model.getAttributeAt(m_CurrentCol) == null) return;

    // really?
    if (ComponentHelper.showMessageBox(
            getParent(),
            "Confirm...",
            "Do you really want to delete the attribute '"
                + model.getAttributeAt(m_CurrentCol).name()
                + "'?",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE)
        != JOptionPane.YES_OPTION) return;

    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    model.deleteAttributeAt(m_CurrentCol);
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
Ejemplo n.º 17
0
 private void enablePanel(boolean enable) {
   if (enable) {
     setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
   } else {
     setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   }
   getLoginButton().setEnabled(enable);
 }
Ejemplo n.º 18
0
 public void displayPanel(JPanel panel) {
   this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   contentPane.removeAll();
   contentPane.add(panel);
   contentPane.repaint();
   contentPane.revalidate();
   this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 }
Ejemplo n.º 19
0
 /** Brings up a preview of the image or images to save. */
 void previewImage() {
   ImgSaverPreviewer preview = new ImgSaverPreviewer(this);
   setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   createImages(uiDelegate.getSavingType());
   setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
   preview.initialize();
   UIUtilities.centerAndShow(preview);
 }
Ejemplo n.º 20
0
 /**
  * Long operations need to display an hourglass.
  *
  * @param comp The <code>JComponent</code> on which to apply the hour glass cursor
  * @param on If true, we set the cursor on the hourglass
  */
 public static void setCursorOnWait(Component comp, boolean on) {
   if (on) {
     if (comp instanceof AbstractEditorPanel) ((AbstractEditorPanel) comp).showWaitCursor();
     else comp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   } else {
     if (comp instanceof AbstractEditorPanel) ((AbstractEditorPanel) comp).hideWaitCursor();
     else comp.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
   }
 }
Ejemplo n.º 21
0
  // Draws the buttons and adds functions to them
  private void drawButtons() {

    playAnim = new JButton("Play");
    playAnim.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    playAnim.setBounds((width / 2) + 30, 750, 80, 25);
    playAnim.setToolTipText("Play Animation");
    window.add(playAnim);

    cap = new JButton("Capture");
    cap.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    rcap = new Rectangle((width / 2) - 50, 750, 80, 25);
    cap.setBounds(rcap);
    cap.setToolTipText("Capture Frame");
    window.add(cap);

    // Not working right
    playAnim.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent action) {
            if (canon == true) {
              renderCanon.setIcon(null);
            } else if (webcam == true) {
              for (int i = 0; i < framename; i++) {
                images = new ImageIcon(Save_Algorithm.imgdir + "\\image_" + i + ".tiff");
                //                        renderWebcam.setIcon(null);
                //                        renderWebcam.setIcon(images);
                //                        renderWebcam.revalidate();
                System.out.println(images);
              }
            }
          }
        });

    cap.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent actionEvent) {
            try {
              if (canon == true) {
                sound();
                camera.execute(new ShootTask(filename()));
                System.out.println("Frame Captured from Canon SLR at... " + Save_as.pathname);
                framename++;
              } else if (canon == false) {
                opencv_core.IplImage img = frame.frame();
                sound();
                cvSaveImage(Save_Algorithm.imgdir + "\\image_" + framename + ".tiff", img);
                System.out.println("Frame Captured from Webcam at... " + Save_as.pathname);
                framename++;
              }
            } catch (RuntimeException e) {
              throw e;
            } catch (Exception e) {
              throw e;
            }
          }
        });
  }
  /**
   * Left Mouse dragging drags end of feature if drag type right or left boundary. dragType is
   * figured in mousePressed
   */
  public void mouseDragged(MouseEvent e) {
    if (!MouseButtonEvent.isLeftMouseClick(e)) return;
    // dragFeature set in mousePressed
    // not needed
    if (dragging == false && dragFeature != null) {
      // changer = baseEditorPanel.getAnnotationEditor().beginRangeChange(dragFeature);// ??
      preDragStartBasePair = dragFeature.getStart();
      preDragEndBasePair = dragFeature.getEnd();
    }
    dragging = true;
    // dragType determined in MousePressed
    if (dragType == baseEditorPanel.START_BOUNDARY)
      baseEditorPanel.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
    else if (dragType == baseEditorPanel.END_BOUNDARY)
      baseEditorPanel.setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
    else if (dragType == baseEditorPanel.SEQ_SELECT_DRAG) {
      baseEditorPanel.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
    }
    setPos(e.getX(), e.getY());
    startPos = pos;
    // going right
    // substract the one because during dragging
    // the person operating the mouse drags it
    // one position beyond where they want the
    // drop to occur.
    // pos--;

    if (dragType == baseEditorPanel.START_BOUNDARY) {
      // Is this position okay to use as the new
      // low end or will it make the feature too short?
      if (baseEditorPanel.notTooSmall(
          pos, baseEditorPanel.basePairToPos((int) dragFeature.getEnd())))
        // this actually changes the model - do we really need to do that
        // with every mouse drag - cant we just change it at the end of the
        // drag? No - the EDE relies on the feature being changed - bummer
        baseEditorPanel.changeStart(dragFeature, pos - dragStartPos, limit_5prime, limit_3prime);
    } else if (dragType == baseEditorPanel.END_BOUNDARY) {
      // Is this position okay to use as the new
      // high end or will it make the feature too short?
      if (baseEditorPanel.notTooSmall(
          baseEditorPanel.basePairToPos((int) dragFeature.getStart()), pos))
        // This changes the actual exon model! EDE relies on this
        baseEditorPanel.changeEnd(dragFeature, pos - dragStartPos, limit_5prime, limit_3prime);
    } else if (dragType == baseEditorPanel.SEQ_SELECT_DRAG) {
      int redrawLowPos = baseEditorPanel.selectLowPos();
      int redrawHighPos = baseEditorPanel.selectHighPos();
      if (pos < redrawLowPos) redrawLowPos = pos;
      if (pos > redrawHighPos) redrawHighPos = pos;
      // selectCurrentPos = pos;
      baseEditorPanel.setSelectCurrentPos(pos);
      baseEditorPanel.repaint(redrawLowPos, redrawHighPos);
      return;
    }
    // repaint with exon seq feature ends changed
    baseEditorPanel.repaint(pos, dragStartPos);
    dragStartPos = pos;
  }
Ejemplo n.º 23
0
 public void setWaitingCursor(final boolean waiting) {
   Component glassPane = getRootPane().getGlassPane();
   if (waiting) {
     glassPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
     glassPane.setVisible(true);
   } else {
     glassPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
     glassPane.setVisible(false);
   }
 }
Ejemplo n.º 24
0
  /*
   * executado ao clicar no botao excluir
   */
  private void jBExcluirLoteActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jBExcluirLoteActionPerformed

    timerTelaExclusao.stop();
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    excluir();
    this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    timerTelaExclusao.start();
    jBAtualizar.doClick();
  } // GEN-LAST:event_jBExcluirLoteActionPerformed
Ejemplo n.º 25
0
  protected void setCursor(int sideName) {
    Cursor cursor = null;

    switch (sideName) {
      case NONE:
        cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
        break;
      case NORTH:
        cursor = Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR);
        break;
      case SOUTH:
        cursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
        break;
      case EAST:
        cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
        break;
      case WEST:
        cursor = Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR);
        break;
      case NORTHWEST:
        cursor = Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR);
        break;
      case NORTHEAST:
        cursor = Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR);
        break;
      case SOUTHWEST:
        cursor = Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR);
        break;
      case SOUTHEAST:
        cursor = Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR);
        break;
    }

    this.setCursor(cursor);
  }
Ejemplo n.º 26
0
  private AbstractButton createButton(AppAction action) {
    if (action instanceof CustomizableAppAction) {
      ((CustomizableAppAction) action).requestUpdate(this);
    }
    if (action.isToggle()) {
      JToggleButton bt = new JToggleButton(action);
      bt.setOpaque(false);
      bt.setContentAreaFilled(false);
      bt.setBorderPainted(false);

      bt.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              hideThreadrunning = false;
              TrayIconPopup.this.dispose();
            }
          });

      Icon icon;
      bt.setIcon(icon = NewTheme.I().getCheckBoxImage(action.getIconKey(), false, ICON_SIZE));
      bt.setRolloverIcon(icon);
      bt.setSelectedIcon(
          icon = NewTheme.I().getCheckBoxImage(action.getIconKey(), true, ICON_SIZE));
      bt.setRolloverSelectedIcon(icon);

      bt.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
      bt.setFocusPainted(false);
      bt.setHorizontalAlignment(JButton.LEFT);
      bt.setIconTextGap(5);
      bt.addMouseListener(new HoverEffect(bt));
      return bt;
    } else {
      // we use a JToggleButton here, because JToggle buttons seem to have a different left icon gap
      // the jbuttons

      JToggleButton bt = new JToggleButton(action);
      bt.setOpaque(false);
      bt.setContentAreaFilled(false);
      bt.setBorderPainted(false);
      bt.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              hideThreadrunning = false;
              TrayIconPopup.this.dispose();
            }
          });
      bt.setIcon(NewTheme.I().getIcon(action.getIconKey(), ICON_SIZE));
      bt.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
      bt.setFocusPainted(false);
      bt.setHorizontalAlignment(JButton.LEFT);
      bt.setIconTextGap(5);
      bt.addMouseListener(new HoverEffect(bt));
      return bt;
    }
  }
    private void updateCursor(MouseEvent e) {
      Container component = getDisplayerParent();
      Insets insets = component.getInsets();

      boolean valid =
          e.getComponent() == component && e.getY() <= insets.top
              || e.getY() >= component.getHeight() - insets.bottom
              || e.getX() <= insets.left
              || e.getX() >= component.getWidth() - insets.right;

      if (valid) {
        int corner = corner();

        boolean top = e.getY() <= corner;
        boolean left = e.getX() <= corner;
        boolean bottom = e.getY() >= component.getHeight() - corner;
        boolean right = e.getX() >= component.getWidth() - corner;

        if (top && left) {
          setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR));
          position = Position.NW;
        } else if (top && right) {
          setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR));
          position = Position.NE;
        } else if (bottom && right) {
          setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
          position = Position.SE;
        } else if (bottom && left) {
          setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR));
          position = Position.SW;
        } else if (top) {
          int width = component.getWidth();
          if (getConfiguration().isMoveOnBorder()
              && e.getX() > width / 3
              && e.getX() < width / 3 * 2) {
            setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
            position = Position.MOVE;
          } else {
            setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
            position = Position.N;
          }
        } else if (bottom) {
          setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
          position = Position.S;
        } else if (left) {
          setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
          position = Position.W;
        } else if (right) {
          setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
          position = Position.E;
        } else {
          setCursor(Cursor.getDefaultCursor());
          position = Position.NOTHING;
        }
      } else {
        setCursor(Cursor.getDefaultCursor());
        position = Position.NOTHING;
      }
      updateBorder();
    }
 @NotNull
 @Override
 public Cursor getCursor() {
   final boolean isVerticalCursor =
       myInfo.isDocked()
           ? myInfo.getAnchor().isSplitVertically()
           : myInfo.getAnchor().isHorizontal();
   return isVerticalCursor
       ? Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)
       : Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
 }
Ejemplo n.º 29
0
 private void aceptarActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_aceptarActionPerformed
   if (this.tablaDatos.getSelectedRow() >= 0) {
     this.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
     ServicioIndexAutoData seleccion =
         this.datos.get(this.tablaDatos.convertRowIndexToModel(this.tablaDatos.getSelectedRow()));
     this.application.loadAuto(seleccion);
     this.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
   }
   this.dispose();
 } // GEN-LAST:event_aceptarActionPerformed
Ejemplo n.º 30
0
 public void keyTyped(KeyEvent event) {
   char keyChar = event.getKeyChar();
   if (keyChar == t) {
     ((Component) event.getSource())
         .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
     graphMouse.setMode(Mode.TRANSFORMING);
   } else if (keyChar == p) {
     ((Component) event.getSource()).setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
     graphMouse.setMode(Mode.PICKING);
   }
 }