List of usage examples for java.awt Cursor Cursor
protected Cursor(String name)
Note: this constructor should only be used by AWT implementations as part of their support for custom cursors.
From source file:com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionContentPanel.java
private void addSparkClustersLineItem() { JLabel sparkClusterLabel = new JLabel("Spark clusters(Linux only)"); sparkClusterLabel.setToolTipText(/*from w w w. j ava 2 s. c o m*/ "The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported."); GridBagConstraints c11 = new GridBagConstraints(); c11.gridx = 0; c11.gridy = 0; c11.insets = new Insets(margin, margin, 0, margin); add(sparkClusterLabel, new GridBagConstraints(0, displayLayoutCurrentRow, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, margin), 0, 0)); clustersListComboBox = new ComboboxWithBrowseButton(); clustersListComboBox.setButtonIcon(StreamUtil.getImageResourceFile(REFRESH_BUTTON_PATH)); clustersListComboBox.getButton().setToolTipText("Refresh"); clustersListComboBox.getButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Cursor cursor = getCursor(); setCursor(new Cursor(Cursor.WAIT_CURSOR)); List<IClusterDetail> clusterDetails = ClusterManagerEx.getInstance() .getClusterDetails(submitModel.getProject()); setCursor(cursor); submitModel.setClusterComboBoxModel(clusterDetails); } }); clustersListComboBox.getComboBox().setToolTipText( "The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported."); clustersListComboBox.getComboBox().addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName() == "model" && evt.getNewValue() instanceof DefaultComboBoxModel) { int size = ((DefaultComboBoxModel) evt.getNewValue()).getSize(); setVisibleForFixedErrorMessageLabel(ErrorMessageLabelTag.ClusterName.ordinal(), size <= 0); } } }); add(clustersListComboBox, new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, margin), 0, 0)); errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()] = new JLabel( "Cluster Name Should not be null"); errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()] .setForeground(DarkThemeManager.getInstance().getErrorMessageColor()); clustersListComboBox.getComboBox().addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { setVisibleForFixedErrorMessageLabel(0, clustersListComboBox.getComboBox().getItemCount() == 0); } }); add(errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()], new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, margin, 0, 0), 0, 0)); }
From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.imagem.PanelDescricaoImagens.java
private void initComponentsEscalavel(ArrayList<FerramentaDescricaoModel> erros) { Ferramenta_Imagens.carregaTexto(TokenLang.LANG); JPanel regraFonteBtn = new JPanel(); regraFonteBtn.setLayout(new BorderLayout()); textAreaSourceCode = new G_TextAreaSourceCode(); textAreaSourceCode.setTipoHTML();/*w w w . j av a 2 s . co m*/ new OnChange(textAreaSourceCode, this); // parentFrame.setTitle("Associador de rtulos"); tableLinCod = new TabelaDescricao(this, erros); arTextPainelCorrecao = new ArTextPainelCorrecao(this); // scrollPaneCorrecaoLabel = new ConteudoCorrecaoLabel(); analiseSistematica = new JButton(); salvar = new JButton(); abrir = new JButton(); cancelar = new JButton(); strConteudoalt = new String(); // panelLegenda = new JPanel(); btnSalvar = new JMenuItem(GERAL.BTN_SALVAR); pnRegra = new JPanel(); lbRegras1 = new JLabel(); lbRegras2 = new JLabel(); pnSetaDescricao = new JPanel(); spTextoDescricao = new JScrollPane(); tArParticipRotulo = new TArParticipRotulo(this); conteudoDoAlt = new JTextArea(); pnListaErros = new JPanel(); scrollPanetabLinCod = new JScrollPane(); /** * Mostra pro usurio a imagem que est sem descrio */ imagemSemDesc = new XHTMLPanel(); pnBotoes = new JPanel(); salvar.setEnabled(false); salvaAlteracoes = TxtBuffer.getInstanciaSalvaAlteracoes(textAreaSourceCode.getTextPane(), salvar, new JMenuItem(), parentFrame); adicionar = new JButton(); aplicar = new JButton(); conteudoParticRotulo = new ArrayList<String>(); analiseSistematica.setEnabled(false); // setJMenuBar(this.criaMenuBar()); // ======== this ======== // setTitle("Associe explicitamente os r\u00f3tulos aos respectivos // controles:"); setBackground(CoresDefault.getCorPaineis()); Container contentPane = this;// ?? contentPane.setLayout(new GridLayout(2, 1)); // ======== pnRegra ======== { pnRegra.setBorder(criaBorda(Ferramenta_Imagens.TITULO_REGRA)); pnRegra.setLayout(new GridLayout(2, 1)); pnRegra.add(lbRegras1); lbRegras1.setText(Ferramenta_Imagens.REGRAP1); lbRegras2.setText(Ferramenta_Imagens.REGRAP2); lbRegras1.setHorizontalAlignment(SwingConstants.CENTER); lbRegras2.setHorizontalAlignment(SwingConstants.CENTER); pnRegra.add(lbRegras1); pnRegra.add(lbRegras2); pnRegra.setPreferredSize(new Dimension(700, 60)); } // G_URLIcon.setIcon(lbTemp, // "http://pitecos.blogs.sapo.pt/arquivo/pai%20natal%20o5.%20jpg.jpg"); JScrollPane sp = new JScrollPane(); sp.setViewportView(imagemSemDesc); sp.setPreferredSize(new Dimension(500, 300)); // ======== pnDescricao ======== // ---- Salvar ---- salvar.setText(Ferramenta_Imagens.BTN_SALVAR); salvar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { salvarActionPerformed(e); } }); salvar.setToolTipText(Ferramenta_Imagens.DICA_SALVAR); salvar.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_SALVAR); salvar.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.DICA_SALVAR); salvar.setBounds(10, 0, 150, 25); abrir.setText(Ferramenta_Imagens.BTN_ABRIR); abrir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AbrirActionPerformed(e); } }); abrir.setToolTipText(Ferramenta_Imagens.DICA_ABRIR_HTML); abrir.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_ABRIR_HTML); abrir.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.DICA_ABRIR_HTML); abrir.setBounds(165, 0, 150, 25); cancelar.setText(Ferramenta_Imagens.TELA_ANTERIOR); cancelar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { CancelarActionPerformed(e); } }); cancelar.setToolTipText(Ferramenta_Imagens.DICA_TELA_ANTERIOR); cancelar.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_TELA_ANTERIOR); cancelar.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.TELA_ANTERIOR); cancelar.setBounds(320, 0, 150, 25); analiseSistematica.setText(GERAL.ANALISE_SISTEMATICA); analiseSistematica.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { buttonAction = e; Thread t = new Thread(new Runnable() { public void run() { PainelStatusBar.showProgTarReq(); parentFrame.setCursor(new Cursor(Cursor.WAIT_CURSOR)); analiseSistematicaActionPerformed(buttonAction); parentFrame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); PainelStatusBar.hideProgTarReq(); } }); t.setPriority(9); t.start(); } }); analiseSistematica.setToolTipText(GERAL.DICA_ANALISE_SISTEMATICA); analiseSistematica.getAccessibleContext().setAccessibleDescription(GERAL.DICA_ANALISE_SISTEMATICA); analiseSistematica.getAccessibleContext().setAccessibleName(GERAL.DICA_ANALISE_SISTEMATICA); analiseSistematica.setBounds(480, 0, 150, 25); // ======== pnParticRotulo ======== pnSetaDescricao.setBorder(criaBorda(Ferramenta_Imagens.TITULO_DIGITE_O_ALT)); GridBagConstraints cons = new GridBagConstraints(); GridBagLayout layout = new GridBagLayout(); cons.fill = GridBagConstraints.BOTH; cons.weighty = 1; cons.weightx = 0.80; pnSetaDescricao.setLayout(layout); cons.anchor = GridBagConstraints.SOUTHEAST; cons.insets = new Insets(0, 0, 0, 10); conteudoDoAlt.addKeyListener(new KeyListener() { public void keyPressed(KeyEvent arg0) { } public void keyTyped(KeyEvent arg0) { } public void keyReleased(KeyEvent arg0) { if (conteudoDoAlt.getText().length() == 0) { System.out.println("conteudo vazio"); aplicar.setEnabled(false); } else if (tableLinCod.getSelectedRow() != -1) { System.out.println("com conteudo"); aplicar.setEnabled(true); } } }); // ======== spParticRotulo ======== { spTextoDescricao.setViewportView(conteudoDoAlt); } // lbRegras1.setText(Reparo_Imagens.REGRAP2); // lbRegras1.setHorizontalAlignment(SwingConstants.CENTER); // pnRegra.add(lbRegras1); pnSetaDescricao.add(spTextoDescricao, cons); cons.weightx = 0.20; pnSetaDescricao.setPreferredSize(new Dimension(400, 60)); // ======== pnListaErros ======== { pnListaErros.setBorder(criaBorda(Ferramenta_Imagens.LISTA_ERROS)); pnListaErros.setLayout(new BorderLayout()); // ======== scrollPanetabLinCod ======== { scrollPanetabLinCod.setViewportView(tableLinCod); } pnListaErros.add(scrollPanetabLinCod, BorderLayout.CENTER); } // ======== pnBotoes ======== { // pnBotoes.setBorder(criaBorda("")); pnBotoes.setLayout(null); // ---- adicionar ---- adicionar.setText(Ferramenta_Imagens.BTN_ADICIONAR); adicionar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { adicionarActionPerformed(e); } }); adicionar.setToolTipText(Ferramenta_Imagens.DICA_ADICIONAR); adicionar.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_ADICIONAR); adicionar.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.DICA_ADICIONAR); adicionar.setBounds(10, 5, 150, 25); // pnBotoes.add(adicionar); // ---- aplicarRotulo ---- aplicar.setEnabled(false); aplicar.setText(Ferramenta_Imagens.BTN_APLICAR); aplicar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { aplicarRotuloActionPerformed(e); } }); aplicar.setToolTipText(Ferramenta_Imagens.DICA_APLICAR); aplicar.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_APLICAR); aplicar.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.DICA_APLICAR); aplicar.setBounds(10, 5, 150, 25); pnBotoes.add(aplicar); } /* * Colocar os controles */ pnRegra.setBackground(CoresDefault.getCorPaineis()); regraFonteBtn.add(pnRegra, BorderLayout.NORTH); textAreaSourceCode.setBorder(criaBorda("")); textAreaSourceCode.setBackground(CoresDefault.getCorPaineis()); JSplitPane splitPane = null; Dimension minimumSize = new Dimension(0, 0); // JScrollPane ajudaScrollPane = new // JScrollPane(ajuda,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); sp.setMinimumSize(minimumSize); sp.setPreferredSize(new Dimension(150, 90)); splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp, textAreaSourceCode); splitPane.setOneTouchExpandable(true); // splitPane.set // splitPane.setDividerLocation(0.95); int w = parentFrame.getWidth(); int s = w / 4; splitPane.setDividerLocation(s); // regraFonteBtn.add(scrollPaneCorrecaoLabel, BorderLayout.CENTER); regraFonteBtn.add(splitPane, BorderLayout.CENTER); pnBotoes.setPreferredSize(new Dimension(600, 35)); pnBotoes.setBackground(CoresDefault.getCorPaineis()); // regraFonteBtn.add(pnBotoes, BorderLayout.SOUTH); regraFonteBtn.setBackground(CoresDefault.getCorPaineis()); contentPane.add(regraFonteBtn); JPanel textoErrosBtn = new JPanel(); textoErrosBtn.setLayout(new BorderLayout()); pnSetaDescricao.setBackground(CoresDefault.getCorPaineis()); pnSetaDescricao.add(pnBotoes, cons); textoErrosBtn.add(pnSetaDescricao, BorderLayout.NORTH); textoErrosBtn.add(pnListaErros, BorderLayout.CENTER); JPanel pnSalvarCancelar = new JPanel(); pnSalvarCancelar.setLayout(null); pnSalvarCancelar.setPreferredSize(new Dimension(600, 35)); pnSalvarCancelar.add(salvar); pnSalvarCancelar.add(abrir); pnSalvarCancelar.add(cancelar); if (!original) { reverter = new JButton("Reverter"); reverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); TxtBuffer.setContent(TxtBuffer.getContentOriginal()); parentFrame.showPainelFerramentaImgPArq(TxtBuffer.getContentOriginal(), enderecoPagina); setVisible(true); } }); //reverter.setActionCommand("Reverter"); reverter.setText(TradPainelRelatorio.REVERTER); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); if (EstadoSilvinha.conteudoEmPainelResumo) { reverter.setBounds(640, 0, 150, 25); } else { reverter.setBounds(480, 0, 150, 25); } pnSalvarCancelar.add(reverter); } if (EstadoSilvinha.conteudoEmPainelResumo) { pnSalvarCancelar.add(analiseSistematica); } pnSalvarCancelar.setBackground(CoresDefault.getCorPaineis()); textoErrosBtn.add(pnSalvarCancelar, BorderLayout.SOUTH); pnListaErros.setBackground(CoresDefault.getCorPaineis()); textoErrosBtn.add(pnListaErros, BorderLayout.CENTER); if (tableLinCod.getRowCount() == 0) tableLinCod.addLinha(0, 0, GERAL.DOC_SEM_ERROS); contentPane.setBackground(CoresDefault.getCorPaineis()); contentPane.add(textoErrosBtn); this.setVisible(true); }
From source file:com.qumasoft.guitools.compare.CompareFrame.java
/** * Compare two files.//from w w w.jav a2 s . c o m */ public void compare() { fitToScreen(); currentDifferenceIndex = -1; // Compare the files // <editor-fole> String[] compareArgs = new String[3]; compareArgs[0] = getFirstFileActualName(); compareArgs[1] = getSecondFileActualName(); compareArgs[2] = "junk"; // </editor-fold> compareFilesForGUI = new CompareFilesForGUI(compareArgs); compareFilesForGUI.setIgnoreAllWhiteSpace(ignoreAllWhiteSpaceFlag); compareFilesForGUI.setIgnoreLeadingWhiteSpace(ignoreLeadingWhiteSpaceFlag); compareFilesForGUI.setIgnoreCaseFlag(ignoreCaseFlag); compareFilesForGUI.setIgnoreEOLChangesFlag(ignoreEOLChangesFlag); try { Cursor currentCursor = getCursor(); setCursor(new Cursor(Cursor.WAIT_CURSOR)); compareFilesForGUI.execute(); // Enable/disable the forward/backward actions. setNextPreviousActionStates(compareFilesForGUI.getNumberOfChanges()); if (file1ContentsList != null) { leftPanel.remove(file1ContentsList); } if (file2ContentsList != null) { rightPanel.remove(file2ContentsList); } // Set up the model object for the list JList objects. file1ContentsListModel = new FileContentsListModel(getFirstFileActualName(), compareFilesForGUI, true, null); file2ContentsListModel = new FileContentsListModel(getSecondFileActualName(), compareFilesForGUI, false, file1ContentsListModel); addBlanksToShorterModel(); file1ContentsList = new FileContentsList(file1ContentsListModel, this); leftPanel.add(file1ContentsList); rowHeight = file1ContentsList.getRowHeight(); file1ChangeMarkerPanel = new ChangeMarkerPanel(file1ContentsListModel, rowHeight); file2ContentsList = new FileContentsList(file2ContentsListModel, this); rightPanel.add(file2ContentsList); file2ChangeMarkerPanel = new ChangeMarkerPanel(file2ContentsListModel, rowHeight); firstFileDisplayName.setForeground(blackColor); firstFileDisplayName.setFont(new java.awt.Font("Arial", 0, DEFAULT_FONT_SIZE)); firstFileDisplayName.setBorder(bevelBorder); leftParentPanel.add(firstFileDisplayName, BorderLayout.NORTH); leftParentPanel.add(leftScrollPane, BorderLayout.CENTER); leftParentPanel.add(file1ChangeMarkerPanel, BorderLayout.EAST); secondFileDisplayName.setForeground(blackColor); secondFileDisplayName.setBorder(bevelBorder); secondFileDisplayName.setFont(new java.awt.Font("Arial", 0, DEFAULT_FONT_SIZE)); rightParentPanel.add(secondFileDisplayName, BorderLayout.NORTH); rightParentPanel.add(rightScrollPane, BorderLayout.CENTER); rightParentPanel.add(file2ChangeMarkerPanel, BorderLayout.EAST); // Center the splitter bar centerSplitterDivider(); // Hook the scroll panes up... hookScrollPanes(); setCursor(currentCursor); if (!isVisible()) { setVisible(true); } } catch (QVCSOperationException e) { LOGGER.log(Level.WARNING, "Caught QVCSOperationException: " + e.getMessage()); } }
From source file:AST.DesignPatternDetection.java
private void btRunSgisoActionPerformed(ActionEvent e) throws IOException, InterruptedException { // TODO add your code here try {// ww w. jav a2 s.c o m Cursor hourglassCursor = new Cursor(Cursor.WAIT_CURSOR); setCursor(hourglassCursor); String myCommand = programPath + "/Projects/script_" + cbSelectionDP.getSelectedItem().toString() + ".sh"; ProcessBuilder pb = new ProcessBuilder(myCommand); long startTime = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()); Process p = pb.start(); // Start the process. p.waitFor(); // Wait for the process to finish. long endTime = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()); long duration = (endTime - startTime); String duration_ = Long.toString(duration); DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Date date = new Date(); PrintWriter writer_time = new PrintWriter(programPath + "/Projects/" + tfProjectName.getText() + "/outputs/" + cbSelectionDP.getSelectedItem().toString() + "_outputs/time_" + cbSelectionDP.getSelectedItem().toString() + ".txt"); writer_time.println( "Script lasts " + duration_ + " seconds. --" + dateFormat.format(date).toString() + "--"); writer_time.close(); taInfo.append("5. Subdue-Sgiso isomorphic search algorithm runned in " + duration_ + " seconds.(/Projects/" + tfProjectName.getText() + "/outputs/" + cbSelectionDP.getSelectedItem().toString() + "_outputs)" + "\n"); Cursor normalCursor = new Cursor(Cursor.DEFAULT_CURSOR); setCursor(normalCursor); //remove the executable file. String myShellScript = ""; myShellScript = "rm " + programPath + "/Projects/script_" + cbSelectionDP.getSelectedItem().toString() + ".sh "; Runtime.getRuntime().exec(myShellScript); JOptionPane.showMessageDialog(null, "Sgiso script executed successfully"); } catch (Exception e2) { // TODO: handle exception System.out.println(e2.toString()); JOptionPane.showMessageDialog(null, e2.toString()); e2.printStackTrace(); } }
From source file:com.projity.pm.graphic.gantt.GanttInteractor.java
public Cursor selectCursor() { Cursor cursor = null;//w w w. ja va2s . co m switch (state) { case BAR_MOVE_START: cursor = new Cursor(Cursor.W_RESIZE_CURSOR); break; case BAR_MOVE_END: cursor = new Cursor(Cursor.E_RESIZE_CURSOR); break; case PROGRESS_BAR_MOVE: cursor = getProgressCursor(); break; case SPLIT: cursor = getSplitCursor(); break; } if (cursor == null) super.selectCursor(); else getGraph().setCursor(cursor); return cursor; }
From source file:org.openscience.jmol.app.Jmol.java
public static Jmol getJmol(JFrame frame, int startupWidth, int startupHeight, String commandOptions) { Splash splash = null;/* w w w . ja v a2 s. com*/ if (haveDisplay.booleanValue()) { ImageIcon splash_image = JmolResourceHandler.getIconX("splash"); report("splash_image=" + splash_image); splash = new Splash(frame, splash_image); splash.setCursor(new Cursor(Cursor.WAIT_CURSOR)); splash.showStatus(GT._("Creating main window...")); splash.showStatus(GT._("Initializing Swing...")); } try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception exc) { System.err.println("Error loading L&F: " + exc); } screenSize = Toolkit.getDefaultToolkit().getScreenSize(); if (splash != null) splash.showStatus(GT._("Initializing Jmol...")); Jmol window = new Jmol(splash, frame, null, startupWidth, startupHeight, commandOptions); if (haveDisplay.booleanValue()) frame.show(); return window; }
From source file:semgen.extraction.RadialGraph.Clusterer.java
public String clusterAndRecolor(AggregateLayout<String, Number> layout, int numEdgesToRemove, Color[] colors, boolean groupClusters) { setCursor(new Cursor(Cursor.WAIT_CURSOR)); String moduletable = ""; Graph<String, Number> g = layout.getGraph(); layout.removeAll();//from ww w . j av a 2 s . c o m EdgeBetweennessClusterer<String, Number> clusterer = new EdgeBetweennessClusterer<String, Number>( numEdgesToRemove); Set<Set<String>> clusterSet = clusterer.transform(g); List<Number> edges = clusterer.getEdgesRemoved(); sempanel.removeAll(); int i = 0; // Set the colors of each node so that each cluster's vertices have the same color extractor.clusterpanel.checkboxpanel.removeAll(); for (Iterator<Set<String>> cIt = clusterSet.iterator(); cIt.hasNext();) { moduletable = moduletable + "\nCLUSTER " + (i + 1); Set<String> vertices = cIt.next(); Color c = colors[i % colors.length]; Set<DataStructure> datastrs = new HashSet<DataStructure>(); for (String vertex : vertices) { datastrs.add(extractor.semsimmodel.getDataStructure(vertex)); } JLabel modulelabel = new JLabel("Cluster " + (i + 1)); modulelabel.setOpaque(true); modulelabel.setFont(SemGenFont.defaultBold()); modulelabel.setBackground(c); modulelabel.setAlignmentX(LEFT_ALIGNMENT); sempanel.add(modulelabel); // Update the semantics panel Set<String> addedterms = new HashSet<String>(); for (String ver : vertices) { if (extractor.semsimmodel.getDataStructure(ver).hasPhysicalProperty()) { if (extractor.semsimmodel.getDataStructure(ver).getPhysicalProperty() .getPhysicalPropertyOf() != null) { PhysicalModelComponent pmc = extractor.semsimmodel.getDataStructure(ver) .getPhysicalProperty().getPhysicalPropertyOf(); String name = null; if (pmc.hasRefersToAnnotation()) { name = pmc.getFirstRefersToReferenceOntologyAnnotation().getValueDescription(); } else { name = pmc.getName(); } if (!addedterms.contains(name)) { addedterms.add(name); JTextArea enttext = new JTextArea(name); enttext.setOpaque(true); enttext.setBackground(c); enttext.setFont(SemGenFont.defaultPlain(-2)); if (pmc instanceof PhysicalProcess) { enttext.setFont(SemGenFont.defaultItalic(-2)); name = "Process: " + name; } else name = "Entity: " + name; enttext.setWrapStyleWord(true); enttext.setLineWrap(true); enttext.setBorder(BorderFactory.createEmptyBorder(7, 7, 0, 0)); enttext.setAlignmentX(LEFT_ALIGNMENT); sempanel.add(enttext); moduletable = moduletable + "\n " + name; } } } } sempanel.validate(); sempanel.repaint(); semscroller.repaint(); semscroller.validate(); this.repaint(); this.validate(); colorCluster(vertices, c); ExtractorJCheckBox box = new ExtractorJCheckBox("Cluster " + (i + 1), datastrs); box.setBackground(c); box.setOpaque(true); box.addItemListener(extractor); extractor.clusterpanel.checkboxpanel.add(box); if (groupClusters == true) groupCluster(layout, vertices); i++; } refreshModulePanel(); for (Number e : g.getEdges()) { if (edges.contains(e)) edgePaints.put(e, Color.lightGray); else edgePaints.put(e, Color.black); } nummodules = i; setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); return moduletable; }
From source file:org.p_vcd.ui.VcdDialog.java
public VcdDialog() { setSize(700, 450);/* w ww . java2 s . com*/ setTitle("P-VCD - Video Copy Detection"); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.currentStep = 1; getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new CardLayout(0, 0)); { JPanel panel_Step1 = new JPanel(); contentPanel.add(panel_Step1, "card_step1"); panel_Step1.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 1 - Video Database (the \"known\")"); panel_Step1.add(lblTitle, BorderLayout.NORTH); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); JPanel panel_1 = new JPanel(); panel_Step1.add(panel_1, BorderLayout.CENTER); panel_1.setLayout(new MigLayout("", "[250px,grow][20px][250px,grow]", "[][][230px,grow][][][]")); JLabel lblNewLabel = new JLabel("Please select the video databases to search in:"); panel_1.add(lblNewLabel, "cell 0 0"); panel_1.add(lbl_refDbTitle, "cell 2 1"); JScrollPane scrollPane_1 = new JScrollPane(); panel_1.add(scrollPane_1, "cell 0 1 1 3,grow"); panel_refDatabasesList.setBackground(Color.WHITE); scrollPane_1.setViewportView(panel_refDatabasesList); panel_refDatabasesList.setLayout(new MigLayout("gapy 10", "[200px]", "[][]")); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBorder(null); panel_1.add(scrollPane, "cell 2 2,grow"); scrollPane.setViewportView(lbl_refDbFiles); panel_1.add(lbl_refDbMetadata, "cell 2 3"); JButton btnNewDatabase = new JButton("New database..."); panel_1.add(btnNewDatabase, "cell 0 4"); btnNewDatabase.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { newDatabaseButton(); } }); } { JPanel panel_Step2 = new JPanel(); contentPanel.add(panel_Step2, "card_step2"); panel_Step2.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 2 - Query (the \"unknown\")"); panel_Step2.add(lblTitle, BorderLayout.NORTH); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); JPanel panel = new JPanel(); panel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Query", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_Step2.add(panel, BorderLayout.CENTER); panel.setLayout( new MigLayout("", "[160px][grow]", "[25px][grow,top][25px][grow,top][25px][grow,top][grow]")); ButtonGroup queryButtonGroup = new ButtonGroup(); queryButtonGroup.add(radio_queryFile); radio_queryFile.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_queryFile, "cell 0 0"); lbl_queryFile.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { radio_queryFile.setSelected(true); } }); panel.add(lbl_queryFile, "flowy,cell 1 0"); JButton btnSelectFile = new JButton("Select File..."); btnSelectFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectFileButton(); } }); panel.add(btnSelectFile, "cell 1 0"); JLabel lblIumageOrVideo = new JLabel("Select an image or video in the local machine."); panel.add(lblIumageOrVideo, "cell 1 1"); queryButtonGroup.add(radio_queryUrl); radio_queryUrl.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_queryUrl, "cell 0 2"); txt_queryUrl.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { radio_queryUrl.setSelected(true); } }); txt_queryUrl.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { radio_queryUrl.setSelected(true); } }); txt_queryUrl.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { radio_queryUrl.setSelected(true); } }); txt_queryUrl.setText("http://"); panel.add(txt_queryUrl, "flowy,cell 1 2"); txt_queryUrl.setColumns(50); JLabel lblUrlToA = new JLabel( "<html>Enter the URL to download an image or video.<br>You can use a URL like: http://www.youtube.com/watch?v=... </html>"); panel.add(lblUrlToA, "flowy,cell 1 3"); queryButtonGroup.add(radio_queryDb); radio_queryDb.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_queryDb, "cell 0 4"); comboBox_queryDb.setMaximumRowCount(12); comboBox_queryDb.setPreferredSize(new Dimension(100, 20)); comboBox_queryDb.setMinimumSize(new Dimension(100, 20)); comboBox_queryDb.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (comboBox_queryDb.getSelectedIndex() > 0) radio_queryDb.setSelected(true); updateQueryDbDetail(); } }); comboBox_queryDb.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (comboBox_queryDb.getSelectedIndex() > 0) radio_queryDb.setSelected(true); updateQueryDbDetail(); } }); panel.add(comboBox_queryDb, "flowx,cell 1 4"); panel.add(lbl_queryDb, "cell 1 4"); JLabel lblPleaseNopteThe = new JLabel("<html>A search is run for each video in the database.</html>"); panel.add(lblPleaseNopteThe, "cell 1 5"); } { JPanel panel_Step3 = new JPanel(); contentPanel.add(panel_Step3, "card_step3"); panel_Step3.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 3 - Search Options"); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); panel_Step3.add(lblTitle, BorderLayout.NORTH); JPanel panel2 = new JPanel(); panel2.setLayout(new FlowLayout()); panel_Step3.add(panel2, BorderLayout.CENTER); JPanel panel = new JPanel(); panel2.add(panel); panel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Basic Options", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setLayout(new MigLayout("gapy 5px", "[30px][101px]", "[][][][][][][20px]")); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(radio_searchByGlobal); radio_searchByGlobal.setFont(new Font("Tahoma", Font.PLAIN, 13)); radio_searchByGlobal.setSelected(true); panel.add(radio_searchByGlobal, "cell 0 0 2 1,alignx left,aligny top"); JLabel lblNewLabel_2 = new JLabel( "Detects most of the copies that are visually alike to the original."); panel.add(lblNewLabel_2, "cell 1 1"); JButton btnOptions = new JButton("Advanced Options..."); btnOptions.setEnabled(false); panel.add(btnOptions, "cell 1 2"); buttonGroup.add(radio_searchByLocal); radio_searchByLocal.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_searchByLocal, "cell 0 4 2 1,alignx left,aligny top"); JLabel lblNewLabel_3 = new JLabel( "Requires more resources (disk space, search time, memory) but can detect more copies."); panel.add(lblNewLabel_3, "cell 1 5"); JButton btnOptions_1 = new JButton("Advanced Options..."); btnOptions_1.setEnabled(false); panel.add(btnOptions_1, "cell 1 6"); } { JPanel panel_Step4 = new JPanel(); contentPanel.add(panel_Step4, "card_step4"); panel_Step4.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 4 - Search"); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); panel_Step4.add(lblTitle, BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(); panel_Step4.add(scrollPane, BorderLayout.CENTER); textConsole.setFont(new Font("Monospaced", Font.PLAIN, 11)); textConsole.setForeground(Color.WHITE); textConsole.setBackground(Color.BLACK); textConsole.setEditable(false); textConsole.setCursor(new Cursor(Cursor.TEXT_CURSOR)); textConsole.setText( "Press 'Next' button to start the search...\nNote: Depending on the selected options, the search may take up to several hours."); scrollPane.setViewportView(textConsole); JPanel panel = new JPanel(); panel_Step4.add(panel, BorderLayout.SOUTH); panel.setLayout(new GridLayout(0, 1, 0, 0)); JSeparator separator = new JSeparator(); separator.setPreferredSize(new Dimension(0, 1)); panel.add(separator); progressBar.setStringPainted(true); progressBar.setPreferredSize(new Dimension(350, 20)); panel.add(progressBar); lblProgress.setHorizontalAlignment(SwingConstants.CENTER); lblProgress.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel.add(lblProgress); } { JPanel panel_Step5 = new JPanel(); contentPanel.add(panel_Step5, "card_step5"); panel_Step5.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 5 - Results"); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); panel_Step5.add(lblTitle, BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(); panel_Step5.add(scrollPane, BorderLayout.CENTER); scrollPane.setViewportView(panelResults); panelResults.setLayout(new MigLayout("gapy 10, gapx 20", "[120px,center][150px,center,grow][150px,center,grow]", "[25px][]")); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton prevButton = new JButton("Previous"); prevButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { previousButton(); } }); prevButton.setActionCommand("Previous"); buttonPane.add(prevButton); } { JButton okButton = new JButton("Next"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { nextButton(); } }); okButton.setActionCommand("OK"); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButton(); } }); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } this.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { closeWindow(); } }); updateDatabases(null); }
From source file:org.jas.dnd.DragTooltipDialog.java
private void initialize() { this.setSize(this.getPreferredSize()); this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); this.setContentPane(getJContentPane()); this.setUndecorated(true); this.setAlwaysOnTop(true); }
From source file:edu.ku.brc.af.tasks.BaseTask.java
/** * @param navBox/* w w w . j a v a 2s. c o m*/ * @param labelText * @param iconNameArg * @param toolTip * @param cmdAction * @param delCmdAction * @param makeDraggable * @param position * @param addSorted * @return */ public static NavBoxItemIFace makeDnDNavBtn(final NavBox navBox, final String labelText, final String iconNameArg, final String toolTip, final CommandAction cmdAction, final CommandAction delCmdAction, final boolean makeDraggable, final int position, final boolean addSorted) { NavBoxItemIFace nb = NavBox.createBtn(labelText, iconNameArg, IconManager.STD_ICON_SIZE); if (StringUtils.isNotEmpty(toolTip)) { ((RolloverCommand) nb).setToolTip(toolTip); } if (cmdAction != null) { NavBoxButton nbb = (NavBoxButton) nb; nbb.addActionListener(new CommandActionWrapper(cmdAction)); nbb.setData(cmdAction); } if (delCmdAction != null) { ((NavBoxButton) nb).setDeleteCommandAction(delCmdAction); } if (addSorted) { navBox.insertSorted(nb); } else if (position == -1) { navBox.add(nb); } else { navBox.insert(nb, false, false, position); } // Make the Btn Draggable if (nb instanceof GhostActionable) { GhostActionable ga = (GhostActionable) nb; if (makeDraggable) { ga.createMouseInputAdapter(); // this makes it draggable ((RolloverCommand) nb).setCursor(new Cursor(Cursor.HAND_CURSOR)); } else { //UIRegistry.getGlassPane().add(ga); } } return nb; }