List of usage examples for java.awt GridBagConstraints REMAINDER
int REMAINDER
To view the source code for java.awt GridBagConstraints REMAINDER.
Click Source Link
From source file:org.openconcerto.erp.core.finance.accounting.ui.SuppressionEcrituresPanel.java
public SuppressionEcrituresPanel(final int idMvt) { this.setLayout(new GridBagLayout()); final GridBagConstraints c = new DefaultGridBagConstraints(); c.weightx = 1;/*from www . j a va 2s .c om*/ SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete(); SQLTable tableMouvement = base.getTable("MOUVEMENT"); SQLRow rowMvt = tableMouvement.getRow(idMvt); JLabel label = new JLabel("Vous allez supprimer la pice n" + rowMvt.getInt("ID_PIECE")); JLabelWarning warning = new JLabelWarning(); JPanel panelLabel = new JPanel(); panelLabel.add(warning); panelLabel.add(label); c.gridwidth = GridBagConstraints.REMAINDER; this.add(panelLabel, c); // TODO afficher les numeros de mouvement implique int[] idS = getMouvement(rowMvt.getInt("ID_PIECE")); if (idS == null) { ExceptionHandler.handle("Aucun mouvement associ la pice n" + ((rowMvt != null) ? rowMvt.getInt("ID_PIECE") : "mouvement nul")); } else { StringBuffer s = new StringBuffer(); s.append("Elle est compose par les mouvements : ("); JLabel labelMouv = new JLabel(); // c.gridwidth = 1; c.gridy++; c.gridx = 0; this.add(labelMouv, c); s.append(idS[0]); for (int i = 1; i < idS.length; i++) { s.append(", "); s.append(idS[i]); } s.append(')'); labelMouv.setText(s.toString()); } JButton buttonOK = new JButton("OK"); JButton buttonCancel = new JButton("Annuler"); c.gridwidth = 1; c.gridy++; c.gridx = 0; this.add(buttonOK, c); c.gridx++; this.add(buttonCancel, c); buttonOK.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { EcritureSQLElement elt = (EcritureSQLElement) Configuration.getInstance().getDirectory() .getElement("ECRITURE"); elt.archiveMouvement(idMvt); ((JFrame) SwingUtilities.getRoot(SuppressionEcrituresPanel.this)).dispose(); } }); buttonCancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ((JFrame) SwingUtilities.getRoot(SuppressionEcrituresPanel.this)).dispose(); } }); }
From source file:org.pentaho.ui.xul.swing.tags.SwingGroupbox.java
public void resetContainer() { container.removeAll();/*ww w . j a v a 2 s . c om*/ if (this.getOrientation() == Orient.VERTICAL) { gc = new GridBagConstraints(); gc.gridy = GridBagConstraints.RELATIVE; gc.gridx = 0; gc.gridheight = 1; gc.gridwidth = GridBagConstraints.REMAINDER; int pad = getPadding(); gc.insets = new Insets(pad, pad, pad, pad); gc.fill = GridBagConstraints.HORIZONTAL; gc.anchor = GridBagConstraints.NORTHWEST; gc.weightx = 1; } else { gc = new GridBagConstraints(); gc.gridy = 0; gc.gridx = GridBagConstraints.RELATIVE; gc.gridheight = GridBagConstraints.REMAINDER; gc.gridwidth = 1; gc.insets = new Insets(2, 2, 2, 2); gc.fill = GridBagConstraints.VERTICAL; gc.anchor = GridBagConstraints.NORTHWEST; gc.weighty = 1; } }
From source file:pipeline.parameter_cell_views.CurveEditor.java
public CurveEditor() { super();// ww w.java2s.c o m setPreferredSize(new Dimension(500, 500)); setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; c.gridheight = 2; parameterName = new JLabel(""); splineEditor = new SplineDisplay(); splineEditor.addPropertyChangeListener(evt -> { currentParameter .setValue(new Object[] { splineEditor.getCurvePoints(), splineEditor.getControlPoints() }); boolean saveSilenceUpdate = silenceUpdate; silenceUpdate = true; currentParameter.fireValueChanged(false, true, true);// The parameter value might still be // changing, but the information is not passed up from the SplineDisplay silenceUpdate = saveSilenceUpdate; }); c.gridx = 0; c.gridy = 0; c.weighty = 1.0; c.weightx = 1.0; c.gridwidth = GridBagConstraints.REMAINDER; add(splineEditor, c); c.gridwidth = 1; c.ipady = 0; parameterName = new JLabel("parameter"); c.gridx = 0; c.gridy = 1; c.weighty = 0.01; c.weightx = 0.0; parameterName.setMaximumSize(new Dimension(10000, 30)); add(parameterName, c); }
From source file:MessageViewer.java
public MessageViewer(Message what) { // set our layout super(new GridBagLayout()); // add the toolbar addToolbar();/* ww w.j a v a 2 s . c o m*/ GridBagConstraints gb = new GridBagConstraints(); gb.gridwidth = GridBagConstraints.REMAINDER; gb.fill = GridBagConstraints.BOTH; gb.weightx = 1.0; gb.weighty = 0.0; // add the headers headers = new TextArea("", 4, 80, TextArea.SCROLLBARS_NONE); headers.setEditable(false); add(headers, gb); // now display our message setMessage(what); }
From source file:org.ut.biolab.medsavant.client.view.dialog.ProgressDialog.java
ProgressDialog(String title, String message, boolean cancellable) { super(DialogUtils.getFrontWindow(), title, Dialog.ModalityType.APPLICATION_MODAL); setResizable(false);/*from w ww . j av a2s . co m*/ Container p = getContentPane(); p.setLayout(new GridBagLayout()); JLabel messageLabel = new JLabel(message); bar = ViewUtil.getIndeterminateProgressBar(); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(15, 45, 3, 45); p.add(messageLabel, gbc); gbc.insets = new Insets(3, 45, cancellable ? 3 : 30, 45); p.add(bar, gbc); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); }
From source file:org.pentaho.ui.xul.swing.tags.SwingHbox.java
public void resetContainer() { container.removeAll();/* w w w . jav a 2 s .c o m*/ gc = new GridBagConstraints(); gc.gridx = GridBagConstraints.RELATIVE; gc.gridy = 0; gc.gridheight = GridBagConstraints.REMAINDER; gc.gridwidth = 1; int pad = getPadding(); gc.insets = new Insets(pad, pad, pad, pad); gc.fill = GridBagConstraints.HORIZONTAL; gc.anchor = GridBagConstraints.NORTHWEST; gc.weighty = 1; }
From source file:de.codesourcery.jasm16.ide.ui.viewcontainers.ViewFrame.java
public ViewFrame(String title, final IView component) { super(title); if (component == null) { throw new IllegalArgumentException("component must not be NULL."); }// w w w .ja v a2 s .c om this.component = component; addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { disposeView(component); helper.fireViewContainerClosed(ViewFrame.this); } }); setDefaultCloseOperation(DISPOSE_ON_CLOSE); final JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); final GridBagConstraints cnstrs = new GridBagConstraints(); cnstrs.weightx = 1.0d; cnstrs.weighty = 1.0d; cnstrs.fill = GridBagConstraints.BOTH; cnstrs.gridheight = GridBagConstraints.REMAINDER; cnstrs.gridwidth = GridBagConstraints.REMAINDER; cnstrs.gridx = 0; cnstrs.gridy = 0; panel.add(component.getPanel(this), cnstrs); getContentPane().add(panel); pack(); }
From source file:savant.settings.Section.java
public GridBagConstraints getFullRowConstraints() { return new GridBagConstraints(0, GridBagConstraints.RELATIVE, GridBagConstraints.REMAINDER, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(3, 3, 3, 3), 0, 0); }
From source file:TreeExpandEventDemo2.java
public TreeExpandEventDemo2() { super(new GridBagLayout()); GridBagLayout gridbag = (GridBagLayout) getLayout(); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1.0;/*from w w w. ja v a 2s . c o m*/ c.weighty = 1.0; c.insets = new Insets(1, 1, 1, 1); demoArea = new DemoArea(); gridbag.setConstraints(demoArea, c); add(demoArea); c.insets = new Insets(0, 0, 0, 0); textArea = new JTextArea(); textArea.setEditable(false); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setPreferredSize(new Dimension(200, 75)); gridbag.setConstraints(scrollPane, c); add(scrollPane); setPreferredSize(new Dimension(450, 450)); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); }
From source file:org.tranche.gui.user.SignInPanel.java
public SignInPanel() { setBackground(Styles.COLOR_PANEL_BACKGROUND); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridwidth = GridBagConstraints.RELATIVE; gbc.insets = new Insets(7, 7, 0, 0); gbc.weightx = 0;//from w ww. ja v a 2 s . c o m gbc.weighty = 1; add(new GenericLabel("Unique Name / Email:"), gbc); userNameTextField.addActionListener(this); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.insets = new Insets(7, 7, 0, 7); gbc.weightx = 1; add(userNameTextField, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; gbc.insets = new Insets(7, 7, 0, 0); gbc.weightx = 0; add(new GenericLabel("Password:"), gbc); passwordField.addActionListener(this); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.insets = new Insets(7, 7, 0, 7); gbc.weightx = 1; add(passwordField, gbc); GenericRoundedButton signInButton = new GenericRoundedButton("Sign In"); signInButton.addActionListener(this); gbc.insets = new Insets(7, 7, 7, 7); add(signInButton, gbc); if (ConfigureTranche.get(ConfigureTranche.CATEGORY_GENERAL, ConfigureTranche.PROP_SIGN_UP_URL) != null && !ConfigureTranche.get(ConfigureTranche.CATEGORY_GENERAL, ConfigureTranche.PROP_SIGN_UP_URL) .equals("")) { JLabel noAccountLabel = new GenericLabel("No Account?"); noAccountLabel.setFont(Styles.FONT_14PT_BOLD); gbc.insets = new Insets(10, 7, 0, 7); add(noAccountLabel, gbc); GenericRoundedButton applyButton = new GenericRoundedButton("Apply For An Account"); applyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Thread t = new Thread() { @Override() public void run() { GUIUtil.displayURL(ConfigureTranche.get(ConfigureTranche.CATEGORY_GENERAL, ConfigureTranche.PROP_SIGN_UP_URL)); } }; t.setDaemon(true); t.start(); } }); gbc.insets = new Insets(7, 7, 0, 7); add(applyButton, gbc); } JLabel userCertLabel = new GenericLabel("Have a User File?"); userCertLabel.setFont(Styles.FONT_14PT_BOLD); gbc.insets = new Insets(10, 7, 0, 7); add(userCertLabel, gbc); GenericRoundedButton logInWithCertButton = new GenericRoundedButton("Sign In With My User Certificate"); logInWithCertButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFileChooser jfc = GUIUtil.makeNewFileChooser(); Thread t = new Thread() { @Override public void run() { UserZipFile uzf = null; try { uzf = GUIUtil.promptForUserFile(jfc, SignInPanel.this); } catch (Exception e) { ef.show(e, SignInPanel.this); } if (uzf != null) { abq.offer(uzf); } } }; t.setDaemon(true); t.start(); } }); gbc.insets = new Insets(7, 7, 7, 7); add(logInWithCertButton, gbc); }