List of usage examples for com.jgoodies.forms.layout CellConstraints xy
public CellConstraints xy(int col, int row)
Examples:
cc.xy(1, 1); cc.xy(1, 3);
From source file:com.alternatecomputing.jschnizzle.JSchnizzle.java
License:Apache License
private JPanel createMainPanel() { JPanel panel = new JXPanel( new FormLayout("4dlu, fill:min:grow, 4dlu", "4dlu, fill:min:grow, 4dlu, pref, 4dlu")); CellConstraints cc = new CellConstraints(); JSplitPane verticalSplitPane = UIUtils.createUndecoratedSplitPane(JSplitPane.VERTICAL_SPLIT); verticalSplitPane.setDividerLocation(350); verticalSplitPane.setResizeWeight(1); verticalSplitPane.setDividerSize(8); panel.add(verticalSplitPane, cc.xy(2, 2)); verticalSplitPane.add(createTopSubPanel()); consoleTextArea = new JTextArea(); JScrollPane scrollPane = new JScrollPane(consoleTextArea); scrollPane.setPreferredSize(new Dimension(0, 100)); verticalSplitPane.add(UIUtils.createTitledPanel("Console", scrollPane)); panel.add(createStatusArea(), cc.xy(2, 4)); return panel; }
From source file:com.alternatecomputing.jschnizzle.JSchnizzle.java
License:Apache License
private JPanel createTopSubPanel() { mainPanel = new JXPanel(new FormLayout("fill:min:grow", "fill:min:grow")); CellConstraints cc = new CellConstraints(); JSplitPane horizontalSplitPane = UIUtils.createUndecoratedSplitPane(JSplitPane.HORIZONTAL_SPLIT); horizontalSplitPane.setDividerLocation(200); horizontalSplitPane.setDividerSize(8); mainPanel.add(horizontalSplitPane, cc.xy(1, 1)); JXTaskPaneContainer taskPaneContainer = new JXTaskPaneContainer(); activityScriptsList = createScriptsList(applicationModel.getActivityScriptsModel(), mainPanel); JXTaskPane activityTaskPane = new JXTaskPane(); activityTaskPane.setTitle("Activity Diagrams"); activityTaskPane.setToolTipText("Activity Diagram Definitions"); activityTaskPane.add(activityScriptsList); activityTaskPane.getContentPane().setBackground(Color.WHITE); MouseAdapter activityMouseAdapter = createDefinitionsMouseAdapter(DiagramType.Activity, mainPanel, activityScriptsList);//from w w w. j a v a 2 s. c o m activityScriptsList.addMouseListener(activityMouseAdapter); activityTaskPane.addMouseListener(activityMouseAdapter); taskPaneContainer.add(activityTaskPane); classScriptsList = createScriptsList(applicationModel.getClassScriptsModel(), mainPanel); JXTaskPane classTaskPane = new JXTaskPane(); classTaskPane.setTitle("Class Diagrams"); classTaskPane.setToolTipText("Class Diagram Definitions"); classTaskPane.add(classScriptsList); classTaskPane.getContentPane().setBackground(Color.WHITE); MouseAdapter classMouseAdapter = createDefinitionsMouseAdapter(DiagramType.Class, mainPanel, classScriptsList); classScriptsList.addMouseListener(classMouseAdapter); classTaskPane.addMouseListener(classMouseAdapter); taskPaneContainer.add(classTaskPane); useCaseScriptsList = createScriptsList(applicationModel.getUseCaseScriptsModel(), mainPanel); JXTaskPane useCaseTaskPane = new JXTaskPane(); useCaseTaskPane.setTitle("Use Case Diagrams"); useCaseTaskPane.setToolTipText("Use Case Diagram Definitions"); useCaseTaskPane.add(useCaseScriptsList); useCaseTaskPane.getContentPane().setBackground(Color.WHITE); MouseAdapter useCaseMouseAdapter = createDefinitionsMouseAdapter(DiagramType.UseCase, mainPanel, useCaseScriptsList); useCaseScriptsList.addMouseListener(useCaseMouseAdapter); useCaseTaskPane.addMouseListener(useCaseMouseAdapter); taskPaneContainer.add(useCaseTaskPane); sequenceScriptsList = createScriptsList(applicationModel.getSequenceScriptsModel(), mainPanel); JXTaskPane sequenceTaskPane = new JXTaskPane(); sequenceTaskPane.setTitle("Sequence Diagrams"); sequenceTaskPane.setToolTipText("Sequence Diagram Definitions"); sequenceTaskPane.add(sequenceScriptsList); sequenceTaskPane.getContentPane().setBackground(Color.WHITE); MouseAdapter sequenceMouseAdapter = createDefinitionsMouseAdapter(DiagramType.Sequence, mainPanel, sequenceScriptsList); sequenceScriptsList.addMouseListener(sequenceMouseAdapter); sequenceTaskPane.addMouseListener(sequenceMouseAdapter); taskPaneContainer.add(sequenceTaskPane); horizontalSplitPane.add(UIUtils.createTitledPanel("Definitions", new JScrollPane(taskPaneContainer))); imagePanel = new ImagePanel(); imagePanel.addDiagramPanelMouseListener(createImagePanelMouseAdapter()); horizontalSplitPane.add(UIUtils.createTitledPanel("Diagram", imagePanel)); return mainPanel; }
From source file:com.alternatecomputing.jschnizzle.JSchnizzle.java
License:Apache License
private Component createStatusArea() { JPanel panel = new JXPanel(new FormLayout("fill:min:grow, 4dlu, pref", "pref")); CellConstraints cc = new CellConstraints(); JLabel status = new JLabel(" "); status.setBorder(BorderFactory.createEtchedBorder()); panel.add(status, cc.xy(1, 1)); progressBar = new JProgressBar(); panel.add(progressBar, cc.xy(3, 1)); return panel; }
From source file:com.alternatecomputing.jschnizzle.ui.ImagePanel.java
License:Apache License
public ImagePanel() { super();// w w w . jav a 2 s . c o m this.setLayout(new FormLayout("fill:min:grow, pref, 4dlu, pref, 4dlu", "fill:min:grow, 4dlu, pref, 4dlu")); CellConstraints cc = new CellConstraints(); this.diagramPanel = new JPanel(); this.diagramPanel.setLayout(new BorderLayout()); this.diagramPanel.setBackground(Color.WHITE); JScrollPane jScrollPane = new JScrollPane(diagramPanel); add(jScrollPane, cc.xywh(1, 1, 5, 1)); add(new JLabel("Scale:"), cc.xy(2, 3)); scaleSlider = createScaleSlider(this); add(scaleSlider, cc.xy(4, 3)); }
From source file:com.alternatecomputing.jschnizzle.util.UIUtils.java
License:Apache License
/** * create a diagram panel// ww w . j a v a 2 s . c o m * * @param header header for the panel * @param diagram model to be bound to the UI * @param dialog component that this panel will be embedded into * @param isNew whether this will be used for a new diagram or to update an existing one * @return diagram panel */ public static JPanel createDiagramPanel(JXHeader header, final Diagram diagram, final JDialog dialog, final boolean isNew) { final String originalScript = diagram.getScript(); final DiagramStyle originalStyle = diagram.getStyle(); FormLayout layout = new FormLayout("right:max(40dlu;pref), 4dlu, fill:min:grow", "pref, 4dlu, pref, 4dlu, pref, 4dlu, pref, 4dlu, pref, fill:pref:grow, 4dlu, pref"); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.add(header, cc.xywh(1, 1, 3, 1)); builder.add(new JLabel("Name:"), cc.xy(1, 3)); final JTextField nameTextField = new JTextField(diagram.getName() == null ? "" : diagram.getName()); builder.add(nameTextField, cc.xy(3, 3)); builder.add(new JLabel("Note:"), cc.xy(1, 5)); final JTextField noteTextField = new JTextField(diagram.getNote() == null ? "" : diagram.getNote()); builder.add(noteTextField, cc.xy(3, 5)); builder.add(new JLabel("Style:"), cc.xy(1, 7)); Renderer renderer = RendererFactory.getRendererForDiagram(diagram); final JComboBox<DiagramStyle> styleComboBox = new JComboBox<DiagramStyle>( renderer.getStylesForType(diagram.getType())); if (originalScript != null) { styleComboBox.setSelectedItem(originalStyle); } else { styleComboBox.setSelectedIndex(0); } builder.add(styleComboBox, cc.xy(3, 7)); builder.add(new JLabel("Script:"), cc.xy(1, 9)); final JTextArea scriptTextArea = new JTextArea(diagram.getScript() == null ? "" : diagram.getScript()); builder.add(new JScrollPane(scriptTextArea), cc.xywh(3, 9, 1, 2)); JButton okButton = new JButton("OK"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { diagram.setName(nameTextField.getText()); diagram.setNote(noteTextField.getText()); diagram.setStyle((DiagramStyle) styleComboBox.getSelectedItem()); diagram.setScript(scriptTextArea.getText()); Dispatcher.dispatchEvent(new JSEvent(EventType.ProgressStarted, null, null)); Thread t = new Thread() { public void run() { try { if (needsRendering()) { LOGGER.info("Rendering diagram '" + diagram.getName() + "'..."); Renderer renderer = RendererFactory.getRendererForDiagram(diagram); BufferedImage image = renderer.render(diagram); diagram.nonBeanImage(image); LOGGER.info("Diagram '" + diagram.getName() + "' successfully rendered."); } if (isNew) { LOGGER.info("Diagram '" + diagram.getName() + "' created."); Dispatcher.dispatchEvent(new JSEvent(EventType.DiagramAdded, this, diagram)); Dispatcher.dispatchEvent(new JSEvent(EventType.SelectDiagram, this, diagram)); } else { LOGGER.info("Diagram '" + diagram.getName() + "' modified."); Dispatcher.dispatchEvent(new JSEvent(EventType.DiagramModified, this, diagram)); } } catch (Exception e) { LOGGER.error("Error processing user action.", e); } finally { Dispatcher.dispatchEvent(new JSEvent(EventType.ProgressCompleted, null, null)); } } private boolean needsRendering() { return (!diagram.getScript().equals(originalScript)) || (!diagram.getStyle().equals(originalStyle)); } }; t.start(); dialog.dispose(); } }); JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); builder.add(ButtonBarFactory.buildOKCancelBar(okButton, cancelButton), cc.xy(3, 12)); return builder.getPanel(); }
From source file:com.archivas.clienttools.arcmover.gui.settings.ClusterOptionsForm.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR * call it in your code!//from w w w. j av a 2 s.co m * * @noinspection ALL */ private void $$$setupUI$$$() { contentPane = new JPanel(); contentPane.setLayout(new FormLayout("fill:d:grow", "top:d:grow")); archiveOptionsTab = new JPanel(); archiveOptionsTab.setLayout(new FormLayout( "fill:4dlu:noGrow,fill:129px:noGrow,left:4dlu:noGrow,fill:d:grow,fill:4dlu:noGrow", "center:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,center:max(d;4px):noGrow,center:max(d;4px):noGrow,top:max(m;6dlu):noGrow,center:d:grow,top:6dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,center:max(d;4px):noGrow,center:26px:noGrow,center:4dlu:grow")); CellConstraints cc = new CellConstraints(); contentPane.add(archiveOptionsTab, cc.xy(1, 1)); indexDefaultRadio = new JRadioButton(); indexDefaultRadio.setSelected(true); indexDefaultRadio.setText("Use Namespace Default"); indexDefaultRadio.setToolTipText("File(s) will be indexed based on namespace's settings"); archiveOptionsTab.add(indexDefaultRadio, cc.xyw(2, 4, 3)); indexYesRadio = new JRadioButton(); indexYesRadio.setText("Yes"); indexYesRadio.setToolTipText("File(s) will be indexed by search engine"); archiveOptionsTab.add(indexYesRadio, cc.xyw(2, 5, 3)); indexNoRadio = new JRadioButton(); indexNoRadio.setText("No"); indexNoRadio.setToolTipText("File(s) will not be indexed by search engine"); archiveOptionsTab.add(indexNoRadio, cc.xyw(2, 6, 3)); final JSeparator separator1 = new JSeparator(); archiveOptionsTab.add(separator1, cc.xyw(2, 8, 3, CellConstraints.FILL, CellConstraints.FILL)); shredDefaultRadio = new JRadioButton(); shredDefaultRadio.setSelected(true); shredDefaultRadio.setText("Use Namespace Default"); shredDefaultRadio.setToolTipText("File(s) will be disposed of based on namespace's settings."); archiveOptionsTab.add(shredDefaultRadio, cc.xyw(2, 12, 3)); shredYesRadio = new JRadioButton(); shredYesRadio.setText("Yes"); shredYesRadio.setToolTipText("Shred file(s) upon delete."); archiveOptionsTab.add(shredYesRadio, cc.xyw(2, 13, 3)); shredNoRadio = new JRadioButton(); shredNoRadio.setText("No"); shredNoRadio.setToolTipText("File(s) will not be shred upon delete."); archiveOptionsTab.add(shredNoRadio, cc.xyw(2, 14, 3)); final JPanel panel1 = new JPanel(); panel1.setLayout( new FormLayout("fill:d:noGrow,left:d:noGrow,left:4dlu:noGrow,left:d:noGrow,fill:max(d;4dlu):grow", "center:d:grow")); archiveOptionsTab.add(panel1, cc.xyw(2, 2, 3)); final JLabel label1 = new JLabel(); label1.setFont(new Font(label1.getFont().getName(), Font.BOLD, 14)); label1.setText("Index Files for Search"); panel1.add(label1, cc.xy(1, 1)); final JLabel label2 = new JLabel(); label2.setText("(only available on HCP 3.0+)"); panel1.add(label2, cc.xy(4, 1)); final JPanel panel2 = new JPanel(); panel2.setLayout( new FormLayout("left:89px:noGrow,fill:4dlu:noGrow,left:max(m;4dlu):grow", "center:d:grow")); archiveOptionsTab.add(panel2, cc.xyw(2, 10, 3)); final JLabel label3 = new JLabel(); label3.setFont(new Font(label3.getFont().getName(), Font.BOLD, 14)); label3.setText("Shred Files on Delete"); panel2.add(label3, cc.xyw(1, 1, 3)); indexFileButtonGroup = new ButtonGroup(); indexFileButtonGroup.add(indexNoRadio); indexFileButtonGroup.add(indexYesRadio); indexFileButtonGroup.add(indexDefaultRadio); ButtonGroup buttonGroup; buttonGroup = new ButtonGroup(); buttonGroup.add(shredDefaultRadio); buttonGroup.add(shredYesRadio); buttonGroup.add(shredNoRadio); }
From source file:com.archivas.clienttools.arcmover.gui.settings.PermissionsForm.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR * call it in your code!//from w ww.j av a 2 s .c o m * * @noinspection ALL */ private void $$$setupUI$$$() { panel1 = new JPanel(); panel1.setLayout(new FormLayout( "fill:max(m;4px):noGrow,left:4dlu:noGrow,fill:max(m;4px):noGrow,left:4dlu:noGrow,fill:max(m;4px):noGrow,left:4dlu:noGrow,fill:max(m;4px):noGrow", "center:d:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow")); final JLabel label1 = new JLabel(); label1.setText(" "); CellConstraints cc = new CellConstraints(); panel1.add(label1, cc.xy(1, 1)); final JLabel label2 = new JLabel(); label2.setText("Read"); panel1.add(label2, cc.xy(3, 1)); final JLabel label3 = new JLabel(); label3.setText("Write"); panel1.add(label3, cc.xy(5, 1)); final JLabel label4 = new JLabel(); label4.setText("Execute"); panel1.add(label4, cc.xy(7, 1)); final JLabel label5 = new JLabel(); label5.setText("Owner"); panel1.add(label5, cc.xy(1, 3)); final JLabel label6 = new JLabel(); label6.setText("Group"); panel1.add(label6, cc.xy(1, 5)); final JLabel label7 = new JLabel(); label7.setText("Other"); panel1.add(label7, cc.xy(1, 7)); ownerRead = new JCheckBox(); ownerRead.setText(""); panel1.add(ownerRead, cc.xy(3, 3, CellConstraints.CENTER, CellConstraints.DEFAULT)); ownerWrite = new JCheckBox(); ownerWrite.setText(""); panel1.add(ownerWrite, cc.xy(5, 3, CellConstraints.CENTER, CellConstraints.DEFAULT)); ownerExecute = new JCheckBox(); ownerExecute.setText(""); panel1.add(ownerExecute, cc.xy(7, 3, CellConstraints.CENTER, CellConstraints.DEFAULT)); groupRead = new JCheckBox(); groupRead.setText(""); panel1.add(groupRead, cc.xy(3, 5, CellConstraints.CENTER, CellConstraints.DEFAULT)); groupWrite = new JCheckBox(); groupWrite.setText(""); panel1.add(groupWrite, cc.xy(5, 5, CellConstraints.CENTER, CellConstraints.DEFAULT)); groupExecute = new JCheckBox(); groupExecute.setText(""); panel1.add(groupExecute, cc.xy(7, 5, CellConstraints.CENTER, CellConstraints.DEFAULT)); otherRead = new JCheckBox(); otherRead.setText(""); panel1.add(otherRead, cc.xy(3, 7, CellConstraints.CENTER, CellConstraints.DEFAULT)); otherWrite = new JCheckBox(); otherWrite.setText(""); panel1.add(otherWrite, cc.xy(5, 7, CellConstraints.CENTER, CellConstraints.DEFAULT)); otherExecute = new JCheckBox(); otherExecute.setText(""); panel1.add(otherExecute, cc.xy(7, 7, CellConstraints.CENTER, CellConstraints.DEFAULT)); final JLabel label8 = new JLabel(); label8.setText("Numeric code"); panel1.add(label8, cc.xyw(1, 9, 5)); numberPerms = new JTextField(); panel1.add(numberPerms, cc.xy(7, 9, CellConstraints.FILL, CellConstraints.DEFAULT)); }
From source file:com.archivas.clienttools.arcmover.gui.ssl.SSLCertificateAllowDialog.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR * call it in your code!/*from www. ja v a 2 s.c o m*/ * * @noinspection ALL */ private void $$$setupUI$$$() { contentPane = new JPanel(); contentPane.setLayout(new FormLayout("fill:4dlu:noGrow,fill:d:grow,fill:4dlu:noGrow", "center:4dlu:noGrow,center:d:grow,top:4dlu:noGrow,center:max(d;15dlu):noGrow,center:4dlu:noGrow")); contentPane.setMinimumSize(new Dimension(300, 300)); contentPane.setPreferredSize(new Dimension(500, 500)); final JPanel panel1 = new JPanel(); panel1.setLayout(new FormLayout( "fill:d:grow,left:4dlu:noGrow,fill:max(d;50dlu):noGrow,left:4dlu:noGrow,fill:max(d;50dlu):noGrow", "center:d:grow")); panel1.setPreferredSize(new Dimension(300, 24)); CellConstraints cc = new CellConstraints(); contentPane.add(panel1, cc.xy(2, 4)); buttonOK = new JButton(); buttonOK.setText("Confirm Security Exception"); buttonOK.setToolTipText("Accept this cerficate"); panel1.add(buttonOK, cc.xy(3, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); buttonCancel = new JButton(); buttonCancel.setText("Cancel"); panel1.add(buttonCancel, cc.xy(5, 1)); sslCertificateForm = new SSLCertificateForm(); contentPane.add(sslCertificateForm.$$$getRootComponent$$$(), cc.xy(2, 2, CellConstraints.FILL, CellConstraints.FILL)); }
From source file:com.archivas.clienttools.arcmover.gui.ssl.SSLCertificateDialog.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR * call it in your code!//w ww. ja v a 2 s. c om * * @noinspection ALL */ private void $$$setupUI$$$() { contentPane = new JPanel(); contentPane.setLayout(new FormLayout("fill:4dlu:noGrow,fill:d:grow,fill:4dlu:noGrow", "center:4dlu:noGrow,center:d:grow,top:4dlu:noGrow,center:max(d;15dlu):noGrow,center:4dlu:noGrow")); contentPane.setMinimumSize(new Dimension(300, 300)); contentPane.setPreferredSize(new Dimension(500, 500)); final JPanel panel1 = new JPanel(); panel1.setLayout( new FormLayout("fill:d:grow,left:4dlu:noGrow,fill:50dlu:noGrow,left:4dlu:noGrow,fill:50dlu:noGrow", "center:15dlu:grow")); panel1.setPreferredSize(new Dimension(300, 24)); CellConstraints cc = new CellConstraints(); contentPane.add(panel1, cc.xy(2, 4)); buttonOK = new JButton(); buttonOK.setText("OK"); panel1.add(buttonOK, cc.xy(3, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); buttonCancel = new JButton(); buttonCancel.setText("Cancel"); panel1.add(buttonCancel, cc.xy(5, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); sslCertificateForm = new SSLCertificateForm(); contentPane.add(sslCertificateForm.$$$getRootComponent$$$(), cc.xy(2, 2, CellConstraints.FILL, CellConstraints.FILL)); }
From source file:com.atlassian.theplugin.idea.bamboo.BambooToolWindowPanel.java
License:Apache License
private JComponent createRightToolBar() { final JPanel toolBarPanel = new JPanel( new FormLayout("pref, fill:pref:grow, 3dlu", "pref, 3dlu, pref, 3dlu")); CellConstraints cc = new CellConstraints(); toolBarPanel.add(loadToolBar("ThePlugin.Bamboo.RightToolBar"), cc.xyw(1, 1, 2)); planHistoryListLabel = new JLabel(COMPLETED_BUILDS); toolBarPanel.add(planHistoryListLabel, cc.xy(1, 3)); toolBarPanel.add(new JSeparator(SwingConstants.HORIZONTAL), cc.xy(2, 3)); return toolBarPanel; }