List of usage examples for java.awt GridBagConstraints WEST
int WEST
To view the source code for java.awt GridBagConstraints WEST.
Click Source Link
From source file:org.pentaho.mondrian.publish.RepositoryLoginDialog.java
private JPanel buildPublishSettingsPanel(String jndiName, boolean enableXmla) { JPanel publishSettingsPanel = new JPanel(new GridBagLayout()); publishSettingsPanel.setBorder(BorderFactory .createTitledBorder(Messages.getString("PublishToServerCommand.PublishSettingsTitle"))); //$NON-NLS-1$ GridBagConstraints c = new GridBagConstraints(); c.insets = new Insets(5, 5, 0, 5); c.gridwidth = 2;/* ww w. j a v a2 s . com*/ c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; publishSettingsPanel.add(new JLabel(Messages.getString("PublishToServerCommand.DatasourceLabel")), c); //$NON-NLS-1$ c.insets = new Insets(5, 5, 5, 0); c.gridwidth = 1; c.gridx = 0; c.gridy = 1; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; c.weightx = 1.0; jndiDataSourceName.setText(jndiName); publishSettingsPanel.add(jndiDataSourceName, c); enableXmlaCheckBox.setSelected(enableXmla); c.gridwidth = 2; c.insets = new Insets(5, 5, 5, 5); c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; c.gridx = 0; c.gridy = 2; c.weightx = 1.0; publishSettingsPanel.add(enableXmlaCheckBox, c); c.weightx = 0.0; c.insets = new Insets(5, 5, 5, 5); c.gridx = 0; c.gridy = 3; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; getContentPane().add(publishSettingsPanel, c); return publishSettingsPanel; }
From source file:fxts.stations.ui.SideLayout.java
/** * Adjusts the x, y, width, and height fields to the correct * values depending on the constraint geometry and pads. * * @param aConstraints the constraints to be applied * @param aRectangle the <code>Rectangle</code> to be adjusted *///ww w. ja va 2 s. c o m protected void adjustForGravity(SideConstraints aConstraints, Rectangle aRectangle) { int diffx, diffy; if (!mRightToLeft) { aRectangle.x += aConstraints.insets.left; } else { aRectangle.x -= aRectangle.width - aConstraints.insets.right; } aRectangle.width -= aConstraints.insets.left + aConstraints.insets.right; aRectangle.y += aConstraints.insets.top; aRectangle.height -= aConstraints.insets.top + aConstraints.insets.bottom; diffx = 0; if (aConstraints.fill != SideConstraints.HORIZONTAL && aConstraints.fill != SideConstraints.BOTH && aRectangle.width > aConstraints.minWidth + aConstraints.ipadx) { diffx = aRectangle.width - (aConstraints.minWidth + aConstraints.ipadx); aRectangle.width = aConstraints.minWidth + aConstraints.ipadx; } diffy = 0; if (aConstraints.fill != SideConstraints.VERTICAL && aConstraints.fill != SideConstraints.BOTH && aRectangle.height > aConstraints.minHeight + aConstraints.ipady) { diffy = aRectangle.height - (aConstraints.minHeight + aConstraints.ipady); aRectangle.height = aConstraints.minHeight + aConstraints.ipady; } switch (aConstraints.anchor) { case GridBagConstraints.CENTER: aRectangle.x += diffx / 2; aRectangle.y += diffy / 2; break; case SideConstraints.PAGE_START: case GridBagConstraints.NORTH: aRectangle.x += diffx / 2; break; case GridBagConstraints.NORTHEAST: aRectangle.x += diffx; break; case GridBagConstraints.EAST: aRectangle.x += diffx; aRectangle.y += diffy / 2; break; case GridBagConstraints.SOUTHEAST: aRectangle.x += diffx; aRectangle.y += diffy; break; case SideConstraints.PAGE_END: case GridBagConstraints.SOUTH: aRectangle.x += diffx / 2; aRectangle.y += diffy; break; case GridBagConstraints.SOUTHWEST: aRectangle.y += diffy; break; case GridBagConstraints.WEST: aRectangle.y += diffy / 2; break; case GridBagConstraints.NORTHWEST: break; case SideConstraints.LINE_START: if (mRightToLeft) { aRectangle.x += diffx; } aRectangle.y += diffy / 2; break; case SideConstraints.LINE_END: if (!mRightToLeft) { aRectangle.x += diffx; } aRectangle.y += diffy / 2; break; case SideConstraints.FIRST_LINE_START: if (mRightToLeft) { aRectangle.x += diffx; } break; case SideConstraints.FIRST_LINE_END: if (!mRightToLeft) { aRectangle.x += diffx; } break; case SideConstraints.LAST_LINE_START: if (mRightToLeft) { aRectangle.x += diffx; } aRectangle.y += diffy; break; case SideConstraints.LAST_LINE_END: if (!mRightToLeft) { aRectangle.x += diffx; } aRectangle.y += diffy; break; default: throw new IllegalArgumentException("illegal anchor value"); } }
From source file:org.jets3t.gui.ItemPropertiesDialog.java
/** * Initialise the GUI elements to display the given item. * * @param s3Item/* w w w. j a v a2 s . c o m*/ * the S3Bucket or an S3Object whose details will be displayed */ private void initGui(boolean isObjectBased) { // Initialise skins factory. skinsFactory = SkinsFactory.getInstance(applicationProperties); // Set Skinned Look and Feel. LookAndFeel lookAndFeel = skinsFactory.createSkinnedMetalTheme("SkinnedLookAndFeel"); try { UIManager.setLookAndFeel(lookAndFeel); } catch (UnsupportedLookAndFeelException e) { log.error("Unable to set skinned LookAndFeel", e); } this.setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); JPanel commonPropertiesContainer = skinsFactory.createSkinnedJPanel("ItemPropertiesCommonPanel"); commonPropertiesContainer.setLayout(new GridBagLayout()); JPanel metadataContainer = skinsFactory.createSkinnedJPanel("ItemPropertiesMetadataPanel"); metadataContainer.setLayout(new GridBagLayout()); JPanel grantsContainer = skinsFactory.createSkinnedJPanel("ItemPropertiesGrantsPanel"); grantsContainer.setLayout(new GridBagLayout()); if (!isObjectBased) { // Display bucket details. JLabel bucketNameLabel = skinsFactory.createSkinnedJHtmlLabel("BucketNameLabel"); bucketNameLabel.setText("Bucket name:"); bucketNameTextField = skinsFactory.createSkinnedJTextField("BucketNameTextField"); bucketNameTextField.setEditable(false); JLabel bucketLocationLabel = skinsFactory.createSkinnedJHtmlLabel("BucketLocationLabel"); bucketLocationLabel.setText("Location:"); bucketLocationTextField = skinsFactory.createSkinnedJTextField("BucketLocationTextField"); bucketLocationTextField.setEditable(false); JLabel bucketCreationDateLabel = skinsFactory.createSkinnedJHtmlLabel("BucketCreationDateLabel"); bucketCreationDateLabel.setText("Creation date:"); bucketCreationDateTextField = skinsFactory.createSkinnedJTextField("BucketCreationDateTextField"); bucketCreationDateTextField.setEditable(false); ownerNameLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerNameLabel"); ownerNameLabel.setText("Owner name:"); ownerNameTextField = skinsFactory.createSkinnedJTextField("OwnerNameTextField"); ownerNameTextField.setEditable(false); ownerIdLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerIdLabel"); ownerIdLabel.setText("Owner ID:"); ownerIdTextField = skinsFactory.createSkinnedJTextField("OwnerIdTextField"); ownerIdTextField.setEditable(false); bucketIsRequesterPaysLabel = skinsFactory.createSkinnedJHtmlLabel("BucketIsRequesterPaysLabel"); bucketIsRequesterPaysLabel.setText("Requester Pays?"); bucketIsRequesterPaysCheckBox = skinsFactory.createSkinnedJCheckBox("BucketIsRequesterPaysCheckBox"); bucketIsRequesterPaysCheckBox.setEnabled(false); int row = 0; commonPropertiesContainer.add(bucketNameLabel, new GridBagConstraints(0, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketNameTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketLocationLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketLocationTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketCreationDateLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketCreationDateTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketIsRequesterPaysLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketIsRequesterPaysCheckBox, new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); } else { // Display object details. JLabel objectKeyLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectKeyLabel"); objectKeyLabel.setText("Object key:"); objectKeyTextField = skinsFactory.createSkinnedJTextField("ObjectKeyTextField"); objectKeyTextField.setEditable(false); JLabel objectContentTypeLabel = skinsFactory.createSkinnedJHtmlLabel("ContentTypeLabel"); objectContentTypeLabel.setText("Content type:"); objectContentTypeTextField = skinsFactory.createSkinnedJTextField("ContentTypeTextField"); objectContentTypeTextField.setEditable(false); JLabel objectContentLengthLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectContentLengthLabel"); objectContentLengthLabel.setText("Size:"); objectContentLengthTextField = skinsFactory.createSkinnedJTextField("ObjectContentLengthTextField"); objectContentLengthTextField.setEditable(false); JLabel objectLastModifiedLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectLastModifiedLabel"); objectLastModifiedLabel.setText("Last modified:"); objectLastModifiedTextField = skinsFactory.createSkinnedJTextField("ObjectLastModifiedTextField"); objectLastModifiedTextField.setEditable(false); JLabel objectETagLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectETagLabel"); objectETagLabel.setText("ETag:"); objectETagTextField = skinsFactory.createSkinnedJTextField("ObjectETagTextField"); objectETagTextField.setEditable(false); JLabel bucketNameLabel = skinsFactory.createSkinnedJHtmlLabel("BucketNameLabel"); bucketNameLabel.setText("Bucket name:"); bucketNameTextField = skinsFactory.createSkinnedJTextField("BucketNameTextField"); bucketNameTextField.setEditable(false); ownerNameLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerNameLabel"); ownerNameLabel.setText("Owner name:"); ownerNameTextField = skinsFactory.createSkinnedJTextField("OwnerNameTextField"); ownerNameTextField.setEditable(false); ownerIdLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerIdLabel"); ownerIdLabel.setText("Owner ID:"); ownerIdTextField = skinsFactory.createSkinnedJTextField("OwnerIdTextField"); ownerIdTextField.setEditable(false); commonPropertiesContainer.add(objectKeyLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectKeyTextField, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentTypeLabel, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentTypeTextField, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentLengthLabel, new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentLengthTextField, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectLastModifiedLabel, new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectLastModifiedTextField, new GridBagConstraints(1, 3, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectETagLabel, new GridBagConstraints(0, 4, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectETagTextField, new GridBagConstraints(1, 4, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketNameLabel, new GridBagConstraints(0, 5, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketNameTextField, new GridBagConstraints(1, 5, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameLabel, new GridBagConstraints(0, 7, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameTextField, new GridBagConstraints(1, 7, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdLabel, new GridBagConstraints(0, 8, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdTextField, new GridBagConstraints(1, 8, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); // Build metadata table. objectMetadataTableModel = new DefaultTableModel(new Object[] { "Name", "Value" }, 0) { private static final long serialVersionUID = -3762866886166776851L; @Override public boolean isCellEditable(int row, int column) { return false; } }; TableSorter metadataTableSorter = new TableSorter(objectMetadataTableModel); JTable metadataTable = skinsFactory.createSkinnedJTable("MetadataTable"); metadataTable.setModel(metadataTableSorter); metadataTableSorter.setTableHeader(metadataTable.getTableHeader()); metadataContainer.add(new JScrollPane(metadataTable), new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); } // Build grants table. grantsTableModel = new DefaultTableModel(new Object[] { "Grantee", "Permission" }, 0) { private static final long serialVersionUID = -5882427163845726770L; @Override public boolean isCellEditable(int row, int column) { return false; } }; TableSorter grantsTableSorter = new TableSorter(grantsTableModel); grantsTable = skinsFactory.createSkinnedJTable("GrantsTable"); grantsTable.setModel(grantsTableSorter); grantsTableSorter.setTableHeader(grantsTable.getTableHeader()); grantsContainer.add(new JScrollPane(grantsTable), new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); // OK Button. JButton okButton = skinsFactory.createSkinnedJButton("ItemPropertiesOKButton"); okButton.setText("Finished"); okButton.setActionCommand("OK"); okButton.addActionListener(this); // Set default ENTER button. this.getRootPane().setDefaultButton(okButton); // Put it all together. int row = 0; JPanel container = skinsFactory.createSkinnedJPanel("ItemPropertiesPanel"); container.setLayout(new GridBagLayout()); container.add(commonPropertiesContainer, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); if (isObjectBased) { if (includeMetadata) { JHtmlLabel metadataLabel = skinsFactory.createSkinnedJHtmlLabel("MetadataLabel"); metadataLabel.setText("<html><b>Metadata</b></html>"); metadataLabel.setHorizontalAlignment(JLabel.CENTER); container.add(metadataLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsVerticalSpace, 0, 0)); container.add(metadataContainer, new GridBagConstraints(0, row++, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); } // Object previous and next buttons, if we have multiple objects. previousObjectButton = skinsFactory.createSkinnedJButton("ItemPropertiesPreviousButton"); previousObjectButton.setText("Previous"); previousObjectButton.addActionListener(this); previousObjectButton.setEnabled(false); nextObjectButton = skinsFactory.createSkinnedJButton("ItemPropertiesNextButton"); nextObjectButton.setText("Next"); nextObjectButton.addActionListener(this); nextObjectButton.setEnabled(false); currentObjectLabel = skinsFactory.createSkinnedJHtmlLabel("ItemPropertiesCurrentObjectLabel"); currentObjectLabel.setHorizontalAlignment(JLabel.CENTER); nextPreviousPanel = skinsFactory.createSkinnedJPanel("ItemPropertiesNextPreviousPanel"); nextPreviousPanel.setLayout(new GridBagLayout()); nextPreviousPanel.add(previousObjectButton, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0)); nextPreviousPanel.add(currentObjectLabel, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); nextPreviousPanel.add(nextObjectButton, new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsZero, 0, 0)); container.add(nextPreviousPanel, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); row++; } else { JHtmlLabel grantsLabel = skinsFactory.createSkinnedJHtmlLabel("GrantsLabel"); grantsLabel.setText("<html><b>Permissions</b></html>"); grantsLabel.setHorizontalAlignment(JLabel.CENTER); container.add(grantsLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsVerticalSpace, 0, 0)); container.add(grantsContainer, new GridBagConstraints(0, row++, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); } container.add(okButton, new GridBagConstraints(0, row++, 3, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsZero, 0, 0)); this.getContentPane().add(container); this.pack(); if (isObjectBased) { this.setSize(400, (includeMetadata ? 550 : 400)); } this.setLocationRelativeTo(this.getOwner()); }
From source file:ca.uhn.hl7v2.testpanel.ui.conn.Hl7ConnectionPanel.java
/** * Create the panel.//from w ww . j a va2s .c o m */ public Hl7ConnectionPanel(Controller theController) { setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[] { 150, 0 }; gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; gridBagLayout.columnWeights = new double[] { 0.0, 1.0 }; gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; setLayout(gridBagLayout); mySinglePortRadio = new JRadioButton("Single Port MLLP"); mySinglePortRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(mySinglePortRadio); GridBagConstraints gbc_SinglePortRadio = new GridBagConstraints(); gbc_SinglePortRadio.anchor = GridBagConstraints.WEST; gbc_SinglePortRadio.insets = new Insets(0, 0, 5, 5); gbc_SinglePortRadio.gridx = 0; gbc_SinglePortRadio.gridy = 0; add(mySinglePortRadio, gbc_SinglePortRadio); JPanel panel_4 = new JPanel(); panel_4.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_4 = new GridBagConstraints(); gbc_panel_4.fill = GridBagConstraints.BOTH; gbc_panel_4.insets = new Insets(0, 0, 5, 0); gbc_panel_4.gridx = 1; gbc_panel_4.gridy = 0; add(panel_4, gbc_panel_4); GridBagLayout gbl_panel_4 = new GridBagLayout(); gbl_panel_4.columnWidths = new int[] { 0, 0, 0 }; gbl_panel_4.rowHeights = new int[] { 0, 0 }; gbl_panel_4.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_panel_4.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_4.setLayout(gbl_panel_4); mySinglePortTextBox = new JTextField(); mySinglePortTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = mySinglePortTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(mySinglePortTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { mySinglePortTextBox.setText(newVal); } }); } if (mySinglePortRadio.isSelected()) { if (text.length() > 0) { myConnection.setIncomingOrSinglePort(Integer.parseInt(text)); } else { myConnection.setIncomingOrSinglePort(-1); } } } }); mylabel = new JLabel("Port"); mylabel.setHorizontalAlignment(SwingConstants.CENTER); mylabel.setPreferredSize(new Dimension(60, 16)); mylabel.setMinimumSize(new Dimension(60, 16)); mylabel.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_label = new GridBagConstraints(); gbc_label.anchor = GridBagConstraints.EAST; gbc_label.insets = new Insets(0, 0, 0, 5); gbc_label.gridx = 0; gbc_label.gridy = 0; panel_4.add(mylabel, gbc_label); GridBagConstraints gbc_SinglePortTextBox = new GridBagConstraints(); gbc_SinglePortTextBox.insets = new Insets(0, 5, 0, 0); gbc_SinglePortTextBox.anchor = GridBagConstraints.WEST; gbc_SinglePortTextBox.gridx = 1; gbc_SinglePortTextBox.gridy = 0; panel_4.add(mySinglePortTextBox, gbc_SinglePortTextBox); mySinglePortTextBox.setMinimumSize(new Dimension(100, 28)); mySinglePortTextBox.setMaximumSize(new Dimension(100, 2147483647)); mySinglePortTextBox.setColumns(10); myDualPortRadio = new JRadioButton("Dual Port MLLP"); myDualPortRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(myDualPortRadio); GridBagConstraints gbc_DualPortRadio = new GridBagConstraints(); gbc_DualPortRadio.anchor = GridBagConstraints.WEST; gbc_DualPortRadio.insets = new Insets(0, 0, 5, 5); gbc_DualPortRadio.gridx = 0; gbc_DualPortRadio.gridy = 1; add(myDualPortRadio, gbc_DualPortRadio); JPanel panel = new JPanel(); panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_BottomPanel = new GridBagConstraints(); gbc_BottomPanel.insets = new Insets(0, 0, 5, 0); gbc_BottomPanel.fill = GridBagConstraints.BOTH; gbc_BottomPanel.gridx = 1; gbc_BottomPanel.gridy = 1; add(panel, gbc_BottomPanel); GridBagLayout gbl_panel = new GridBagLayout(); gbl_panel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0 }; gbl_panel.rowHeights = new int[] { 0, 0 }; gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel.setLayout(gbl_panel); JLabel lblInbound = new JLabel("Inbound"); lblInbound.setHorizontalAlignment(SwingConstants.CENTER); lblInbound.setPreferredSize(new Dimension(60, 16)); lblInbound.setMinimumSize(new Dimension(60, 16)); lblInbound.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_lblInbound = new GridBagConstraints(); gbc_lblInbound.insets = new Insets(0, 5, 0, 5); gbc_lblInbound.anchor = GridBagConstraints.EAST; gbc_lblInbound.gridx = 0; gbc_lblInbound.gridy = 0; panel.add(lblInbound, gbc_lblInbound); myDualIncomingTextBox = new JTextField(); myDualIncomingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myDualIncomingTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(myDualIncomingTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { myDualIncomingTextBox.setText(newVal); } }); } if (myDualPortRadio.isSelected()) { if (text.length() > 0) { myConnection.setIncomingOrSinglePort(Integer.parseInt(text)); } else { myConnection.setIncomingOrSinglePort(-1); } } } }); myDualIncomingTextBox.setMaximumSize(new Dimension(100, 2147483647)); myDualIncomingTextBox.setMinimumSize(new Dimension(100, 28)); GridBagConstraints gbc_DualIncomingTextBox = new GridBagConstraints(); gbc_DualIncomingTextBox.anchor = GridBagConstraints.WEST; gbc_DualIncomingTextBox.insets = new Insets(0, 0, 0, 5); gbc_DualIncomingTextBox.gridx = 1; gbc_DualIncomingTextBox.gridy = 0; panel.add(myDualIncomingTextBox, gbc_DualIncomingTextBox); myDualIncomingTextBox.setColumns(10); JLabel lblOutbound = new JLabel("Outbound"); GridBagConstraints gbc_lblOutbound = new GridBagConstraints(); gbc_lblOutbound.anchor = GridBagConstraints.EAST; gbc_lblOutbound.insets = new Insets(0, 0, 0, 5); gbc_lblOutbound.gridx = 2; gbc_lblOutbound.gridy = 0; panel.add(lblOutbound, gbc_lblOutbound); myDualOutgoingTextBox = new JTextField(); myDualOutgoingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myDualOutgoingTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(myDualOutgoingTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { myDualOutgoingTextBox.setText(newVal); } }); } if (myDualPortRadio.isSelected()) { if (text.length() > 0) { myConnection.setOutgoingPort(Integer.parseInt(text)); } else { myConnection.setOutgoingPort(-1); } } } }); myDualOutgoingTextBox.setMinimumSize(new Dimension(100, 28)); myDualOutgoingTextBox.setMaximumSize(new Dimension(100, 2147483647)); GridBagConstraints gbc_DualOutgoingTextBox = new GridBagConstraints(); gbc_DualOutgoingTextBox.insets = new Insets(0, 0, 0, 5); gbc_DualOutgoingTextBox.anchor = GridBagConstraints.WEST; gbc_DualOutgoingTextBox.gridx = 3; gbc_DualOutgoingTextBox.gridy = 0; panel.add(myDualOutgoingTextBox, gbc_DualOutgoingTextBox); myDualOutgoingTextBox.setColumns(10); myHl7OverHttpRadioButton = new JRadioButton("HL7 over HTTP"); myHl7OverHttpRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(myHl7OverHttpRadioButton); GridBagConstraints gbc_Hl7OverHttpRadioButton = new GridBagConstraints(); gbc_Hl7OverHttpRadioButton.anchor = GridBagConstraints.WEST; gbc_Hl7OverHttpRadioButton.insets = new Insets(0, 0, 5, 5); gbc_Hl7OverHttpRadioButton.gridx = 0; gbc_Hl7OverHttpRadioButton.gridy = 2; add(myHl7OverHttpRadioButton, gbc_Hl7OverHttpRadioButton); mypanel = new JPanel(); mypanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel = new GridBagConstraints(); gbc_panel.insets = new Insets(0, 0, 5, 0); gbc_panel.fill = GridBagConstraints.BOTH; gbc_panel.gridx = 1; gbc_panel.gridy = 2; add(mypanel, gbc_panel); GridBagLayout gbl_panel2 = new GridBagLayout(); gbl_panel2.columnWidths = new int[] { 0, 0 }; gbl_panel2.rowHeights = new int[] { 0, 0 }; gbl_panel2.columnWeights = new double[] { 0.0, 1.0 }; gbl_panel2.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel.setLayout(gbl_panel2); mylabel_1 = new JLabel("URL"); mylabel_1.setHorizontalAlignment(SwingConstants.CENTER); mylabel_1.setPreferredSize(new Dimension(60, 16)); mylabel_1.setMinimumSize(new Dimension(60, 16)); mylabel_1.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_label_1 = new GridBagConstraints(); gbc_label_1.anchor = GridBagConstraints.EAST; gbc_label_1.insets = new Insets(0, 0, 0, 5); gbc_label_1.gridx = 0; gbc_label_1.gridy = 0; mypanel.add(mylabel_1, gbc_label_1); myHoHUrlTextField = new JTextField(); myHoHUrlTextField.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { if (myHohUrlTextFieldUpdating) { return; } String value = myHoHUrlTextField.getText(); try { URL url = new URL(value); boolean tls; if (url.getProtocol().equals("http")) { tls = false; } else if (url.getProtocol().equals("https")) { tls = true; } else { ourLog.info("Unknown protocol: {}", url.getProtocol()); myHoHUrlTextField.setBackground(ERROR_BG); return; } myConnection.setTls(tls); myConnection.setHost(url.getHost()); myConnection .setIncomingOrSinglePort(url.getPort() != -1 ? url.getPort() : url.getDefaultPort()); myConnection.setHttpUriPath(url.getPath()); myHohUrlTextFieldUpdating = true; updatePortsUi(); myHohUrlTextFieldUpdating = false; myTlsCheckbox.setSelected(tls); myHohTlsCheckbox.setSelected(tls); myHoHUrlTextField.setBackground(Color.white); } catch (MalformedURLException e) { myHoHUrlTextField.setBackground(ERROR_BG); } } }); GridBagConstraints gbc_HohUsernameTextbox = new GridBagConstraints(); gbc_HohUsernameTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohUsernameTextbox.gridx = 1; gbc_HohUsernameTextbox.gridy = 0; mypanel.add(myHoHUrlTextField, gbc_HohUsernameTextbox); myHoHUrlTextField.setColumns(10); JLabel lblEncoding = new JLabel("Encoding"); GridBagConstraints gbc_lblEncoding = new GridBagConstraints(); gbc_lblEncoding.insets = new Insets(0, 0, 5, 5); gbc_lblEncoding.gridx = 0; gbc_lblEncoding.gridy = 3; add(lblEncoding, gbc_lblEncoding); JPanel encodingPanel = new JPanel(); GridBagConstraints gbc_encodingPanel = new GridBagConstraints(); gbc_encodingPanel.fill = GridBagConstraints.HORIZONTAL; gbc_encodingPanel.insets = new Insets(0, 0, 5, 0); gbc_encodingPanel.gridx = 1; gbc_encodingPanel.gridy = 3; add(encodingPanel, gbc_encodingPanel); encodingPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_encodingPanel = new GridBagLayout(); gbl_encodingPanel.columnWidths = new int[] { 144, 58, 0 }; gbl_encodingPanel.rowHeights = new int[] { 23, 0 }; gbl_encodingPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; gbl_encodingPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; encodingPanel.setLayout(gbl_encodingPanel); myXmlRadio = new JRadioButton("XML"); myXmlRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent theE) { updateEncodingModel(); } }); myEr7Radio = new JRadioButton("ER7 (Pipe and hat)"); myEr7Radio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateEncodingModel(); } }); encodingButtonGroup.add(myEr7Radio); GridBagConstraints gbc_Er7Radio = new GridBagConstraints(); gbc_Er7Radio.anchor = GridBagConstraints.NORTHWEST; gbc_Er7Radio.insets = new Insets(0, 0, 0, 5); gbc_Er7Radio.gridx = 0; gbc_Er7Radio.gridy = 0; encodingPanel.add(myEr7Radio, gbc_Er7Radio); encodingButtonGroup.add(myXmlRadio); GridBagConstraints gbc_XmlRadio = new GridBagConstraints(); gbc_XmlRadio.anchor = GridBagConstraints.NORTHWEST; gbc_XmlRadio.gridx = 1; gbc_XmlRadio.gridy = 0; encodingPanel.add(myXmlRadio, gbc_XmlRadio); JLabel lblCharset = new JLabel("Charset"); GridBagConstraints gbc_lblCharset = new GridBagConstraints(); gbc_lblCharset.insets = new Insets(0, 0, 5, 5); gbc_lblCharset.gridx = 0; gbc_lblCharset.gridy = 4; add(lblCharset, gbc_lblCharset); JPanel panel_2 = new JPanel(); GridBagConstraints gbc_panel_2 = new GridBagConstraints(); gbc_panel_2.fill = GridBagConstraints.HORIZONTAL; gbc_panel_2.insets = new Insets(0, 0, 5, 0); gbc_panel_2.gridx = 1; gbc_panel_2.gridy = 4; add(panel_2, gbc_panel_2); panel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_panel_2 = new GridBagLayout(); gbl_panel_2.columnWidths = new int[] { 28, 198, 0, 0 }; gbl_panel_2.rowHeights = new int[] { 27, 0 }; gbl_panel_2.columnWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel_2.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_2.setLayout(gbl_panel_2); myCharsetSelectRadio = new JRadioButton(""); myCharsetSelectRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); charsetButtonGroup.add(myCharsetSelectRadio); GridBagConstraints gbc_CharsetSelectRadio = new GridBagConstraints(); gbc_CharsetSelectRadio.anchor = GridBagConstraints.WEST; gbc_CharsetSelectRadio.insets = new Insets(0, 0, 0, 5); gbc_CharsetSelectRadio.gridx = 0; gbc_CharsetSelectRadio.gridy = 0; panel_2.add(myCharsetSelectRadio, gbc_CharsetSelectRadio); myCharsetCombo = new JComboBox(); myCharsetCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); GridBagConstraints gbc_CharsetCombo = new GridBagConstraints(); gbc_CharsetCombo.anchor = GridBagConstraints.NORTHWEST; gbc_CharsetCombo.insets = new Insets(0, 0, 0, 5); gbc_CharsetCombo.gridx = 1; gbc_CharsetCombo.gridy = 0; panel_2.add(myCharsetCombo, gbc_CharsetCombo); myCharsetDetectRadio = new JRadioButton("Detect in Message (MSH-18)"); myCharsetDetectRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); charsetButtonGroup.add(myCharsetDetectRadio); GridBagConstraints gbc_CharsetDetectRadio = new GridBagConstraints(); gbc_CharsetDetectRadio.anchor = GridBagConstraints.NORTH; gbc_CharsetDetectRadio.gridwidth = 2; gbc_CharsetDetectRadio.gridx = 2; gbc_CharsetDetectRadio.gridy = 0; panel_2.add(myCharsetDetectRadio, gbc_CharsetDetectRadio); mylabel_5 = new JLabel("Debug"); GridBagConstraints gbc_label_5 = new GridBagConstraints(); gbc_label_5.insets = new Insets(0, 0, 5, 5); gbc_label_5.gridx = 0; gbc_label_5.gridy = 5; add(mylabel_5, gbc_label_5); mypanel_2 = new JPanel(); mypanel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_75 = new GridBagConstraints(); gbc_panel_75.insets = new Insets(0, 0, 5, 0); gbc_panel_75.fill = GridBagConstraints.BOTH; gbc_panel_75.gridx = 1; gbc_panel_75.gridy = 5; add(mypanel_2, gbc_panel_75); GridBagLayout gbl_panel_74 = new GridBagLayout(); gbl_panel_74.columnWidths = new int[] { 0, 0 }; gbl_panel_74.rowHeights = new int[] { 0, 0 }; gbl_panel_74.columnWeights = new double[] { 0.0, Double.MIN_VALUE }; gbl_panel_74.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel_2.setLayout(gbl_panel_74); myCaptureByteStreamCheckbox = new JCheckBox("Capture Bytes"); GridBagConstraints gbc_CaptureByteStreamCheckbox = new GridBagConstraints(); gbc_CaptureByteStreamCheckbox.gridx = 0; gbc_CaptureByteStreamCheckbox.gridy = 0; mypanel_2.add(myCaptureByteStreamCheckbox, gbc_CaptureByteStreamCheckbox); myCaptureByteStreamCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myConnection.setCaptureBytes(myCaptureByteStreamCheckbox.isSelected()); } }); myCaptureByteStreamCheckbox.setToolTipText("Check this box to capture the transport level communication"); myInterfaceTypeCardPanel = new JPanel(); myInterfaceTypeCardPanel.setBorder(null); GridBagConstraints gbc_InterfaceTypeCardPanel = new GridBagConstraints(); gbc_InterfaceTypeCardPanel.gridwidth = 2; gbc_InterfaceTypeCardPanel.fill = GridBagConstraints.BOTH; gbc_InterfaceTypeCardPanel.gridx = 0; gbc_InterfaceTypeCardPanel.gridy = 6; add(myInterfaceTypeCardPanel, gbc_InterfaceTypeCardPanel); myInterfaceTypeCardPanel.setLayout(new CardLayout(0, 0)); myMllpCard = new JPanel(); myMllpCard.setBorder(null); myInterfaceTypeCardPanel.add(myMllpCard, IFACE_TYPE_CARD_MLLP); GridBagLayout gbl_MllpCard = new GridBagLayout(); gbl_MllpCard.columnWidths = new int[] { 150, 0, 0 }; gbl_MllpCard.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_MllpCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_MllpCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; myMllpCard.setLayout(gbl_MllpCard); JLabel lblHost = new JLabel("Host"); GridBagConstraints gbc_lblHost = new GridBagConstraints(); gbc_lblHost.insets = new Insets(0, 0, 5, 5); gbc_lblHost.gridx = 0; gbc_lblHost.gridy = 0; myMllpCard.add(lblHost, gbc_lblHost); mypanel_1 = new JPanel(); mypanel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_1 = new GridBagConstraints(); gbc_panel_1.insets = new Insets(0, 0, 5, 0); gbc_panel_1.fill = GridBagConstraints.BOTH; gbc_panel_1.gridx = 1; gbc_panel_1.gridy = 0; myMllpCard.add(mypanel_1, gbc_panel_1); GridBagLayout gbl_panel_1 = new GridBagLayout(); gbl_panel_1.columnWidths = new int[] { 134, 0 }; gbl_panel_1.rowHeights = new int[] { 28, 0 }; gbl_panel_1.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_panel_1.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel_1.setLayout(gbl_panel_1); myHostBox = new JTextField(); GridBagConstraints gbc_HostBox = new GridBagConstraints(); gbc_HostBox.fill = GridBagConstraints.HORIZONTAL; gbc_HostBox.anchor = GridBagConstraints.NORTH; gbc_HostBox.gridx = 0; gbc_HostBox.gridy = 0; mypanel_1.add(myHostBox, gbc_HostBox); myHostBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHost(myHostBox.getText()); } }); myHostBox.setColumns(10); JLabel lblTransport = new JLabel("Transport"); GridBagConstraints gbc_lblTransport = new GridBagConstraints(); gbc_lblTransport.insets = new Insets(0, 0, 5, 5); gbc_lblTransport.gridx = 0; gbc_lblTransport.gridy = 1; myMllpCard.add(lblTransport, gbc_lblTransport); JPanel panel_3 = new JPanel(); GridBagConstraints gbc_hohAuthPanel = new GridBagConstraints(); gbc_hohAuthPanel.fill = GridBagConstraints.HORIZONTAL; gbc_hohAuthPanel.insets = new Insets(0, 0, 5, 0); gbc_hohAuthPanel.gridx = 1; gbc_hohAuthPanel.gridy = 1; myMllpCard.add(panel_3, gbc_hohAuthPanel); panel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_hohAuthPanel = new GridBagLayout(); gbl_hohAuthPanel.columnWidths = new int[] { 0, 0, 0 }; gbl_hohAuthPanel.rowHeights = new int[] { 0, 0 }; gbl_hohAuthPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; gbl_hohAuthPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_3.setLayout(gbl_hohAuthPanel); myTlsCheckbox = new JCheckBox("Use TLS/SSL"); myTlsCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myHohTlsCheckbox.setSelected(myTlsCheckbox.isSelected()); myConnection.setTls(myTlsCheckbox.isSelected()); } }); GridBagConstraints gbc_TlsCheckbox = new GridBagConstraints(); gbc_TlsCheckbox.insets = new Insets(0, 0, 0, 5); gbc_TlsCheckbox.anchor = GridBagConstraints.WEST; gbc_TlsCheckbox.gridx = 0; gbc_TlsCheckbox.gridy = 0; panel_3.add(myTlsCheckbox, gbc_TlsCheckbox); myHoHCard = new JPanel(); myInterfaceTypeCardPanel.add(myHoHCard, IFACE_TYPE_CARD_HOH); GridBagLayout gbl_HoHCard = new GridBagLayout(); gbl_HoHCard.columnWidths = new int[] { 150, 0, 0 }; gbl_HoHCard.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_HoHCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_HoHCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; myHoHCard.setLayout(gbl_HoHCard); mylabel_6 = new JLabel("Authorization"); GridBagConstraints gbc_label_6 = new GridBagConstraints(); gbc_label_6.insets = new Insets(0, 0, 5, 5); gbc_label_6.gridx = 0; gbc_label_6.gridy = 0; myHoHCard.add(mylabel_6, gbc_label_6); hohAuthPanel = new JPanel(); hohAuthPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_hohAuthPanel2 = new GridBagConstraints(); gbc_hohAuthPanel2.insets = new Insets(0, 0, 5, 0); gbc_hohAuthPanel2.fill = GridBagConstraints.BOTH; gbc_hohAuthPanel2.gridx = 1; gbc_hohAuthPanel2.gridy = 0; myHoHCard.add(hohAuthPanel, gbc_hohAuthPanel2); GridBagLayout gbl_hohAuthPanel3 = new GridBagLayout(); gbl_hohAuthPanel3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0 }; gbl_hohAuthPanel3.rowHeights = new int[] { 0, 0 }; gbl_hohAuthPanel3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; gbl_hohAuthPanel3.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; hohAuthPanel.setLayout(gbl_hohAuthPanel3); myHohAuthEnabledCheckbox = new JCheckBox("Enabled"); myHohAuthEnabledCheckbox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { myConnection.setHohAuthenticationEnabled(myHohAuthEnabledCheckbox.isSelected()); } }); GridBagConstraints gbc_HohAuthEnabledCheckbox = new GridBagConstraints(); gbc_HohAuthEnabledCheckbox.insets = new Insets(0, 0, 0, 5); gbc_HohAuthEnabledCheckbox.gridx = 0; gbc_HohAuthEnabledCheckbox.gridy = 0; hohAuthPanel.add(myHohAuthEnabledCheckbox, gbc_HohAuthEnabledCheckbox); mylabel_7 = new JLabel("Username:"); GridBagConstraints gbc_label_7 = new GridBagConstraints(); gbc_label_7.insets = new Insets(0, 0, 0, 5); gbc_label_7.anchor = GridBagConstraints.EAST; gbc_label_7.gridx = 1; gbc_label_7.gridy = 0; hohAuthPanel.add(mylabel_7, gbc_label_7); myHohAuthUsernameTextbox = new JTextField(); myHohAuthUsernameTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohAuthenticationUsername(myHohAuthUsernameTextbox.getText()); } }); myHohAuthUsernameTextbox.setMaximumSize(new Dimension(200, 2147483647)); myHohAuthUsernameTextbox.setMinimumSize(new Dimension(100, 28)); myHohAuthUsernameTextbox.setPreferredSize(new Dimension(100, 28)); GridBagConstraints gbc_HohUsernameTextbox2 = new GridBagConstraints(); gbc_HohUsernameTextbox2.insets = new Insets(0, 0, 0, 5); gbc_HohUsernameTextbox2.fill = GridBagConstraints.HORIZONTAL; gbc_HohUsernameTextbox2.gridx = 2; gbc_HohUsernameTextbox2.gridy = 0; hohAuthPanel.add(myHohAuthUsernameTextbox, gbc_HohUsernameTextbox2); myHohAuthUsernameTextbox.setColumns(10); mylabel_8 = new JLabel("Password:"); GridBagConstraints gbc_label_8 = new GridBagConstraints(); gbc_label_8.insets = new Insets(0, 0, 0, 5); gbc_label_8.anchor = GridBagConstraints.EAST; gbc_label_8.gridx = 3; gbc_label_8.gridy = 0; hohAuthPanel.add(mylabel_8, gbc_label_8); myHohAuthPasswordTextbox = new JTextField(); myHohAuthPasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohAuthenticationPassword(myHohAuthPasswordTextbox.getText()); } }); myHohAuthPasswordTextbox.setPreferredSize(new Dimension(100, 28)); myHohAuthPasswordTextbox.setMaximumSize(new Dimension(200, 2147483647)); myHohAuthPasswordTextbox.setMinimumSize(new Dimension(100, 28)); GridBagConstraints gbc_HohSignatureKeystoreTextbox = new GridBagConstraints(); gbc_HohSignatureKeystoreTextbox.insets = new Insets(0, 0, 0, 5); gbc_HohSignatureKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeystoreTextbox.gridx = 4; gbc_HohSignatureKeystoreTextbox.gridy = 0; hohAuthPanel.add(myHohAuthPasswordTextbox, gbc_HohSignatureKeystoreTextbox); myHohAuthPasswordTextbox.setColumns(10); mylabel_2 = new JLabel("Security Profile"); mylabel_2.setVerticalTextPosition(SwingConstants.TOP); mylabel_2.setVerticalAlignment(SwingConstants.TOP); GridBagConstraints gbc_label_2 = new GridBagConstraints(); gbc_label_2.insets = new Insets(0, 0, 5, 5); gbc_label_2.gridx = 0; gbc_label_2.gridy = 1; myHoHCard.add(mylabel_2, gbc_label_2); // securityProfilePanel = new JPanel(); GridBagConstraints gbc_securityProfilePanel = new GridBagConstraints(); gbc_securityProfilePanel.insets = new Insets(0, 0, 5, 0); gbc_securityProfilePanel.fill = GridBagConstraints.BOTH; gbc_securityProfilePanel.gridx = 1; gbc_securityProfilePanel.gridy = 1; // myHoHCard.add(securityProfilePanel, gbc_securityProfilePanel); // securityProfilePanel.setLayout(new BorderLayout(0, 0)); tlsKeystorePanel = new JPanel(); tlsKeystorePanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); // securityProfilePanel.add(tlsKeystorePanel, BorderLayout.CENTER); myHoHCard.add(tlsKeystorePanel, gbc_securityProfilePanel); GridBagLayout gbl_tlsKeystorePanel = new GridBagLayout(); gbl_tlsKeystorePanel.columnWidths = new int[] { 0, 58, 107, 77, 0, 0 }; gbl_tlsKeystorePanel.rowHeights = new int[] { 28, 16, 0, 0 }; gbl_tlsKeystorePanel.columnWeights = new double[] { 0.0, 0.0, 1.0, 1.0, 0.0, Double.MIN_VALUE }; gbl_tlsKeystorePanel.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; tlsKeystorePanel.setLayout(gbl_tlsKeystorePanel); myHohTlsCheckbox = new JCheckBox("TLS Enabled"); GridBagConstraints gbc_HohTlsCheckbox = new GridBagConstraints(); gbc_HohTlsCheckbox.gridheight = 2; gbc_HohTlsCheckbox.insets = new Insets(0, 0, 5, 5); gbc_HohTlsCheckbox.gridx = 0; gbc_HohTlsCheckbox.gridy = 0; tlsKeystorePanel.add(myHohTlsCheckbox, gbc_HohTlsCheckbox); myHohTlsCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myConnection.setTls(myHohTlsCheckbox.isSelected()); myTlsCheckbox.setSelected(myHohTlsCheckbox.isSelected()); updatePortsUi(); } }); mylabel_3 = new JLabel("Keystore:"); GridBagConstraints gbc_label_3 = new GridBagConstraints(); gbc_label_3.anchor = GridBagConstraints.WEST; gbc_label_3.fill = GridBagConstraints.VERTICAL; gbc_label_3.insets = new Insets(0, 0, 5, 5); gbc_label_3.gridx = 1; gbc_label_3.gridy = 0; tlsKeystorePanel.add(mylabel_3, gbc_label_3); myHohSecurityKeystoreTextbox = new JTextField(); GridBagConstraints gbc_HohKeystoreTextbox = new GridBagConstraints(); gbc_HohKeystoreTextbox.gridwidth = 2; gbc_HohKeystoreTextbox.anchor = GridBagConstraints.NORTH; gbc_HohKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohKeystoreTextbox.insets = new Insets(0, 0, 5, 5); gbc_HohKeystoreTextbox.gridx = 2; gbc_HohKeystoreTextbox.gridy = 0; tlsKeystorePanel.add(myHohSecurityKeystoreTextbox, gbc_HohKeystoreTextbox); myHohSecurityKeystoreTextbox.setColumns(10); myHohSecurityKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myHohSecurityKeystoreTextbox.getText(); myHohSecurityKeyPwTextBox.setEnabled(isNotBlank(text)); myConnection.setTlsKeystoreLocation(text); } }); myHohSecurityKeystoreChooseBtn = new JButton("Choose"); myHohSecurityKeystoreChooseBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Hl7ConnectionPanel.chooseKeystore(Hl7ConnectionPanel.this, myHohSecurityKeystoreTextbox); } }); myHohSecurityKeystoreChooseBtn.setIcon( new ImageIcon(Hl7ConnectionPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png"))); GridBagConstraints gbc_HohSignatureKeystoreChooseButton = new GridBagConstraints(); gbc_HohSignatureKeystoreChooseButton.insets = new Insets(0, 0, 5, 0); gbc_HohSignatureKeystoreChooseButton.gridx = 4; gbc_HohSignatureKeystoreChooseButton.gridy = 0; tlsKeystorePanel.add(myHohSecurityKeystoreChooseBtn, gbc_HohSignatureKeystoreChooseButton); mylabel_4 = new JLabel("Store Pass:"); GridBagConstraints gbc_label_4 = new GridBagConstraints(); gbc_label_4.insets = new Insets(0, 0, 0, 5); gbc_label_4.anchor = GridBagConstraints.EAST; gbc_label_4.gridx = 1; gbc_label_4.gridy = 1; tlsKeystorePanel.add(mylabel_4, gbc_label_4); myHohSecurityKeyPwTextBox = new JTextField(); myHohSecurityKeyPwTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setTlsKeystorePassword(myHohSecurityKeyPwTextBox.getText()); } }); GridBagConstraints gbc_HohSecurityKeyPwTextBox = new GridBagConstraints(); gbc_HohSecurityKeyPwTextBox.insets = new Insets(0, 0, 0, 5); gbc_HohSecurityKeyPwTextBox.fill = GridBagConstraints.HORIZONTAL; gbc_HohSecurityKeyPwTextBox.gridx = 2; gbc_HohSecurityKeyPwTextBox.gridy = 1; tlsKeystorePanel.add(myHohSecurityKeyPwTextBox, gbc_HohSecurityKeyPwTextBox); myHohSecurityKeyPwTextBox.setColumns(10); myHohSecurityProfileKeystoreStatus = new JLabel("Value goes here"); myHohSecurityProfileKeystoreStatus.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_HohSecurityProfileKeystoreStatus = new GridBagConstraints(); gbc_HohSecurityProfileKeystoreStatus.anchor = GridBagConstraints.NORTH; gbc_HohSecurityProfileKeystoreStatus.fill = GridBagConstraints.HORIZONTAL; gbc_HohSecurityProfileKeystoreStatus.gridwidth = 5; gbc_HohSecurityProfileKeystoreStatus.gridx = 0; gbc_HohSecurityProfileKeystoreStatus.gridy = 2; tlsKeystorePanel.add(myHohSecurityProfileKeystoreStatus, gbc_HohSecurityProfileKeystoreStatus); mylabel_9 = new JLabel("Signature Profile"); GridBagConstraints gbc_label_9 = new GridBagConstraints(); gbc_label_9.insets = new Insets(0, 0, 0, 5); gbc_label_9.gridx = 0; gbc_label_9.gridy = 2; myHoHCard.add(mylabel_9, gbc_label_9); mypanel_3 = new JPanel(); mypanel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_3 = new GridBagConstraints(); gbc_panel_3.fill = GridBagConstraints.BOTH; gbc_panel_3.gridx = 1; gbc_panel_3.gridy = 2; myHoHCard.add(mypanel_3, gbc_panel_3); GridBagLayout gbl_panel_3 = new GridBagLayout(); gbl_panel_3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 50, 0, 0 }; gbl_panel_3.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_panel_3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel_3.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; mypanel_3.setLayout(gbl_panel_3); myHohSignatureEnabled = new JCheckBox("Enabled"); myHohSignatureEnabled.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { myConnection.setHohSignatureEnabled(myHohSignatureEnabled.isSelected()); } }); GridBagConstraints gbc_HohSignatureEnabled = new GridBagConstraints(); gbc_HohSignatureEnabled.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureEnabled.gridx = 0; gbc_HohSignatureEnabled.gridy = 0; mypanel_3.add(myHohSignatureEnabled, gbc_HohSignatureEnabled); mylabel_10 = new JLabel("Keystore:"); GridBagConstraints gbc_label_10 = new GridBagConstraints(); gbc_label_10.anchor = GridBagConstraints.EAST; gbc_label_10.insets = new Insets(0, 0, 5, 5); gbc_label_10.gridx = 1; gbc_label_10.gridy = 0; mypanel_3.add(mylabel_10, gbc_label_10); myHohSignatureKeystoreTextbox = new JTextField(); myHohSignatureKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohSignatureKeystore(myHohSignatureKeystoreTextbox.getText()); } }); GridBagConstraints gbc_HohSignatureKeystoreTextbox2 = new GridBagConstraints(); gbc_HohSignatureKeystoreTextbox2.gridwidth = 5; gbc_HohSignatureKeystoreTextbox2.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureKeystoreTextbox2.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeystoreTextbox2.gridx = 2; gbc_HohSignatureKeystoreTextbox2.gridy = 0; mypanel_3.add(myHohSignatureKeystoreTextbox, gbc_HohSignatureKeystoreTextbox2); myHohSignatureKeystoreTextbox.setColumns(10); myHohSignatureKeystoreChooseButton = new JButton("Choose"); myHohSignatureKeystoreChooseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Hl7ConnectionPanel.chooseKeystore(Hl7ConnectionPanel.this, myHohSignatureKeystoreTextbox); } }); myHohSignatureKeystoreChooseButton.setIcon( new ImageIcon(Hl7ConnectionPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png"))); GridBagConstraints gbc_HohSignatureKeystoreChooseButton2 = new GridBagConstraints(); gbc_HohSignatureKeystoreChooseButton2.insets = new Insets(0, 0, 5, 0); gbc_HohSignatureKeystoreChooseButton2.gridx = 7; gbc_HohSignatureKeystoreChooseButton2.gridy = 0; mypanel_3.add(myHohSignatureKeystoreChooseButton, gbc_HohSignatureKeystoreChooseButton2); mylabel_11 = new JLabel("Store Pass:"); GridBagConstraints gbc_label_11 = new GridBagConstraints(); gbc_label_11.anchor = GridBagConstraints.EAST; gbc_label_11.insets = new Insets(0, 0, 5, 5); gbc_label_11.gridx = 1; gbc_label_11.gridy = 1; mypanel_3.add(mylabel_11, gbc_label_11); myHohSignatureKeystorePasswordTextbox = new JTextField(); myHohSignatureKeystorePasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohSignatureKeystorePassword(myHohSignatureKeystorePasswordTextbox.getText()); } }); myHohSignatureKeystorePasswordTextbox.setPreferredSize(new Dimension(100, 28)); myHohSignatureKeystorePasswordTextbox.setMinimumSize(new Dimension(100, 28)); myHohSignatureKeystorePasswordTextbox.setMaximumSize(new Dimension(200, 2147483647)); GridBagConstraints gbc_HohSignatureKeystorePasswordTextbox = new GridBagConstraints(); gbc_HohSignatureKeystorePasswordTextbox.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureKeystorePasswordTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeystorePasswordTextbox.gridx = 2; gbc_HohSignatureKeystorePasswordTextbox.gridy = 1; mypanel_3.add(myHohSignatureKeystorePasswordTextbox, gbc_HohSignatureKeystorePasswordTextbox); myHohSignatureKeystorePasswordTextbox.setColumns(10); mylabel_12 = new JLabel("Key:"); GridBagConstraints gbc_label_12 = new GridBagConstraints(); gbc_label_12.anchor = GridBagConstraints.EAST; gbc_label_12.insets = new Insets(0, 0, 5, 5); gbc_label_12.gridx = 3; gbc_label_12.gridy = 1; mypanel_3.add(mylabel_12, gbc_label_12); myHohSignatureKeyAliasCombo = new JComboBox(); myHohSignatureKeyAliasCombo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { if (myUpdatingHohSignatureKeyAliasCombo) { return; } String selection = (String) myHohSignatureKeyAliasCombo.getSelectedItem(); if (selection == HOH_SIGNATURE_KEY_USE_ANY_AVAILABLE) { myConnection.setHohSignatureKey(null); } else { myConnection.setHohSignatureKey(selection.replaceAll(" .*", "")); } } }); GridBagConstraints gbc_HohSignatureKeyAliasCombo = new GridBagConstraints(); gbc_HohSignatureKeyAliasCombo.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureKeyAliasCombo.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeyAliasCombo.gridx = 4; gbc_HohSignatureKeyAliasCombo.gridy = 1; mypanel_3.add(myHohSignatureKeyAliasCombo, gbc_HohSignatureKeyAliasCombo); mylabel_13 = new JLabel("Key Pass:"); GridBagConstraints gbc_label_13 = new GridBagConstraints(); gbc_label_13.anchor = GridBagConstraints.EAST; gbc_label_13.insets = new Insets(0, 0, 5, 5); gbc_label_13.gridx = 5; gbc_label_13.gridy = 1; mypanel_3.add(mylabel_13, gbc_label_13); myHohSignatureKeyPass = new JTextField(); myHohSignatureKeyPass.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohSignatureKeyPassword(myHohSignatureKeyPass.getText()); } }); myHohSignatureKeyPass.setMinimumSize(new Dimension(50, 28)); myHohSignatureKeyPass.setMaximumSize(new Dimension(50, 2147483647)); myHohSignatureKeyPass.setPreferredSize(new Dimension(50, 28)); GridBagConstraints gbc_HohSignatureKeyPass = new GridBagConstraints(); gbc_HohSignatureKeyPass.gridwidth = 2; gbc_HohSignatureKeyPass.insets = new Insets(0, 0, 5, 0); gbc_HohSignatureKeyPass.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeyPass.gridx = 6; gbc_HohSignatureKeyPass.gridy = 1; mypanel_3.add(myHohSignatureKeyPass, gbc_HohSignatureKeyPass); myHohSignatureKeyPass.setColumns(10); myHohSignatureStatusLabel = new JLabel("New label"); myHohSignatureStatusLabel.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_HohSignatureStatusLabel = new GridBagConstraints(); gbc_HohSignatureStatusLabel.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureStatusLabel.gridwidth = 8; gbc_HohSignatureStatusLabel.insets = new Insets(0, 0, 0, 5); gbc_HohSignatureStatusLabel.gridx = 0; gbc_HohSignatureStatusLabel.gridy = 2; mypanel_3.add(myHohSignatureStatusLabel, gbc_HohSignatureStatusLabel); init(); }
From source file:de.tor.tribes.ui.views.DSWorkbenchChurchFrame.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./* www .ja v a2 s . c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jXPanel1 = new org.jdesktop.swingx.JXPanel(); infoPanel = new org.jdesktop.swingx.JXCollapsiblePane(); jXLabel1 = new org.jdesktop.swingx.JXLabel(); jScrollPane2 = new javax.swing.JScrollPane(); jChurchPanel = new org.jdesktop.swingx.JXPanel(); jChurchFrameAlwaysOnTop = new javax.swing.JCheckBox(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jXPanel1.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) { jXLabel1fireHideInfoEvent(evt); } }); infoPanel.add(jXLabel1, java.awt.BorderLayout.CENTER); jXPanel1.add(infoPanel, java.awt.BorderLayout.SOUTH); jChurchTable .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" })); jScrollPane2.setViewportView(jChurchTable); jXPanel1.add(jScrollPane2, java.awt.BorderLayout.CENTER); setTitle("Kirchen"); getContentPane().setLayout(new java.awt.GridBagLayout()); jChurchPanel.setBackground(new java.awt.Color(239, 235, 223)); jChurchPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 500; gridBagConstraints.ipady = 300; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jChurchPanel, gridBagConstraints); jChurchFrameAlwaysOnTop.setText("Immer im Vordergrund"); jChurchFrameAlwaysOnTop.setOpaque(false); jChurchFrameAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireChurchFrameOnTopEvent(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(jChurchFrameAlwaysOnTop, gridBagConstraints); capabilityInfoPanel1.setCopyable(false); capabilityInfoPanel1.setPastable(false); capabilityInfoPanel1.setSearchable(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:net.sf.taverna.t2.activities.rshell.views.RshellConfigurationPanel.java
private Component createSettingsPanel() { JPanel settingsPanel = new JPanel(new GridBagLayout()); GridBagConstraints labelConstraints = new GridBagConstraints(); labelConstraints.weightx = 0.0;/*from w w w. j ava 2s. c om*/ labelConstraints.gridx = 0; labelConstraints.gridy = 0; labelConstraints.fill = GridBagConstraints.NONE; labelConstraints.anchor = GridBagConstraints.LINE_START; GridBagConstraints fieldConstraints = new GridBagConstraints(); fieldConstraints.weightx = 1.0; fieldConstraints.gridx = 1; fieldConstraints.gridy = 0; fieldConstraints.fill = GridBagConstraints.HORIZONTAL; GridBagConstraints buttonConstraints = new GridBagConstraints(); buttonConstraints.weightx = 1.0; buttonConstraints.gridx = 1; buttonConstraints.gridy = 2; buttonConstraints.fill = GridBagConstraints.NONE; buttonConstraints.anchor = GridBagConstraints.WEST; Dimension dimension = new Dimension(0, 0); hostnameField = new JTextField(); JLabel hostnameLabel = new JLabel("Hostname"); hostnameField.setSize(dimension); hostnameLabel.setSize(dimension); hostnameLabel.setLabelFor(hostnameField); JsonNode connectionSettings = getJson().path("connection"); hostnameField.setText(connectionSettings.path("hostname").asText()); portField = new JTextField(); JLabel portLabel = new JLabel("Port"); portField.setSize(dimension); portLabel.setSize(dimension); portLabel.setLabelFor(portField); portField.setText( Integer.toString(connectionSettings.path("port").asInt(RshellTemplateService.DEFAULT_PORT))); // "Set username and password" button ActionListener usernamePasswordListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (credManagerUI == null) { credManagerUI = new CredentialManagerUI(credentialManager); } credManagerUI.newPasswordForService( URI.create("rserve://" + hostnameField.getText() + ":" + portField.getText())); // this is used as a key for the service in Credential Manager } }; JButton setHttpUsernamePasswordButton = new JButton("Set username and password"); setHttpUsernamePasswordButton.setSize(dimension); setHttpUsernamePasswordButton.addActionListener(usernamePasswordListener); keepSessionAliveCheckBox = new JCheckBox("Keep Session Alive"); keepSessionAliveCheckBox.setSelected(connectionSettings.path("keepSessionAlive") .asBoolean(RshellTemplateService.DEFAULT_KEEP_SESSION_ALIVE)); settingsPanel.add(hostnameLabel, labelConstraints); labelConstraints.gridy++; settingsPanel.add(hostnameField, fieldConstraints); fieldConstraints.gridy++; settingsPanel.add(portLabel, labelConstraints); labelConstraints.gridy++; settingsPanel.add(portField, fieldConstraints); fieldConstraints.gridy++; settingsPanel.add(setHttpUsernamePasswordButton, buttonConstraints); buttonConstraints.gridy++; fieldConstraints.gridy++; settingsPanel.add(keepSessionAliveCheckBox, fieldConstraints); fieldConstraints.gridy++; return settingsPanel; }
From source file:org.languagetool.gui.ConfigurationDialog.java
public boolean show(List<Rule> rules) { configChanged = false;// w w w .jav a2 s .c o m if (original != null) { config.restoreState(original); } dialog = new JDialog(owner, true); dialog.setTitle(messages.getString("guiConfigWindowTitle")); // close dialog when user presses Escape key: KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); ActionListener actionListener = new ActionListener() { @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent actionEvent) { dialog.setVisible(false); } }; JRootPane rootPane = dialog.getRootPane(); rootPane.registerKeyboardAction(actionListener, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW); configurableRules.clear(); Language lang = config.getLanguage(); if (lang == null) { lang = Languages.getLanguageForLocale(Locale.getDefault()); } String specialTabNames[] = config.getSpecialTabNames(); int numConfigTrees = 2 + specialTabNames.length; configTree = new JTree[numConfigTrees]; JPanel checkBoxPanel[] = new JPanel[numConfigTrees]; DefaultMutableTreeNode rootNode; GridBagConstraints cons; for (int i = 0; i < numConfigTrees; i++) { checkBoxPanel[i] = new JPanel(); cons = new GridBagConstraints(); checkBoxPanel[i].setLayout(new GridBagLayout()); cons.anchor = GridBagConstraints.NORTHWEST; cons.gridx = 0; cons.weightx = 1.0; cons.weighty = 1.0; cons.fill = GridBagConstraints.HORIZONTAL; Collections.sort(rules, new CategoryComparator()); if (i == 0) { rootNode = createTree(rules, false, null); // grammar options } else if (i == 1) { rootNode = createTree(rules, true, null); // Style options } else { rootNode = createTree(rules, true, specialTabNames[i - 2]); // Special tab options } configTree[i] = new JTree(getTreeModel(rootNode)); configTree[i].applyComponentOrientation(ComponentOrientation.getOrientation(lang.getLocale())); configTree[i].setRootVisible(false); configTree[i].setEditable(false); configTree[i].setCellRenderer(new CheckBoxTreeCellRenderer()); TreeListener.install(configTree[i]); checkBoxPanel[i].add(configTree[i], cons); configTree[i].addMouseListener(getMouseAdapter()); } JPanel portPanel = new JPanel(); portPanel.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.insets = new Insets(0, 4, 0, 0); cons.gridx = 0; cons.gridy = 0; cons.anchor = GridBagConstraints.WEST; cons.fill = GridBagConstraints.NONE; cons.weightx = 0.0f; if (!insideOffice) { createNonOfficeElements(cons, portPanel); } else { createOfficeElements(cons, portPanel); } JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridBagLayout()); JButton okButton = new JButton(Tools.getLabel(messages.getString("guiOKButton"))); okButton.setMnemonic(Tools.getMnemonic(messages.getString("guiOKButton"))); okButton.setActionCommand(ACTION_COMMAND_OK); okButton.addActionListener(this); JButton cancelButton = new JButton(Tools.getLabel(messages.getString("guiCancelButton"))); cancelButton.setMnemonic(Tools.getMnemonic(messages.getString("guiCancelButton"))); cancelButton.setActionCommand(ACTION_COMMAND_CANCEL); cancelButton.addActionListener(this); cons = new GridBagConstraints(); cons.insets = new Insets(0, 4, 0, 0); buttonPanel.add(okButton, cons); buttonPanel.add(cancelButton, cons); JTabbedPane tabpane = new JTabbedPane(); JPanel jPane = new JPanel(); jPane.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.insets = new Insets(4, 4, 4, 4); cons.gridx = 0; cons.gridy = 0; cons.weightx = 10.0f; cons.weighty = 0.0f; cons.fill = GridBagConstraints.NONE; cons.anchor = GridBagConstraints.NORTHWEST; cons.gridy++; cons.anchor = GridBagConstraints.WEST; jPane.add(getMotherTonguePanel(cons), cons); if (insideOffice) { cons.gridy += 3; } else { cons.gridy++; } cons.anchor = GridBagConstraints.WEST; jPane.add(getNgramPanel(cons), cons); cons.gridy++; cons.anchor = GridBagConstraints.WEST; jPane.add(getWord2VecPanel(cons), cons); cons.gridy++; cons.anchor = GridBagConstraints.WEST; jPane.add(portPanel, cons); cons.fill = GridBagConstraints.HORIZONTAL; cons.anchor = GridBagConstraints.WEST; for (JPanel extra : extraPanels) { //in case it wasn't in a containment hierarchy when user changed L&F SwingUtilities.updateComponentTreeUI(extra); cons.gridy++; jPane.add(extra, cons); } cons.gridy++; cons.fill = GridBagConstraints.BOTH; cons.weighty = 1.0f; jPane.add(new JPanel(), cons); tabpane.addTab(messages.getString("guiGeneral"), jPane); jPane = new JPanel(); jPane.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.insets = new Insets(4, 4, 4, 4); cons.gridx = 0; cons.gridy = 0; cons.weightx = 10.0f; cons.weighty = 10.0f; cons.fill = GridBagConstraints.BOTH; jPane.add(new JScrollPane(checkBoxPanel[0]), cons); cons.weightx = 0.0f; cons.weighty = 0.0f; cons.gridx = 0; cons.gridy++; cons.fill = GridBagConstraints.NONE; cons.anchor = GridBagConstraints.LINE_END; jPane.add(getTreeButtonPanel(0), cons); tabpane.addTab(messages.getString("guiGrammarRules"), jPane); jPane = new JPanel(); jPane.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.insets = new Insets(4, 4, 4, 4); cons.gridx = 0; cons.gridy = 0; cons.weightx = 10.0f; cons.weighty = 10.0f; cons.fill = GridBagConstraints.BOTH; jPane.add(new JScrollPane(checkBoxPanel[1]), cons); cons.weightx = 0.0f; cons.weighty = 0.0f; cons.gridx = 0; cons.gridy++; cons.fill = GridBagConstraints.NONE; cons.anchor = GridBagConstraints.LINE_END; jPane.add(getTreeButtonPanel(1), cons); cons.gridx = 0; cons.gridy++; cons.weightx = 5.0f; cons.weighty = 5.0f; cons.fill = GridBagConstraints.BOTH; cons.anchor = GridBagConstraints.WEST; jPane.add(new JScrollPane(getSpecialRuleValuePanel()), cons); tabpane.addTab(messages.getString("guiStyleRules"), jPane); for (int i = 0; i < specialTabNames.length; i++) { jPane = new JPanel(); jPane.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.insets = new Insets(4, 4, 4, 4); cons.gridx = 0; cons.gridy = 0; cons.weightx = 10.0f; cons.weighty = 10.0f; cons.fill = GridBagConstraints.BOTH; jPane.add(new JScrollPane(checkBoxPanel[i + 2]), cons); cons.weightx = 0.0f; cons.weighty = 0.0f; cons.gridx = 0; cons.gridy++; cons.fill = GridBagConstraints.NONE; cons.anchor = GridBagConstraints.LINE_END; jPane.add(getTreeButtonPanel(i + 2), cons); tabpane.addTab(specialTabNames[i], jPane); } jPane = new JPanel(); jPane.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.insets = new Insets(4, 4, 4, 4); cons.gridx = 0; cons.gridy = 0; if (insideOffice) { JLabel versionText = new JLabel(messages.getString("guiUColorHint")); versionText.setForeground(Color.blue); jPane.add(versionText, cons); cons.gridy++; } cons.weightx = 2.0f; cons.weighty = 2.0f; cons.fill = GridBagConstraints.BOTH; jPane.add(new JScrollPane(getUnderlineColorPanel(rules)), cons); Container contentPane = dialog.getContentPane(); contentPane.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.insets = new Insets(4, 4, 4, 4); cons.gridx = 0; cons.gridy = 0; cons.weightx = 10.0f; cons.weighty = 10.0f; cons.fill = GridBagConstraints.BOTH; cons.anchor = GridBagConstraints.NORTHWEST; contentPane.add(tabpane, cons); cons.weightx = 0.0f; cons.weighty = 0.0f; cons.gridy++; cons.fill = GridBagConstraints.NONE; cons.anchor = GridBagConstraints.EAST; contentPane.add(buttonPanel, cons); dialog.pack(); // center on screen: Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = dialog.getSize(); dialog.setLocation(screenSize.width / 2 - frameSize.width / 2, screenSize.height / 2 - frameSize.height / 2); dialog.setLocationByPlatform(true); // add Color tab after dimension was set tabpane.addTab(messages.getString("guiUnderlineColor"), jPane); for (JPanel extra : this.extraPanels) { if (extra instanceof SavablePanel) { ((SavablePanel) extra).componentShowing(); } } dialog.setVisible(true); return configChanged; }
From source file:org.openconcerto.erp.core.supplychain.receipt.component.BonReceptionSQLComponent.java
public void addViews() { this.setLayout(new GridBagLayout()); final GridBagConstraints c = new DefaultGridBagConstraints(); // Champ Module c.gridx = 0;//from www . ja va 2 s . com 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.textTotalHT.setOpaque(false); this.textTotalTVA.setOpaque(false); this.textTotalTTC.setOpaque(false); this.selectCommande = new ElementComboBox(); // Numero JLabel labelNum = new JLabel(getLabelFor("NUMERO")); labelNum.setHorizontalAlignment(SwingConstants.RIGHT); this.add(labelNum, c); this.textNumeroUnique = new JUniqueTextField(16); c.gridx++; c.weightx = 1; c.weighty = 0; c.fill = GridBagConstraints.NONE; DefaultGridBagConstraints.lockMinimumSize(this.textNumeroUnique); this.add(this.textNumeroUnique, c); // Date JLabel labelDate = new JLabel(getLabelFor("DATE")); labelDate.setHorizontalAlignment(SwingConstants.RIGHT); c.fill = GridBagConstraints.HORIZONTAL; c.gridx++; c.weightx = 0; this.add(labelDate, c); JDate date = new JDate(true); c.gridx++; c.weightx = 0; c.weighty = 0; this.add(date, c); // Reference c.gridy++; c.gridx = 0; final JLabel labelNom = new JLabel(getLabelFor("NOM")); labelNom.setHorizontalAlignment(SwingConstants.RIGHT); this.add(labelNom, c); c.gridx++; c.fill = GridBagConstraints.HORIZONTAL; DefaultGridBagConstraints.lockMinimumSize(this.textReference); this.add(this.textReference, c); // Fournisseur JLabel labelFournisseur = new JLabel(getLabelFor("ID_FOURNISSEUR")); labelFournisseur.setHorizontalAlignment(SwingConstants.RIGHT); c.gridx = 0; c.gridy++; c.weightx = 0; c.weighty = 0; this.add(labelFournisseur, c); this.fournisseur = new ElementComboBox(); c.gridx++; c.weightx = 0; c.weighty = 0; c.fill = GridBagConstraints.NONE; this.add(this.fournisseur, c); // Devise c.gridx = 0; c.gridy++; c.weightx = 0; c.fill = GridBagConstraints.HORIZONTAL; this.add(new JLabel(getLabelFor("ID_DEVISE"), SwingConstants.RIGHT), c); final ElementComboBox boxDevise = new ElementComboBox(); c.gridx = GridBagConstraints.RELATIVE; c.gridwidth = 1; c.weightx = 1; c.weighty = 0; c.fill = GridBagConstraints.NONE; this.add(boxDevise, c); this.addView(boxDevise, "ID_DEVISE"); // Element du bon this.tableBonItem = new BonReceptionItemTable(); c.gridx = 0; c.gridy++; c.weightx = 1; c.weighty = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.BOTH; this.add(this.tableBonItem, c); this.fournisseur.addValueListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { tableBonItem.setFournisseur(fournisseur.getSelectedRow()); } }); c.anchor = GridBagConstraints.EAST; // Totaux reconfigure(this.textTotalHT); reconfigure(this.textTotalTVA); reconfigure(this.textTotalTTC); // Poids Total c.gridy++; c.gridx = 1; c.weightx = 0; c.weighty = 0; c.anchor = GridBagConstraints.EAST; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; DefaultProps props = DefaultNXProps.getInstance(); Boolean b = props.getBooleanValue("ArticleShowPoids"); if (b) { JPanel panelPoids = new JPanel(new GridBagLayout()); GridBagConstraints c2 = new DefaultGridBagConstraints(); c2.fill = GridBagConstraints.NONE; panelPoids.add(new JLabel(getLabelFor("TOTAL_POIDS")), c2); // Necessaire pour ne pas avoir de saut de layout DefaultGridBagConstraints.lockMinimumSize(this.textPoidsTotal); this.textPoidsTotal.setEnabled(false); this.textPoidsTotal.setHorizontalAlignment(JTextField.RIGHT); this.textPoidsTotal.setDisabledTextColor(Color.BLACK); c2.gridx++; c2.weightx = 1; c2.fill = GridBagConstraints.HORIZONTAL; panelPoids.add(this.textPoidsTotal, c2); this.add(panelPoids, c); } c.gridx = 2; c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 0; c.weighty = 0; c.anchor = GridBagConstraints.EAST; c.fill = GridBagConstraints.HORIZONTAL; final GridBagConstraints cTotalPan = new DefaultGridBagConstraints(); JPanel panelTotalHT = new JPanel(); panelTotalHT.setLayout(new GridBagLayout()); cTotalPan.gridx = 0; cTotalPan.weightx = 0; cTotalPan.fill = GridBagConstraints.HORIZONTAL; cTotalPan.anchor = GridBagConstraints.WEST; final JLabelBold labelTotalHT = new JLabelBold(getLabelFor("TOTAL_HT")); panelTotalHT.add(labelTotalHT, cTotalPan); cTotalPan.anchor = GridBagConstraints.EAST; cTotalPan.gridx++; cTotalPan.weightx = 1; this.textTotalHT.setFont(labelTotalHT.getFont()); DefaultGridBagConstraints.lockMinimumSize(this.textTotalHT); panelTotalHT.add(this.textTotalHT, cTotalPan); this.add(panelTotalHT, c); JPanel panelTotalTVA = new JPanel(); panelTotalTVA.setLayout(new GridBagLayout()); cTotalPan.gridx = 0; cTotalPan.weightx = 0; cTotalPan.anchor = GridBagConstraints.WEST; cTotalPan.fill = GridBagConstraints.HORIZONTAL; panelTotalTVA.add(new JLabelBold(getLabelFor("TOTAL_TVA")), cTotalPan); cTotalPan.anchor = GridBagConstraints.EAST; cTotalPan.gridx++; cTotalPan.weightx = 1; DefaultGridBagConstraints.lockMinimumSize(this.textTotalTVA); panelTotalTVA.add(this.textTotalTVA, cTotalPan); c.gridy++; c.fill = GridBagConstraints.HORIZONTAL; this.add(panelTotalTVA, c); JPanel panelTotalTTC = new JPanel(); panelTotalTTC.setLayout(new GridBagLayout()); cTotalPan.gridx = 0; cTotalPan.anchor = GridBagConstraints.WEST; cTotalPan.gridwidth = GridBagConstraints.REMAINDER; cTotalPan.fill = GridBagConstraints.BOTH; cTotalPan.weightx = 1; panelTotalTTC.add(new JSeparator(), cTotalPan); cTotalPan.gridwidth = 1; cTotalPan.fill = GridBagConstraints.NONE; cTotalPan.weightx = 0; cTotalPan.gridy++; panelTotalTTC.add(new JLabelBold(getLabelFor("TOTAL_TTC")), cTotalPan); cTotalPan.anchor = GridBagConstraints.EAST; cTotalPan.gridx++; this.textTotalTTC.setFont(labelTotalHT.getFont()); DefaultGridBagConstraints.lockMinimumSize(this.textTotalTTC); panelTotalTTC.add(this.textTotalTTC, cTotalPan); c.gridy++; // probleme de tremblement vertical this.add(panelTotalTTC, c); c.anchor = GridBagConstraints.WEST; /******************************************************************************************* * * INFORMATIONS COMPLEMENTAIRES ******************************************************************************************/ c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy++; TitledSeparator sep = new TitledSeparator("Informations complmentaires"); c.insets = new Insets(10, 2, 1, 2); this.add(sep, c); c.insets = new Insets(2, 2, 1, 2); c.gridx = 0; c.gridy++; c.gridheight = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1; c.weighty = 0; c.fill = GridBagConstraints.BOTH; final ITextArea textInfos = new ITextArea(4, 4); JScrollPane scrollPane = new JScrollPane(textInfos); DefaultGridBagConstraints.lockMinimumSize(scrollPane); this.add(textInfos, c); this.addRequiredSQLObject(date, "DATE"); this.addSQLObject(textInfos, "INFOS"); this.addSQLObject(this.textReference, "NOM"); this.addSQLObject(this.selectCommande, "ID_COMMANDE"); this.addRequiredSQLObject(this.textNumeroUnique, "NUMERO"); this.addSQLObject(this.textPoidsTotal, "TOTAL_POIDS"); this.addRequiredSQLObject(this.textTotalHT, "TOTAL_HT"); this.addRequiredSQLObject(this.textTotalTVA, "TOTAL_TVA"); this.addRequiredSQLObject(this.textTotalTTC, "TOTAL_TTC"); this.addRequiredSQLObject(this.fournisseur, "ID_FOURNISSEUR"); this.textNumeroUnique.setText(NumerotationAutoSQLElement.getNextNumero(BonReceptionSQLElement.class)); // Listeners this.tableBonItem.getModel().addTableModelListener(new TableModelListener() { public void tableChanged(TableModelEvent e) { int columnIndexHT = BonReceptionSQLComponent.this.tableBonItem.getModel().getColumnIndexForElement( BonReceptionSQLComponent.this.tableBonItem.getPrixTotalHTElement()); int columnIndexTTC = BonReceptionSQLComponent.this.tableBonItem.getModel().getColumnIndexForElement( BonReceptionSQLComponent.this.tableBonItem.getPrixTotalTTCElement()); int columnIndexPoids = BonReceptionSQLComponent.this.tableBonItem.getModel() .getColumnIndexForElement( BonReceptionSQLComponent.this.tableBonItem.getPoidsTotalElement()); if (e.getColumn() == TableModelEvent.ALL_COLUMNS || e.getColumn() == columnIndexHT || e.getColumn() == columnIndexTTC) { updateTotal(); } if (e.getColumn() == TableModelEvent.ALL_COLUMNS || e.getColumn() == columnIndexPoids) { BonReceptionSQLComponent.this.textPoidsTotal.setText(String .valueOf(Math.round(BonReceptionSQLComponent.this.tableBonItem.getPoidsTotal() * 1000) / 1000.0)); } } }); // Lock UI DefaultGridBagConstraints.lockMinimumSize(this.fournisseur); }
From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.dialogs.RepositoryPublishDialog.java
protected JPanel createLocationFieldPanel() { final GridBagConstraints c = new GridBagConstraints(); final JPanel locationFieldPanel = new JPanel(); locationFieldPanel.setLayout(new GridBagLayout()); c.insets = new Insets(0, 5, 5, 0); c.gridx = 0;/*from w w w . j av a2 s. c om*/ c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; c.anchor = GridBagConstraints.WEST; locationFieldPanel.add(getLocationCombo(), c); c.insets = new Insets(5, 8, 5, 0); c.gridx = 1; c.gridy = 0; c.fill = GridBagConstraints.NONE; c.weightx = 0.0; c.anchor = GridBagConstraints.WEST; locationFieldPanel.add(new BorderlessButton(new LevelUpAction()), c); c.gridx = 2; c.gridy = 0; c.fill = GridBagConstraints.NONE; c.weightx = 0.0; c.anchor = GridBagConstraints.EAST; locationFieldPanel.add(new BorderlessButton(new BrowseRepositoryAction()), c); c.gridx = 3; c.gridy = 0; c.fill = GridBagConstraints.NONE; c.weightx = 0.0; c.anchor = GridBagConstraints.EAST; locationFieldPanel.add(new BorderlessButton(new NewFolderAction()), c); return locationFieldPanel; }
From source file:cool.pandora.modeller.ui.jpanel.base.NewBagInPlaceFrame.java
/** * layoutAddKeepFilesToEmptyCheckBox.// w w w .j av a2 s.c o m * * <p>Setting and displaying the ".keep Files in Empty Folder(s):" Check Box * on the Create Bag In Place Pane */ private void layoutAddKeepFilesToEmptyCheckBox(final JPanel contentPane, final int row) { // Delete Empty Folder(s) final JLabel addKeepFilesToEmptyFoldersCheckBoxLabel = new JLabel( bagView.getPropertyMessage("bag.label" + ".addkeepfilestoemptyfolders")); addKeepFilesToEmptyFoldersCheckBoxLabel .setToolTipText(bagView.getPropertyMessage("bag" + ".addkeepfilestoemptyfolders" + ".help")); final JCheckBox addKeepFilesToEmptyFoldersCheckBox = new JCheckBox(bagView.getPropertyMessage("")); addKeepFilesToEmptyFoldersCheckBox.setSelected(bag.isAddKeepFilesToEmptyFolders()); addKeepFilesToEmptyFoldersCheckBox.addActionListener(new AddKeepFilesToEmptyFoldersHandler()); GridBagConstraints glbc = new GridBagConstraints(); final JLabel spacerLabel = new JLabel(); glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); contentPane.add(addKeepFilesToEmptyFoldersCheckBoxLabel, glbc); glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); contentPane.add(addKeepFilesToEmptyFoldersCheckBox, glbc); glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE, GridBagConstraints.EAST); contentPane.add(spacerLabel, glbc); }