List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints
public CellConstraints()
From source file:com.facetoe.jreader.ui.NewProfileWindow.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL// w w w . jav a2s. c om */ private void $$$setupUI$$$() { parentPanel = new JPanel(); parentPanel.setLayout(new FormLayout("fill:d:grow", "center:max(d;4px):noGrow,top:4dlu:noGrow,center:d:grow,top:4dlu: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")); parentPanel .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null)); pnlName = new JPanel(); pnlName.setLayout(new FormLayout("fill:104px:noGrow,left:17dlu:noGrow,fill:d:grow", "center:d:noGrow,top:4dlu:noGrow,center:d:grow")); CellConstraints cc = new CellConstraints(); parentPanel.add(pnlName, cc.xy(1, 5)); pnlName.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null)); txtName = new JTextField(); txtName.setPreferredSize(new Dimension(350, 20)); txtName.setToolTipText("Name for this profile"); pnlName.add(txtName, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.FILL)); final JLabel label1 = new JLabel(); label1.setText("Profile Name:"); pnlName.add(label1, cc.xy(1, 1)); final Spacer spacer1 = new Spacer(); pnlName.add(spacer1, cc.xy(3, 3, CellConstraints.DEFAULT, CellConstraints.FILL)); pnlDocs = new JPanel(); pnlDocs.setLayout(new FormLayout( "fill:101px:noGrow,left:19dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:d:noGrow")); parentPanel.add(pnlDocs, cc.xy(1, 7)); pnlDocs.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null)); final JLabel label2 = new JLabel(); label2.setPreferredSize(new Dimension(300, 14)); label2.setText("Javadoc Directory:"); pnlDocs.add(label2, cc.xyw(1, 1, 2)); txtDocs = new JTextField(); txtDocs.setText(""); txtDocs.setToolTipText("Path to the Javadocs"); pnlDocs.add(txtDocs, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); btnDocs = new JButton(); btnDocs.setText("..."); btnDocs.setToolTipText("Choose directory"); pnlDocs.add(btnDocs, cc.xy(5, 1)); pnlSrc = new JPanel(); pnlSrc.setLayout(new FormLayout( "fill:101px:noGrow,left:19dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:d:noGrow")); parentPanel.add(pnlSrc, cc.xy(1, 9)); pnlSrc.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null)); final JLabel label3 = new JLabel(); label3.setPreferredSize(new Dimension(300, 14)); label3.setText("Source Directory:"); pnlSrc.add(label3, cc.xyw(1, 1, 2)); txtSrc = new JTextField(); txtSrc.setToolTipText("Path to the source code"); pnlSrc.add(txtSrc, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); btnSrc = new JButton(); btnSrc.setText("..."); btnSrc.setToolTipText("Choose directory"); pnlSrc.add(btnSrc, cc.xy(5, 1)); final JPanel panel1 = new JPanel(); panel1.setLayout( new FormLayout("fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:d:noGrow")); parentPanel.add(panel1, cc.xy(1, 11)); btnOK = new JButton(); btnOK.setText("OK"); panel1.add(btnOK, cc.xy(1, 1)); btnCancel = new JButton(); btnCancel.setText("Cancel"); panel1.add(btnCancel, cc.xy(3, 1)); final JPanel panel2 = new JPanel(); panel2.setLayout(new FormLayout("fill:d:grow", "center:d:grow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow")); parentPanel.add(panel2, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); final JLabel label4 = new JLabel(); label4.setFont(new Font(label4.getFont().getName(), Font.BOLD, label4.getFont().getSize())); label4.setText("Select a name, source and documentation directory for this profile."); panel2.add(label4, cc.xy(1, 3)); progressBar = new JProgressBar(); progressBar.setVerifyInputWhenFocusTarget(true); progressBar.setVisible(false); panel2.add(progressBar, cc.xy(1, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); lblStatus = new JLabel(); lblStatus.setText("Preparing to parse..."); lblStatus.setVisible(false); panel2.add(lblStatus, cc.xy(1, 7)); final Spacer spacer2 = new Spacer(); parentPanel.add(spacer2, cc.xy(1, 3, CellConstraints.DEFAULT, CellConstraints.FILL)); }
From source file:com.floreantpos.ui.dialog.DiscountListDialog.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL//from ww w . j av a 2s . com */ private void $$$setupUI$$$() { contentPane = new JPanel(); contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1)); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_SOUTH, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); final Spacer spacer1 = new Spacer(); panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); final JPanel panel2 = new JPanel(); panel2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); panel1.add(panel2, new GridConstraints(0, 1, 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)); btnDeleteSelected = new PosButton(); btnDeleteSelected.setIcon(IconFactory.getIcon("/ui_icons/", "delete.png")); //$NON-NLS-1$ //$NON-NLS-2$ btnDeleteSelected.setPreferredSize(new Dimension(140, 50)); btnDeleteSelected.setText(Messages.getString("DiscountListDialog.5")); //$NON-NLS-1$ panel2.add(btnDeleteSelected); buttonOK = new PosButton(); buttonOK.setIcon(IconFactory.getIcon("/ui_icons/", "finish.png")); //$NON-NLS-1$ //$NON-NLS-2$ buttonOK.setPreferredSize(new Dimension(120, 50)); buttonOK.setText(com.floreantpos.POSConstants.OK); panel2.add(buttonOK); buttonCancel = new PosButton(); buttonCancel.setIcon(IconFactory.getIcon("/ui_icons/", "cancel.png")); //$NON-NLS-1$ //$NON-NLS-2$ buttonCancel.setPreferredSize(new Dimension(120, 50)); buttonCancel.setText(com.floreantpos.POSConstants.CANCEL); panel2.add(buttonCancel); final JPanel panel3 = new JPanel(); panel3.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(458, 310), null, 0, false)); final JScrollPane scrollPane1 = new JScrollPane(); panel3.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); tableDiscounts = new JTable(); scrollPane1.setViewportView(tableDiscounts); final JPanel panel4 = new JPanel(); panel4.setLayout(new FormLayout("fill:p:grow", "center:d:grow,top:4dlu:noGrow,center:d:grow")); //$NON-NLS-1$ //$NON-NLS-2$ panel3.add(panel4, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); btnScrollUp = new PosButton(); btnScrollUp.setIcon(IconFactory.getIcon("/ui_icons/", "up.png")); //$NON-NLS-1$ //$NON-NLS-2$ btnScrollUp.setPreferredSize(new Dimension(50, 50)); btnScrollUp.setText(""); //$NON-NLS-1$ CellConstraints cc = new CellConstraints(); panel4.add(btnScrollUp, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.BOTTOM)); btnScrollDown = new PosButton(); btnScrollDown.setIcon(IconFactory.getIcon("/ui_icons/", "down.png")); //$NON-NLS-1$ //$NON-NLS-2$ btnScrollDown.setPreferredSize(new Dimension(50, 50)); btnScrollDown.setText(""); //$NON-NLS-1$ panel4.add(btnScrollDown, cc.xy(1, 3, CellConstraints.CENTER, CellConstraints.TOP)); }
From source file:com.gui.account.AccountEditorDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents ResourceBundle bundle = ResourceBundle.getBundle("com.resource.locale"); DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); editorPane = new JPanel(); editorContent = new JPanel(); separator1 = compFactory.createSeparator(bundle.getString("AccountEditorDialog.separator1.text")); label1 = new JLabel(); textField1 = BasicComponentFactory/*from ww w . jav a2 s .c o m*/ .createTextField(this.accountPresentationModel.getBufferedModel("pseudo")); label2 = new JLabel(); textField2 = BasicComponentFactory .createTextField(this.accountPresentationModel.getBufferedModel("password")); separator2 = compFactory.createSeparator(bundle.getString("AccountEditorDialog.separator2.text")); label3 = new JLabel(); textField3 = BasicComponentFactory .createTextField(this.accountPresentationModel.getBufferedModel("description")); label4 = new JLabel(); textField4 = BasicComponentFactory .createTextField(this.accountPresentationModel.getBufferedModel("initDate")); label5 = new JLabel(); textField5 = new JTextField(); editorButtons = new JPanel(); editorOk = new JButton(); editorCancel = new JButton(); actionOk = new EditorOk(); actionCancel = new EditorCancel(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("AccountEditorDialog.this.title")); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== editorPane ======== { editorPane.setBorder(Borders.DIALOG_BORDER); editorPane.setLayout(new BorderLayout()); //======== editorContent ======== { editorContent.setBorder(Borders.DLU4_BORDER); editorContent.setLayout(new FormLayout("right:[50dlu,default], $lcgap, [100dlu,default]", "6*(default, $lgap), default")); editorContent.add(separator1, cc.xywh(1, 1, 3, 1)); //---- label1 ---- label1.setText(bundle.getString("AccountEditorDialog.label1.text")); editorContent.add(label1, cc.xy(1, 3)); editorContent.add(textField1, cc.xy(3, 3)); //---- label2 ---- label2.setText(bundle.getString("AccountEditorDialog.label2.text")); editorContent.add(label2, cc.xy(1, 5)); editorContent.add(textField2, cc.xy(3, 5)); editorContent.add(separator2, cc.xywh(1, 7, 3, 1)); //---- label3 ---- label3.setText(bundle.getString("AccountEditorDialog.label3.text")); editorContent.add(label3, cc.xy(1, 9)); editorContent.add(textField3, cc.xy(3, 9)); //---- label4 ---- label4.setText(bundle.getString("AccountEditorDialog.label4.text")); editorContent.add(label4, cc.xy(1, 11)); //---- textField4 ---- textField4.setEditable(false); editorContent.add(textField4, cc.xy(3, 11)); //---- label5 ---- label5.setText(bundle.getString("AccountEditorDialog.label5.text")); editorContent.add(label5, cc.xy(1, 13)); //---- textField5 ---- textField5.setEditable(false); editorContent.add(textField5, cc.xy(3, 13)); } editorPane.add(editorContent, BorderLayout.CENTER); //======== editorButtons ======== { editorButtons.setBorder(Borders.BUTTON_BAR_GAP_BORDER); editorButtons.setLayout(new FormLayout("$glue, $button, $rgap, $button", "pref")); //---- editorOk ---- editorOk.setMnemonic(bundle.getString("AccountEditorDialog.editorOk.mnemonic").charAt(0)); editorOk.setAction(actionOk); editorButtons.add(editorOk, cc.xy(2, 1)); //---- editorCancel ---- editorCancel.setMnemonic(bundle.getString("AccountEditorDialog.editorCancel.mnemonic").charAt(0)); editorCancel.setAction(actionCancel); editorButtons.add(editorCancel, cc.xy(4, 1)); } editorPane.add(editorButtons, BorderLayout.SOUTH); } contentPane.add(editorPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.gui.IHM.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Van Fanel ResourceBundle bundle = ResourceBundle.getBundle("com.resource.locale"); menuTop = new JMenuBar(); menu1 = new JMenu(); menuItem1 = new JMenuItem(); menuItem2 = new JMenuItem(); menu2 = new JMenu(); menuItem6 = new JMenuItem(); menu3 = new JMenu(); menuItem5 = new JMenuItem(); menu4 = new JMenu(); menu5 = new JMenu(); menuItem4 = new JMenuItem(); menu6 = new JMenu(); menuItem3 = new JMenuItem(); uIFSplitPane1 = new UIFSplitPane(); frameLeft = new SimpleInternalFrame(); tabsLeft = new JTabbedPane(); uIFSplitPane2 = new UIFSplitPane(); uIFSplitPane3 = new UIFSplitPane(); frameCenter = new SimpleInternalFrame(); tabsCenter = new JTabbedPane(); panelGoban = new JPanel(); frameRight = new SimpleInternalFrame(); tabsRight = new JTabbedPane(); frameBottom = new SimpleInternalFrame(); tabsBottom = new JTabbedPane(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("IHM.this.title")); Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout("[1010px,default]", "[710px,default]")); //======== menuTop ======== {/* w w w .j a v a2 s.c o m*/ //======== menu1 ======== { menu1.setText(bundle.getString("IHM.menu1.text")); //---- menuItem1 ---- menuItem1.setText(bundle.getString("IHM.menuItem1.text")); menu1.add(menuItem1); //---- menuItem2 ---- menuItem2.setText(bundle.getString("IHM.menuItem2.text")); menu1.add(menuItem2); } menuTop.add(menu1); //======== menu2 ======== { menu2.setText(bundle.getString("IHM.menu2.text")); //---- menuItem6 ---- menuItem6.setText(bundle.getString("IHM.menuItem6.text")); menu2.add(menuItem6); } menuTop.add(menu2); //======== menu3 ======== { menu3.setText(bundle.getString("IHM.menu3.text")); //---- menuItem5 ---- menuItem5.setText(bundle.getString("IHM.menuItem5.text")); menu3.add(menuItem5); } menuTop.add(menu3); //======== menu4 ======== { menu4.setText(bundle.getString("IHM.menu4.text")); } menuTop.add(menu4); //======== menu5 ======== { menu5.setText(bundle.getString("IHM.menu5.text")); //---- menuItem4 ---- menuItem4.setText(bundle.getString("IHM.menuItem4.text")); menu5.add(menuItem4); } menuTop.add(menu5); //======== menu6 ======== { menu6.setText(bundle.getString("IHM.menu6.text")); //---- menuItem3 ---- menuItem3.setText(bundle.getString("IHM.menuItem3.text")); menu6.add(menuItem3); } menuTop.add(menu6); } setJMenuBar(menuTop); //======== uIFSplitPane1 ======== { //======== frameLeft ======== { frameLeft.setTitle(bundle.getString("IHM.frameLeft.title")); // JFormDesigner evaluation mark frameLeft.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), frameLeft.getBorder())); frameLeft.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); Container frameLeftContentPane = frameLeft.getContentPane(); frameLeftContentPane.setLayout(new FormLayout("default", "default")); frameLeftContentPane.add(tabsLeft, cc.xy(1, 1)); } uIFSplitPane1.setLeftComponent(frameLeft); //======== uIFSplitPane2 ======== { uIFSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT); //======== uIFSplitPane3 ======== { //======== frameCenter ======== { frameCenter.setTitle(bundle.getString("IHM.frameCenter.title")); Container frameCenterContentPane = frameCenter.getContentPane(); frameCenterContentPane.setLayout(new FormLayout("default", "default")); //======== tabsCenter ======== { //======== panelGoban ======== { panelGoban.setLayout(new GridBagLayout()); ((GridBagLayout) panelGoban.getLayout()).columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ((GridBagLayout) panelGoban.getLayout()).rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ((GridBagLayout) panelGoban.getLayout()).columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 }; ((GridBagLayout) panelGoban.getLayout()).rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 }; } tabsCenter.addTab(bundle.getString("IHM.panelGoban.tab.title"), panelGoban); } frameCenterContentPane.add(tabsCenter, cc.xy(1, 1)); } uIFSplitPane3.setLeftComponent(frameCenter); //======== frameRight ======== { frameRight.setTitle(bundle.getString("IHM.frameRight.title")); Container frameRightContentPane = frameRight.getContentPane(); frameRightContentPane.setLayout(new FormLayout("default", "default")); frameRightContentPane.add(tabsRight, cc.xy(1, 1)); } uIFSplitPane3.setRightComponent(frameRight); } uIFSplitPane2.setTopComponent(uIFSplitPane3); //======== frameBottom ======== { frameBottom.setTitle(bundle.getString("IHM.frameBottom.title")); Container frameBottomContentPane = frameBottom.getContentPane(); frameBottomContentPane.setLayout(new FormLayout("default", "default")); frameBottomContentPane.add(tabsBottom, cc.xy(1, 1)); } uIFSplitPane2.setBottomComponent(frameBottom); } uIFSplitPane1.setRightComponent(uIFSplitPane2); } contentPane.add(uIFSplitPane1, cc.xy(1, 1)); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.imaginea.betterdocs.BetterDocsSettings.java
License:Apache License
@Nullable @Override//from w w w . j ava2s.c o m public JComponent createComponent() { FormLayout layout = new FormLayout(COLUMN_SPECS, ROW_SPECS); PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(); CellConstraints cc = new CellConstraints(); JLabel esURL = new JLabel(ELASTIC_SEARCH_URL); esURL.setVisible(true); JLabel size = new JLabel(RESULTS_SIZE); size.setVisible(true); JLabel distance = new JLabel(DISTANCE_FROM_CURSOR); distance.setVisible(true); esURLText = new JTextField(); esURLText.setEditable(true); esURLText.setVisible(true); if (propertiesComponent.isValueSet(BetterDocsAction.ES_URL)) { esURLText.setText(propertiesComponent.getValue(BetterDocsAction.ES_URL)); } else { esURLText.setText(BetterDocsAction.ES_URL_DEFAULT); } sizeText = new JTextField(); sizeText.setEditable(true); sizeText.setVisible(true); sizeText.setText(propertiesComponent.getValue(BetterDocsAction.SIZE, String.valueOf(BetterDocsAction.SIZE_DEFAULT_VALUE))); distanceText = new JTextField(); distanceText.setEditable(true); distanceText.setVisible(true); distanceText.setText(propertiesComponent.getValue(BetterDocsAction.DISTANCE, String.valueOf(BetterDocsAction.DISTANCE_DEFAULT_VALUE))); JPanel jPanel = new JPanel(layout); jPanel.add(esURL, cc.xy(1, 3)); jPanel.add(esURLText, cc.xy(2, 3)); jPanel.add(size, cc.xy(1, 2)); jPanel.add(sizeText, cc.xy(2, 2)); jPanel.add(distance, cc.xy(1, 1)); jPanel.add(distanceText, cc.xy(2, 1)); return jPanel; }
From source file:com.imaginea.betterdocs.BetterDocsWindow.java
License:Apache License
@Override public void createToolWindowContent(Project project, ToolWindow toolWindow) { toolWindow.setIcon(Messages.getInformationIcon()); DefaultMutableTreeNode root = new DefaultMutableTreeNode(PROJECTS); JTree jTree = new JTree(root); jTree.setVisible(false);// w w w . j a v a2s . c o m jTree.setAutoscrolls(true); jTree.setForeground(new JBColor(new Color(100, 155, 155), new Color(100, 155, 155))); Document document = EditorFactory.getInstance().createDocument(""); Editor windowEditor = EditorFactory.getInstance().createEditor(document, project, FileTypeManager.getInstance().getFileTypeByExtension("java"), false); BetterDocsAction action = new BetterDocsAction(); action.setTree(jTree); action.setWindowEditor(windowEditor); DefaultActionGroup group = new DefaultActionGroup(); group.add(action); JComponent toolBar = ActionManager.getInstance().createActionToolbar("BetterDocs", group, true) .getComponent(); EditorToggleAction toggleAction = new EditorToggleAction(); DefaultActionGroup moveGroup = new DefaultActionGroup(); moveGroup.add(toggleAction); FormLayout layout = new FormLayout(PREF_PREF_GROW, PREF_PREF); CellConstraints cc = new CellConstraints(); JBScrollPane jTreeScrollPane = new JBScrollPane(); jTreeScrollPane.setViewportView(jTree); jTreeScrollPane.setAutoscrolls(true); jTreeScrollPane.setBackground(new Color(255, 0, 0)); jTreeScrollPane.setPreferredSize(new Dimension(200, 300)); JPanel jPanel = new JPanel(layout); jPanel.setVisible(true); jPanel.add(toolBar, cc.xy(1, 1)); jPanel.add(jTreeScrollPane, cc.xy(2, 1)); JBScrollPane jbScrollPane = new JBScrollPane(); jbScrollPane.setViewportView(windowEditor.getComponent()); final JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, jbScrollPane, jPanel); jSplitPane.setDividerLocation(0.5); toggleAction.setjSplitPane(jSplitPane); toolWindow.getComponent().getParent().add(jSplitPane); }
From source file:com.isencia.passerelle.hmi.form.CheckableComponent.java
License:Open Source License
public CheckableComponent(Component c, Object subject, boolean isChecked) { super(new FormLayout("pref,10px,pref", "pref")); this.checkedComponent = c; this.checkBox = new JCheckBox(); this.subject = subject; checkBox.setSelected(isChecked);/*from w w w .ja va 2 s .com*/ checkBox.addActionListener(new ComponentVisualizer()); // for some reason, if we put it as not visible here // the component can not be set visible later on // when we're checking the checkbox... checkedComponent.setEnabled(isChecked); CellConstraints cc = new CellConstraints(); add(this.checkBox, cc.xy(1, 1)); add(this.checkedComponent, cc.xy(3, 1)); }
From source file:com.isencia.passerelle.hmi.specific.HMITest.java
License:Open Source License
private JPanel getButtonPanel() { addScanLineButton = new JButton("Add scan line"); final AddRowCommand addRowCommand = new AddRowCommand(myTableModel); addScanLineButton.addActionListener(addRowCommand); ///*from ww w. jav a2 s .co m*/ deleteScanLineButton = new JButton("Delete scan line"); final DeleteRowCommand deleteRowCommand = new DeleteRowCommand(table, myTableModel); deleteScanLineButton.addActionListener(deleteRowCommand); // goButton = new JButton("GO"); // loadScanButton = new JButton("Load sequence"); // LoadSequenceCommand loadSequenceCommand = new // LoadSequenceCommand(contextData); // loadScanButton.addActionListener(loadSequenceCommand); // saveScanButton = new JButton("Save sequence"); // // //SaveRockingCommand saveRockingCommand = new SaveRockingCommand(); // saveScanButton.addActionListener(new ModelSaver()); saveScanButton.setAction(new SaveAction(this)); // saveScanAsButton = new JButton("Save sequence as"); // SaveSequenceCommand saveSequenceCommand = new // SaveSequenceCommand(contextData); // saveScanAsButton.addActionListener(saveSequenceCommand); // // saveFileTextField = new JTextField(getCurrentModel().getName()); // final FormLayout layout = new FormLayout("p, 3dlu, p, 3dlu, p", // cols "pref, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); // rows // Specify that columns 1 & 5 as well as 3 & 7 have equal widths. layout.setColumnGroups(new int[][] { { 1, 3, 5 } }); // // // Create a builder that assists in adding components to the // container. // // Wrap the panel with a standardized border. final PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); // Obtain a reusable constraints object to place components in the grid. final CellConstraints cc = new CellConstraints(); // Fill the grid with components; the builder offers to create // frequently used components, e.g. separators and labels. // Add a titled separator to cell (1, 1) that spans 7 columns. builder.addSeparator("Commands", cc.xyw(1, 1, 5)); builder.add(addScanLineButton, cc.xyw(1, 3, 1)); builder.add(deleteScanLineButton, cc.xyw(3, 3, 1)); builder.add(goButton, cc.xyw(5, 3, 1)); builder.addSeparator("File", cc.xyw(1, 5, 5)); builder.add(loadScanButton, cc.xyw(1, 7, 1)); builder.add(saveScanButton, cc.xyw(3, 7, 1)); builder.add(saveScanAsButton, cc.xyw(5, 7, 1)); builder.add(saveFileTextField, cc.xyw(1, 9, 5)); return builder.getPanel(); }
From source file:com.isencia.passerelle.hmi.specific.HMITest.java
License:Open Source License
private JPanel getRockingCurvePanel() { // Initialization rockingCurveTextField = new JTextField("100"); registerBinding("rockingCurveField", rockingCurveTextField, (ParameterToWidgetBinder) new ParameterToTextFieldBinder()); // Create panel final FormLayout layout = new FormLayout("p, 3dlu, p", // cols "pref, 3dlu, p"); // rows // Specify that columns 1 & 5 as well as 3 & 7 have equal widths. layout.setColumnGroups(new int[][] { { 1, 3 } }); // Create a builder that assists in adding components to the container. // Wrap the panel with a standardized border. final PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder();//from w ww. j a v a 2s .c om // Obtain a reusable constraints object to place components in the grid. final CellConstraints cc = new CellConstraints(); builder.addSeparator("Rocking curve", cc.xyw(1, 1, 3)); builder.addLabel("Rocking curve (%)", cc.xy(1, 3)); builder.add(rockingCurveTextField, cc.xy(3, 3)); return builder.getPanel(); }
From source file:com.isencia.passerelle.hmi.specific.HMITest.java
License:Open Source License
private JPanel getTableScrollPane() { // Scan list table final String[] columnNames = { "Scan", "Position", "Sample name", "Scan name", "Number of scans", "Gain auto" }; myTableModel = new MyTableModel(columnNames, 0); table = new JTable(myTableModel); table.setPreferredScrollableViewportSize(new Dimension(600, 200)); tableScrollPane = new JScrollPane(table); registerBinding("scanPositionColumn", myTableModel, (ParameterToWidgetBinder) new ParameterToTableColumnBinder(1)); // Create panel final FormLayout layout = new FormLayout("p", // cols "pref, 3dlu, p"); // rows // Specify that columns 1 & 5 as well as 3 & 7 have equal widths. // layout.setColumnGroups(new int[][]{{1, 3}}); // Create a builder that assists in adding components to the container. // Wrap the panel with a standardized border. final PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder();/*w w w. ja v a 2 s. c om*/ // Obtain a reusable constraints object to place components in the grid. final CellConstraints cc = new CellConstraints(); builder.addSeparator("Scan sequences", cc.xyw(1, 1, 1)); builder.add(tableScrollPane, cc.xyw(1, 3, 1)); return builder.getPanel(); }