List of usage examples for javax.swing JLabel setToolTipText
@BeanProperty(bound = false, preferred = true, description = "The text to display in a tool tip.") public void setToolTipText(String text)
From source file:com.rapidminer.gui.plotter.charts.AbstractPieChartPlotter.java
@Override public JComponent getOptionsComponent(int index) { switch (index) { case 0:/*from w ww . j a v a 2s . c om*/ JLabel label = new JLabel("Aggregation"); label.setToolTipText( "Select the type of the aggregation function which should be used for grouped values."); return label; case 1: return aggregationFunction; case 2: return useDistinct; case 3: if (isSupportingExplosion()) { label = new JLabel("Explosion Groups"); label.setToolTipText( "Select the groups which should explode, i.e. which should be located outside of the chart to the specified extent."); return label; } else { return null; } case 4: if (isSupportingExplosion()) { explodingGroupList.setToolTipText( "Select the groups which should explode, i.e. which should be located outside of the chart to the specified extent."); JScrollPane pane = new ExtendedJScrollPane(explodingGroupList); return pane; } else { return null; } case 5: if (isSupportingExplosion()) { label = new JLabel("Explosion Amount"); label.setToolTipText("Select the amount of explosion for the selected groups."); return label; } else { return null; } case 6: if (isSupportingExplosion()) { explodingSlider.setToolTipText("Select the amount of explosion for the selected groups."); return explodingSlider; } } return null; }
From source file:it.cnr.icar.eric.client.ui.swing.AdhocQuerySearchPanel.java
private JPanel createParameterEntryPanel(QueryType uiQueryType) { JPanel parameterEntryPanel = new JPanel(); GridBagLayout gbl = new GridBagLayout(); parameterEntryPanel.setLayout(gbl);/*w w w . j a va 2 s . c o m*/ paramComponents.clear(); List<?> params = uiQueryType.getParameter(); Iterator<?> iter = params.iterator(); int i = 0; while (iter.hasNext()) { ParameterType param = (ParameterType) iter.next(); String tooltip = getLocalizedValue(param.getDescription()); JLabel label = new JLabel(getLocalizedValue(param.getName()) + ":", SwingConstants.LEADING); label.setToolTipText(tooltip); c.gridx = 0; c.gridy = i; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.0; c.weighty = 0.0; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_END; c.insets = new Insets(4, 4, 0, 4); gbl.setConstraints(label, c); parameterEntryPanel.add(label); //Get default value for Parameter if any String defaultValue = param.getDefaultValue(); JComponent comp = getComponentForParameter(param, defaultValue); //comp.setToolTipText(tooltip); c.gridx = 1; c.gridy = i; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.5; c.weighty = 0.0; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.LINE_END; c.insets = new Insets(4, 4, 4, 4); gbl.setConstraints(comp, c); parameterEntryPanel.add(comp); paramComponents.add(comp); i++; } return parameterEntryPanel; }
From source file:org.apache.taverna.activities.rest.ui.config.RESTActivityConfigurationPanel.java
private JPanel createAdvancedTab() { JPanel jpAdvanced = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0;/* ww w. j a va 2 s. c om*/ c.gridy = 0; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(8, 10, 2, 4); JLabel jlExpectHeaderInfoIcon = new JLabel(infoIcon); jlExpectHeaderInfoIcon .setToolTipText("<html>Ticking this checkbox may significantly improve performance when<br>" + "large volumes of data are sent to the remote server and a redirect<br>" + "from the original URL to the one specified by the server is likely.<br>" + "<br>" + "However, this checkbox <b>must not</b> be ticked to allow this activity<br>" + "to post updates to Twitter.</html>"); jpAdvanced.add(jlExpectHeaderInfoIcon, c); c.gridx++; c.weightx = 1.0; c.insets = new Insets(8, 0, 2, 8); cbSendHTTPExpectHeader = new JCheckBox("Send HTTP Expect request-header field"); jpAdvanced.add(cbSendHTTPExpectHeader, c); c.gridx = 0; c.gridy++; c.weightx = 0; c.insets = new Insets(2, 10, 5, 4); JLabel jlShowRedirectionOutputPortInfoIcon = new JLabel(infoIcon); jlShowRedirectionOutputPortInfoIcon .setToolTipText("<html>\"Redirection\" output port displays the URL of the final redirect<br>" + "that has yielded the output data on the \"Response Body\" port.</html>"); jpAdvanced.add(jlShowRedirectionOutputPortInfoIcon, c); c.gridx++; c.weightx = 1.0; c.insets = new Insets(2, 0, 5, 8); cbShowRedirectionOutputPort = new JCheckBox("Show \"Redirection\" output port"); jpAdvanced.add(cbShowRedirectionOutputPort, c); c.gridx = 0; c.gridy++; c.weightx = 0; c.insets = new Insets(2, 10, 5, 4); JLabel jlShowActualUrlPortInfoIcon = new JLabel(infoIcon); jlShowActualUrlPortInfoIcon .setToolTipText("<html>\"Actual URL\" output port displays the URL used by the REST service<br>" + "with the actual parameter values.</html>"); jpAdvanced.add(jlShowActualUrlPortInfoIcon, c); c.gridx++; c.weightx = 1.0; c.insets = new Insets(2, 0, 5, 8); cbShowActualUrlPort = new JCheckBox("Show \"Actual URL\" output port"); jpAdvanced.add(cbShowActualUrlPort, c); c.gridx = 0; c.gridy++; c.weightx = 0; c.insets = new Insets(2, 10, 5, 4); JLabel jlShowResponseHeadersPortInfoIcon = new JLabel(infoIcon); jlShowResponseHeadersPortInfoIcon .setToolTipText("<html>\"Response headers\" output port displays the HTTP headers<br>" + "received from the final (after redirection) HTTP call.</html>"); jpAdvanced.add(jlShowResponseHeadersPortInfoIcon, c); c.gridx++; c.weightx = 1.0; c.insets = new Insets(2, 0, 5, 8); cbShowResponseHeadersPort = new JCheckBox("Show \"Response headers\" output port"); jpAdvanced.add(cbShowResponseHeadersPort, c); c.gridx = 0; c.gridy++; c.weightx = 0; c.insets = new Insets(2, 10, 5, 4); JLabel jlEscapeParametersInfoIcon = new JLabel(infoIcon); jlEscapeParametersInfoIcon.setToolTipText("<html>Determines if parameters you pass to form the full URL<br>" + " of the REST service will be URL-escaped.</html>"); jpAdvanced.add(jlEscapeParametersInfoIcon, c); c.gridx++; c.weightx = 1.0; c.insets = new Insets(2, 0, 5, 8); cbEscapeParameters = new JCheckBox("Escape URL parameter values"); jpAdvanced.add(cbEscapeParameters, c); c.gridx = 0; c.gridy++; c.weightx = 0; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.NONE; c.insets = new Insets(2, 10, 5, 4); JLabel jlHTTPHeadersInfoIcon = new JLabel(infoIcon); jlHTTPHeadersInfoIcon.setToolTipText("<html>Set additional HTTP headers</html>"); jpAdvanced.add(jlHTTPHeadersInfoIcon, c); c.gridx = 1; c.weightx = 0; c.weighty = 0; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.NONE; c.insets = new Insets(2, 10, 5, 4); addHeaderButton = new JButton("Add HTTP header"); addHeaderButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { httpHeadersTableModel.addEmptyRow(); httpHeadersTable.getSelectionModel().setSelectionInterval(httpHeadersTableModel.getRowCount() - 1, httpHeadersTableModel.getRowCount() - 1); } }); removeHeaderButton = new JButton("Remove HTTP header"); removeHeaderButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { int row = httpHeadersTable.getSelectedRow(); httpHeadersTableModel.removeRow(row); } }); JPanel buttonPanel = new JPanel(); buttonPanel.add(addHeaderButton, FlowLayout.LEFT); buttonPanel.add(removeHeaderButton); jpAdvanced.add(buttonPanel, c); c.gridx = 1; c.gridy++; c.weightx = 0; c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(2, 10, 5, 4); httpHeadersTableModel = new HTTPHeadersTableModel(); httpHeadersTable = new JTable(httpHeadersTableModel); httpHeadersTable.setGridColor(Color.GRAY); httpHeadersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); setVisibleRowCount(httpHeadersTable, 3); JScrollPane headersTableScrollPane = new JScrollPane(httpHeadersTable); jpAdvanced.add(headersTableScrollPane, c); return (jpAdvanced); }
From source file:com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionContentPanel.java
private void addSelectedArtifactLineItem() { final String tipInfo = "The Artifact you want to use."; JLabel artifactSelectLabel = new JLabel("Select an Artifact to submit"); artifactSelectLabel.setToolTipText(tipInfo); selectedArtifactComboBox = new ComboBox(); selectedArtifactComboBox.setToolTipText(tipInfo); errorMessageLabels[ErrorMessageLabelTag.SystemArtifact.ordinal()] = new JLabel( "Artifact should not be null!"); errorMessageLabels[ErrorMessageLabelTag.SystemArtifact.ordinal()] .setForeground(DarkThemeManager.getInstance().getErrorMessageColor()); errorMessageLabels[ErrorMessageLabelTag.SystemArtifact.ordinal()].setVisible(false); errorMessageLabels[ErrorMessageLabelTag.LocalArtifact.ordinal()] = new JLabel( "Could not find the local jar package for Artifact"); errorMessageLabels[ErrorMessageLabelTag.LocalArtifact.ordinal()] .setForeground(DarkThemeManager.getInstance().getErrorMessageColor()); errorMessageLabels[ErrorMessageLabelTag.LocalArtifact.ordinal()].setVisible(false); selectedArtifactTextField = new TextFieldWithBrowseButton(); selectedArtifactTextField.setToolTipText("Artifact from local jar package."); selectedArtifactTextField.setEditable(true); selectedArtifactTextField.setEnabled(false); selectedArtifactTextField.getTextField().getDocument().addDocumentListener(new DocumentListener() { @Override// w ww .j a v a 2 s. c o m public void insertUpdate(DocumentEvent e) { setVisibleForFixedErrorMessageLabel(2, !SparkSubmitHelper.isLocalArtifactPath(selectedArtifactTextField.getText())); } @Override public void removeUpdate(DocumentEvent e) { setVisibleForFixedErrorMessageLabel(2, !SparkSubmitHelper.isLocalArtifactPath(selectedArtifactTextField.getText())); } @Override public void changedUpdate(DocumentEvent e) { setVisibleForFixedErrorMessageLabel(2, !SparkSubmitHelper.isLocalArtifactPath(selectedArtifactTextField.getText())); } }); selectedArtifactTextField.getButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FileChooserDescriptor chooserDescriptor = new FileChooserDescriptor(false, false, true, false, true, false); chooserDescriptor.setTitle("Select Local Artifact File"); VirtualFile chooseFile = FileChooser.chooseFile(chooserDescriptor, null, null); if (chooseFile != null) { String path = chooseFile.getPath(); if (path.endsWith("!/")) { path = path.substring(0, path.length() - 2); } selectedArtifactTextField.setText(path); } } }); intelliJArtifactRadioButton = new JRadioButton("Artifact from IntelliJ project:", true); localArtifactRadioButton = new JRadioButton("Artifact from local disk:", false); intelliJArtifactRadioButton.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { selectedArtifactComboBox.setEnabled(true); selectedArtifactTextField.setEnabled(false); mainClassTextField.setButtonEnabled(true); setVisibleForFixedErrorMessageLabel(2, false); if (selectedArtifactComboBox.getItemCount() == 0) { setVisibleForFixedErrorMessageLabel(2, true); } } } }); localArtifactRadioButton.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { selectedArtifactComboBox.setEnabled(false); selectedArtifactTextField.setEnabled(true); mainClassTextField.setButtonEnabled(false); setVisibleForFixedErrorMessageLabel(1, false); if (StringHelper.isNullOrWhiteSpace(selectedArtifactTextField.getText())) { setVisibleForFixedErrorMessageLabel(2, true); } } } }); ButtonGroup group = new ButtonGroup(); group.add(intelliJArtifactRadioButton); group.add(localArtifactRadioButton); intelliJArtifactRadioButton.setSelected(true); add(artifactSelectLabel, new GridBagConstraints(0, ++displayLayoutCurrentRow, 0, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, margin), 0, 0)); add(intelliJArtifactRadioButton, new GridBagConstraints(0, ++displayLayoutCurrentRow, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin / 3, margin * 3, 0, margin), 0, 0)); add(selectedArtifactComboBox, new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(margin / 3, margin, 0, margin), 0, 0)); add(errorMessageLabels[ErrorMessageLabelTag.SystemArtifact.ordinal()], new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, margin, 0, 0), 0, 0)); add(localArtifactRadioButton, new GridBagConstraints(0, ++displayLayoutCurrentRow, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin / 3, margin * 3, 0, margin), 0, 0)); add(selectedArtifactTextField, new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(margin / 3, margin, 0, margin), 0, 0)); add(errorMessageLabels[ErrorMessageLabelTag.LocalArtifact.ordinal()], new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, margin, 0, 0), 0, 0)); }
From source file:edu.harvard.i2b2.query.QueryTopPanel.java
public void addPanel() { int rightmostPosition = dataModel.lastLabelPosition(); JLabel label = new JLabel(); label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); label.setText("and"); label.setToolTipText("Click to change the relationship"); label.setBorder(javax.swing.BorderFactory.createEtchedBorder()); label.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabelMouseClicked(evt); }/*from w w w . j a va2s. c o m*/ }); //jPanel1.add(label); //label.setBounds(rightmostPosition, 90, 30, 18); QueryConceptTreePanel panel = new QueryConceptTreePanel("Group " + (dataModel.getCurrentPanelCount() + 1), this); jPanel1.add(panel); panel.setBounds(rightmostPosition + 5, 0, 180, getParent().getHeight() - 100); jPanel1.setPreferredSize(new Dimension(rightmostPosition + 5 + 181, 150)); jScrollPane4.setViewportView(jPanel1); dataModel.addPanel(panel, null, rightmostPosition + 5 + 180); jScrollPane4.getHorizontalScrollBar().setValue(jScrollPane4.getHorizontalScrollBar().getMaximum()); jScrollPane4.getHorizontalScrollBar().setUnitIncrement(40); }
From source file:edu.harvard.i2b2.query.QueryTopPanel.java
private void jMorePanelsButtonActionPerformed(java.awt.event.ActionEvent evt) { if (dataModel.hasEmptyPanels()) { JOptionPane.showMessageDialog(this, "Please use an existing empty panel before adding a new one."); return;/*from w w w. j a v a 2 s . c o m*/ } int rightmostPosition = dataModel.lastLabelPosition(); JLabel label = new JLabel(); label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); label.setText("and"); label.setToolTipText("Click to change the relationship"); label.setBorder(javax.swing.BorderFactory.createEtchedBorder()); label.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabelMouseClicked(evt); } }); //jPanel1.add(label); //label.setBounds(rightmostPosition, 90, 30, 18); QueryConceptTreePanel panel = new QueryConceptTreePanel("Group " + (dataModel.getCurrentPanelCount() + 1), this); jPanel1.add(panel); panel.setBounds(rightmostPosition + 5, 0, 180, getParent().getHeight() - 100); jPanel1.setPreferredSize(new Dimension(rightmostPosition + 5 + 181, getHeight() - 100)); jScrollPane4.setViewportView(jPanel1); dataModel.addPanel(panel, label, rightmostPosition + 5 + 180); /*System.out.println(jScrollPane4.getViewport().getExtentSize().width+":"+ jScrollPane4.getViewport().getExtentSize().height); System.out.println(jScrollPane4.getHorizontalScrollBar().getVisibleRect().width+":" +jScrollPane4.getHorizontalScrollBar().getVisibleRect().height); System.out.println(jScrollPane4.getHorizontalScrollBar().getVisibleAmount()); System.out.println(jScrollPane4.getHorizontalScrollBar().getValue());*/ jScrollPane4.getHorizontalScrollBar().setValue(jScrollPane4.getHorizontalScrollBar().getMaximum()); jScrollPane4.getHorizontalScrollBar().setUnitIncrement(40); //this.jScrollPane4.removeAll(); //this.jScrollPane4.setViewportView(jPanel1); //revalidate(); //jScrollPane3.setBounds(420, 0, 170, 300); //jScrollPane4.setBounds(20, 35, 335, 220); resizePanels(getParent().getWidth(), getParent().getHeight()); }
From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.links_redundantes.PanelLinkRedundante.java
private void criaInterfaceVisualEscalavel() { miBtnSalvar = new JMenuItem(XHTML_Panel.BTN_SALVAR); painel = new JPanel(); textAreaSourceCode = new G_TextAreaSourceCode(); //frameSilvinha.setJMenuBar(this.criaMenuBar()); textAreaSourceCode.setTipoHTML();// w w w. j a va 2 s .co m textAreaSourceCode.setBorder(criaBorda(XHTML_Panel.COD_FONTE)); //frameSilvinha.setTitle(XHTMLPanel.TIT_LINK_RED); painel.setLayout(new GridLayout(2, 1)); setBackground(frameSilvinha.corDefault); Container contentPane = this; contentPane.setLayout(new GridLayout(1, 1)); painel.add(textAreaSourceCode); JPanel panelBtnTabela = new JPanel(); panelBtnTabela.setLayout(new BorderLayout()); /* * Barra de botes */ btnPanel = new JPanel(); btnPanel.setLayout(null); btn_salvar = new JButton(XHTML_Panel.BTN_SALVAR); btn_salvar.setToolTipText(XHTML_Panel.DICA_SALVAR); btn_salvar.setBounds(10, 0, 150, 25); btnPanel.add(btn_salvar); btn_abrir = new JButton(XHTML_Panel.BTN_ABRIR); btn_abrir.setToolTipText(XHTML_Panel.DICA_ABRIR); btn_abrir.setBounds(165, 0, 150, 25); btnPanel.add(btn_abrir); btn_salvarComo = new JButton(XHTML_Panel.BTN_SALVAR_COMO); btn_salvarComo.setToolTipText(XHTML_Panel.DICA_SALVAR_COMO); btn_salvarComo.setBounds(320, 0, 150, 25); btnPanel.add(btn_salvarComo); btn_cancelar = new JButton(XHTML_Panel.TELA_ANTERIOR); btn_cancelar.setToolTipText(XHTML_Panel.DICA_TELA_ANTERIOR); btn_cancelar.setBounds(480, 0, 150, 25); btnPanel.add(btn_cancelar); btnPanel.setPreferredSize(new Dimension(430, 30)); /* * Barra de correcao */ btnAplicar = new JButton(XHTML_Panel.BTN_APLICAR); btnAplicar.setToolTipText(XHTML_Panel.DICA_BTN_APLICAR); btnAplicar.setEnabled(false); texto = new JTextField(); texto.setBorder(BorderFactory.createLineBorder(Color.BLACK)); JPanel borda = new JPanel(new BorderLayout()); JLabel lbl_texto = new JLabel(XHTML_Panel.ROTULO_TEXTO); lbl_texto.setToolTipText(XHTML_Panel.DICA_ROTULO_TEXTO); borda.add(lbl_texto, BorderLayout.WEST); borda.add(texto, BorderLayout.CENTER); borda.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); borda.setOpaque(false); panelCorretor = new JPanel(new BorderLayout()); panelCorretor.add(borda, BorderLayout.CENTER); panelCorretor.add(btnAplicar, BorderLayout.EAST); //panelCorretor.add(btnPanel,BorderLayout.WEST); panelCorretor.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); panelCorretor.setOpaque(false); /* * Tabela de erros */ tabelaDeErros = new TabelaErros(); scrollPaneTabela = new JScrollPane(); scrollPaneTabela.setViewportView(tabelaDeErros); panelBtnTabela.add(panelCorretor, BorderLayout.NORTH); panelBtnTabela.add(scrollPaneTabela, BorderLayout.CENTER); panelBtnTabela.add(btnPanel, BorderLayout.SOUTH); scrollPaneTabela.setBorder(criaBorda(XHTML_Panel.LISTA_ERROS)); painel.add(panelBtnTabela); btnPanel.setBackground(frameSilvinha.corDefault); if (!original) { reverter = new JButton("Reverter"); reverter.setText(TradPainelRelatorio.REVERTER); reverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub setVisible(false); TxtBuffer.setContent(TxtBuffer.getContentOriginal()); frameSilvinha.showPainelFerramentaLinksRedundantes(); setVisible(true); } }); //reverter.setActionCommand("Reverter"); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); reverter.setBounds(640, 0, 150, 25); btnPanel.add(reverter); } panelBtnTabela.setBackground(frameSilvinha.corDefault); painel.setBackground(frameSilvinha.corDefault); contentPane.setBackground(frameSilvinha.corDefault); scrollPaneTabela.setBackground(frameSilvinha.corDefault); textAreaSourceCode.setBackground(frameSilvinha.corDefault); miBtnSalvar.setEnabled(false); btn_salvar.setEnabled(false); salvaAlteracoes = TxtBuffer.getInstanciaSalvaAlteracoes(textAreaSourceCode.getTextPane(), btn_salvar, miBtnSalvar, frameSilvinha); String fil[] = { ".html", ".htm" }; salvaAlteracoes.setFiltro(fil); contentPane.add(painel); // pack(); this.setVisible(true); }
From source file:org.simbrain.plot.projection.ProjectionGui.java
/** * Construct the Projection GUI.//from ww w .ja v a 2s . c o m */ public ProjectionGui(final GenericFrame frame, final ProjectionComponent component) { super(frame, component); setPreferredSize(new Dimension(500, 400)); actionManager = new PlotActionManager(this); setLayout(new BorderLayout()); // Generate the graph chart = ChartFactory.createScatterPlot("High Dimensional Projection", "Projection X", "Projection Y", getWorkspaceComponent().getProjectionModel().getDataset(), PlotOrientation.VERTICAL, false, true, false); // chart.getXYPlot().getDomainAxis().setRange(-100, 100); // chart.getXYPlot().getRangeAxis().setRange(-100, 100); chart.getXYPlot().setBackgroundPaint(Color.white); chart.getXYPlot().setDomainGridlinePaint(Color.gray); chart.getXYPlot().setRangeGridlinePaint(Color.gray); chart.getXYPlot().getDomainAxis().setAutoRange(true); chart.getXYPlot().getRangeAxis().setAutoRange(true); panel = new ChartPanel(chart); // Custom render points as dots (not squares) and use custom tooltips // that show high-d point CustomRenderer renderer = new CustomRenderer(); chart.getXYPlot().setRenderer(renderer); renderer.setSeriesLinesVisible(0, false); renderer.setSeriesShape(0, new Ellipse2D.Double(-5, -5, 5, 5)); CustomToolTipGenerator generator = new CustomToolTipGenerator(); renderer.setSeriesToolTipGenerator(0, generator); // Toolbar openBtn.setToolTipText("Open high-dimensional data"); saveBtn.setToolTipText("Save data"); projectionList.setMaximumSize(new java.awt.Dimension(200, 100)); iterateBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getWorkspaceComponent().getProjector().iterate(); update(); } }); clearBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getWorkspaceComponent().getWorkspace().stop(); Executors.newSingleThreadExecutor().execute(new Runnable() { @Override public void run() { getWorkspaceComponent().clearData(); } }); } }); playBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (getWorkspaceComponent().getProjectionModel().isRunning()) { playBtn.setIcon(ResourceManager.getImageIcon("Stop.png")); playBtn.setToolTipText("Stop iterating projection algorithm"); getWorkspaceComponent().getProjectionModel().setRunning(false); Executors.newSingleThreadExecutor().execute(new ProjectionUpdater(getWorkspaceComponent())); } else { playBtn.setIcon(ResourceManager.getImageIcon("Play.png")); playBtn.setToolTipText("Start iterating projection algorithm"); getWorkspaceComponent().getProjectionModel().setRunning(true); } } }); prefsBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // TODO (Still working out overall dialog structure). } }); randomBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getWorkspaceComponent().getProjector().randomize(100); } }); theToolBar.add(projectionList); playBtn.setToolTipText("Iterate projection algorithm"); theToolBar.add(playBtn); iterateBtn.setToolTipText("Step projection algorithm"); theToolBar.add(iterateBtn); clearBtn.setToolTipText("Clear current data"); theToolBar.add(clearBtn); randomBtn.setToolTipText("Randomize datapoints"); theToolBar.add(randomBtn); theToolBar.addSeparator(); warningLabel.setPreferredSize(new Dimension(16, 16)); warningLabel.setToolTipText("This method works best with more " + "datapoints already added"); theToolBar.add(warningLabel); String stepSizeToolTip = "Scales the amount points are moved on each iteration"; JLabel stepSizeLabel = new JLabel("Step Size"); stepSizeLabel.setToolTipText(stepSizeToolTip); sammonStepSizePanel.add(stepSizeLabel); try { sammonStepSize = new JTextField("" + SimbrainPreferences.getDouble("projectorSammonEpsilon")); } catch (PropertyNotFoundException e1) { e1.printStackTrace(); } sammonStepSize.setColumns(3); sammonStepSize.setToolTipText(stepSizeToolTip); sammonStepSizePanel.add(sammonStepSize); theToolBar.add(sammonStepSizePanel); adjustDimension1.setToolTipText("Dimension 1"); adjustDimension2.setToolTipText("Dimension 2"); theToolBar.add(adjustDimension1); theToolBar.add(adjustDimension2); // Help button JButton helpButton = new JButton(); helpButton.setAction(helpAction); // Add/Remove dimension buttons JButton addButton = new JButton("Add Dimension"); addButton.setActionCommand("Add"); addButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getWorkspaceComponent().getProjectionModel().addSource(); } }); JButton deleteButton = new JButton("Remove Dimension"); deleteButton.setActionCommand("Delete"); deleteButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getWorkspaceComponent().getProjectionModel().removeSource(); } }); // Button Panel JPanel buttonPanel = new JPanel(); buttonPanel.add(helpButton); buttonPanel.add(addButton); buttonPanel.add(deleteButton); // Setup Menu Bar createAttachMenuBar(); // Status Bar statusBar.add(pointsLabel); statusBar.add(dimsLabel); errorBar.add(errorLabel); // Bottom panel bottomPanel.add("North", buttonPanel); JPanel southPanel = new JPanel(); southPanel.add(errorBar); southPanel.add(statusBar); bottomPanel.add("South", southPanel); // Put all panels together add("North", theToolBar); add("Center", panel); add("South", bottomPanel); // Other initialization initializeComboBoxes(); addListeners(); updateToolBar(); update(); }
From source file:cool.pandora.modeller.ui.jpanel.base.SaveBagFrame.java
private JPanel createComponents() { final Border border = new EmptyBorder(5, 5, 5, 5); final TitlePane titlePane = new TitlePane(); initStandardCommands();/*from w w w . j a v a 2 s . c o m*/ final JPanel pageControl = new JPanel(new BorderLayout()); final JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("SaveBagFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Define the Bag " + "settings"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); final JPanel contentPane = new JPanel(); // TODO: Add bag name field // TODO: Add save name file selection button final JLabel location = new JLabel("Save in:"); final JButton browseButton = new JButton(getMessage("bag.button.browse")); browseButton.addActionListener(new SaveBagAsHandler()); browseButton.setEnabled(true); browseButton.setToolTipText(getMessage("bag.button.browse.help")); final DefaultBag bag = bagView.getBag(); if (bag != null) { bagNameField = new JTextField(bag.getName()); bagNameField.setCaretPosition(bag.getName().length()); bagNameField.setEditable(false); bagNameField.setEnabled(false); } // Holey bag control final JLabel holeyLabel = new JLabel(bagView.getPropertyMessage("bag.label.isholey")); holeyLabel.setToolTipText(bagView.getPropertyMessage("bag.isholey.help")); final JCheckBox holeyCheckbox = new JCheckBox(bagView.getPropertyMessage("bag.checkbox" + ".isholey")); holeyCheckbox.setBorder(border); holeyCheckbox.addActionListener(new HoleyBagHandler()); holeyCheckbox.setToolTipText(bagView.getPropertyMessage("bag.isholey.help")); urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); urlField = new JTextField(""); try { assert bag != null; urlField.setText(bag.getFetch().getBaseURL()); } catch (Exception e) { log.error("Failed to set url label", e); } urlField.setEnabled(false); // TODO: Add format label final JLabel serializeLabel; serializeLabel = new JLabel(getMessage("bag.label.ispackage")); serializeLabel.setToolTipText(getMessage("bag.serializetype.help")); // TODO: Add format selection panel noneButton = new JRadioButton(getMessage("bag.serializetype.none")); noneButton.setEnabled(true); final AbstractAction serializeListener = new SerializeBagHandler(); noneButton.addActionListener(serializeListener); noneButton.setToolTipText(getMessage("bag.serializetype.none.help")); zipButton = new JRadioButton(getMessage("bag.serializetype.zip")); zipButton.setEnabled(true); zipButton.addActionListener(serializeListener); zipButton.setToolTipText(getMessage("bag.serializetype.zip.help")); /* * tarButton = new JRadioButton(getMessage("bag.serializetype.tar")); * tarButton.setEnabled(true); * tarButton.addActionListener(serializeListener); * tarButton.setToolTipText(getMessage("bag.serializetype.tar.help")); * * tarGzButton = new JRadioButton(getMessage("bag.serializetype.targz")); * tarGzButton.setEnabled(true); * tarGzButton.addActionListener(serializeListener); * tarGzButton.setToolTipText(getMessage("bag.serializetype.targz.help")); * * tarBz2Button = new JRadioButton(getMessage("bag.serializetype.tarbz2")); * tarBz2Button.setEnabled(true); * tarBz2Button.addActionListener(serializeListener); * tarBz2Button.setToolTipText(getMessage("bag.serializetype.tarbz2.help")); */ short mode = 2; if (bag != null) { mode = bag.getSerialMode(); } if (mode == DefaultBag.NO_MODE) { this.noneButton.setEnabled(true); } else if (mode == DefaultBag.ZIP_MODE) { this.zipButton.setEnabled(true); } else { this.noneButton.setEnabled(true); } final ButtonGroup serializeGroup = new ButtonGroup(); serializeGroup.add(noneButton); serializeGroup.add(zipButton); // serializeGroup.add(tarButton); // serializeGroup.add(tarGzButton); // serializeGroup.add(tarBz2Button); final JPanel serializeGroupPanel = new JPanel(new FlowLayout()); serializeGroupPanel.add(serializeLabel); serializeGroupPanel.add(noneButton); serializeGroupPanel.add(zipButton); // serializeGroupPanel.add(tarButton); // serializeGroupPanel.add(tarGzButton); // serializeGroupPanel.add(tarBz2Button); serializeGroupPanel.setBorder(border); serializeGroupPanel.setEnabled(true); serializeGroupPanel.setToolTipText(bagView.getPropertyMessage("bag.serializetype.help")); final JLabel tagLabel = new JLabel(getMessage("bag.label.istag")); tagLabel.setToolTipText(getMessage("bag.label.istag.help")); final JCheckBox isTagCheckbox = new JCheckBox(); isTagCheckbox.setBorder(border); isTagCheckbox.addActionListener(new TagManifestHandler()); isTagCheckbox.setToolTipText(getMessage("bag.checkbox.istag.help")); final JLabel tagAlgorithmLabel = new JLabel(getMessage("bag.label.tagalgorithm")); tagAlgorithmLabel.setToolTipText(getMessage("bag.label.tagalgorithm.help")); final ArrayList<String> listModel = new ArrayList<>(); for (final Algorithm algorithm : Algorithm.values()) { listModel.add(algorithm.bagItAlgorithm); } final JComboBox<String> tagAlgorithmList = new JComboBox<>(listModel.toArray(new String[listModel.size()])); tagAlgorithmList.setName(getMessage("bag.tagalgorithmlist")); tagAlgorithmList.addActionListener(new TagAlgorithmListHandler()); tagAlgorithmList.setToolTipText(getMessage("bag.tagalgorithmlist.help")); final JLabel payloadLabel = new JLabel(getMessage("bag.label.ispayload")); payloadLabel.setToolTipText(getMessage("bag.ispayload.help")); final JCheckBox isPayloadCheckbox = new JCheckBox(); isPayloadCheckbox.setBorder(border); isPayloadCheckbox.addActionListener(new PayloadManifestHandler()); isPayloadCheckbox.setToolTipText(getMessage("bag.ispayload.help")); final JLabel payAlgorithmLabel = new JLabel(bagView.getPropertyMessage("bag.label" + ".payalgorithm")); payAlgorithmLabel.setToolTipText(getMessage("bag.payalgorithm.help")); final JComboBox<String> payAlgorithmList = new JComboBox<String>( listModel.toArray(new String[listModel.size()])); payAlgorithmList.setName(getMessage("bag.payalgorithmlist")); payAlgorithmList.addActionListener(new PayAlgorithmListHandler()); payAlgorithmList.setToolTipText(getMessage("bag.payalgorithmlist.help")); //only if bag is not null if (bag != null) { final String fileName = bag.getName(); bagNameField = new JTextField(fileName); bagNameField.setCaretPosition(fileName.length()); holeyCheckbox.setSelected(bag.isHoley()); urlLabel.setEnabled(bag.isHoley()); isTagCheckbox.setSelected(bag.isBuildTagManifest()); tagAlgorithmList.setSelectedItem(bag.getTagManifestAlgorithm()); isPayloadCheckbox.setSelected(bag.isBuildPayloadManifest()); payAlgorithmList.setSelectedItem(bag.getPayloadManifestAlgorithm()); } final GridBagLayout layout = new GridBagLayout(); final GridBagConstraints glbc = new GridBagConstraints(); final JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(location, glbc); panel.add(location); buildConstraints(glbc, 2, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.EAST); glbc.ipadx = 5; layout.setConstraints(browseButton, glbc); glbc.ipadx = 0; panel.add(browseButton); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); glbc.ipadx = 5; layout.setConstraints(bagNameField, glbc); glbc.ipadx = 0; panel.add(bagNameField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(holeyLabel, glbc); panel.add(holeyLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.WEST, GridBagConstraints.WEST); layout.setConstraints(holeyCheckbox, glbc); panel.add(holeyCheckbox); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(serializeLabel, glbc); panel.add(serializeLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); layout.setConstraints(serializeGroupPanel, glbc); panel.add(serializeGroupPanel); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(tagLabel, glbc); panel.add(tagLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(isTagCheckbox, glbc); panel.add(isTagCheckbox); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(tagAlgorithmLabel, glbc); panel.add(tagAlgorithmLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(tagAlgorithmList, glbc); panel.add(tagAlgorithmList); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(payloadLabel, glbc); panel.add(payloadLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(isPayloadCheckbox, glbc); panel.add(isPayloadCheckbox); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(payAlgorithmLabel, glbc); panel.add(payAlgorithmLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(payAlgorithmList, glbc); panel.add(payAlgorithmList); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); final JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }
From source file:gov.loc.repository.bagger.ui.SaveBagFrame.java
private JPanel createComponents() { Border border = new EmptyBorder(5, 5, 5, 5); TitlePane titlePane = new TitlePane(); initStandardCommands();//from w w w. j a v a 2 s. c om JPanel pageControl = new JPanel(new BorderLayout()); JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("SaveBagFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Define the Bag settings"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); JPanel contentPane = new JPanel(); // TODO: Add bag name field // TODO: Add save name file selection button JLabel location = new JLabel("Save in:"); browseButton = new JButton(getMessage("bag.button.browse")); browseButton.addActionListener(new SaveBagAsHandler()); browseButton.setEnabled(true); browseButton.setToolTipText(getMessage("bag.button.browse.help")); String fileName = ""; DefaultBag bag = bagView.getBag(); if (bag != null) { fileName = bag.getName(); } bagNameField = new JTextField(fileName); bagNameField.setCaretPosition(fileName.length()); bagNameField.setEditable(false); bagNameField.setEnabled(false); // Holey bag control JLabel holeyLabel = new JLabel(bagView.getPropertyMessage("bag.label.isholey")); holeyLabel.setToolTipText(bagView.getPropertyMessage("bag.isholey.help")); holeyCheckbox = new JCheckBox(bagView.getPropertyMessage("bag.checkbox.isholey")); holeyCheckbox.setBorder(border); holeyCheckbox.setSelected(bag.isHoley()); holeyCheckbox.addActionListener(new HoleyBagHandler()); holeyCheckbox.setToolTipText(bagView.getPropertyMessage("bag.isholey.help")); urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); urlLabel.setEnabled(bag.isHoley()); urlField = new JTextField(""); try { urlField.setText(bag.getFetch().getBaseURL()); } catch (Exception e) { log.error("fetch baseURL: " + e.getMessage()); } urlField.setEnabled(false); // TODO: Add format label JLabel serializeLabel; serializeLabel = new JLabel(getMessage("bag.label.ispackage")); serializeLabel.setToolTipText(getMessage("bag.serializetype.help")); // TODO: Add format selection panel noneButton = new JRadioButton(getMessage("bag.serializetype.none")); noneButton.setEnabled(true); AbstractAction serializeListener = new SerializeBagHandler(); noneButton.addActionListener(serializeListener); noneButton.setToolTipText(getMessage("bag.serializetype.none.help")); zipButton = new JRadioButton(getMessage("bag.serializetype.zip")); zipButton.setEnabled(true); zipButton.addActionListener(serializeListener); zipButton.setToolTipText(getMessage("bag.serializetype.zip.help")); /* tarButton = new JRadioButton(getMessage("bag.serializetype.tar")); tarButton.setEnabled(true); tarButton.addActionListener(serializeListener); tarButton.setToolTipText(getMessage("bag.serializetype.tar.help")); tarGzButton = new JRadioButton(getMessage("bag.serializetype.targz")); tarGzButton.setEnabled(true); tarGzButton.addActionListener(serializeListener); tarGzButton.setToolTipText(getMessage("bag.serializetype.targz.help")); tarBz2Button = new JRadioButton(getMessage("bag.serializetype.tarbz2")); tarBz2Button.setEnabled(true); tarBz2Button.addActionListener(serializeListener); tarBz2Button.setToolTipText(getMessage("bag.serializetype.tarbz2.help")); */ short mode = bag.getSerialMode(); if (mode == DefaultBag.NO_MODE) { this.noneButton.setEnabled(true); } else if (mode == DefaultBag.ZIP_MODE) { this.zipButton.setEnabled(true); } /*else if (mode == DefaultBag.TAR_MODE) { this.tarButton.setEnabled(true); } else if (mode == DefaultBag.TAR_GZ_MODE) { this.tarGzButton.setEnabled(true); } else if (mode == DefaultBag.TAR_BZ2_MODE) { this.tarBz2Button.setEnabled(true); } */else { this.noneButton.setEnabled(true); } ButtonGroup serializeGroup = new ButtonGroup(); serializeGroup.add(noneButton); serializeGroup.add(zipButton); //serializeGroup.add(tarButton); //serializeGroup.add(tarGzButton); //serializeGroup.add(tarBz2Button); serializeGroupPanel = new JPanel(new FlowLayout()); serializeGroupPanel.add(serializeLabel); serializeGroupPanel.add(noneButton); serializeGroupPanel.add(zipButton); //serializeGroupPanel.add(tarButton); //serializeGroupPanel.add(tarGzButton); //serializeGroupPanel.add(tarBz2Button); serializeGroupPanel.setBorder(border); serializeGroupPanel.setEnabled(true); serializeGroupPanel.setToolTipText(bagView.getPropertyMessage("bag.serializetype.help")); JLabel tagLabel = new JLabel(getMessage("bag.label.istag")); tagLabel.setToolTipText(getMessage("bag.label.istag.help")); isTagCheckbox = new JCheckBox(); isTagCheckbox.setBorder(border); isTagCheckbox.setSelected(bag.isBuildTagManifest()); isTagCheckbox.addActionListener(new TagManifestHandler()); isTagCheckbox.setToolTipText(getMessage("bag.checkbox.istag.help")); JLabel tagAlgorithmLabel = new JLabel(getMessage("bag.label.tagalgorithm")); tagAlgorithmLabel.setToolTipText(getMessage("bag.label.tagalgorithm.help")); ArrayList<String> listModel = new ArrayList<String>(); for (Algorithm algorithm : Algorithm.values()) { listModel.add(algorithm.bagItAlgorithm); } tagAlgorithmList = new JComboBox(listModel.toArray()); tagAlgorithmList.setName(getMessage("bag.tagalgorithmlist")); tagAlgorithmList.setSelectedItem(bag.getTagManifestAlgorithm()); tagAlgorithmList.addActionListener(new TagAlgorithmListHandler()); tagAlgorithmList.setToolTipText(getMessage("bag.tagalgorithmlist.help")); JLabel payloadLabel = new JLabel(getMessage("bag.label.ispayload")); payloadLabel.setToolTipText(getMessage("bag.ispayload.help")); isPayloadCheckbox = new JCheckBox(); isPayloadCheckbox.setBorder(border); isPayloadCheckbox.setSelected(bag.isBuildPayloadManifest()); isPayloadCheckbox.addActionListener(new PayloadManifestHandler()); isPayloadCheckbox.setToolTipText(getMessage("bag.ispayload.help")); JLabel payAlgorithmLabel = new JLabel(bagView.getPropertyMessage("bag.label.payalgorithm")); payAlgorithmLabel.setToolTipText(getMessage("bag.payalgorithm.help")); payAlgorithmList = new JComboBox(listModel.toArray()); payAlgorithmList.setName(getMessage("bag.payalgorithmlist")); payAlgorithmList.setSelectedItem(bag.getPayloadManifestAlgorithm()); payAlgorithmList.addActionListener(new PayAlgorithmListHandler()); payAlgorithmList.setToolTipText(getMessage("bag.payalgorithmlist.help")); GridBagLayout layout = new GridBagLayout(); GridBagConstraints glbc = new GridBagConstraints(); JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(location, glbc); panel.add(location); buildConstraints(glbc, 2, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.EAST); glbc.ipadx = 5; layout.setConstraints(browseButton, glbc); glbc.ipadx = 0; panel.add(browseButton); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); glbc.ipadx = 5; layout.setConstraints(bagNameField, glbc); glbc.ipadx = 0; panel.add(bagNameField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(holeyLabel, glbc); panel.add(holeyLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.WEST, GridBagConstraints.WEST); layout.setConstraints(holeyCheckbox, glbc); panel.add(holeyCheckbox); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(serializeLabel, glbc); panel.add(serializeLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); layout.setConstraints(serializeGroupPanel, glbc); panel.add(serializeGroupPanel); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(tagLabel, glbc); panel.add(tagLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(isTagCheckbox, glbc); panel.add(isTagCheckbox); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(tagAlgorithmLabel, glbc); panel.add(tagAlgorithmLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(tagAlgorithmList, glbc); panel.add(tagAlgorithmList); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(payloadLabel, glbc); panel.add(payloadLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(isPayloadCheckbox, glbc); panel.add(isPayloadCheckbox); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(payAlgorithmLabel, glbc); panel.add(payAlgorithmLabel); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(payAlgorithmList, glbc); panel.add(payAlgorithmList); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }