List of usage examples for java.awt GridBagConstraints EAST
int EAST
To view the source code for java.awt GridBagConstraints EAST.
Click Source Link
From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.dialogs.RepositoryOpenDialog.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 a v a2 s . co m c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; c.anchor = GridBagConstraints.WEST; locationFieldPanel.add(locationCombo, 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); return locationFieldPanel; }
From source file:org.apache.jmeter.testbeans.gui.GenericTestBeanCustomizer.java
/** * Initialize the GUI.// ww w.java 2 s . c o m */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new GridBagLayout()); GridBagConstraints cl = new GridBagConstraints(); // for labels cl.gridx = 0; cl.anchor = GridBagConstraints.EAST; cl.insets = new Insets(0, 1, 0, 1); GridBagConstraints ce = new GridBagConstraints(); // for editors ce.fill = GridBagConstraints.BOTH; ce.gridx = 1; ce.weightx = 1.0; ce.insets = new Insets(0, 1, 0, 1); GridBagConstraints cp = new GridBagConstraints(); // for panels cp.fill = GridBagConstraints.BOTH; cp.gridx = 1; cp.gridy = GridBagConstraints.RELATIVE; cp.gridwidth = 2; cp.weightx = 1.0; JPanel currentPanel = this; String currentGroup = DEFAULT_GROUP; int y = 0; for (int i = 0; i < editors.length; i++) { if (editors[i] == null) { continue; } if (log.isDebugEnabled()) { log.debug("Laying property " + descriptors[i].getName()); } String g = group(descriptors[i]); if (!currentGroup.equals(g)) { if (currentPanel != this) { add(currentPanel, cp); } currentGroup = g; currentPanel = new JPanel(new GridBagLayout()); currentPanel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), groupDisplayName(g))); cp.weighty = 0.0; y = 0; } Component customEditor = editors[i].getCustomEditor(); boolean multiLineEditor = false; if (customEditor.getPreferredSize().height > 50 || customEditor instanceof JScrollPane || descriptors[i].getValue(MULTILINE) != null) { // TODO: the above works in the current situation, but it's // just a hack. How to get each editor to report whether it // wants to grow bigger? Whether the property label should // be at the left or at the top of the editor? ...? multiLineEditor = true; } JLabel label = createLabel(descriptors[i]); label.setLabelFor(customEditor); cl.gridy = y; cl.gridwidth = multiLineEditor ? 2 : 1; cl.anchor = multiLineEditor ? GridBagConstraints.CENTER : GridBagConstraints.EAST; currentPanel.add(label, cl); ce.gridx = multiLineEditor ? 0 : 1; ce.gridy = multiLineEditor ? ++y : y; ce.gridwidth = multiLineEditor ? 2 : 1; ce.weighty = multiLineEditor ? 1.0 : 0.0; cp.weighty += ce.weighty; currentPanel.add(customEditor, ce); y++; } if (currentPanel != this) { add(currentPanel, cp); } // Add a 0-sized invisible component that will take all the vertical // space that nobody wants: cp.weighty = 0.0001; add(Box.createHorizontalStrut(0), cp); }
From source file:de.tor.tribes.ui.views.DSWorkbenchFormFrame.java
/** This method is called from within the constructor to * initialize the form./* ww w . j a v a 2 s .c om*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jFormTablePanel = new org.jdesktop.swingx.JXPanel(); infoPanel = new org.jdesktop.swingx.JXCollapsiblePane(); jXLabel1 = new org.jdesktop.swingx.JXLabel(); jScrollPane4 = new javax.swing.JScrollPane(); jFormPanel = new javax.swing.JPanel(); jAlwaysOnTop = new javax.swing.JCheckBox(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jFormTablePanel.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); jFormTablePanel.add(infoPanel, java.awt.BorderLayout.SOUTH); jFormsTable .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(jFormsTable); jFormTablePanel.add(jScrollPane4, java.awt.BorderLayout.CENTER); setTitle("Zeichnungen"); getContentPane().setLayout(new java.awt.GridBagLayout()); jFormPanel.setBackground(new java.awt.Color(239, 235, 223)); jFormPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 439; gridBagConstraints.ipady = 319; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jFormPanel, gridBagConstraints); jAlwaysOnTop.setText("Immer im Vordergrund"); jAlwaysOnTop.setOpaque(false); jAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireFormFrameAlwaysOnTopEvent(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(jAlwaysOnTop, gridBagConstraints); 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:org.jets3t.apps.cockpitlite.CockpitLite.java
/** * Initialises the application's GUI elements. *///w w w. j a v a 2 s . com private void initGui() { // Initialise skins factory. skinsFactory = SkinsFactory.getInstance(cockpitLiteProperties.getProperties()); // 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); } // Primary panel that contains all other items. JPanel primaryPanel = skinsFactory.createSkinnedJPanel("PrimaryPanel"); primaryPanel.setLayout(new GridBagLayout()); this.getContentPane().add(primaryPanel); // Setup the stack panel, which contains all other panels as a stack. stackPanel = skinsFactory.createSkinnedJPanel("StackPanel"); stackPanelCardLayout = new CardLayout(); stackPanel.setLayout(stackPanelCardLayout); primaryPanel.add(stackPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); // Progress notification panel progressNotificationPanel = skinsFactory.createSkinnedJPanel("ProgressNotificationPanel"); progressNotificationPanel.setLayout(new GridBagLayout()); primaryPanel.add(progressNotificationPanel, new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 0, 5, 0), 0, 0)); int row = 0; // Login panel. row = 0; loginPanel = skinsFactory.createSkinnedJPanel("LoginPanel"); loginPanel.setLayout(new GridBagLayout()); userInputFields = new UserInputFields(insetsDefault, null, skinsFactory); userInputFields.buildFieldsPanel(loginPanel, cockpitLiteProperties); loginButton = skinsFactory.createSkinnedJButton("LoginButton"); loginButton.setText("Log me in"); loginButton.addActionListener(this); loginPanel.add(loginButton, new GridBagConstraints(0, loginPanel.getComponentCount(), 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0)); // Filter panel. filterObjectsPanel = skinsFactory.createSkinnedJPanel("FilterPanel"); filterObjectsPanel.setLayout(new GridBagLayout()); filterObjectsPrefix = skinsFactory.createSkinnedJTextField("FilterPrefix"); filterObjectsPrefix.setToolTipText("Only show files starting with this string"); filterObjectsPrefix.addActionListener(this); filterObjectsPrefix.setActionCommand("RefreshObjects"); JLabel filterPrefixLabel = skinsFactory.createSkinnedJHtmlLabel("FilterPrefixLable", this); filterPrefixLabel.setText("File name starts with: "); filterObjectsPanel.add(filterPrefixLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0)); filterObjectsPanel.add(filterObjectsPrefix, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); filterObjectsPanel.setVisible(false); // Objects panel. row = 0; JPanel objectsPanel = skinsFactory.createSkinnedJPanel("ObjectsPanel"); objectsPanel.setLayout(new GridBagLayout()); filterObjectsCheckBox = skinsFactory.createSkinnedJCheckBox("FilterCheckbox"); filterObjectsCheckBox.setText("Search files"); filterObjectsCheckBox.setEnabled(true); filterObjectsCheckBox.addActionListener(this); filterObjectsCheckBox.setToolTipText("Check this option to search your files"); objectsHeadingLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectsHeadingLabel", this); objectsHeadingLabel.setText("Not logged in"); objectsPanel.add(objectsHeadingLabel, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); objectsPanel.add(filterObjectsCheckBox, new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); JButton objectActionButton = skinsFactory.createSkinnedJButton("ObjectMenuButton"); objectActionButton.setToolTipText("File actions menu"); guiUtils.applyIcon(objectActionButton, "/images/nuvola/16x16/actions/misc.png"); objectActionButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JButton sourceButton = (JButton) e.getSource(); objectActionMenu.show(sourceButton, 0, sourceButton.getHeight()); } }); objectsPanel.add(objectActionButton, new GridBagConstraints(2, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); objectsPanel.add(filterObjectsPanel, new GridBagConstraints(0, ++row, 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); objectsTable = skinsFactory.createSkinnedJTable("ObjectsTable"); objectTableModel = new CLObjectTableModel(); objectTableModelSorter = new TableSorter(objectTableModel); objectTableModelSorter.setTableHeader(objectsTable.getTableHeader()); objectsTable.setModel(objectTableModelSorter); objectsTable.setDefaultRenderer(Long.class, new DefaultTableCellRenderer() { private static final long serialVersionUID = 7229656175879985698L; @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { String formattedSize = byteFormatter.formatByteSize(((Long) value).longValue()); return super.getTableCellRendererComponent(table, formattedSize, isSelected, hasFocus, row, column); } }); objectsTable.setDefaultRenderer(Date.class, new DefaultTableCellRenderer() { private static final long serialVersionUID = -4983176028291916397L; @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Date date = (Date) value; return super.getTableCellRendererComponent(table, yearAndTimeSDF.format(date), isSelected, hasFocus, row, column); } }); objectsTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); objectsTable.getSelectionModel().addListSelectionListener(this); objectsTable.setShowHorizontalLines(true); objectsTable.setShowVerticalLines(true); objectsTable.addMouseListener(new ContextMenuListener()); objectsTableSP = skinsFactory.createSkinnedJScrollPane("ObjectsTableSP", objectsTable); objectsPanel.add(objectsTableSP, new GridBagConstraints(0, ++row, 3, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); objectsSummaryLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectsSummary", this); objectsSummaryLabel.setHorizontalAlignment(JLabel.CENTER); objectsSummaryLabel.setFocusable(false); objectsPanel.add(objectsSummaryLabel, new GridBagConstraints(0, ++row, 3, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); // Object action menu. objectActionMenu = skinsFactory.createSkinnedJPopupMenu("ObjectPopupMenu"); refreshObjectMenuItem = skinsFactory.createSkinnedJMenuItem("RefreshMenuItem"); refreshObjectMenuItem.setText("Refresh file listing"); refreshObjectMenuItem.setActionCommand("RefreshObjects"); refreshObjectMenuItem.addActionListener(this); guiUtils.applyIcon(refreshObjectMenuItem, "/images/nuvola/16x16/actions/reload.png"); objectActionMenu.add(refreshObjectMenuItem); viewObjectPropertiesMenuItem = skinsFactory.createSkinnedJMenuItem("PropertiesMenuItem"); viewObjectPropertiesMenuItem.setText("View file properties..."); viewObjectPropertiesMenuItem.setActionCommand("ViewObjectProperties"); viewObjectPropertiesMenuItem.addActionListener(this); guiUtils.applyIcon(viewObjectPropertiesMenuItem, "/images/nuvola/16x16/actions/viewmag.png"); objectActionMenu.add(viewObjectPropertiesMenuItem); downloadObjectMenuItem = skinsFactory.createSkinnedJMenuItem("DownloadMenuItem"); downloadObjectMenuItem.setText("Download file(s)..."); downloadObjectMenuItem.setActionCommand("DownloadObjects"); downloadObjectMenuItem.addActionListener(this); guiUtils.applyIcon(downloadObjectMenuItem, "/images/nuvola/16x16/actions/1downarrow.png"); objectActionMenu.add(downloadObjectMenuItem); uploadFilesMenuItem = skinsFactory.createSkinnedJMenuItem("UploadMenuItem"); uploadFilesMenuItem.setText("Upload file(s)..."); uploadFilesMenuItem.setActionCommand("UploadFiles"); uploadFilesMenuItem.addActionListener(this); guiUtils.applyIcon(uploadFilesMenuItem, "/images/nuvola/16x16/actions/1uparrow.png"); objectActionMenu.add(uploadFilesMenuItem); objectActionMenu.add(new JSeparator()); togglePublicMenuItem = skinsFactory.createSkinnedJMenuItem("AclToggleMenuItem"); togglePublicMenuItem.setText("Change privacy setting..."); togglePublicMenuItem.setActionCommand("TogglePublicPrivate"); togglePublicMenuItem.addActionListener(this); guiUtils.applyIcon(togglePublicMenuItem, "/images/nuvola/16x16/actions/encrypted.png"); objectActionMenu.add(togglePublicMenuItem); generatePublicGetUrl = skinsFactory.createSkinnedJMenuItem("PublicUrlMenuItem"); generatePublicGetUrl.setText("Public web link..."); generatePublicGetUrl.setActionCommand("GeneratePublicGetURL"); generatePublicGetUrl.addActionListener(this); guiUtils.applyIcon(generatePublicGetUrl, "/images/nuvola/16x16/actions/wizard.png"); objectActionMenu.add(generatePublicGetUrl); objectActionMenu.add(new JSeparator()); deleteObjectMenuItem = skinsFactory.createSkinnedJMenuItem("DeleteMenuItem"); deleteObjectMenuItem.setText("Delete file(s)..."); deleteObjectMenuItem.setActionCommand("DeleteObjects"); deleteObjectMenuItem.addActionListener(this); guiUtils.applyIcon(deleteObjectMenuItem, "/images/nuvola/16x16/actions/cancel.png"); objectActionMenu.add(deleteObjectMenuItem); viewObjectPropertiesMenuItem.setEnabled(false); refreshObjectMenuItem.setEnabled(false); togglePublicMenuItem.setEnabled(false); downloadObjectMenuItem.setEnabled(false); generatePublicGetUrl.setEnabled(false); deleteObjectMenuItem.setEnabled(false); // Card layout in stack panel stackPanel.add(loginPanel, "LoginPanel"); stackPanel.add(objectsPanel, "ObjectsPanel"); // Set preferred sizes int preferredWidth = 800; int preferredHeight = 600; this.setBounds(new Rectangle(new Dimension(preferredWidth, preferredHeight))); // Initialize drop target. initDropTarget(new JComponent[] { objectsPanel }); objectsPanel.getDropTarget().setActive(true); }
From source file:net.technicpack.launcher.ui.InstallerFrame.java
private void setupStandardInstall(JPanel panel) { panel.setLayout(new GridBagLayout()); JLabel standardSpiel = new JLabel("<html><body align=\"left\" style='margin-right:10px;'>" + resources.getString("launcher.installer.standardspiel") + "</body></html>"); standardSpiel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16)); standardSpiel.setForeground(LauncherFrame.COLOR_WHITE_TEXT); standardSpiel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.add(standardSpiel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(9, 0, 0, 3), 0, 0)); panel.add(Box.createGlue(), new GridBagConstraints(0, 1, 3, 1, 1.0, 0.7, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); standardDefaultDirectory = new JCheckBox(resources.getString("launcher.installer.default")); standardDefaultDirectory.setOpaque(false); standardDefaultDirectory.setHorizontalAlignment(SwingConstants.RIGHT); standardDefaultDirectory.setBorder(BorderFactory.createEmptyBorder()); standardDefaultDirectory.setIconTextGap(0); standardDefaultDirectory.setSelectedIcon(resources.getIcon("checkbox_closed.png")); standardDefaultDirectory.setIcon(resources.getIcon("checkbox_open.png")); standardDefaultDirectory.setFocusPainted(false); standardDefaultDirectory.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16)); standardDefaultDirectory.setForeground(LauncherFrame.COLOR_WHITE_TEXT); standardDefaultDirectory.setIconTextGap(6); standardDefaultDirectory.setSelected(settings.isPortable() || settings.getTechnicRoot().getAbsolutePath() .equals(SettingsFactory.getTechnicHomeDir().getAbsolutePath())); standardDefaultDirectory.addActionListener(new ActionListener() { @Override// w ww . j av a 2s . com public void actionPerformed(ActionEvent e) { useDefaultDirectoryChanged(); } }); panel.add(standardDefaultDirectory, new GridBagConstraints(0, 2, 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 24, 12, 0), 0, 0)); JLabel installFolderLabel = new JLabel(resources.getString("launcher.installer.folder")); installFolderLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18)); installFolderLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT); panel.add(installFolderLabel, new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 24, 0, 8), 0, 0)); String installDir = SettingsFactory.getTechnicHomeDir().getAbsolutePath(); if (!settings.isPortable()) installDir = settings.getTechnicRoot().getAbsolutePath(); standardInstallDir = new JTextField(installDir); standardInstallDir.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18)); standardInstallDir.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL); standardInstallDir.setHighlighter(null); standardInstallDir.setEditable(false); standardInstallDir.setCursor(null); panel.add(standardInstallDir, new GridBagConstraints(1, 3, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0)); standardSelectButton = new RoundedButton(resources.getString("launcher.installer.select")); standardSelectButton.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18)); standardSelectButton.setContentAreaFilled(false); standardSelectButton.setHoverForeground(LauncherFrame.COLOR_BLUE); standardSelectButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { selectStandard(); } }); panel.add(standardSelectButton, new GridBagConstraints(2, 3, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 16), 0, 0)); useDefaultDirectoryChanged(); panel.add(Box.createGlue(), new GridBagConstraints(0, 4, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); String defaultLocaleText = resources.getString("launcheroptions.language.default"); if (!resources.isDefaultLocaleSupported()) { defaultLocaleText = defaultLocaleText .concat(" (" + resources.getString("launcheroptions.language.unavailable") + ")"); } standardLanguages = new JComboBox(); standardLanguages.addItem(new LanguageItem(ResourceLoader.DEFAULT_LOCALE, defaultLocaleText, resources)); for (int i = 0; i < ResourceLoader.SUPPORTED_LOCALES.length; i++) { standardLanguages .addItem(new LanguageItem(resources.getCodeFromLocale(ResourceLoader.SUPPORTED_LOCALES[i]), ResourceLoader.SUPPORTED_LOCALES[i].getDisplayName(ResourceLoader.SUPPORTED_LOCALES[i]), resources.getVariant(ResourceLoader.SUPPORTED_LOCALES[i]))); } if (!settings.getLanguageCode().equalsIgnoreCase(ResourceLoader.DEFAULT_LOCALE)) { Locale loc = resources.getLocaleFromCode(settings.getLanguageCode()); for (int i = 0; i < ResourceLoader.SUPPORTED_LOCALES.length; i++) { if (loc.equals(ResourceLoader.SUPPORTED_LOCALES[i])) { standardLanguages.setSelectedIndex(i + 1); break; } } } standardLanguages.setBorder(new RoundBorder(LauncherFrame.COLOR_SCROLL_THUMB, 1, 10)); standardLanguages.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 14)); standardLanguages.setUI(new LanguageCellUI(resources)); standardLanguages.setForeground(LauncherFrame.COLOR_WHITE_TEXT); standardLanguages.setBackground(LauncherFrame.COLOR_SELECTOR_BACK); standardLanguages.setRenderer(new LanguageCellRenderer(resources, "globe.png", LauncherFrame.COLOR_SELECTOR_BACK, LauncherFrame.COLOR_WHITE_TEXT)); standardLanguages.setEditable(false); standardLanguages.setFocusable(false); standardLanguages.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { standardLanguageChanged(); } }); panel.add(standardLanguages, new GridBagConstraints(0, 5, 1, 0, 0, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(0, 8, 8, 0), 0, 0)); RoundedButton install = new RoundedButton(resources.getString("launcher.installer.install")); install.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18)); install.setContentAreaFilled(false); install.setForeground(LauncherFrame.COLOR_BUTTON_BLUE); install.setHoverForeground(LauncherFrame.COLOR_BLUE); install.setBorder(BorderFactory.createEmptyBorder(8, 56, 8, 56)); install.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { standardInstall(); } }); panel.add(install, new GridBagConstraints(1, 5, 2, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 8, 8), 0, 0)); }
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. 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; 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:mt.listeners.InteractiveRANSAC.java
public void CardTable() { this.lambdaSB = new Scrollbar(Scrollbar.HORIZONTAL, this.lambdaInt, 1, MIN_SLIDER, MAX_SLIDER + 1); maxSlopeSB.setValue(utility.Slicer.computeScrollbarPositionFromValue((float) maxSlope, (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize)); maxDistSB.setValue(/* www. j a va 2s . c o m*/ utility.Slicer.computeScrollbarPositionFromValue(maxDist, MIN_Gap, MAX_Gap, scrollbarSize)); minInliersSB.setValue(utility.Slicer.computeScrollbarPositionFromValue(minInliers, MIN_Inlier, MAX_Inlier, scrollbarSize)); maxErrorSB.setValue( utility.Slicer.computeScrollbarPositionFromValue(maxError, MIN_ERROR, MAX_ERROR, scrollbarSize)); minSlopeSB.setValue(utility.Slicer.computeScrollbarPositionFromValue((float) minSlope, (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize)); lambdaLabel = new Label("Linearity (fraction) = " + new DecimalFormat("#.##").format(lambda), Label.CENTER); maxErrorLabel = new Label("Maximum Error (px) = " + new DecimalFormat("#.##").format(maxError) + " ", Label.CENTER); minInliersLabel = new Label( "Minimum No. of timepoints (tp) = " + new DecimalFormat("#.##").format(minInliers), Label.CENTER); maxDistLabel = new Label("Maximum Gap (tp) = " + new DecimalFormat("#.##").format(maxDist), Label.CENTER); minSlopeLabel = new Label("Min. Segment Slope (px/tp) = " + new DecimalFormat("#.##").format(minSlope), Label.CENTER); maxSlopeLabel = new Label("Max. Segment Slope (px/tp) = " + new DecimalFormat("#.##").format(maxSlope), Label.CENTER); maxResLabel = new Label( "MT is rescued if the start of event# i + 1 > start of event# i by px = " + this.restolerance, Label.CENTER); CardLayout cl = new CardLayout(); Object[] colnames = new Object[] { "Track File", "Growth velocity", "Shrink velocity", "Growth events", "Shrink events", "fcat", "fres", "Error" }; Object[][] rowvalues = new Object[0][colnames.length]; if (inputfiles != null) { rowvalues = new Object[inputfiles.length][colnames.length]; for (int i = 0; i < inputfiles.length; ++i) { rowvalues[i][0] = inputfiles[i].getName(); } } table = new JTable(rowvalues, colnames); table.setFillsViewportHeight(true); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.isOpaque(); int size = 100; table.getColumnModel().getColumn(0).setPreferredWidth(size); table.getColumnModel().getColumn(1).setPreferredWidth(size); table.getColumnModel().getColumn(2).setPreferredWidth(size); table.getColumnModel().getColumn(3).setPreferredWidth(size); table.getColumnModel().getColumn(4).setPreferredWidth(size); table.getColumnModel().getColumn(5).setPreferredWidth(size); table.getColumnModel().getColumn(6).setPreferredWidth(size); table.getColumnModel().getColumn(7).setPreferredWidth(size); maxErrorField = new TextField(5); maxErrorField.setText(Float.toString(maxError)); minInlierField = new TextField(5); minInlierField.setText(Float.toString(minInliers)); maxGapField = new TextField(5); maxGapField.setText(Float.toString(maxDist)); maxSlopeField = new TextField(5); maxSlopeField.setText(Float.toString(maxSlope)); minSlopeField = new TextField(5); minSlopeField.setText(Float.toString(minSlope)); maxErrorSB.setSize(new Dimension(SizeX, 20)); minSlopeSB.setSize(new Dimension(SizeX, 20)); minInliersSB.setSize(new Dimension(SizeX, 20)); maxDistSB.setSize(new Dimension(SizeX, 20)); maxSlopeSB.setSize(new Dimension(SizeX, 20)); maxErrorField.setSize(new Dimension(SizeX, 20)); minInlierField.setSize(new Dimension(SizeX, 20)); maxGapField.setSize(new Dimension(SizeX, 20)); minSlopeField.setSize(new Dimension(SizeX, 20)); maxSlopeField.setSize(new Dimension(SizeX, 20)); scrollPane = new JScrollPane(table); scrollPane.setMinimumSize(new Dimension(300, 200)); scrollPane.setPreferredSize(new Dimension(300, 200)); scrollPane.getViewport().add(table); scrollPane.setAutoscrolls(true); // Location panelFirst.setLayout(layout); panelSecond.setLayout(layout); PanelSavetoFile.setLayout(layout); PanelParameteroptions.setLayout(layout); Panelfunction.setLayout(layout); Panelslope.setLayout(layout); PanelCompileRes.setLayout(layout); PanelDirectory.setLayout(layout); panelCont.setLayout(cl); panelCont.add(panelFirst, "1"); panelCont.add(panelSecond, "2"); panelFirst.setName("Ransac fits for rates and frequency analysis"); c.insets = new Insets(5, 5, 5, 5); c.anchor = GridBagConstraints.BOTH; c.ipadx = 35; inputLabelT = new Label("Compute length distribution at time: "); inputLabelTcont = new Label("(Press Enter to start computation) "); inputFieldT = new TextField(5); inputFieldT.setText("1"); c.gridwidth = 10; c.gridheight = 10; c.gridy = 1; c.gridx = 0; String[] Method = { "Linear Function only", "Linearized Quadratic function", "Linearized Cubic function" }; JComboBox<String> ChooseMethod = new JComboBox<String>(Method); final Checkbox findCatastrophe = new Checkbox("Detect Catastrophies", this.detectCatastrophe); final Checkbox findmanualCatastrophe = new Checkbox("Detect Catastrophies without fit", this.detectmanualCatastrophe); final Scrollbar minCatDist = new Scrollbar(Scrollbar.HORIZONTAL, this.minDistCatInt, 1, MIN_SLIDER, MAX_SLIDER + 1); final Scrollbar maxRes = new Scrollbar(Scrollbar.HORIZONTAL, this.restoleranceInt, 1, MIN_SLIDER, MAX_SLIDER + 1); final Label minCatDistLabel = new Label("Min. Catastrophy height (tp) = " + this.minDistanceCatastrophe, Label.CENTER); final Button done = new Button("Done"); final Button batch = new Button("Save Parameters for Batch run"); final Button cancel = new Button("Cancel"); final Button Compile = new Button("Compute rates and freq. till current file"); final Button AutoCompile = new Button("Auto Compute Velocity and Frequencies"); final Button Measureserial = new Button("Select directory of MTrack generated files"); final Button WriteLength = new Button("Compute length distribution at framenumber : "); final Button WriteStats = new Button("Compute lifetime and mean length distribution"); final Button WriteAgain = new Button("Save Velocity and Frequencies to File"); PanelDirectory.add(Measureserial, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelDirectory.add(scrollPane, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelDirectory.setBorder(selectdirectory); PanelDirectory.setPreferredSize(new Dimension(SizeX, SizeY)); panelFirst.add(PanelDirectory, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); SliderBoxGUI combomaxerror = new SliderBoxGUI(errorstring, maxErrorSB, maxErrorField, maxErrorLabel, scrollbarSize, maxError, MAX_ERROR); PanelParameteroptions.add(combomaxerror.BuildDisplay(), new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); SliderBoxGUI combomininlier = new SliderBoxGUI(inlierstring, minInliersSB, minInlierField, minInliersLabel, scrollbarSize, minInliers, MAX_Inlier); PanelParameteroptions.add(combomininlier.BuildDisplay(), new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); SliderBoxGUI combomaxdist = new SliderBoxGUI(maxgapstring, maxDistSB, maxGapField, maxDistLabel, scrollbarSize, maxDist, MAX_Gap); PanelParameteroptions.add(combomaxdist.BuildDisplay(), new GridBagConstraints(0, 3, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelParameteroptions.add(ChooseMethod, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelParameteroptions.add(lambdaSB, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelParameteroptions.add(lambdaLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelParameteroptions.setPreferredSize(new Dimension(SizeX, SizeY)); PanelParameteroptions.setBorder(selectparam); panelFirst.add(PanelParameteroptions, new GridBagConstraints(3, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); SliderBoxGUI combominslope = new SliderBoxGUI(minslopestring, minSlopeSB, minSlopeField, minSlopeLabel, scrollbarSize, (float) minSlope, (float) MAX_ABS_SLOPE); Panelslope.add(combominslope.BuildDisplay(), new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); SliderBoxGUI combomaxslope = new SliderBoxGUI(maxslopestring, maxSlopeSB, maxSlopeField, maxSlopeLabel, scrollbarSize, (float) maxSlope, (float) MAX_ABS_SLOPE); Panelslope.add(combomaxslope.BuildDisplay(), new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); Panelslope.add(findCatastrophe, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, insets, 0, 0)); Panelslope.add(findmanualCatastrophe, new GridBagConstraints(4, 4, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, insets, 0, 0)); Panelslope.add(minCatDist, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, insets, 0, 0)); Panelslope.add(minCatDistLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, insets, 0, 0)); Panelslope.setBorder(selectslope); Panelslope.setPreferredSize(new Dimension(SizeX, SizeY)); panelFirst.add(Panelslope, new GridBagConstraints(3, 1, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelCompileRes.add(AutoCompile, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelCompileRes.add(WriteLength, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelCompileRes.add(inputFieldT, new GridBagConstraints(3, 1, 3, 1, 0.1, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelCompileRes.add(WriteStats, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); PanelCompileRes.setPreferredSize(new Dimension(SizeX, SizeY)); PanelCompileRes.setBorder(compileres); panelFirst.add(PanelCompileRes, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insets, 0, 0)); if (inputfiles != null) { table.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() >= 1) { if (!jFreeChartFrame.isVisible()) jFreeChartFrame = Tracking.display(chart, new Dimension(500, 500)); JTable target = (JTable) e.getSource(); row = target.getSelectedRow(); // do some action if appropriate column if (row > 0) displayclicked(row); else displayclicked(0); } } }); } maxErrorSB.addAdjustmentListener(new ErrorListener(this, maxErrorLabel, errorstring, MIN_ERROR, MAX_ERROR, scrollbarSize, maxErrorSB)); minInliersSB.addAdjustmentListener(new MinInlierListener(this, minInliersLabel, inlierstring, MIN_Inlier, MAX_Inlier, scrollbarSize, minInliersSB)); maxDistSB.addAdjustmentListener( new MaxDistListener(this, maxDistLabel, maxgapstring, MIN_Gap, MAX_Gap, scrollbarSize, maxDistSB)); ChooseMethod.addActionListener(new FunctionItemListener(this, ChooseMethod)); lambdaSB.addAdjustmentListener(new LambdaListener(this, lambdaLabel, lambdaSB)); minSlopeSB.addAdjustmentListener(new MinSlopeListener(this, minSlopeLabel, minslopestring, (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize, minSlopeSB)); maxSlopeSB.addAdjustmentListener(new MaxSlopeListener(this, maxSlopeLabel, maxslopestring, (float) MIN_ABS_SLOPE, (float) MAX_ABS_SLOPE, scrollbarSize, maxSlopeSB)); findCatastrophe.addItemListener( new CatastrophyCheckBoxListener(this, findCatastrophe, minCatDistLabel, minCatDist)); findmanualCatastrophe.addItemListener( new ManualCatastrophyCheckBoxListener(this, findmanualCatastrophe, minCatDistLabel, minCatDist)); minCatDist.addAdjustmentListener(new MinCatastrophyDistanceListener(this, minCatDistLabel, minCatDist)); Measureserial.addActionListener(new MeasureserialListener(this)); Compile.addActionListener(new CompileResultsListener(this)); AutoCompile.addActionListener(new AutoCompileResultsListener(this)); WriteLength.addActionListener(new WriteLengthListener(this)); WriteStats.addActionListener(new WriteStatsListener(this)); WriteAgain.addActionListener(new WriteRatesListener(this)); done.addActionListener(new FinishButtonListener(this, false)); batch.addActionListener(new RansacBatchmodeListener(this)); cancel.addActionListener(new FinishButtonListener(this, true)); inputFieldT.addTextListener(new LengthdistroListener(this)); maxSlopeField.addTextListener(new MaxSlopeLocListener(this, false)); minSlopeField.addTextListener(new MinSlopeLocListener(this, false)); maxErrorField.addTextListener(new ErrorLocListener(this, false)); minInlierField.addTextListener(new MinInlierLocListener(this, false)); maxGapField.addTextListener(new MaxDistLocListener(this, false)); panelFirst.setVisible(true); functionChoice = 0; cl.show(panelCont, "1"); Cardframe.add(panelCont, BorderLayout.CENTER); setFunction(); Cardframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); Cardframe.pack(); Cardframe.setVisible(true); Cardframe.pack(); }
From source file:com.sec.ose.osi.ui.frm.main.identification.codematch.JPanCodeMatchMain.java
/** * This method initializes jPanel2 /*w w w .j ava2s.co m*/ * * @return javax.swing.JPanel */ private JPanel getJPanelViewBtn() { if (jPanelViewBtn == null) { GridBagConstraints gridBagConstraints18 = new GridBagConstraints(); gridBagConstraints18.gridx = 1; gridBagConstraints18.anchor = GridBagConstraints.EAST; gridBagConstraints18.fill = GridBagConstraints.NONE; gridBagConstraints18.insets = new Insets(0, 0, 10, 10); gridBagConstraints18.weightx = 1.0; GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); gridBagConstraints16.gridx = 0; gridBagConstraints16.weightx = 1.0; gridBagConstraints16.anchor = GridBagConstraints.WEST; gridBagConstraints16.insets = new Insets(0, 10, 0, 0); gridBagConstraints16.gridy = 0; jLabelStringSearchIdentifyInfo = new JLabel(); jLabelStringSearchIdentifyInfo .setText("This file is identified as (StringSearchLicense) by String Search"); jPanelViewBtn = new JPanel(); jPanelViewBtn.setLayout(new GridBagLayout()); jPanelViewBtn.add(getJButtonView(), gridBagConstraints18); jPanelViewBtn.add(jLabelStringSearchIdentifyInfo, gridBagConstraints16); } return jPanelViewBtn; }
From source file:com.lp.client.frame.component.PanelDokumentenablage.java
private void jbInit() throws Throwable { if (LPMain.getInstance().getDesktop() .darfAnwenderAufZusatzfunktionZugreifen(MandantFac.ZUSATZFUNKTION_DOKUMENTENABLAGE)) { if (!(new HeliumDocPath()).equals(fullDocPath)) { bHatDokumentenablage = true; }/*from w w w . j a v a 2s . c o m*/ } if (bShowExitButton) { String[] aWhichButtonIUse = new String[] { PanelBasis.ACTION_NEW, PanelBasis.ACTION_UPDATE, PanelBasis.ACTION_SAVE, PanelBasis.ACTION_DISCARD }; enableToolsPanelButtons(aWhichButtonIUse); createAndSaveAndShowButton("/com/lp/client/res/scanner.png", "TWAIN-Import", BUTTON_SCAN, null); } dropArea.setCenterText(LPMain.getTextRespectUISPr("lp.datei.draganddrop.ablegen")); dropArea.setBackground(Color.LIGHT_GRAY); dropArea.setSupportFiles(true); dropArea.addDropListener(this); dropArea.setMinimumSize(new Dimension(200, 100)); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); JPanel leftPane = new JPanel(); JPanel rightPane = new JPanel(); JLayeredPane rightLayered = new JLayeredPane(); rightLayered.setLayout(new GridBagLayout()); rightLayered.add(rightPane, new GridBagConstraints(1, 1, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // rightLayered.setLayer(rightPane, 0, 1); if (bShowExitButton && bHatDokumentenablage) rightLayered.add(dropArea, new GridBagConstraints(1, 2, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // rightLayered.setLayer(dropArea, 1, 1); rightPane.setLayout(new GridBagLayout()); tree = new WrapperJTree(treeModel); tree.setEditable(false); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.setShowsRootHandles(true); tree.setRowHeight(0); tree.setCellRenderer(new ToolTipCellRenderer()); ToolTipManager.sharedInstance().registerComponent(tree); tree.addTreeSelectionListener(this); refresh(); personalDto = DelegateFactory.getInstance().getPersonalDelegate() .personalFindByPrimaryKey(LPMain.getTheClient().getIDPersonal()); dokumentbelegartDto = DelegateFactory.getInstance().getJCRDocDelegate() .dokumentbelegartfindbyMandant(LPMain.getTheClient().getMandant()); for (int i = 0; i < dokumentbelegartDto.length; i++) { if (!JCRDocFac.DEFAULT_ARCHIV_BELEGART.equals(dokumentbelegartDto[i].getCNr())) wcbBelegart.addItem(dokumentbelegartDto[i].getCNr()); } dokumentgruppierungDto = DelegateFactory.getInstance().getJCRDocDelegate() .dokumentgruppierungfindbyMandant(LPMain.getTheClient().getMandant()); for (int i = 0; i < dokumentgruppierungDto.length; i++) { if (!JCRDocFac.DEFAULT_ARCHIV_GRUPPE.equals(dokumentgruppierungDto[i].getCNr()) || !JCRDocFac.DEFAULT_KOPIE_GRUPPE.equals(dokumentgruppierungDto[i].getCNr()) || !JCRDocFac.DEFAULT_VERSANDAUFTRAG_GRUPPE.equals(dokumentgruppierungDto[i].getCNr())) { wcbGruppierung.addItem(dokumentgruppierungDto[i].getCNr()); } } // Listen for when the selection changes. tree.addTreeExpansionListener(this); wcbVersteckteAnzeigen.setEnabled(true); wcbVersteckteAnzeigen.addActionListener(actionListener); wtfSuche.setEditable(true); wbuSuche.setEnabled(true); wbuSuche.addActionListener(actionListener); wbuPartner = new WrapperButton(); wbuPartner.setText(LPMain.getTextRespectUISPr("button.partner")); wbuPartner.setToolTipText(LPMain.getTextRespectUISPr("button.partner.tooltip")); wbuPartner.setActionCommand(ACTION_SPECIAL_PARTNER); wbuPartner.addActionListener(this); wbuChooseDoc.setActionCommand(ACTION_SPECIAL_CHOOSE); wbuChooseDoc.addActionListener(this); wbuShowDoc.setActionCommand(ACTION_SPECIAL_SHOW); wbuShowDoc.addActionListener(this); wbuSaveDoc.setActionCommand(ACTION_SPECIAL_SAVE); wbuSaveDoc.addActionListener(this); wtfPartner = new WrapperTextField(); wtfPartner.setColumnsMax(Facade.MAX_UNBESCHRAENKT); wtfPartner.setActivatable(false); wtfAnleger.setActivatable(false); wdfZeitpunkt.setActivatable(false); wtfBelegnummer.setActivatable(false); wtfTable.setActivatable(false); wtfRow.setActivatable(false); wtfFilename.setActivatable(false); wtfFilename.setColumnsMax(100); wtfMIME.setActivatable(false); wcbVersteckt.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { wtfSchlagworte.setMandatoryField(!wcbVersteckt.isSelected()); } }); if (bHatStufe0) { wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_NONE); } if (bHatStufe1) { wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_LOW); } if (bHatStufe2) { wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_MEDIUM); } if (bHatStufe3) { wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_HIGH); } if (bHatStufe99) { wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_ARCHIV); } wtfTable.setMandatoryField(true); wtfName.setMandatoryField(true); wtfName.setColumnsMax(200); wtfBelegnummer.setMandatoryField(true); wtfRow.setMandatoryField(true); wtfFilename.setMandatoryField(true); wtfMIME.setMandatoryField(true); wtfAnleger.setMandatoryField(true); wtfSchlagworte.setMandatoryField(true); wtfSchlagworte.setColumnsMax(300); wdfZeitpunkt.setMandatoryField(true); wtfPartner.setMandatoryField(true); treeView = new JScrollPane(tree); treeView.setMinimumSize(new Dimension(200, 10)); treeView.setPreferredSize(new Dimension(200, 10)); iZeile = 0; if (!bShowExitButton) { jpaWorkingOn.add(wtfSuche, new GridBagConstraints(0, iZeile, 1, 1, 0.2, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); jpaWorkingOn.add(wbuSuche, new GridBagConstraints(1, iZeile, 1, 1, 0.1, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; } jpaWorkingOn.add(wcbVersteckteAnzeigen, new GridBagConstraints(0, iZeile, 1, 1, 1, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; leftPane.add(treeView); jpaWorkingOn.add(splitPane, new GridBagConstraints(0, iZeile, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile = 0; rightPane.add(wlaName, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfName, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wlaTable, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfTable, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wlaSchlagworte, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfSchlagworte, new GridBagConstraints(1, iZeile, 6, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wlaZeitpunkt, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wdfZeitpunkt, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wlaSicherheitsstufe, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wcbSicherheitsstufe, new GridBagConstraints(5, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wcbVersteckt, new GridBagConstraints(6, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wlaBelegnummer, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfBelegnummer, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wlaRow, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfRow, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wlaFilename, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfFilename, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wlaMIME, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfMIME, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wlaBelegart, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wcbBelegart, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wlaGruppierung, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wcbGruppierung, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wbuPartner, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfPartner, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wlaAnleger, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wtfAnleger, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wbuChooseDoc, new GridBagConstraints(0, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wbuShowDoc, new GridBagConstraints(3, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); rightPane.add(wbuSaveDoc, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wlaVorschau, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); iZeile++; rightPane.add(wmcMedia, new GridBagConstraints(0, iZeile, 7, 4, 1.0, 0.5, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); splitPane.setLeftComponent(treeView); splitPane.setRightComponent(rightLayered); }
From source file:org.openconcerto.erp.core.supplychain.order.component.CommandeSQLComponent.java
private JPanel getBottomPanel() { final JPanel panel = new JPanel(new GridBagLayout()); final GridBagConstraints c = new DefaultGridBagConstraints(); // Colonne 1 : Infos c.gridx = 0;/*from ww w. j a v a 2s . co m*/ c.weightx = 1; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; panel.add(new TitledSeparator(getLabelFor("INFOS")), c); c.gridy++; c.weighty = 0; c.weightx = 1; c.fill = GridBagConstraints.BOTH; final JScrollPane scrollPane = new JScrollPane(this.infos); scrollPane.setBorder(null); panel.add(scrollPane, c); // Colonne 2 : Poids & autres DefaultProps props = DefaultNXProps.getInstance(); Boolean b = props.getBooleanValue("ArticleShowPoids"); final JTextField textPoidsTotal = new JTextField(8); JTextField poids = new JTextField(); if (b) { final JPanel panelPoids = new JPanel(); panelPoids.add(new JLabel(getLabelFor("T_POIDS")), c); textPoidsTotal.setEnabled(false); textPoidsTotal.setHorizontalAlignment(JTextField.RIGHT); textPoidsTotal.setDisabledTextColor(Color.BLACK); panelPoids.add(textPoidsTotal, c); c.gridx++; c.gridy = 0; c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.gridheight = 2; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.NORTHEAST; panel.add(panelPoids, c); DefaultGridBagConstraints.lockMinimumSize(panelPoids); addSQLObject(textPoidsTotal, "T_POIDS"); } else { addSQLObject(poids, "T_POIDS"); } DeviseField textPortHT = new DeviseField(); ElementComboBox comboTaxePort = new ElementComboBox(); if (getTable().contains("PORT_HT")) { addRequiredSQLObject(textPortHT, "PORT_HT"); final JPanel panelPoids = new JPanel(new GridBagLayout()); GridBagConstraints cPort = new DefaultGridBagConstraints(); cPort.gridx = 0; cPort.weightx = 0; panelPoids.add(new JLabel(getLabelFor("PORT_HT")), cPort); textPortHT.setHorizontalAlignment(JTextField.RIGHT); cPort.gridx++; cPort.weightx = 1; panelPoids.add(textPortHT, cPort); cPort.gridy++; cPort.gridx = 0; cPort.weightx = 0; addRequiredSQLObject(comboTaxePort, "ID_TAXE_PORT"); panelPoids.add(new JLabel(getLabelFor("ID_TAXE_PORT")), cPort); cPort.gridx++; cPort.weightx = 0; panelPoids.add(comboTaxePort, cPort); c.gridx++; c.gridy = 0; c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.gridheight = 2; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.NORTHEAST; panel.add(panelPoids, c); DefaultGridBagConstraints.lockMinimumSize(panelPoids); } // Total DeviseField textRemiseHT = new DeviseField(); DeviseField fieldHT = new DeviseField(); DeviseField fieldTVA = new DeviseField(); DeviseField fieldTTC = new DeviseField(); DeviseField fieldDevise = new DeviseField(); DeviseField fieldService = new DeviseField(); fieldHT.setOpaque(false); fieldTVA.setOpaque(false); fieldTTC.setOpaque(false); fieldService.setOpaque(false); addRequiredSQLObject(fieldDevise, "T_DEVISE"); addRequiredSQLObject(fieldHT, "T_HT"); addRequiredSQLObject(fieldTVA, "T_TVA"); addRequiredSQLObject(fieldTTC, "T_TTC"); addRequiredSQLObject(fieldService, "T_SERVICE"); final TotalPanel totalTTC = new TotalPanel(this.table, fieldHT, fieldTVA, fieldTTC, textPortHT, textRemiseHT, fieldService, null, fieldDevise, null, null, (getTable().contains("ID_TAXE_PORT") ? comboTaxePort : null)); c.gridx++; c.gridy--; c.gridwidth = GridBagConstraints.REMAINDER; c.gridheight = 2; c.anchor = GridBagConstraints.NORTHEAST; c.fill = GridBagConstraints.BOTH; c.weighty = 0; DefaultGridBagConstraints.lockMinimumSize(totalTTC); panel.add(totalTTC, c); c.gridy += 3; c.gridheight = 2; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.EAST; panel.add(getModuleTotalPanel(), c); table.getModel().addTableModelListener(new TableModelListener() { public void tableChanged(TableModelEvent e) { textPoidsTotal.setText(String.valueOf(table.getPoidsTotal())); } }); textPortHT.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { totalTTC.updateTotal(); } public void removeUpdate(DocumentEvent e) { totalTTC.updateTotal(); } public void insertUpdate(DocumentEvent e) { totalTTC.updateTotal(); } }); comboTaxePort.addValueListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { // TODO Raccord de mthode auto-gnr totalTTC.updateTotal(); } }); textRemiseHT.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { totalTTC.updateTotal(); } public void removeUpdate(DocumentEvent e) { totalTTC.updateTotal(); } public void insertUpdate(DocumentEvent e) { totalTTC.updateTotal(); } }); return panel; }