List of usage examples for com.jgoodies.forms.layout CellConstraints CENTER
Alignment CENTER
To view the source code for com.jgoodies.forms.layout CellConstraints CENTER.
Click Source Link
From source file:fileCompare.processor.DuplicateFinder.java
License:Open Source License
/** * This class actually finds the duplicates, and displays some status in a * dialog box while it is searching for them. * /*from ww w .j a v a2 s.c om*/ * @param fsd */ public DuplicateFinder(FolderSelectionDialog fsd) { fsd_ = fsd; dialog = new JDialog(fsd_, "Processing....", false); FormLayout layout = new FormLayout("4dlu, c:pref:grow", "c:pref:grow, 4dlu, c:pref:grow"); PanelBuilder builder = new PanelBuilder(layout); status = new JLabel("Preparing to process"); JButton cancel = new JButton("Cancel"); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancel_ = true; } }); builder.add(status, new CellConstraints(2, 1, CellConstraints.LEFT, CellConstraints.CENTER)); builder.nextLine(2); builder.nextColumn(); builder.add(cancel); dialog.getContentPane().add(builder.getPanel()); dialog.setSize(300, 150); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = dialog.getSize(); dialog.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); }
From source file:fsart.diffTools.gui.DiffToolsMainPanel.java
License:CeCILL license
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it by your code! * * @noinspection ALL/*from w w w .j a va 2s . co m*/ */ private void $$$setupUI$$$() { panel1 = new JPanel(); panel1.setLayout(new BorderLayout(0, 0)); final Spacer spacer1 = new Spacer(); panel1.add(spacer1, BorderLayout.WEST); final Spacer spacer2 = new Spacer(); panel1.add(spacer2, BorderLayout.EAST); final Spacer spacer3 = new Spacer(); panel1.add(spacer3, BorderLayout.SOUTH); final Spacer spacer4 = new Spacer(); panel1.add(spacer4, BorderLayout.NORTH); final JPanel panel2 = new JPanel(); panel2.setLayout(new FormLayout( "left:max(d;4px):noGrow,left:4dlu:noGrow,center:max(d;50px):grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:5dlu:noGrow,fill:max(d;4px):noGrow", "top:d:grow,top:4dlu:noGrow,top:d:noGrow,top:4dlu:noGrow,center:max(d;25px):noGrow,top:6dlu:noGrow,top:max(d;4px):noGrow,top:4dlu:noGrow,top:max(d;25px):noGrow,top:7dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,bottom:d:grow")); panel2.putClientProperty("html.disable", Boolean.FALSE); panel1.add(panel2, BorderLayout.CENTER); final Spacer spacer5 = new Spacer(); CellConstraints cc = new CellConstraints(); panel2.add(spacer5, cc.xy(3, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); browseButton = new JButton(); browseButton.setText("Browse"); panel2.add(browseButton, cc.xy(5, 5)); comparedFileLabel = new JLabel(); comparedFileLabel.setText("Compared file :"); panel2.add(comparedFileLabel, cc.xy(3, 7, CellConstraints.LEFT, CellConstraints.TOP)); browseButton1 = new JButton(); browseButton1.setText("Browse"); panel2.add(browseButton1, cc.xy(5, 9, CellConstraints.DEFAULT, CellConstraints.TOP)); final Spacer spacer6 = new Spacer(); panel2.add(spacer6, cc.xy(3, 13, CellConstraints.DEFAULT, CellConstraints.FILL)); final Spacer spacer7 = new Spacer(); panel2.add(spacer7, cc.xy(1, 9, CellConstraints.FILL, CellConstraints.DEFAULT)); final Spacer spacer8 = new Spacer(); panel2.add(spacer8, cc.xy(7, 7, CellConstraints.FILL, CellConstraints.DEFAULT)); final JPanel panel3 = new JPanel(); panel3.setLayout(new FormLayout("fill:d:grow", "center:d:grow")); panel2.add(panel3, cc.xyw(3, 11, 3, CellConstraints.FILL, CellConstraints.FILL)); compareButton = new JButton(); compareButton.setPreferredSize(new Dimension(100, 29)); compareButton.setText("Compare"); panel3.add(compareButton, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.CENTER)); baseFileLabel = new JLabel(); baseFileLabel.setText("Base file :"); panel2.add(baseFileLabel, cc.xy(3, 3, CellConstraints.FILL, CellConstraints.FILL)); baseFileTxt = new JTextField(); baseFileTxt.setMinimumSize(new Dimension(50, 27)); baseFileTxt.setPreferredSize(new Dimension(50, 27)); panel2.add(baseFileTxt, cc.xy(3, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); comparedFileTxt = new JTextField(); comparedFileTxt.setMinimumSize(new Dimension(50, 27)); comparedFileTxt.setPreferredSize(new Dimension(100, 27)); panel2.add(comparedFileTxt, cc.xy(3, 9, CellConstraints.FILL, CellConstraints.DEFAULT)); outputField = new JTextField(); outputField.setMinimumSize(new Dimension(50, 27)); outputField.setPreferredSize(new Dimension(100, 27)); panel2.add(outputField, cc.xy(3, 15, CellConstraints.FILL, CellConstraints.DEFAULT)); }
From source file:hu.pagavcs.client.gui.CleanupGui.java
License:Open Source License
public void display() throws SVNException { JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p")); CellConstraints cc = new CellConstraints(); frame = GuiHelper.createFrame(pnlMain, "Cleanup", null); Label lblWorkingCopy = new Label("Path:"); Label sfWorkingCopy = new Label(cleanup.getPath()); JButton btnClose = new JButton(new CloseAction(frame)); lblStatus = new Label(" "); pnlMain.add(lblWorkingCopy, cc.xy(1, 1)); pnlMain.add(sfWorkingCopy, cc.xy(3, 1)); pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); frame.execute();// www . j av a 2 s. co m }
From source file:hu.pagavcs.client.gui.CreateRepoGui.java
License:Open Source License
public void display() throws SVNException { JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p")); CellConstraints cc = new CellConstraints(); frame = GuiHelper.createFrame(pnlMain, "Create Repository", null); Label lblWorkingCopy = new Label("Path:"); Label sfWorkingCopy = new Label(createRepo.getPath()); JButton btnClose = new JButton(new CloseAction(frame)); lblStatus = new Label(" "); pnlMain.add(lblWorkingCopy, cc.xy(1, 1)); pnlMain.add(sfWorkingCopy, cc.xy(3, 1)); pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); frame.execute();/*from www.ja va 2 s .c om*/ }
From source file:hu.pagavcs.client.gui.DeleteGui.java
License:Open Source License
public void display() throws SVNException { JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p")); CellConstraints cc = new CellConstraints(); frame = GuiHelper.createFrame(pnlMain, "Delete", null); Label lblWorkingCopy = new Label("Path:"); String wcText;//from ww w. j av a 2 s. c om if (delete.getPath().size() == 1) { wcText = delete.getPath().get(0); } else { wcText = "<Multiple files are selected>"; } Label sfWorkingCopy = new Label(wcText); btnClose = new JButton(new CloseAction(frame)); lblStatus = new Label(" "); pnlMain.add(lblWorkingCopy, cc.xy(1, 1)); pnlMain.add(sfWorkingCopy, cc.xy(3, 1)); pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); frame.execute(); }
From source file:hu.pagavcs.client.gui.IgnoreGui.java
License:Open Source License
public void display() throws SVNException { JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p")); CellConstraints cc = new CellConstraints(); frame = GuiHelper.createFrame(pnlMain, "Ignore", null); Label lblWorkingCopy = new Label("Path:"); Label sfWorkingCopy = new Label(ignore.getPath()); JButton btnClose = new JButton(new CloseAction(frame)); lblStatus = new Label(" "); pnlMain.add(lblWorkingCopy, cc.xy(1, 1)); pnlMain.add(sfWorkingCopy, cc.xy(3, 1)); pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); frame.execute();//from ww w .j a v a2s . c o m }
From source file:hu.pagavcs.client.gui.LockGui.java
License:Open Source License
public void display() throws SVNException { JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p")); CellConstraints cc = new CellConstraints(); frame = GuiHelper.createFrame(pnlMain, "Lock", null); Label lblWorkingCopy = new Label("Path:"); Label sfWorkingCopy = new Label(operation.getPath()); JButton btnClose = new JButton(new CloseAction(frame)); lblStatus = new Label(" "); pnlMain.add(lblWorkingCopy, cc.xy(1, 1)); pnlMain.add(sfWorkingCopy, cc.xy(3, 1)); pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); frame.execute();// ww w . ja va 2s . c o m }
From source file:hu.pagavcs.client.gui.UnignoreGui.java
License:Open Source License
public void display() throws SVNException { JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p")); CellConstraints cc = new CellConstraints(); frame = GuiHelper.createFrame(pnlMain, "Unignore", null); Label lblWorkingCopy = new Label("Path:"); Label sfWorkingCopy = new Label(unignore.getPath()); JButton btnClose = new JButton(new CloseAction(frame)); lblStatus = new Label(" "); pnlMain.add(lblWorkingCopy, cc.xy(1, 1)); pnlMain.add(sfWorkingCopy, cc.xy(3, 1)); pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); frame.execute();//ww w. j a v a2 s .c o m }
From source file:hu.pagavcs.client.gui.UnlockGui.java
License:Open Source License
public void display() throws SVNException { JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p")); CellConstraints cc = new CellConstraints(); frame = GuiHelper.createFrame(pnlMain, "Unlock", null); Label lblWorkingCopy = new Label("Path:"); Label sfWorkingCopy = new Label(operation.getPath()); JButton btnClose = new JButton(new CloseAction(frame)); lblStatus = new Label(" "); pnlMain.add(lblWorkingCopy, cc.xy(1, 1)); pnlMain.add(sfWorkingCopy, cc.xy(3, 1)); pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); frame.execute();//from w w w . j a v a 2s . c om }
From source file:imageviewer.ui.dialog.PreferencesGeneralPanel.java
License:Open Source License
public PreferencesGeneralPanel(PreferencesDialog pd) { super();// w w w . j av a 2 s .c o m initializeCheckBoxes(); setPreferredSize(new Dimension(385, 360)); JTextArea initialPrefsDescription = DialogUtil.createTextArea( "Preferences shown below are used on starting the imageViewer application. These preferences are stored " + "in the corresponding XML configuration file. Specific information on each preference is given in the tooltip."); JTextArea warningDescription = DialogUtil.createTextArea( "You can selectively toggle the state of application warnings that are given on various actions."); JTextArea undoDescription = DialogUtil.createTextArea( "The number of undo levels stored by the application determines the number of actions that are stored in an undo/redo stack. " + "Increasing the number of levels will permit more changes, but also requires more memory."); FormLayout fl = new FormLayout("10px,pref,10px,pref:grow,10px", "10px,pref,5px,pref,pref,5px,pref,5px,pref,5px,pref,5px,pref,5px,pref,10px,pref"); setLayout(fl); CellConstraints cc = new CellConstraints(); add(initialPrefsDescription, cc.xywh(2, 2, 3, 1)); add(optionBoxes[Options.DISPLAY_IMAGE_INFORMATION.ordinal()], cc.xy(2, 4)); add(optionBoxes[Options.DISPLAY_GRID.ordinal()], cc.xy(4, 4)); add(optionBoxes[Options.DISPLAY_PARTIAL_PANELS.ordinal()], cc.xy(2, 5)); add(new JSeparator(), cc.xywh(2, 7, 3, 1)); add(warningDescription, cc.xywh(2, 9, 3, 1)); add(optionBoxes[Options.ASK_CHANGE_LAYOUT.ordinal()], cc.xy(2, 11)); add(optionBoxes[Options.ASK_CLOSE_TAB.ordinal()], cc.xy(4, 11)); add(new JSeparator(), cc.xywh(2, 13, 3, 1)); add(undoDescription, cc.xywh(2, 15, 3, 1)); Integer ul = (Integer) ApplicationContext.getContext().getProperty(ApplicationContext.UNDO_LEVEL); if (ul != null) undoLevelsSpinner.setValue(ul); else undoLevelsSpinner.setEnabled(false); undoLevelsSpinner.addChangeListener(this); JLabel undoLevelsLabel = new JLabel("Number of undo levels"); JPanel undoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0)); undoPanel.add(undoLevelsLabel); undoPanel.add(undoLevelsSpinner); add(undoPanel, cc.xywh(2, 17, 3, 1, CellConstraints.CENTER, CellConstraints.CENTER)); this.pd = pd; }