List of usage examples for java.awt Insets Insets
public Insets(int top, int left, int bottom, int right)
From source file:org.datacleaner.widgets.result.PatternFinderResultSwingRendererCrosstabDelegate.java
@Override public JComponent render(CrosstabResult result) { final CrosstabPanel crosstabPanel = super.renderInternal(result); final DCTable table = crosstabPanel.getTable(); if (isInitiallyCharted(table) || isTooLimitedToChart(table)) { return crosstabPanel; }//from w ww . ja v a 2s . c o m final DCPanel headerPanel = new DCPanel(); headerPanel.setLayout(new FlowLayout(Alignment.RIGHT.getFlowLayoutAlignment(), 1, 1)); final JButton chartButton = WidgetFactory.createDefaultButton("Show distribution chart", IconUtils.CHART_BAR); chartButton.setMargin(new Insets(1, 1, 1, 1)); chartButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { headerPanel.setVisible(false); displayChart(table, crosstabPanel.getDisplayChartCallback()); } }); headerPanel.add(chartButton); final DCPanel panel = new DCPanel(); panel.setLayout(new BorderLayout()); panel.add(headerPanel, BorderLayout.NORTH); panel.add(crosstabPanel, BorderLayout.CENTER); return panel; }
From source file:org.fhcrc.cpl.viewer.quant.gui.PanelWithLogRatioHistAndFields.java
/** * Lay out GUI components, but NOT the histogram *//*ww w.j a v a2s . c o m*/ protected void initGUI() { setLayout(new GridBagLayout()); maxLowRatioLabel = new JLabel("Max Low Ratio: "); minHighRatioLabel = new JLabel("Min High Ratio: "); numPassingRatiosLabel = new JLabel("Retained: "); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.PAGE_START; gbc.insets = new Insets(0, 0, 0, 0); gbc.weighty = 0; gbc.weightx = 1; gbc.gridwidth = 1; add(maxLowRatioLabel, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; add(minHighRatioLabel, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; add(numPassingRatiosLabel, gbc); }
From source file:soap.ui.panel.innerCentralPanel.StatsPanel.java
protected void initUI() { if (mIndicatorsName.size() != 0) { defaultAddComponent(new JLabel(resMan.getString("statsChooseIndicator")), SoapGridbagPanel.END); JPanel indicatorsPanel = new JPanel(); indicatorsPanel.setBackground(Color.WHITE); indicatorsPanel.setLayout(new GridLayout(mIndicatorsName.size(), 1)); mCheckBoxTable = new JCheckBox[mIndicatorsName.size()]; CheckBoxListener listener = new CheckBoxListener(); Iterator it = mIndicatorsName.keySet().iterator(); for (int i = 0; i < mIndicatorsName.size(); i++) { String key = (String) it.next(); mCheckBoxTable[i] = new JCheckBox((String) mIndicatorsName.get(key)); mCheckBoxTable[i].setName(key); mCheckBoxTable[i].setPreferredSize(new Dimension(50, 20)); mCheckBoxTable[i].setBackground(Color.WHITE); mCheckBoxTable[i].addItemListener(listener); indicatorsPanel.add(mCheckBoxTable[i]); }//from www.j a va 2 s .c o m JScrollPane scrollPane = new JScrollPane(indicatorsPanel); scrollPane.setPreferredSize(new Dimension(140, 65)); defaultAddComponent(scrollPane, SoapGridbagPanel.END, 1, 0, new Insets(10, 0, 20, 0)); // add the chart to a panel... mChartPanel.setPreferredSize(new Dimension(580, 330)); defaultAddComponent(new JScrollPane(mChartPanel), SoapGridbagPanel.END); } }
From source file:org.bench4Q.console.ui.section.R_RealSessionShowSection.java
/** * @param resources/* w w w .j a va 2 s.c om*/ * @param processControl * @param agentsCollection * @throws ConsoleException */ public R_RealSessionShowSection(Resources resources, ProcessControl processControl, AgentsCollection agentsCollection) throws ConsoleException { m_resources = resources; m_processControl = processControl; m_agentsCollection = agentsCollection; m_agentsCollection.registerObserver(this); this.setLayout(new GridBagLayout()); this.setPreferredSize(new Dimension(683, 475)); this.setMinimumSize(new Dimension(683, 475)); testduring = -1; resultNumber = 0; picPanel = new PicPanel(); this.add(picPanel, new GridBagConstraints(0, 0, 1, 4, 99.0, 99.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 1, 1)); }
From source file:bazaar4idea.ui.BzrPullDialog.java
/** Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * @noinspection ALL//from w w w. j av a 2s.c o m */ private void $$$setupUI$$$() { mainPanel = new JPanel(); mainPanel.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1)); hgRepositorySelector = new BzrRepositorySelectorComponent(); mainPanel.add(hgRepositorySelector.$$$getRootComponent$$$(), new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final Spacer spacer1 = new Spacer(); mainPanel.add(spacer1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1)); mainPanel.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label1 = new JLabel(); label1.setText("Pull From:"); panel1.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final Spacer spacer2 = new Spacer(); panel1.add(spacer2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); sourceTxt = new JTextField(); panel1.add(sourceTxt, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); }
From source file:org.bench4Q.console.ui.section.R_RealTransactionShowSection.java
/** * @param resources//from w w w . ja v a2 s . co m * @param processControl * @param agentsCollection * @throws ConsoleException */ public R_RealTransactionShowSection(Resources resources, ProcessControl processControl, AgentsCollection agentsCollection) throws ConsoleException { m_resources = resources; m_processControl = processControl; m_agentsCollection = agentsCollection; m_agentsCollection.registerObserver(this); this.setLayout(new GridBagLayout()); this.setPreferredSize(new Dimension(683, 475)); this.setMinimumSize(new Dimension(683, 475)); testduring = -1; resultNumber = 0; picPanel = new PicPanel(); this.add(picPanel, new GridBagConstraints(0, 0, 1, 4, 99.0, 99.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 1, 1)); }
From source file:com.microsoft.alm.plugin.idea.git.ui.simplecheckout.SimpleCheckoutForm.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL/* w w w. j a v a 2 s . c o m*/ */ private void $$$setupUI$$$() { contentPanel = new JPanel(); contentPanel.setLayout(new GridLayoutManager(6, 1, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.setMinimumSize(new Dimension(500, 180)); final JLabel label1 = new JLabel(); label1.setText("Directory Name:"); contentPanel.add(label1, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); directoryName = new JTextField(); contentPanel.add(directoryName, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JLabel label2 = new JLabel(); label2.setText("Repository Url:"); contentPanel.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); repoUrl = new JTextField(); repoUrl.setEditable(false); contentPanel.add(repoUrl, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); parentDirectory = new TextFieldWithBrowseButton(); contentPanel.add(parentDirectory, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(150, -1), null, 0, false)); final JLabel label3 = new JLabel(); label3.setText("Parent Directory:"); contentPanel.add(label3, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); }
From source file:components.ProgressBarDemo2.java
public ProgressBarDemo2() { super(new BorderLayout()); //Create the demo's UI. startButton = new JButton("Start"); startButton.setActionCommand("start"); startButton.addActionListener(this); progressBar = new JProgressBar(0, 100); progressBar.setValue(0);/* w w w. j a va 2 s . c o m*/ //Call setStringPainted now so that the progress bar height //stays the same whether or not the string is shown. progressBar.setStringPainted(true); taskOutput = new JTextArea(5, 20); taskOutput.setMargin(new Insets(5, 5, 5, 5)); taskOutput.setEditable(false); JPanel panel = new JPanel(); panel.add(startButton); panel.add(progressBar); add(panel, BorderLayout.PAGE_START); add(new JScrollPane(taskOutput), BorderLayout.CENTER); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); }
From source file:ShadowPopupBorder.java
/** * Returns the insets of the border. */ public Insets getBorderInsets(Component c) { return new Insets(0, 0, SHADOW_SIZE, SHADOW_SIZE); }
From source file:org.eobjects.datacleaner.widgets.result.PatternFinderResultSwingRendererCrosstabDelegate.java
@Override public JComponent render(CrosstabResult result) { final CrosstabPanel crosstabPanel = super.renderInternal(result); final DCTable table = crosstabPanel.getTable(); if (isInitiallyCharted(table) || isTooLimitedToChart(table)) { return crosstabPanel; }// w w w. j av a2 s .c o m final DCPanel headerPanel = new DCPanel(); headerPanel.setLayout(new FlowLayout(Alignment.RIGHT.getFlowLayoutAlignment(), 1, 1)); final JButton chartButton = new JButton("Show distribution chart", ImageManager.get().getImageIcon("images/chart-types/bar.png")); chartButton.setMargin(new Insets(1, 1, 1, 1)); chartButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { headerPanel.setVisible(false); displayChart(table, crosstabPanel.getDisplayChartCallback()); } }); headerPanel.add(chartButton); final DCPanel panel = new DCPanel(); panel.setLayout(new BorderLayout()); panel.add(headerPanel, BorderLayout.NORTH); panel.add(crosstabPanel, BorderLayout.CENTER); return panel; }