List of usage examples for java.awt GridBagConstraints HORIZONTAL
int HORIZONTAL
To view the source code for java.awt GridBagConstraints HORIZONTAL.
Click Source Link
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectAdd.java
/** * This method initializes jPanelButton * //www. ja v a 2s .c o m * @return javax.swing.JPanel */ private JPanel getJPanelButton() { if (jPanelButton == null) { GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.insets = new Insets(0, 10, 10, 10); gridBagConstraints4.gridy = 1; gridBagConstraints4.gridx = 0; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = GridBagConstraints.CENTER; gridBagConstraints.insets = new Insets(10, 10, 10, 10); gridBagConstraints.gridx = -1; gridBagConstraints.gridy = -1; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; jPanelButton = new JPanel(); jPanelButton.setLayout(new GridBagLayout()); jPanelButton.add(getJButtonOK(), gridBagConstraints); jPanelButton.add(getJButtonCancel(), gridBagConstraints4); } return jPanelButton; }
From source file:net.sf.taverna.t2.workbench.cagrid.CaGridComponent.java
protected void addcagridService() { GridBagConstraints c = new GridBagConstraints(); c.gridx = 0;//from w ww . jav a2 s .co m c.gridy = ++row; c.anchor = GridBagConstraints.LINE_END; c.ipadx = 5; c.ipady = 5; add(new JLabel("CaGrid Service URL :"), c); c.weightx = 0.1; c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = GridBagConstraints.RELATIVE; services = new JComboBox(); services.addItem("https://bridled.ci.uchicago.edu:5000/wsrf/services/cagrid/TavernaWorkflowService"); services.addItem("http://test.cagrid.org//wsrf/services/cagrid/TavernaWorkflowService"); services.setSelectedIndex(0); //set the list of available caGrid workflow services here //services.addActionListener(new ServiceSelectionListener()); services.setEditable(true); add(services, c); c.weightx = 0; //Action connectService = new ConnectServiceAction(); testButton = new JButton("Test Service", WorkbenchIcons.configureIcon); testButton.setActionCommand("test"); testButton.addActionListener(this); add(testButton, c); //Action addService = new NewServiceAction(); //add(new JButton("addService"), c); //Action editService = new EditServiceAction(); //editButton = new JButton("editService"); //add(editButton, c); //Action removeService = new RemoveServiceAction(); //removeButton = new JButton("removeService"); //add(removeButton, c); }
From source file:de.codesourcery.jasm16.ide.ui.utils.UIUtils.java
public static void showErrorDialog(Component parent, String title, String textMessage, Throwable cause) { final String stacktrace; if (cause == null) { stacktrace = null;// w ww.j a v a 2 s .c o m } else { final ByteArrayOutputStream stackTrace = new ByteArrayOutputStream(); cause.printStackTrace(new PrintStream(stackTrace)); stacktrace = new String(stackTrace.toByteArray()); } final JDialog dialog = new JDialog((Window) null, title); dialog.setModal(true); final JTextArea message = createMultiLineLabel(textMessage); final DialogResult[] outcome = { DialogResult.CANCEL }; final JButton okButton = new JButton("Ok"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { outcome[0] = DialogResult.YES; dialog.dispose(); } }); final JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); buttonPanel.add(okButton); final JPanel messagePanel = new JPanel(); messagePanel.setLayout(new GridBagLayout()); GridBagConstraints cnstrs = constraints(0, 0, true, true, GridBagConstraints.BOTH); cnstrs.weightx = 1; cnstrs.weighty = 0.1; cnstrs.gridheight = 1; messagePanel.add(message, cnstrs); if (stacktrace != null) { final JTextArea createMultiLineLabel = new JTextArea(stacktrace); createMultiLineLabel.setBackground(null); createMultiLineLabel.setEditable(false); createMultiLineLabel.setBorder(null); createMultiLineLabel.setLineWrap(false); createMultiLineLabel.setWrapStyleWord(false); final JScrollPane pane = new JScrollPane(createMultiLineLabel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); cnstrs = constraints(0, 1, true, true, GridBagConstraints.BOTH); cnstrs.weightx = 1.0; cnstrs.weighty = 0.9; cnstrs.gridwidth = GridBagConstraints.REMAINDER; cnstrs.gridheight = GridBagConstraints.REMAINDER; messagePanel.add(pane, cnstrs); } final JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); cnstrs = constraints(0, 0, true, false, GridBagConstraints.BOTH); cnstrs.gridwidth = GridBagConstraints.REMAINDER; cnstrs.gridheight = 1; cnstrs.weighty = 1.0; cnstrs.insets = new Insets(5, 2, 5, 2); // top,left,bottom,right panel.add(messagePanel, cnstrs); cnstrs = constraints(0, 1, true, true, GridBagConstraints.HORIZONTAL); cnstrs.gridwidth = GridBagConstraints.REMAINDER; cnstrs.gridheight = 1; cnstrs.weighty = 0; cnstrs.insets = new Insets(0, 2, 10, 2); // top,left,bottom,right panel.add(buttonPanel, cnstrs); dialog.getContentPane().add(panel); dialog.setMinimumSize(new Dimension(600, 400)); dialog.setPreferredSize(new Dimension(600, 400)); dialog.setMaximumSize(new Dimension(600, 400)); dialog.pack(); dialog.setVisible(true); }
From source file:com.att.aro.ui.view.videotab.VideoTab.java
/** * MidPanel contains Video Manifests/*from ww w. j av a 2 s . com*/ */ private JPanel buildManifestsGroup() { JPanel pane; pane = new JPanel(new GridBagLayout()); int section = 0; videoManifestPanel = new VideoManifestPanel(overviewRoute, aroView); pane.add(videoManifestPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, noInsets, 0, 0)); bpObservable.registerObserver(videoManifestPanel); JPanel wrapper = getTitledWrapper("video.tab.manifest.title", new LoadManifestDialog(aroView)); wrapper.add(pane, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, noInsets, 0, 0)); pane.setBorder(BorderFactory.createLineBorder(Color.WHITE)); return wrapper; }
From source file:org.apache.taverna.activities.rest.ui.config.RESTActivityConfigurationPanel.java
private JPanel createGeneralTab() { JPanel jpGeneral = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); // All components to be anchored WEST c.anchor = GridBagConstraints.WEST; c.gridx = 0;//from w w w . ja va2 s .co m c.gridy = 0; c.gridwidth = 1; c.insets = new Insets(7, 7, 3, 3); c.weightx = 0.0; c.fill = GridBagConstraints.NONE; JLabel labelMethod = new JLabel("HTTP Method:", infoIcon, JLabel.LEFT); labelMethod.setToolTipText( "<html>HTTP method determines how a request to the remote server will be made.<br><br>" + "Supported HTTP methods are normally used for different purposes:<br>" + "<b>GET</b> - to fetch data;<br>" + "<b>POST</b> - to create new resources;<br>" + "<b>PUT</b> - to update existing resources;<br>" + "<b>DELETE</b> - to remove existing resources.<br><br>" + "Documentation of the server that is about to be used may suggest the<br>" + "HTTP method that should be used.</html>"); jpGeneral.add(labelMethod, c); // the HTTP method combo-box will always contain the same values - it is // the selected // method which is important; therefore, can prepopulate as the set of // values is known c.gridx++; c.insets = new Insets(7, 3, 3, 7); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; cbHTTPMethod = new JComboBox<>(HTTP_METHOD.values()); cbHTTPMethod.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean contentTypeSelEnabled = RESTActivity .hasMessageBodyInputPort((HTTP_METHOD) cbHTTPMethod.getSelectedItem()); jlContentTypeExplanation.setVisible(contentTypeSelEnabled); jlContentType.setVisible(contentTypeSelEnabled); cbContentType.setVisible(contentTypeSelEnabled); jlSendDataAs.setVisible(contentTypeSelEnabled); cbSendDataAs.setVisible(contentTypeSelEnabled); jlContentTypeExplanationPlaceholder.setVisible(!contentTypeSelEnabled); jlContentTypeLabelPlaceholder.setVisible(!contentTypeSelEnabled); jlContentTypeFieldPlaceholder.setVisible(!contentTypeSelEnabled); jlSendDataAsLabelPlaceholder.setVisible(!contentTypeSelEnabled); jlSendDataAsFieldPlaceholder.setVisible(!contentTypeSelEnabled); } }); jpGeneral.add(cbHTTPMethod, c); c.gridx = 0; c.gridy++; c.insets = new Insets(3, 7, 3, 3); c.fill = GridBagConstraints.NONE; c.weightx = 0.0; JLabel labelString = new JLabel("URL Template:", infoIcon, JLabel.LEFT); labelString.setToolTipText("<html>URL template enables to define a URL with <b>configurable<br>" + "parameters</b> that will be used to access a remote server.<br><br>" + "The template may contain zero or more <b>parameters</b> - each<br>" + "enclosed within curly braces <b>\"{\"</b> and <b>\"}\"</b>.<br>" + "Taverna will automatically create an individual input port for<br>" + "this activity for each parameter.<br><br>" + "Values extracted from these input ports during the workflow<br>" + "execution these will be used to replace the parameters to<br>" + "produce complete URLs.<br><br>" + "For example, if the URL template is configured as<br>" + "\"<i>http://www.myexperiment.org/user.xml?id={userID}</i>\", a<br>" + "single input port with the name \"<i>userID</i>\" will be created.</html>"); labelString.setLabelFor(tfURLSignature); jpGeneral.add(labelString, c); c.gridx++; c.insets = new Insets(3, 3, 3, 7); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; tfURLSignature = new JTextField(40); tfURLSignature.addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { tfURLSignature.selectAll(); } public void focusLost(FocusEvent e) { /* do nothing */ } }); jpGeneral.add(tfURLSignature, c); c.gridx = 0; c.gridwidth = 2; c.gridy++; c.weightx = 0.0; c.fill = GridBagConstraints.NONE; c.insets = new Insets(18, 7, 3, 7); JLabel jlAcceptsExplanation = new JLabel( "Preferred MIME type for data to be fetched from the remote server --"); jpGeneral.add(jlAcceptsExplanation, c); c.gridwidth = 1; c.gridx = 0; c.gridy++; c.insets = new Insets(3, 7, 3, 3); c.weightx = 0.0; c.fill = GridBagConstraints.NONE; JLabel jlAccepts = new JLabel("'Accept' header:", infoIcon, JLabel.LEFT); jlAccepts.setToolTipText( "<html>Select a MIME type from the drop-down menu or type your own.<br>Select blank if you do not want this header to be set.</br>"); jlAccepts.setLabelFor(cbAccepts); jpGeneral.add(jlAccepts, c); c.gridx++; c.insets = new Insets(3, 3, 3, 7); c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; cbAccepts = new JComboBox<>(getMediaTypes()); cbAccepts.setEditable(true); cbAccepts.getEditor().getEditorComponent().addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { cbAccepts.getEditor().selectAll(); } public void focusLost(FocusEvent e) { /* do nothing */ } }); jpGeneral.add(cbAccepts, c); c.gridx = 0; c.gridwidth = 2; c.gridy++; c.insets = new Insets(18, 7, 3, 7); c.weightx = 0.0; c.fill = GridBagConstraints.NONE; jlContentTypeExplanation = new JLabel("MIME type of data that will be sent to the remote server --"); jpGeneral.add(jlContentTypeExplanation, c); c.gridwidth = 1; c.gridx = 0; c.gridy++; c.insets = new Insets(3, 7, 3, 3); c.weightx = 0.0; c.fill = GridBagConstraints.NONE; jlContentType = new JLabel("'Content-Type' header:", infoIcon, JLabel.LEFT); jlContentType.setToolTipText( "<html>Select a MIME type from the drop-down menu or type your own.<br>Select blank if you do not want this header to be set.</html>"); jlContentType.setLabelFor(cbContentType); jpGeneral.add(jlContentType, c); c.gridx++; c.insets = new Insets(3, 3, 3, 7); c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; cbContentType = new JComboBox<>(getMediaTypes()); cbContentType.setEditable(true); cbContentType.getEditor().getEditorComponent().addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { cbContentType.getEditor().selectAll(); } public void focusLost(FocusEvent e) { /* do nothing */ } }); cbContentType.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // change selection in the "Send data as" combo-box, based on // the selection of Content-Type String selectedContentType = (String) cbContentType.getSelectedItem(); if (selectedContentType.startsWith("text")) { cbSendDataAs.setSelectedItem(DATA_FORMAT.String); } else { cbSendDataAs.setSelectedItem(DATA_FORMAT.Binary); } } }); jpGeneral.add(cbContentType, c); c.gridx = 0; c.gridwidth = 2; c.gridy++; c.insets = new Insets(18, 7, 3, 7); c.weightx = 0.0; c.fill = GridBagConstraints.NONE; jlContentTypeExplanationPlaceholder = new JLabel(); jlContentTypeExplanationPlaceholder.setPreferredSize(jlContentTypeExplanation.getPreferredSize()); jpGeneral.add(jlContentTypeExplanationPlaceholder, c); c.gridwidth = 1; c.gridx = 0; c.gridy++; c.insets = new Insets(3, 7, 3, 3); c.weightx = 0.0; c.fill = GridBagConstraints.NONE; jlContentTypeLabelPlaceholder = new JLabel(); jlContentTypeLabelPlaceholder.setPreferredSize(jlContentType.getPreferredSize()); jpGeneral.add(jlContentTypeLabelPlaceholder, c); c.gridx++; c.insets = new Insets(3, 3, 3, 7); c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; jlContentTypeFieldPlaceholder = new JLabel(); jlContentTypeFieldPlaceholder.setPreferredSize(cbContentType.getPreferredSize()); jpGeneral.add(jlContentTypeFieldPlaceholder, c); c.gridx = 0; c.gridy++; c.weightx = 0.0; c.fill = GridBagConstraints.NONE; c.insets = new Insets(3, 7, 8, 3); jlSendDataAs = new JLabel("Send data as:", infoIcon, JLabel.LEFT); jlSendDataAs.setToolTipText("Select the format for the data to be sent to the remote server"); jlSendDataAs.setLabelFor(cbSendDataAs); jpGeneral.add(jlSendDataAs, c); c.gridx++; c.insets = new Insets(3, 3, 8, 7); c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; cbSendDataAs = new JComboBox<>(DATA_FORMAT.values()); cbSendDataAs.setEditable(false); jpGeneral.add(cbSendDataAs, c); c.gridx = 0; c.gridy++; c.insets = new Insets(3, 7, 8, 3); c.weightx = 0.0; c.fill = GridBagConstraints.NONE; jlSendDataAsLabelPlaceholder = new JLabel(); jlSendDataAsLabelPlaceholder.setPreferredSize(jlSendDataAs.getPreferredSize()); jpGeneral.add(jlSendDataAsLabelPlaceholder, c); c.gridx++; c.insets = new Insets(3, 3, 8, 7); c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; jlSendDataAsFieldPlaceholder = new JLabel(); jlSendDataAsFieldPlaceholder.setPreferredSize(cbSendDataAs.getPreferredSize()); jpGeneral.add(jlSendDataAsFieldPlaceholder, c); JPanel finalPanel = new JPanel(new BorderLayout()); finalPanel.add(jpGeneral, BorderLayout.NORTH); return (finalPanel); }
From source file:org.openmicroscopy.shoola.agents.dataBrowser.view.SearchPanel.java
/** * Builds and lays out the component displaying the various options. * //w ww . j ava2 s . c o m * @return See above. */ private JPanel buildScope() { JPanel p = new JPanel(); p.setBackground(UIUtilities.BACKGROUND_COLOR); p.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; p.add(new JLabel("Groups:"), c); c.gridx = 1; p.add(groupsBox, c); groupsBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { updateUsersBox(); } }); c.gridx = 0; c.gridy++; p.add(new JLabel("Data owned by:"), c); c.gridx = 1; p.add(usersBox, c); UIUtilities.setBoldTitledBorder("Scope", p); return p; }
From source file:org.esa.snap.ui.tooladapter.dialogs.ToolParameterEditorDialog.java
private GridBagConstraints getConstraints(int row, int col, int noCells) { GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = col;/* w w w . j ava 2s. com*/ c.gridy = row; if (noCells != -1) { c.gridwidth = noCells; } c.insets = new Insets(2, 10, 2, 10); return c; }
From source file:de.tor.tribes.ui.views.DSWorkbenchConquersFrame.java
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this * method is always regenerated by the Form Editor. *//*from ww w.java 2s .c o m*/ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jConquersPanel = new javax.swing.JPanel(); jConquerTablePanel = new org.jdesktop.swingx.JXPanel(); infoPanel = new org.jdesktop.swingx.JXCollapsiblePane(); jXLabel1 = new org.jdesktop.swingx.JXLabel(); jScrollPane4 = new javax.swing.JScrollPane(); jXPanel2 = new org.jdesktop.swingx.JXPanel(); jSeparator1 = new javax.swing.JSeparator(); jLastUpdateLabel = new javax.swing.JLabel(); jGreyConquersLabel = new javax.swing.JLabel(); jFriendlyConquersLabel = new javax.swing.JLabel(); jSelfConquersLabel = new javax.swing.JLabel(); jxFilterPane = new org.jdesktop.swingx.JXPanel(); jXPanel3 = new org.jdesktop.swingx.JXPanel(); jButton12 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jLabel21 = new javax.swing.JLabel(); jFilterRows = new javax.swing.JCheckBox(); jFilterCaseSensitive = new javax.swing.JCheckBox(); jScrollPane1 = new javax.swing.JScrollPane(); jXColumnList = new org.jdesktop.swingx.JXList(); jLabel22 = new javax.swing.JLabel(); jConquersFrameAlwaysOnTop = new javax.swing.JCheckBox(); jConquerPanel = new org.jdesktop.swingx.JXPanel(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jConquersPanel.setBackground(new java.awt.Color(239, 235, 223)); jConquersPanel.setLayout(new java.awt.BorderLayout()); jConquerTablePanel.setLayout(new java.awt.BorderLayout()); infoPanel.setCollapsed(true); infoPanel.setInheritAlpha(false); jXLabel1.setText("Keine Meldung"); jXLabel1.setOpaque(true); jXLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { fireHideInfoEvent(evt); } }); infoPanel.add(jXLabel1, java.awt.BorderLayout.CENTER); jConquerTablePanel.add(infoPanel, java.awt.BorderLayout.SOUTH); jConquersTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane4.setViewportView(jConquersTable); jConquerTablePanel.add(jScrollPane4, java.awt.BorderLayout.CENTER); jConquersPanel.add(jConquerTablePanel, java.awt.BorderLayout.CENTER); jXPanel2.setOpaque(false); jXPanel2.setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 0); jXPanel2.add(jSeparator1, gridBagConstraints); jLastUpdateLabel.setText("Letzte Aktualisierung:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jLastUpdateLabel, gridBagConstraints); jGreyConquersLabel.setBackground(new java.awt.Color(255, 204, 204)); jGreyConquersLabel.setText("Grau-Adelungen:"); jGreyConquersLabel.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jGreyConquersLabel, gridBagConstraints); jFriendlyConquersLabel.setBackground(new java.awt.Color(0, 255, 255)); jFriendlyConquersLabel.setText("Aufadelungen:"); jFriendlyConquersLabel.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jFriendlyConquersLabel, gridBagConstraints); jSelfConquersLabel.setBackground(new java.awt.Color(213, 255, 128)); jSelfConquersLabel.setText("Selbstadelungen:"); jSelfConquersLabel.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jSelfConquersLabel, gridBagConstraints); jConquersPanel.add(jXPanel2, java.awt.BorderLayout.SOUTH); jxFilterPane.setOpaque(false); jxFilterPane.setLayout(new java.awt.GridBagLayout()); jXPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jXPanel3.setInheritAlpha(false); jButton12.setText("Anwenden"); jButton12.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { jButton12fireHideGlassPaneEvent(evt); } }); jTextField1.addCaretListener(new javax.swing.event.CaretListener() { public void caretUpdate(javax.swing.event.CaretEvent evt) { jTextField1fireHighlightEvent(evt); } }); jLabel21.setText("Suchbegriff"); jFilterRows.setText("Nur gefilterte Zeilen anzeigen"); jFilterRows.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterRowsfireUpdateFilterEvent(evt); } }); jFilterCaseSensitive.setText("Gro-/Kleinschreibung beachten"); jFilterCaseSensitive.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterCaseSensitivefireUpdateFilterEvent(evt); } }); jXColumnList.setModel(new javax.swing.AbstractListModel() { String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; public int getSize() { return strings.length; } public Object getElementAt(int i) { return strings[i]; } }); jXColumnList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jScrollPane1.setViewportView(jXColumnList); jLabel22.setText("Spalten"); javax.swing.GroupLayout jXPanel3Layout = new javax.swing.GroupLayout(jXPanel3); jXPanel3.setLayout(jXPanel3Layout); jXPanel3Layout .setHorizontalGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jXPanel3Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jXPanel3Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jFilterRows, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jFilterCaseSensitive, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jButton12))) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jXPanel3Layout.setVerticalGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel21) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jXPanel3Layout .createSequentialGroup().addComponent(jFilterCaseSensitive) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jFilterRows) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton12)) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel22)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jxFilterPane.add(jXPanel3, new java.awt.GridBagConstraints()); setTitle("Eroberungen"); getContentPane().setLayout(new java.awt.GridBagLayout()); jConquersFrameAlwaysOnTop.setText("Immer im Vordergrund"); jConquersFrameAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireConquersFrameAlwaysOnTopEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jConquersFrameAlwaysOnTop, gridBagConstraints); jConquerPanel.setBackground(new java.awt.Color(239, 235, 223)); jConquerPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 661; gridBagConstraints.ipady = 354; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jConquerPanel, gridBagConstraints); capabilityInfoPanel1.setBbSupport(false); capabilityInfoPanel1.setCopyable(false); capabilityInfoPanel1.setDeletable(false); capabilityInfoPanel1.setPastable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); pack(); }
From source file:org.openconcerto.erp.core.sales.credit.component.AvoirClientSQLComponent.java
public void addViews() { this.setLayout(new GridBagLayout()); final GridBagConstraints c = new DefaultGridBagConstraints(); textNumero = new JUniqueTextField(16); // Champ Module c.gridx = 0;/*from w ww . ja va 2 s . c o m*/ c.gridy++; c.gridwidth = GridBagConstraints.REMAINDER; final JPanel addP = ComptaSQLConfElement.createAdditionalPanel(); this.setAdditionalFieldsPanel(new FormLayouter(addP, 1)); this.add(addP, c); c.gridy++; c.gridwidth = 1; this.textNom = new JTextField(); this.date = new JDate(true); this.date.addValueListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { fireValidChange(); } }); // Ligne 1: Numero this.add(new JLabel(getLabelFor("NUMERO"), SwingConstants.RIGHT), c); c.weightx = 1; c.fill = GridBagConstraints.NONE; c.gridx++; DefaultGridBagConstraints.lockMinimumSize(textNumero); this.add(this.textNumero, c); // Date c.gridx++; c.weightx = 0; c.fill = GridBagConstraints.HORIZONTAL; this.add(new JLabel("Date", SwingConstants.RIGHT), c); c.gridx++; c.weightx = 1; c.fill = GridBagConstraints.NONE; this.add(this.date, c); // Ligne 2: Libell c.gridx = 0; c.gridy++; c.weightx = 0; c.fill = GridBagConstraints.HORIZONTAL; this.add(new JLabel(getLabelFor("NOM"), SwingConstants.RIGHT), c); c.gridx++; // c.weightx = 1; this.add(this.textNom, c); // Commercial c.gridx++; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0; this.comboCommercial = new ElementComboBox(); this.comboCommercial.setMinimumSize(this.comboCommercial.getPreferredSize()); this.add(new JLabel(getLabelFor("ID_COMMERCIAL"), SwingConstants.RIGHT), c); c.gridx++; // c.weightx = 1; c.fill = GridBagConstraints.NONE; this.add(this.comboCommercial, c); this.addSQLObject(this.comboCommercial, "ID_COMMERCIAL"); // Ligne 3: Motif c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy++; c.weightx = 0; this.add(new JLabel(getLabelFor("MOTIF"), SwingConstants.RIGHT), c); c.gridx++; c.gridwidth = 3; // c.weightx = 1; JTextField textMotif = new JTextField(); this.add(textMotif, c); // Client c.gridx = 0; c.gridy++; // c.weightx = 0; c.gridwidth = 1; this.add(new JLabel(getLabelFor("ID_CLIENT"), SwingConstants.RIGHT), c); c.gridx++; c.gridwidth = 3; // c.weightx = 1; c.fill = GridBagConstraints.NONE; this.add(this.comboClient, c); // Adresse spe c.gridx = 0; c.gridy++; c.fill = GridBagConstraints.HORIZONTAL; // c.weightx = 0; c.gridwidth = 1; this.add(new JLabel(getLabelFor("ID_ADRESSE"), SwingConstants.RIGHT), c); c.gridx++; c.gridwidth = 3; // c.weightx = 1; c.fill = GridBagConstraints.NONE; this.add(this.comboAdresse, c); final ComptaPropsConfiguration comptaPropsConfiguration = ((ComptaPropsConfiguration) Configuration .getInstance()); // Contact c.gridx = 0; c.gridy++; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; // c.weightx = 0; final JLabel labelContact = new JLabel(getLabelFor("ID_CONTACT"), SwingConstants.RIGHT); this.add(labelContact, c); c.gridx++; c.gridwidth = 3; // c.weightx = 1; c.fill = GridBagConstraints.NONE; this.add(selectContact, c); final SQLElement contactElement = getElement().getForeignElement("ID_CONTACT"); selectContact.init(contactElement, contactElement.getComboRequest(true)); this.addView(selectContact, "ID_CONTACT"); this.defaultContactRowValues = new SQLRowValues(selectContact.getRequest().getPrimaryTable()); selectContact.getAddComp().setDefaults(this.defaultContactRowValues); // Compte Service this.checkCompteServiceAuto = new JCheckBox(getLabelFor("COMPTE_SERVICE_AUTO")); this.addSQLObject(this.checkCompteServiceAuto, "COMPTE_SERVICE_AUTO"); this.compteSelService = new ISQLCompteSelector(); this.labelCompteServ = new JLabel("Compte Service"); c.gridy++; c.gridx = 0; c.gridwidth = 1; // c.weightx = 0; this.labelCompteServ.setHorizontalAlignment(SwingConstants.RIGHT); this.add(this.labelCompteServ, c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; // c.weightx = 1; this.add(this.compteSelService, c); this.addRequiredSQLObject(this.compteSelService, "ID_COMPTE_PCE_SERVICE"); String valServ = DefaultNXProps.getInstance().getStringProperty("ArticleService"); Boolean bServ = Boolean.valueOf(valServ); if (!bServ) { this.labelCompteServ.setVisible(false); this.compteSelService.setVisible(false); } this.checkCompteServiceAuto.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setCompteServiceVisible(!AvoirClientSQLComponent.this.checkCompteServiceAuto.isSelected()); } }); // setCompteServiceVisible(!(bServ != null && !bServ.booleanValue())); // Tarif if (this.getTable().getFieldsName().contains("ID_TARIF")) { // TARIF c.gridy++; c.gridx = 0; c.weightx = 0; c.weighty = 0; c.gridwidth = 1; this.add(new JLabel("Tarif appliquer", SwingConstants.RIGHT), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1; this.add(boxTarif, c); this.addView(boxTarif, "ID_TARIF"); boxTarif.addValueListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { table.setTarif(boxTarif.getSelectedRow(), false); } }); } // Table this.table = new AvoirItemTable(); c.gridx = 0; c.gridy++; c.fill = GridBagConstraints.BOTH; c.gridheight = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.weighty = 1; // c.weightx = 0; this.add(this.table, c); this.addView(this.table.getRowValuesTable(), ""); // Panel du bas final JPanel panelBottom = getBottomPanel(); c.gridy++; c.weighty = 0; this.add(panelBottom, c); // Infos c.gridheight = 1; c.gridx = 0; c.gridy++; this.add(new JLabel(getLabelFor("INFOS")), c); c.gridy++; c.fill = GridBagConstraints.BOTH; c.weighty = 0; c.gridwidth = 4; ITextArea infos = new ITextArea(4, 4); infos.setBorder(null); JScrollPane scrollPane = new JScrollPane(infos); DefaultGridBagConstraints.lockMinimumSize(scrollPane); this.add(scrollPane, c); // // Impression this.panelGestDoc = new PanelOOSQLComponent(this); c.fill = GridBagConstraints.NONE; c.gridy++; c.anchor = GridBagConstraints.EAST; this.add(panelGestDoc, c); this.addSQLObject(this.textNom, "NOM"); if (getTable().contains("INFOS")) { this.addSQLObject(infos, "INFOS"); } this.addSQLObject(this.boxAdeduire, "A_DEDUIRE"); this.addSQLObject(textMotif, "MOTIF"); this.addSQLObject(this.comboAdresse, "ID_ADRESSE"); this.addRequiredSQLObject(this.textNumero, "NUMERO"); this.addRequiredSQLObject(this.date, "DATE"); this.addRequiredSQLObject(this.comboClient, "ID_CLIENT"); this.boxAdeduire.addActionListener(this); this.comboClient.addModelListener("wantedID", this.listenerModeReglDefaut); this.comboClient.addModelListener("wantedID", this.changeClientListener); DefaultGridBagConstraints.lockMinimumSize(comboClient); DefaultGridBagConstraints.lockMinimumSize(this.comboAdresse); DefaultGridBagConstraints.lockMinimumSize(this.comboBanque); DefaultGridBagConstraints.lockMinimumSize(comboCommercial); }
From source file:erigo.filepump.FilePump.java
private void createAndShowGUI(String default_outputFolderI, double default_filesPerSecI, int default_totNumFilesI, FileMode default_modeI, String default_ftpHostI, String default_ftpUserI, String default_ftpPasswordI) { // Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); // Create the GUI components GridBagLayout framegbl = new GridBagLayout(); filePumpGuiFrame = new JFrame("FilePump"); GridBagLayout gbl = new GridBagLayout(); JPanel guiPanel = new JPanel(gbl); outputFolderLabel = new JLabel(" "); Dimension preferredSize = new Dimension(200, 20); outputFolderLabel.setPreferredSize(preferredSize); filesPerSecLabel = new JLabel("1"); totNumFilesLabel = new JLabel("unlimited"); modeLabel = new JLabel("file system folder"); fileCountLabel = new JLabel("0"); endButton = new JButton("Finish test"); endButton.addActionListener(this); actionButton = new JButton("Start pump"); actionButton.setBackground(Color.GREEN); actionButton.addActionListener(this); filePumpGuiFrame.setFont(new Font("Dialog", Font.PLAIN, 12)); guiPanel.setFont(new Font("Dialog", Font.PLAIN, 12)); int row = 0;/* ww w.ja v a 2 s . c om*/ GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0; gbc.weighty = 0; // ROW 1 JLabel label = new JLabel("Output directory"); gbc.insets = new Insets(15, 15, 0, 5); Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1); gbc.insets = new Insets(15, 0, 0, 15); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 100; gbc.weighty = 100; Utility.add(guiPanel, outputFolderLabel, gbl, gbc, 1, row, 1, 1); gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0; gbc.weighty = 0; ++row; // ROW 2 label = new JLabel("Files/sec"); gbc.insets = new Insets(15, 15, 0, 5); Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1); gbc.insets = new Insets(15, 0, 0, 15); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 100; gbc.weighty = 100; Utility.add(guiPanel, filesPerSecLabel, gbl, gbc, 1, row, 1, 1); gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0; gbc.weighty = 0; ++row; // ROW 3 label = new JLabel("Tot num files"); gbc.insets = new Insets(15, 15, 0, 5); Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1); gbc.insets = new Insets(15, 0, 0, 15); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 100; gbc.weighty = 100; Utility.add(guiPanel, totNumFilesLabel, gbl, gbc, 1, row, 1, 1); gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0; gbc.weighty = 0; ++row; // ROW 4 label = new JLabel("Mode"); gbc.insets = new Insets(15, 15, 0, 5); Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1); gbc.insets = new Insets(15, 0, 0, 15); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 100; gbc.weighty = 100; Utility.add(guiPanel, modeLabel, gbl, gbc, 1, row, 1, 1); gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0; gbc.weighty = 0; ++row; // ROW 5 label = new JLabel("File count"); gbc.insets = new Insets(15, 15, 0, 5); Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1); gbc.insets = new Insets(15, 0, 0, 15); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 100; gbc.weighty = 100; Utility.add(guiPanel, fileCountLabel, gbl, gbc, 1, row, 1, 1); gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0; gbc.weighty = 0; ++row; // ROW 6: command buttons JPanel buttonPanel = new JPanel(); buttonPanel.add(actionButton); buttonPanel.add(endButton); gbc.insets = new Insets(15, 15, 15, 15); gbc.anchor = GridBagConstraints.CENTER; Utility.add(guiPanel, buttonPanel, gbl, gbc, 0, row, 2, 1); gbc.anchor = GridBagConstraints.WEST; ++row; // Now add guiPanel to filePumpGuiFrame gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 100; gbc.weighty = 100; gbc.insets = new Insets(0, 0, 0, 0); Utility.add(filePumpGuiFrame, guiPanel, framegbl, gbc, 0, 0, 1, 1); // Add menu JMenuBar menuBar = createMenu(); filePumpGuiFrame.setJMenuBar(menuBar); // Display the window. filePumpGuiFrame.pack(); filePumpGuiFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); filePumpGuiFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { exit(); } }); // Create a settings dialog box pumpSettings = new FilePumpSettings(filePumpGuiFrame, default_outputFolderI, default_filesPerSecI, default_totNumFilesI, default_modeI, default_ftpHostI, default_ftpUserI, default_ftpPasswordI); // Initialize information displayed on the GUI front panel updateMainFrame(); filePumpGuiFrame.setVisible(true); }