List of usage examples for java.awt Insets Insets
public Insets(int top, int left, int bottom, int right)
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectCreate.java
private JPanel getJPanelButton() { if (jPanelButton == null) { GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); gridBagConstraints12.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints12.insets = new Insets(0, 10, 10, 10); GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.gridx = 0;/* w w w .ja va 2 s . co m*/ gridBagConstraints4.insets = new Insets(0, 10, 10, 10); gridBagConstraints4.gridy = 1; jPanelButton = new JPanel(); jPanelButton.setLayout(new GridBagLayout()); jPanelButton.add(getJButtonOK(), gridBagConstraints12); jPanelButton.add(getJButtonCancel(), gridBagConstraints4); } return jPanelButton; }
From source file:de.cismet.cids.custom.objecteditors.wunda_blau.WebDavPicturePanel.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. */// w ww.j av a2s . c om @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { GridBagConstraints gridBagConstraints; bindingGroup = new BindingGroup(); final RoundedPanel pnlFotos = new RoundedPanel(); final SemiRoundedPanel pnlHeaderFotos = new SemiRoundedPanel(); final JLabel lblHeaderFotos = new JLabel(); final JPanel jPanel2 = new JPanel(); final JPanel jPanel1 = new JPanel(); final JScrollPane jspFotoList = new JScrollPane(); lstFotos = new JList(); final JPanel pnlCtrlButtons = new JPanel(); btnAddImg = new JButton(); btnRemoveImg = new JButton(); final JPanel pnlMap = new JPanel(); final RoundedPanel pnlVorschau = new RoundedPanel(); final SemiRoundedPanel semiRoundedPanel2 = new SemiRoundedPanel(); final JLabel lblVorschau = new JLabel(); final JPanel jPanel3 = new JPanel(); pnlFoto = new JPanel(); lblPicture = new JLabel(); lblBusy = new JXBusyLabel(new Dimension(75, 75)); final JPanel pnlCtrlBtn = new JPanel(); btnPrevImg = new JButton(); btnNextImg = new JButton(); final FormListener formListener = new FormListener(); setName("Form"); // NOI18N setOpaque(false); setLayout(new GridBagLayout()); pnlFotos.setMinimumSize(new Dimension(400, 200)); pnlFotos.setName("pnlFotos"); // NOI18N pnlFotos.setPreferredSize(new Dimension(400, 200)); pnlFotos.setLayout(new GridBagLayout()); pnlHeaderFotos.setBackground(new Color(51, 51, 51)); pnlHeaderFotos.setForeground(new Color(51, 51, 51)); pnlHeaderFotos.setName("pnlHeaderFotos"); // NOI18N pnlHeaderFotos.setLayout(new FlowLayout()); lblHeaderFotos.setForeground(new Color(255, 255, 255)); Mnemonics.setLocalizedText(lblHeaderFotos, NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblHeaderFotos.text")); // NOI18N lblHeaderFotos.setName("lblHeaderFotos"); // NOI18N pnlHeaderFotos.add(lblHeaderFotos); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; pnlFotos.add(pnlHeaderFotos, gridBagConstraints); jPanel2.setName("jPanel2"); // NOI18N jPanel2.setOpaque(false); jPanel2.setLayout(new GridBagLayout()); jPanel1.setName("jPanel1"); // NOI18N jPanel1.setOpaque(false); jPanel1.setLayout(new GridBagLayout()); jspFotoList.setMinimumSize(new Dimension(250, 130)); jspFotoList.setName("jspFotoList"); // NOI18N lstFotos.setMinimumSize(new Dimension(250, 130)); lstFotos.setName("lstFotos"); // NOI18N lstFotos.setPreferredSize(new Dimension(250, 130)); final ELProperty eLProperty = ELProperty.create("${cidsBean." + beanCollProp + "}"); final JListBinding jListBinding = SwingBindings.createJListBinding(AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, lstFotos); bindingGroup.addBinding(jListBinding); lstFotos.addListSelectionListener(formListener); jspFotoList.setViewportView(lstFotos); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1.add(jspFotoList, gridBagConstraints); pnlCtrlButtons.setName("pnlCtrlButtons"); // NOI18N pnlCtrlButtons.setOpaque(false); pnlCtrlButtons.setLayout(new GridBagLayout()); btnAddImg.setIcon(new ImageIcon( getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_add_mini.png"))); // NOI18N Mnemonics.setLocalizedText(btnAddImg, NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnAddImg.text")); // NOI18N btnAddImg.setBorderPainted(false); btnAddImg.setContentAreaFilled(false); btnAddImg.setName("btnAddImg"); // NOI18N btnAddImg.addActionListener(formListener); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.insets = new Insets(0, 0, 5, 0); pnlCtrlButtons.add(btnAddImg, gridBagConstraints); btnRemoveImg.setIcon(new ImageIcon( getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_remove_mini.png"))); // NOI18N Mnemonics.setLocalizedText(btnRemoveImg, NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnRemoveImg.text")); // NOI18N btnRemoveImg.setBorderPainted(false); btnRemoveImg.setContentAreaFilled(false); btnRemoveImg.setName("btnRemoveImg"); // NOI18N btnRemoveImg.addActionListener(formListener); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridy = 1; gridBagConstraints.insets = new Insets(5, 0, 0, 0); pnlCtrlButtons.add(btnRemoveImg, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.anchor = GridBagConstraints.NORTH; gridBagConstraints.insets = new Insets(0, 5, 0, 0); jPanel1.add(pnlCtrlButtons, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new Insets(10, 10, 10, 0); jPanel2.add(jPanel1, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new Insets(0, 0, 2, 0); pnlFotos.add(jPanel2, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.anchor = GridBagConstraints.NORTH; gridBagConstraints.insets = new Insets(0, 0, 5, 5); add(pnlFotos, gridBagConstraints); pnlMap.setBorder(BorderFactory.createEtchedBorder()); pnlMap.setMinimumSize(new Dimension(400, 200)); pnlMap.setName("pnlMap"); // NOI18N pnlMap.setPreferredSize(new Dimension(400, 200)); pnlMap.setLayout(new BorderLayout()); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = GridBagConstraints.VERTICAL; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new Insets(5, 0, 0, 5); add(pnlMap, gridBagConstraints); pnlMap.add(map, BorderLayout.CENTER); pnlVorschau.setName("pnlVorschau"); // NOI18N pnlVorschau.setLayout(new GridBagLayout()); semiRoundedPanel2.setBackground(new Color(51, 51, 51)); semiRoundedPanel2.setName("semiRoundedPanel2"); // NOI18N semiRoundedPanel2.setLayout(new FlowLayout()); lblVorschau.setForeground(new Color(255, 255, 255)); Mnemonics.setLocalizedText(lblVorschau, NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblVorschau.text")); // NOI18N lblVorschau.setName("lblVorschau"); // NOI18N semiRoundedPanel2.add(lblVorschau); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; pnlVorschau.add(semiRoundedPanel2, gridBagConstraints); jPanel3.setName("jPanel3"); // NOI18N jPanel3.setOpaque(false); jPanel3.setLayout(new GridBagLayout()); pnlFoto.setName("pnlFoto"); // NOI18N pnlFoto.setOpaque(false); pnlFoto.setLayout(new GridBagLayout()); lblPicture.setHorizontalAlignment(SwingConstants.CENTER); Mnemonics.setLocalizedText(lblPicture, NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblPicture.text")); // NOI18N lblPicture.setName("lblPicture"); // NOI18N gridBagConstraints = new GridBagConstraints(); gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; pnlFoto.add(lblPicture, gridBagConstraints); lblBusy.setHorizontalAlignment(SwingConstants.CENTER); lblBusy.setMaximumSize(new Dimension(140, 40)); lblBusy.setMinimumSize(new Dimension(140, 60)); lblBusy.setName("lblBusy"); // NOI18N lblBusy.setPreferredSize(new Dimension(140, 60)); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; pnlFoto.add(lblBusy, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new Insets(10, 10, 0, 10); jPanel3.add(pnlFoto, gridBagConstraints); pnlCtrlBtn.setName("pnlCtrlBtn"); // NOI18N pnlCtrlBtn.setOpaque(false); pnlCtrlBtn.setPreferredSize(new Dimension(100, 50)); pnlCtrlBtn.setLayout(new GridBagLayout()); btnPrevImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-left.png"))); // NOI18N Mnemonics.setLocalizedText(btnPrevImg, NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnPrevImg.text")); // NOI18N btnPrevImg.setBorderPainted(false); btnPrevImg.setFocusPainted(false); btnPrevImg.setName("btnPrevImg"); // NOI18N btnPrevImg.addActionListener(formListener); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; pnlCtrlBtn.add(btnPrevImg, gridBagConstraints); btnNextImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-right.png"))); // NOI18N Mnemonics.setLocalizedText(btnNextImg, NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnNextImg.text")); // NOI18N btnNextImg.setBorderPainted(false); btnNextImg.setFocusPainted(false); btnNextImg.setName("btnNextImg"); // NOI18N btnNextImg.addActionListener(formListener); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; pnlCtrlBtn.add(btnNextImg, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.insets = new Insets(0, 10, 10, 10); jPanel3.add(pnlCtrlBtn, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; pnlVorschau.add(jPanel3, gridBagConstraints); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new Insets(0, 5, 0, 0); add(pnlVorschau, gridBagConstraints); bindingGroup.bind(); }
From source file:it.ventuland.ytd.ui.GUIClient.java
private void addComponentsToPane(final Container pane) { this.panel = new JPanel(); this.panel.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 5, 5, 5); gbc.anchor = GridBagConstraints.WEST; ActionManager lActionManager = new ActionManager(); dlm = new DefaultListModel<String>(); this.urllist = new JList<String>(dlm); // TODO maybe we add a button to remove added URLs from list? //this.userlist.setSelectionMode( ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); this.urllist.setFocusable(false); textarea = new JTextArea(2, 2); textarea.setEditable(true);//from w w w .ja v a 2 s .com textarea.setFocusable(false); JScrollPane leftscrollpane = new JScrollPane(this.urllist); JScrollPane rightscrollpane = new JScrollPane(textarea); this.middlepane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftscrollpane, rightscrollpane); this.middlepane.setOneTouchExpandable(true); this.middlepane.setDividerLocation(150); Dimension minimumSize = new Dimension(25, 25); leftscrollpane.setMinimumSize(minimumSize); rightscrollpane.setMinimumSize(minimumSize); this.directorybutton = new JButton("", createImageIcon("images/open.png", "")); gbc.gridx = 0; gbc.gridy = 0; this.directorybutton.addActionListener(lActionManager); this.panel.add(this.directorybutton, gbc); this.saveconfigcheckbox = new JCheckBox("Save config"); this.saveconfigcheckbox.setSelected(false); this.panel.add(this.saveconfigcheckbox); this.saveconfigcheckbox.setEnabled(false); // TODO check if initial download directory exists // assume that at least the users homedir exists String shomedir = System.getProperty("user.home").concat(File.separator); gbc.gridx = 0; gbc.gridy = 2; gbc.gridwidth = 2; gbc.fill = GridBagConstraints.HORIZONTAL; this.directorytextfield = new JTextField(shomedir, 20 + (mIsDebug ? 48 : 0)); this.directorytextfield.setEnabled(false); this.directorytextfield.setFocusable(true); this.directorytextfield.addActionListener(lActionManager); this.panel.add(this.directorytextfield, gbc); JLabel dirhint = new JLabel("Download to folder:"); gbc.gridx = 0; gbc.gridy = 1; this.panel.add(dirhint, gbc); this.middlepane.setPreferredSize(new Dimension(Toolkit.getDefaultToolkit().getScreenSize().width / 3, Toolkit.getDefaultToolkit().getScreenSize().height / 4 + (mIsDebug ? 200 : 0))); gbc.gridx = 0; gbc.gridy = 3; gbc.fill = GridBagConstraints.BOTH; gbc.weighty = 2; gbc.weightx = 2; gbc.gridwidth = 2; this.panel.add(this.middlepane, gbc); // radio buttons for resolution to download mVideoResolutionBtnGrp = new ButtonGroup(); JPanel lRadioPanel = new JPanel(new GridLayout(1, 0)); List<Object> lVidQ = mAppContext.getList("youtube-downloader.video-quality"); JRadioButton lRadioButton = null; for (Object obj : lVidQ) { String lQuality = (String) obj; String lToolTip = mAppContext.getString("youtube-downloader.video-quality." + lQuality + ".tooltip"); boolean lSelected = mAppContext .getBoolean("youtube-downloader.video-quality." + lQuality + ".selected"); boolean lEnabled = mAppContext.getBoolean("youtube-downloader.video-quality." + lQuality + ".enabled"); lRadioButton = new JRadioButton(lQuality); lRadioButton.setName(lQuality); lRadioButton.setActionCommand(lQuality.toLowerCase()); lRadioButton.addActionListener(lActionManager); lRadioButton.setToolTipText(lToolTip); lRadioButton.setSelected(lSelected); lRadioButton.setEnabled(lEnabled); mVideoResolutionBtnGrp.add(lRadioButton); lRadioPanel.add(lRadioButton); } gbc.gridx = 1; gbc.gridy = 0; gbc.gridheight = 0; gbc.gridwidth = 0; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.NORTHEAST; this.panel.add(lRadioPanel, gbc); // radio buttons for video format to download mVideoQualityBtnGrp = new ButtonGroup(); lRadioPanel = new JPanel(new GridLayout(1, 0)); save3dcheckbox = new JCheckBox("3D"); save3dcheckbox.setToolTipText("stereoscopic video"); save3dcheckbox.setSelected(false); save3dcheckbox.setEnabled(true); lRadioPanel.add(save3dcheckbox); List<Object> lVidR = mAppContext.getList("youtube-downloader.video-resolution"); lRadioButton = null; for (Object obj : lVidR) { String lResolution = (String) obj; String lToolTip = mAppContext .getString("youtube-downloader.video-resolution." + lResolution + ".tooltip"); boolean lSelected = mAppContext .getBoolean("youtube-downloader.video-resolution." + lResolution + ".selected"); boolean lEnabled = mAppContext .getBoolean("youtube-downloader.video-resolution." + lResolution + ".enabled"); lRadioButton = new JRadioButton(lResolution); lRadioButton.setName(lResolution); lRadioButton.setActionCommand(lResolution.toLowerCase()); lRadioButton.addActionListener(lActionManager); lRadioButton.setToolTipText(lToolTip); lRadioButton.setSelected(lSelected); lRadioButton.setEnabled(lEnabled); mVideoQualityBtnGrp.add(lRadioButton); lRadioPanel.add(lRadioButton); } gbc.gridx = 1; gbc.gridy = 1; gbc.gridheight = 0; gbc.gridwidth = 0; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.NORTHEAST; this.panel.add(lRadioPanel, gbc); JLabel hint = new JLabel("Type, paste or drag'n drop a YouTube video address:"); gbc.fill = 0; gbc.gridwidth = 0; gbc.gridheight = 1; gbc.weightx = 0; gbc.weighty = 0; gbc.gridx = 0; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; this.panel.add(hint, gbc); textinputfield = new JTextField(20); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridx = 0; gbc.gridy = 5; gbc.gridwidth = 2; textinputfield.setEnabled(true); textinputfield.setFocusable(true); textinputfield.addActionListener(lActionManager); textinputfield.getDocument().addDocumentListener(new UrlInsertListener()); this.panel.add(textinputfield, gbc); this.quitbutton = new JButton("", createImageIcon("images/exit.png", "")); gbc.gridx = 2; gbc.gridy = 5; gbc.gridwidth = 0; this.quitbutton.addActionListener(lActionManager); this.quitbutton.setActionCommand("quit"); this.quitbutton.setToolTipText("Exit."); this.panel.add(this.quitbutton, gbc); pane.add(this.panel); addWindowListener(new GUIWindowAdapter()); this.setDropTarget(new DropTarget(this, new DragDropListener())); textarea.setTransferHandler(null); // otherwise the dropped text would be inserted }
From source file:com.vgi.mafscaling.ClosedLoop.java
private JTable createAfrDataTable(JPanel panel, String tableName, int gridy) { final JTable afrTable = new JTable() { private static final long serialVersionUID = 6526901361175099297L; public boolean isCellEditable(int row, int column) { return false; };// w ww .java 2 s. c o m }; DefaultTableColumnModel afrModel = new DefaultTableColumnModel(); final TableColumn afrColumn = new TableColumn(0, 250); afrColumn.setHeaderValue(tableName); afrModel.addColumn(afrColumn); JTableHeader lblAfrTableName = afrTable.getTableHeader(); lblAfrTableName.setColumnModel(afrModel); lblAfrTableName.setReorderingAllowed(false); DefaultTableCellRenderer headerRenderer = (DefaultTableCellRenderer) lblAfrTableName.getDefaultRenderer(); headerRenderer.setHorizontalAlignment(SwingConstants.LEFT); GridBagConstraints gbc_lblAfrTableName = new GridBagConstraints(); gbc_lblAfrTableName.insets = new Insets((gridy == 0 ? 0 : 5), 0, 0, 0); gbc_lblAfrTableName.anchor = GridBagConstraints.PAGE_START; gbc_lblAfrTableName.fill = GridBagConstraints.HORIZONTAL; gbc_lblAfrTableName.gridx = 0; gbc_lblAfrTableName.gridy = gridy; panel.add(lblAfrTableName, gbc_lblAfrTableName); afrTable.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { afrColumn.setWidth(afrTable.getWidth()); } }); afrTable.getTableHeader().setReorderingAllowed(false); afrTable.setColumnSelectionAllowed(true); afrTable.setCellSelectionEnabled(true); afrTable.setBorder(new LineBorder(new Color(0, 0, 0))); afrTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); afrTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); afrTable.setModel(new DefaultTableModel(AfrTableRowCount, AfrTableColumnCount)); Utils.initializeTable(afrTable, ColumnWidth); if (tableName.equals(Afr1TableName)) { Format[][] formatMatrix = { { new DecimalFormat("#"), new DecimalFormat("0.00") } }; NumberFormatRenderer renderer = (NumberFormatRenderer) afrTable.getDefaultRenderer(Object.class); renderer.setFormats(formatMatrix); } else if (tableName.equals(Afr2TableName)) { Format[][] formatMatrix = { { new DecimalFormat("#"), new DecimalFormat("0.00") }, { new DecimalFormat("#"), new DecimalFormat("#") } }; NumberFormatRenderer renderer = (NumberFormatRenderer) afrTable.getDefaultRenderer(Object.class); renderer.setFormats(formatMatrix); } GridBagConstraints gbc_afrTable = new GridBagConstraints(); gbc_afrTable.insets = new Insets(0, 0, 0, 0); gbc_afrTable.anchor = GridBagConstraints.PAGE_START; gbc_afrTable.gridx = 0; gbc_afrTable.gridy = gridy + 1; panel.add(afrTable, gbc_afrTable); excelAdapter.addTable(afrTable, true, false); return afrTable; }
From source file:com.estate.pdf.Page.java
protected void drawTaxPie(Rectangle rct, double totalValue, double tax, String taxLabel, String netLabel) { double taxPercent = (tax / totalValue) * 100; double netValuePercent = 100 - taxPercent; DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue(taxLabel, taxPercent); dataset.setValue(netLabel, netValuePercent); PiePlot3D plot = new PiePlot3D(dataset); plot.setLabelGenerator(new StandardPieItemLabelGenerator()); plot.setInsets(new Insets(0, 5, 5, 5)); plot.setToolTipGenerator(new CustomeGenerators.CustomToolTipGenerator()); plot.setLabelGenerator(new CustomeGenerators.CustomLabelGenerator()); plot.setSectionPaint(0, new Color(pgRed)); plot.setSectionPaint(1, new Color(pgGreen)); plot.setForegroundAlpha(.6f);//w w w . j a v a 2s . c o m plot.setOutlinePaint(Color.white); plot.setBackgroundPaint(Color.white); JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, true); chart.setBackgroundPaint(Color.white); chart.setAntiAlias(true); Rectangle page = rct; try { Image img = Image.getInstance(chart.createBufferedImage((int) page.getWidth(), (int) page.getHeight()), null); drawDiagram(img, rct, 0, 72); } catch (Exception e) { System.out.println(e.getMessage()); } }
From source file:com.sshtools.common.ui.SshToolsApplication.java
/** * Show an 'About' dialog//w w w. ja v a2s. c o m * * */ public void showAbout(final Component parent) { JPanel p = new JPanel(new GridBagLayout()); p.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); GridBagConstraints gBC = new GridBagConstraints(); gBC.anchor = GridBagConstraints.CENTER; gBC.fill = GridBagConstraints.HORIZONTAL; gBC.insets = new Insets(1, 1, 1, 1); JLabel a = new JLabel(getApplicationName()); a.setFont(a.getFont().deriveFont(24f)); UIUtil.jGridBagAdd(p, a, gBC, GridBagConstraints.REMAINDER); MultilineLabel v = new MultilineLabel(getApplicationName() + " " + getApplicationVersion()); v.setFont(v.getFont().deriveFont(10f)); UIUtil.jGridBagAdd(p, v, gBC, GridBagConstraints.REMAINDER); MultilineLabel x = new MultilineLabel(getAboutAuthors()); x.setBorder(BorderFactory.createEmptyBorder(8, 0, 8, 0)); x.setFont(x.getFont().deriveFont(12f)); UIUtil.jGridBagAdd(p, x, gBC, GridBagConstraints.REMAINDER); MultilineLabel c = new MultilineLabel(getAboutLicenseDetails()); c.setFont(c.getFont().deriveFont(10f)); UIUtil.jGridBagAdd(p, c, gBC, GridBagConstraints.REMAINDER); final JLabel h = new JLabel(getAboutURL()); h.setForeground(Color.blue); h.setFont(new Font(h.getFont().getName(), Font.BOLD, 10)); h.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); h.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { try { BrowserLauncher.openURL(getAboutURL()); } catch (IOException ioe) { ioe.printStackTrace(); } } }); UIUtil.jGridBagAdd(p, h, gBC, GridBagConstraints.REMAINDER); JOptionPane.showMessageDialog(parent, p, "About", JOptionPane.PLAIN_MESSAGE, getApplicationLargeIcon()); }
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectAdd.java
/** * This method initializes jPanelButton * /* w w w . j a v a2 s. c om*/ * @return javax.swing.JPanel */ private JPanel getJPanelButton() { if (jPanelButton == null) { GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.insets = new Insets(0, 10, 10, 10); gridBagConstraints4.gridy = 1; gridBagConstraints4.gridx = 0; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = GridBagConstraints.CENTER; gridBagConstraints.insets = new Insets(10, 10, 10, 10); gridBagConstraints.gridx = -1; gridBagConstraints.gridy = -1; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; jPanelButton = new JPanel(); jPanelButton.setLayout(new GridBagLayout()); jPanelButton.add(getJButtonOK(), gridBagConstraints); jPanelButton.add(getJButtonCancel(), gridBagConstraints4); } return jPanelButton; }
From source file:org.opendatakit.briefcase.ui.settings.SettingsPanelForm.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL/*from w ww. j a v a2 s. co m*/ */ private void $$$setupUI$$$() { createUIComponents(); container = new JPanel(); container.setLayout(new GridBagLayout()); storageLocationContainer = new JPanel(); storageLocationContainer.setLayout(new GridBagLayout()); GridBagConstraints gbc; gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 5; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(storageLocationContainer, gbc); storageLocationLabel = new JLabel(); storageLocationLabel.setText("Storage Location"); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; storageLocationContainer.add(storageLocationLabel, gbc); storageLocationField = new JTextField(); storageLocationField.setEditable(false); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.weightx = 1.0; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; storageLocationContainer.add(storageLocationField, gbc); storageLocationButtons = new JPanel(); storageLocationButtons.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); gbc = new GridBagConstraints(); gbc.gridx = 3; gbc.gridy = 0; gbc.fill = GridBagConstraints.BOTH; storageLocationContainer.add(storageLocationButtons, gbc); storageLocationClearButton = new JButton(); storageLocationClearButton.setText("Clear"); storageLocationClearButton.setVisible(false); storageLocationButtons.add(storageLocationClearButton); storageLocationChooseButton = new JButton(); storageLocationChooseButton.setText("Choose..."); storageLocationButtons.add(storageLocationChooseButton); final JPanel spacer1 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; storageLocationContainer.add(spacer1, gbc); pullInParallelField = new JCheckBox(); pullInParallelField.setText("Pull submissions in parallel (experimental)"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 3; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(pullInParallelField, gbc); rememberPasswordsField = new JCheckBox(); rememberPasswordsField.setText("Remember passwords (unencrypted)"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 7; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(rememberPasswordsField, gbc); sendUsageDataField = new JCheckBox(); sendUsageDataField.setText("Send usage data and crash logs to core developers"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 9; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(sendUsageDataField, gbc); useHttpProxyField = new JCheckBox(); useHttpProxyField.setText("Use HTTP Proxy"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 11; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(useHttpProxyField, gbc); final JPanel spacer2 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 12; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 0, 0, 20); container.add(spacer2, gbc); httpProxyJostLabel = new JLabel(); httpProxyJostLabel.setText("Host"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 12; gbc.anchor = GridBagConstraints.WEST; container.add(httpProxyJostLabel, gbc); httpProxyHostField = new JTextField(); httpProxyHostField.setPreferredSize(new Dimension(150, 30)); httpProxyHostField.setText("127.0.0.1"); gbc = new GridBagConstraints(); gbc.gridx = 4; gbc.gridy = 12; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(httpProxyHostField, gbc); final JPanel spacer3 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 3; gbc.gridy = 12; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer3, gbc); httpProxyPortLabel = new JLabel(); httpProxyPortLabel.setText("Port"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 13; gbc.anchor = GridBagConstraints.WEST; container.add(httpProxyPortLabel, gbc); final JPanel spacer4 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 5; gbc.gridy = 12; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer4, gbc); httpProxyPortField.setPreferredSize(new Dimension(150, 30)); gbc = new GridBagConstraints(); gbc.gridx = 4; gbc.gridy = 13; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(httpProxyPortField, gbc); final JPanel spacer5 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 10; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer5, gbc); final JPanel spacer6 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 6; gbc.gridy = 1; gbc.gridheight = 13; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer6, gbc); final JPanel spacer7 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.gridheight = 13; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer7, gbc); final JPanel spacer8 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer8, gbc); final JPanel spacer9 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 14; gbc.gridwidth = 5; gbc.weighty = 1.0; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer9, gbc); final JPanel spacer10 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 8; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer10, gbc); final JPanel spacer11 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer11, gbc); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridBagLayout()); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 15; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.BOTH; container.add(panel1, gbc); panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Troubleshooting")); reloadCacheButton = new JButton(); reloadCacheButton.setEnabled(false); reloadCacheButton.setText("Reload forms from storage location"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 8; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(reloadCacheButton, gbc); final JPanel spacer12 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 7; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer12, gbc); final JPanel spacer13 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 9; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer13, gbc); final JPanel spacer14 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 3; gbc.gridy = 8; gbc.weightx = 0.5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer14, gbc); final JPanel spacer15 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 8; gbc.weightx = 0.5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer15, gbc); final JLabel label1 = new JLabel(); label1.setText("The form list in Briefcase can get out of date if files are moved manually."); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.WEST; panel1.add(label1, gbc); final JLabel label2 = new JLabel(); label2.setText("This reload is always safe."); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.WEST; panel1.add(label2, gbc); final JPanel spacer16 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer16, gbc); final JPanel spacer17 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer17, gbc); final JPanel spacer18 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 4; gbc.gridy = 5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer18, gbc); final JPanel spacer19 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 4; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer19, gbc); cleanAllPullResumePointsButton = new JButton(); cleanAllPullResumePointsButton.setEnabled(false); cleanAllPullResumePointsButton.setText("Clear pull history"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 3; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(cleanAllPullResumePointsButton, gbc); final JLabel label3 = new JLabel(); label3.setText("Use if you wish to pull every submission, regardless of last submission pulled."); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.WEST; panel1.add(label3, gbc); final JPanel spacer20 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 2; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer20, gbc); final JPanel spacer21 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 16; gbc.gridwidth = 6; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer21, gbc); resumeLastPullField = new JCheckBox(); resumeLastPullField.setText("Start pull from last submission pulled"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(resumeLastPullField, gbc); final JPanel spacer22 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer22, gbc); }
From source file:com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionContentPanel.java
private void addSparkClustersLineItem() { JLabel sparkClusterLabel = new JLabel("Spark clusters(Linux only)"); sparkClusterLabel.setToolTipText(/*from w w w. j a v a2 s . c o m*/ "The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported."); GridBagConstraints c11 = new GridBagConstraints(); c11.gridx = 0; c11.gridy = 0; c11.insets = new Insets(margin, margin, 0, margin); add(sparkClusterLabel, new GridBagConstraints(0, displayLayoutCurrentRow, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, margin), 0, 0)); clustersListComboBox = new ComboboxWithBrowseButton(); clustersListComboBox.setButtonIcon(StreamUtil.getImageResourceFile(REFRESH_BUTTON_PATH)); clustersListComboBox.getButton().setToolTipText("Refresh"); clustersListComboBox.getButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Cursor cursor = getCursor(); setCursor(new Cursor(Cursor.WAIT_CURSOR)); List<IClusterDetail> clusterDetails = ClusterManagerEx.getInstance() .getClusterDetails(submitModel.getProject()); setCursor(cursor); submitModel.setClusterComboBoxModel(clusterDetails); } }); clustersListComboBox.getComboBox().setToolTipText( "The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported."); clustersListComboBox.getComboBox().addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName() == "model" && evt.getNewValue() instanceof DefaultComboBoxModel) { int size = ((DefaultComboBoxModel) evt.getNewValue()).getSize(); setVisibleForFixedErrorMessageLabel(ErrorMessageLabelTag.ClusterName.ordinal(), size <= 0); } } }); add(clustersListComboBox, new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, margin), 0, 0)); errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()] = new JLabel( "Cluster Name Should not be null"); errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()] .setForeground(DarkThemeManager.getInstance().getErrorMessageColor()); clustersListComboBox.getComboBox().addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { setVisibleForFixedErrorMessageLabel(0, clustersListComboBox.getComboBox().getItemCount() == 0); } }); add(errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()], new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, margin, 0, 0), 0, 0)); }