List of usage examples for com.jgoodies.forms.layout CellConstraints TOP
Alignment TOP
To view the source code for com.jgoodies.forms.layout CellConstraints TOP.
Click Source Link
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/*w w w.java2 s . c o 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:loci.visbio.data.SpectralWidget.java
License:Open Source License
/** Creates a new spectral mapping widget with weighted sliders. */ public SpectralWidget(final SpectralTransform mapping, final String[] text) { super();//from w w w . j ava 2 s.c o m this.mapping = mapping; // create sliders, labels and auto-set buttons final RealType[] range = ((ImageTransform) mapping.getParent()).getRangeTypes(); final int in = range.length; final int out = mapping.getRangeCount(); weights = new JSlider[out][in]; labels = new JLabel[out][in]; final Hashtable labelHash = new Hashtable(); labelHash.put(new Integer(-PRECISION), new JLabel("-1")); labelHash.put(new Integer(0), new JLabel("0")); labelHash.put(new Integer(PRECISION), new JLabel("1")); final JButton[] negOnes = new JButton[out]; final JButton[] zeroes = new JButton[out]; final JButton[] ones = new JButton[out]; final double[][] w = mapping.getWeights(); for (int o = 0; o < out; o++) { for (int i = 0; i < in; i++) { final int value = (int) (PRECISION * w[o][i]); final JSlider s = new JSlider(-PRECISION, PRECISION, value); if (i == in - 1) { s.setMajorTickSpacing(PRECISION); s.setMinorTickSpacing(PRECISION / 10); s.setLabelTable(labelHash); s.setPaintTicks(true); s.setPaintLabels(true); } final JLabel l = new JLabel(shortString(value)); s.addChangeListener(new ChangeListener() { @Override public void stateChanged(final ChangeEvent e) { l.setText(shortString(((JSlider) e.getSource()).getValue())); } }); weights[o][i] = s; labels[o][i] = l; } negOnes[o] = new JButton("-1"); negOnes[o].setActionCommand("-1:" + o); negOnes[o].addActionListener(this); zeroes[o] = new JButton("0"); zeroes[o].setActionCommand("0:" + o); zeroes[o].addActionListener(this); ones[o] = new JButton("1"); ones[o].setActionCommand("1:" + o); ones[o].addActionListener(this); } // apply button final JButton apply = new JButton("Apply"); if (!LAFUtil.isMacLookAndFeel()) apply.setMnemonic('a'); apply.setActionCommand("apply"); apply.addActionListener(this); // lay out components final String s = "pref, 3dlu:grow, pref, 3dlu:grow, pref"; final StringBuffer cols = new StringBuffer("pref, 3dlu, " + s + ", 3dlu, pref"); for (int o = 1; o < out; o++) { cols.append(", 9dlu, " + s + ", 3dlu, pref"); } final StringBuffer rows = new StringBuffer("pref, 3dlu, pref"); for (int i = 1; i < in; i++) rows.append(", 3dlu, pref"); rows.append(", 3dlu, pref, 5dlu, pref"); final PanelBuilder builder = new PanelBuilder(new FormLayout(cols.toString(), rows.toString())); final CellConstraints cc = new CellConstraints(); for (int i = 0; i < in; i++) { final int row = 2 * i + 3; builder.addLabel(range[i].getName(), cc.xy(1, row, CellConstraints.RIGHT, CellConstraints.TOP)); } for (int o = 0; o < out; o++) { final int col = 8 * o + 3; builder.addLabel(text[o], cc.xyw(col, 1, 5, CellConstraints.CENTER, CellConstraints.DEFAULT)); for (int i = 0; i < in; i++) { final int row = 2 * i + 3; builder.add(weights[o][i], cc.xyw(col, row, 5)); builder.add(labels[o][i], cc.xy(col + 6, row, CellConstraints.DEFAULT, CellConstraints.TOP)); } final int row = 2 * in + 3; builder.add(negOnes[o], cc.xy(col, row)); builder.add(zeroes[o], cc.xy(col + 2, row)); builder.add(ones[o], cc.xy(col + 4, row)); } builder.add(ButtonBarFactory.buildCenteredBar(apply), cc.xyw(1, 2 * in + 5, 8 * out + 1)); setLayout(new BorderLayout()); add(builder.getPanel()); }
From source file:net.kamhon.ieagle.swing.jgoodies.KFormBuilder.java
License:Apache License
@Override public void addButtonPanel(JPanel buttonPanel) { add(buttonPanel, 0, columnType.columnCount, CellConstraints.CENTER, CellConstraints.TOP); }
From source file:net.kamhon.ieagle.swing.jgoodies.KFormBuilder.java
License:Apache License
@Override public void addButtonPanel(JPanel buttonPanel, int columnIndex, int colSpan) { add(buttonPanel, columnIndex, colSpan, CellConstraints.CENTER, CellConstraints.TOP); }
From source file:net.rptools.maptool.client.ui.token.EditTokenDialog.java
License:Open Source License
private void updateStatesPanel() { // Group the states first into individual panels List<BooleanTokenOverlay> overlays = new ArrayList<BooleanTokenOverlay>( MapTool.getCampaign().getTokenStatesMap().values()); Map<String, JPanel> groups = new TreeMap<String, JPanel>(); groups.put("", new JPanel(new FormLayout("0px:grow 2px 0px:grow 2px 0px:grow 2px 0px:grow"))); for (BooleanTokenOverlay overlay : overlays) { String group = overlay.getGroup(); if (group != null && (group = group.trim()).length() != 0) { JPanel panel = groups.get(group); if (panel == null) { panel = new JPanel(new FormLayout("0px:grow 2px 0px:grow 2px 0px:grow 2px 0px:grow")); panel.setBorder(BorderFactory.createTitledBorder(group)); groups.put(group, panel); }//from www . j ava 2 s . c o m } } // Add the group panels and bar panel to the states panel JPanel panel = getStatesPanel(); panel.removeAll(); FormLayout layout = new FormLayout("0px:grow"); panel.setLayout(layout); int row = 1; for (JPanel gPanel : groups.values()) { layout.appendRow(new RowSpec("pref")); layout.appendRow(new RowSpec("2px")); panel.add(gPanel, new CellConstraints(1, row)); row += 2; } layout.appendRow(new RowSpec("pref")); layout.appendRow(new RowSpec("2px")); JPanel barPanel = new JPanel(new FormLayout("right:pref 2px pref 5px right:pref 2px pref")); panel.add(barPanel, new CellConstraints(1, row)); // Add the individual check boxes. for (BooleanTokenOverlay state : overlays) { String group = state.getGroup(); panel = groups.get(""); if (group != null && (group = group.trim()).length() != 0) panel = groups.get(group); int x = panel.getComponentCount() % 4; int y = panel.getComponentCount() / 4; if (x == 0) { layout = (FormLayout) panel.getLayout(); if (y != 0) layout.appendRow(new RowSpec("2px")); layout.appendRow(new RowSpec("pref")); } panel.add(new JCheckBox(state.getName()), new CellConstraints(x * 2 + 1, y * 2 + 1)); } // Add sliders to the bar panel if (MapTool.getCampaign().getTokenBarsMap().size() > 0) { layout = (FormLayout) barPanel.getLayout(); barPanel.setName("bar"); barPanel.setBorder(BorderFactory.createTitledBorder("Bars")); int count = 0; row = 0; for (BarTokenOverlay bar : MapTool.getCampaign().getTokenBarsMap().values()) { int working = count % 2; if (working == 0) { // slider row layout.appendRow(new RowSpec("pref")); row += 1; } JPanel labelPanel = new JPanel(new FormLayout("pref", "pref 2px:grow pref")); barPanel.add(labelPanel, new CellConstraints(1 + working * 4, row)); labelPanel.add(new JLabel(bar.getName() + ":"), new CellConstraints(1, 1, CellConstraints.RIGHT, CellConstraints.TOP)); JSlider slider = new JSlider(0, 100); JCheckBox hide = new JCheckBox("Hide"); hide.putClientProperty("JSlider", slider); hide.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { JSlider js = (JSlider) ((JCheckBox) e.getSource()).getClientProperty("JSlider"); js.setEnabled(!((JCheckBox) e.getSource()).isSelected()); } }); labelPanel.add(hide, new CellConstraints(1, 3, CellConstraints.RIGHT, CellConstraints.TOP)); slider.setName(bar.getName()); slider.setPaintLabels(true); slider.setPaintTicks(true); slider.setMajorTickSpacing(20); slider.createStandardLabels(20); slider.setMajorTickSpacing(10); barPanel.add(slider, new CellConstraints(3 + working * 4, row)); if (working != 0) { // spacer row layout.appendRow(new RowSpec("2px")); row += 1; } count += 1; } } }
From source file:net.sf.nmedit.jsynth.nomad.forms.SynthInfoFrm.java
License:Open Source License
public JPanel createPanel() { JPanel jpanel1 = new JPanel(); FormLayout formlayout1 = new FormLayout( "FILL:PREF:NONE,FILL:8DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE", "CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE"); CellConstraints cc = new CellConstraints(); jpanel1.setLayout(formlayout1);//from w ww.j ava2 s .co m JLabel jlabel1 = new JLabel(); jlabel1.setText("Synthesizer"); jpanel1.add(jlabel1, cc.xy(3, 1)); JLabel jlabel2 = new JLabel(); jlabel2.setText("Device"); jpanel1.add(jlabel2, cc.xy(3, 2)); JLabel jlabel3 = new JLabel(); jlabel3.setText("Vendor"); jpanel1.add(jlabel3, cc.xy(3, 3)); lblSynthName.setName("lblSynthName"); lblSynthName.setText("lblSynthName"); jpanel1.add(lblSynthName, cc.xy(5, 1)); lblDeviceName.setName("lblDeviceName"); lblDeviceName.setText("lblDeviceName"); jpanel1.add(lblDeviceName, cc.xy(5, 2)); lblVendor.setName("lblVendor"); lblVendor.setText("lblVendor"); jpanel1.add(lblVendor, cc.xy(5, 3)); JLabel jlabel4 = new JLabel(); jlabel4.setText("Slots"); jpanel1.add(jlabel4, cc.xy(3, 5)); lblSlotCount.setName("lblSlotCount"); lblSlotCount.setText("lblSlotCount"); jpanel1.add(lblSlotCount, cc.xy(5, 5)); lblSynthIcon.setName("lblSynthIcon"); lblSynthIcon.setText("JLabel"); jpanel1.add(lblSynthIcon, new CellConstraints(1, 1, 1, 5, CellConstraints.DEFAULT, CellConstraints.TOP)); addFillComponents(jpanel1, new int[] { 2, 4 }, new int[] { 2, 3, 4, 5 }); return jpanel1; }
From source file:net.sourceforge.marathon.mpf.MainPanel.java
License:Open Source License
public JPanel createPanel() { initComponents();//from w w w . j a v a2 s . com PanelBuilder builder = new PanelBuilder(new FormLayout("left:pref, 3dlu, fill:pref:grow, 3dlu, fill:pref", "pref, 3dlu, pref, 3dlu, fill:pref:grow, 3dlu, fill:pref:grow, 3dlu, pref, 3dlu, pref, 3dlu, pref")); builder.setDefaultDialogBorder(); CellConstraints labelConstraints = new CellConstraints(); CellConstraints compConstraints = new CellConstraints(); builder.addLabel("Class &Name: ", labelConstraints.xy(1, 1), mainClassField, compConstraints.xywh(3, 1, 3, 1)); JScrollPane scrollPane = new JScrollPane(programArgsField, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); JLabel label = builder.addLabel("Pro&gram Arguments: ", labelConstraints.xy(1, 5, CellConstraints.LEFT, CellConstraints.TOP), scrollPane, compConstraints.xywh(3, 5, 3, 1)); label.setLabelFor(programArgsField); scrollPane = new JScrollPane(vmArgsField, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); label = builder.addLabel("&VM Arguments: ", labelConstraints.xy(1, 7, CellConstraints.LEFT, CellConstraints.TOP), scrollPane, compConstraints.xywh(3, 7, 3, 1)); label.setLabelFor(vmArgsField); builder.addLabel("&Working Directory: ", labelConstraints.xy(1, 9), workingDirField, compConstraints.xy(3, 9)); builder.add(browse, labelConstraints.xy(5, 9)); browse.setMnemonic(KeyEvent.VK_B); builder.addLabel("&Java Executable: ", labelConstraints.xy(1, 11), vmCommandField, compConstraints.xy(3, 11)); builder.add(browseVM, labelConstraints.xy(5, 11)); return builder.getPanel(); }
From source file:net.sourceforge.marathon.mpf.ProjectPanel.java
License:Open Source License
public JPanel createPanel() { initComponents();/*from w w w. ja va 2s. co m*/ PanelBuilder builder = new PanelBuilder(new FormLayout("left:pref, 3dlu, pref:grow, 3dlu, fill:pref", "pref, 3dlu, pref, 3dlu, fill:pref:grow, 3dlu, pref, 3dlu, pref")); builder.setDefaultDialogBorder(); CellConstraints labelConstraints = new CellConstraints(); CellConstraints compConstraints = new CellConstraints(); builder.addLabel("&Name: ", labelConstraints.xy(1, 1), nameField, compConstraints.xywh(3, 1, 3, 1)); builder.addLabel("Directory: ", labelConstraints.xy(1, 3), dirField, compConstraints.xy(3, 3)); builder.add(browse, compConstraints.xy(5, 3)); JScrollPane scrollPane = new JScrollPane(descriptionField, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); JLabel label = builder.addLabel("&Description: ", labelConstraints.xy(1, 5, CellConstraints.LEFT, CellConstraints.TOP), scrollPane, compConstraints.xywh(3, 5, 3, 1)); label.setLabelFor(descriptionField); builder.add(useToolkitMenumask, labelConstraints.xyw(2, 7, 2)); builder.add(useDevelopmentMode, labelConstraints.xyw(2, 9, 2)); return builder.getPanel(); }
From source file:org.antlr.works.dialog.AWPrefsDialog.java
License:BSD License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - ANTLR (www.antlr.org) dialogPane = new JPanel(); contentPane = new JPanel(); tabbedPane1 = new JTabbedPane(); tabGeneral = new JPanel(); label2 = new JLabel(); label5 = new JLabel(); lafCombo = new JComboBox(); startupActionCombo = new JComboBox(); restoreWindowsBoundButton = new JCheckBox(); desktopModeButton = new JCheckBox(); label25 = new JLabel(); outputPathField = new JTextField(); browseOutputPathButton = new JButton(); label24 = new JLabel(); dotToolPathField = new JTextField(); browseDotToolPathButton = new JButton(); label37 = new JLabel(); antlr3OptionsField = new JTextField(); tabEditor = new JPanel(); label3 = new JLabel(); editorFontCombo = new JComboBox(); editorFontSizeSpinner = new JSpinner(); autoSaveButton = new JCheckBox(); autoSaveDelayField = new JTextField(); label11 = new JLabel(); backupFileButton = new JCheckBox(); highlightCursorLineButton = new JCheckBox(); smoothScrollingButton = new JCheckBox(); autoIndentColonInRuleButton = new JCheckBox(); showLineNumbers = new JCheckBox(); vstyleAutocompletionButton = new JCheckBox(); label1 = new JLabel(); tabWidthField = new JTextField(); label22 = new JLabel(); parserDelayField = new JTextField(); label23 = new JLabel(); tabSyntax = new JPanel(); label26 = new JLabel(); parserColorPanel = new JPanel(); parserBoldButton = new JCheckBox(); parserItalicButton = new JCheckBox(); label27 = new JLabel(); lexerColorPanel = new JPanel(); lexerBoldButton = new JCheckBox(); lexerItalicButton = new JCheckBox(); label28 = new JLabel(); labelColorPanel = new JPanel(); labelsBoldButton = new JCheckBox(); labelsItalicButton = new JCheckBox(); label29 = new JLabel(); refsActionColorPanel = new JPanel(); refsActionBoldButton = new JCheckBox(); refsActionItalicButton = new JCheckBox(); label38 = new JLabel(); blockLabelsColorPanel = new JPanel(); blockLabelsBoldButton = new JCheckBox(); blockLabelsItalicButton = new JCheckBox(); label30 = new JLabel(); commentsColorPanel = new JPanel(); commentsBoldButton = new JCheckBox(); commentsItalicButton = new JCheckBox(); label31 = new JLabel(); stringsColorPanel = new JPanel(); stringsBoldButton = new JCheckBox(); stringsItalicButton = new JCheckBox(); label32 = new JLabel(); keywordsColorPanel = new JPanel(); keywordsBoldButton = new JCheckBox(); keywordsItalicButton = new JCheckBox(); syntaxDefaultButton = new JButton(); tabCompiler = new JPanel(); jikesRadio = new JRadioButton(); integratedRadio = new JRadioButton(); javacRadio = new JRadioButton(); javacCustomPathButton = new JCheckBox(); javacPathField = new JTextField(); browseJavacPath = new JButton(); label4 = new JLabel(); jikesPathField = new JTextField(); browseJikesPath = new JButton(); label9 = new JLabel(); classpathSystemButton = new JCheckBox(); classpathCustomButton = new JCheckBox(); customClasspathField = new JTextField(); browseCustomClassPathButton = new JButton(); tabDebugger = new JPanel(); label33 = new JLabel(); debugDefaultLocalPortField = new JTextField(); label34 = new JLabel(); debugLaunchTimeoutField = new JTextField(); label35 = new JLabel(); label12 = new JLabel(); debugNonConsumedColorPanel = new JPanel(); label13 = new JLabel(); debugConsumedColorPanel = new JPanel(); label14 = new JLabel(); debugHiddenColorPanel = new JPanel(); label15 = new JLabel(); debugDeadColorPanel = new JPanel(); label16 = new JLabel(); debugLTColorPanel = new JPanel(); label36 = new JLabel(); detachablePanelChildrenButton = new JCheckBox(); askGenButton = new JCheckBox(); panel1 = new JPanel(); label8 = new JLabel(); checkGrammarSuccessButton = new JCheckBox(); generateCodeSuccessButton = new JCheckBox(); fileModifiedOnDiskButton = new JCheckBox(); interpreterLimitationButton = new JCheckBox(); label6 = new JLabel(); clearConsoleBeforeCheckButton = new JCheckBox(); tabUpdates = new JPanel(); label7 = new JLabel(); updateTypeCombo = new JComboBox(); checkForUpdatesButton = new JButton(); label10 = new JLabel(); downloadPathField = new JTextField(); browseUpdateDownloadPathButton = new JButton(); tabTestRig = new JPanel(); label17 = new JLabel(); testRigLanguageComboBox = new JComboBox(); testRigDefaultRadio = new JRadioButton(); testRigTextRadio = new JRadioButton(); scrollPane1 = new JScrollPane(); testTextArea = new JTextPane(); buttonBar = new JPanel(); applyButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle("Preferences"); Container contentPane2 = getContentPane(); contentPane2.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from w w w . ja v a 2 s . co m*/ dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setMinimumSize(new Dimension(540, 350)); dialogPane.setLayout(new BorderLayout()); //======== contentPane ======== { contentPane.setLayout(new FormLayout("default, default:grow", "fill:default:grow")); //======== tabbedPane1 ======== { //======== tabGeneral ======== { tabGeneral.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(min;20dlu)"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(min;40dlu)"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label2 ---- label2.setText("At startup:"); tabGeneral.add(label2, cc.xy(3, 3)); //---- label5 ---- label5.setText("Look and feel:"); tabGeneral.add(label5, cc.xy(3, 7)); tabGeneral.add(lafCombo, cc.xywh(5, 7, 3, 1)); //---- startupActionCombo ---- startupActionCombo.setModel(new DefaultComboBoxModel(new String[] { "Create a new document", "Open the last opened document", "Open the last saved document", "Open all opened documents when ANTLRWorks was closed" })); tabGeneral.add(startupActionCombo, cc.xywh(5, 3, 3, 1)); //---- restoreWindowsBoundButton ---- restoreWindowsBoundButton.setText("Restore project's windows position and size"); tabGeneral.add(restoreWindowsBoundButton, cc.xywh(5, 5, 3, 1)); //---- desktopModeButton ---- desktopModeButton.setText("Desktop Mode"); desktopModeButton .setToolTipText("This option will take effect after restarting ANTLRWorks"); tabGeneral.add(desktopModeButton, cc.xywh(5, 9, 3, 1)); //---- label25 ---- label25.setText("Output path:"); tabGeneral.add(label25, cc.xy(3, 11)); //---- outputPathField ---- outputPathField.setToolTipText( "Relative path will be generated in the same directory as the grammar itself"); tabGeneral.add(outputPathField, cc.xywh(5, 11, 3, 1)); //---- browseOutputPathButton ---- browseOutputPathButton.setText("Browse..."); tabGeneral.add(browseOutputPathButton, cc.xy(9, 11)); //---- label24 ---- label24.setText("DOT path:"); tabGeneral.add(label24, cc.xy(3, 13)); //---- dotToolPathField ---- dotToolPathField.setToolTipText("Absolute path to the DOT command-line tool"); tabGeneral.add(dotToolPathField, cc.xywh(5, 13, 3, 1)); //---- browseDotToolPathButton ---- browseDotToolPathButton.setText("Browse..."); tabGeneral.add(browseDotToolPathButton, cc.xy(9, 13)); //---- label37 ---- label37.setText("ANTLR options:"); tabGeneral.add(label37, cc.xy(3, 15)); tabGeneral.add(antlr3OptionsField, cc.xywh(5, 15, 3, 1)); } tabbedPane1.addTab("General", tabGeneral); //======== tabEditor ======== { tabEditor.setLayout(new FormLayout(new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(20)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(default;45dlu)"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(20)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(30)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) })); //---- label3 ---- label3.setText("Font:"); tabEditor.add(label3, cc.xy(3, 3)); //---- editorFontCombo ---- editorFontCombo.setActionCommand("editorFontCombo"); tabEditor.add(editorFontCombo, cc.xywh(5, 3, 5, 1)); //---- editorFontSizeSpinner ---- editorFontSizeSpinner.setModel(new SpinnerNumberModel(12, 8, null, 1)); tabEditor.add(editorFontSizeSpinner, cc.xy(11, 3)); //---- autoSaveButton ---- autoSaveButton.setText("Auto-save every"); tabEditor.add(autoSaveButton, cc.xywh(5, 5, 3, 1)); tabEditor.add(autoSaveDelayField, cc.xy(9, 5)); //---- label11 ---- label11.setText("minutes"); tabEditor.add(label11, cc.xy(11, 5)); //---- backupFileButton ---- backupFileButton.setText("Create backup file"); tabEditor.add(backupFileButton, cc.xywh(5, 7, 5, 1)); //---- highlightCursorLineButton ---- highlightCursorLineButton.setText("Highlight cursor line"); tabEditor.add(highlightCursorLineButton, cc.xywh(5, 9, 5, 1)); //---- smoothScrollingButton ---- smoothScrollingButton.setText("Smooth scrolling"); tabEditor.add(smoothScrollingButton, cc.xywh(5, 11, 3, 1)); //---- autoIndentColonInRuleButton ---- autoIndentColonInRuleButton.setText("Auto-indent ':' in rule"); tabEditor.add(autoIndentColonInRuleButton, cc.xywh(5, 13, 7, 1)); //---- showLineNumbers ---- showLineNumbers.setText("Show line numbers"); tabEditor.add(showLineNumbers, cc.xywh(5, 15, 5, 1)); //---- vstyleAutocompletionButton ---- vstyleAutocompletionButton.setText("Visual Studio auto-completion menu"); vstyleAutocompletionButton.setToolTipText( "Displayed when a space is pressed, remember previous auto-completed word, continues to auto-complete without decreasing the word choice as you type"); tabEditor.add(vstyleAutocompletionButton, cc.xywh(5, 17, 9, 1)); //---- label1 ---- label1.setText("Tab width:"); label1.setHorizontalAlignment(SwingConstants.RIGHT); tabEditor.add(label1, cc.xy(3, 19)); //---- tabWidthField ---- tabWidthField.setText("8"); tabEditor.add(tabWidthField, cc.xy(5, 19)); //---- label22 ---- label22.setText("Update delay:"); tabEditor.add(label22, cc.xy(3, 21)); //---- parserDelayField ---- parserDelayField.setText("250"); tabEditor.add(parserDelayField, cc.xy(5, 21)); //---- label23 ---- label23.setText("ms"); tabEditor.add(label23, cc.xy(7, 21)); } tabbedPane1.addTab("Editor", tabEditor); //======== tabSyntax ======== { tabSyntax.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(20)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label26 ---- label26.setText("Parser References:"); tabSyntax.add(label26, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); //======== parserColorPanel ======== { parserColorPanel.setForeground(Color.black); parserColorPanel.setPreferredSize(new Dimension(70, 20)); parserColorPanel.setBackground(new Color(255, 255, 51)); parserColorPanel.setBorder(LineBorder.createBlackLineBorder()); parserColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(parserColorPanel, cc.xy(5, 3)); //---- parserBoldButton ---- parserBoldButton.setText("Bold"); parserBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(parserBoldButton, cc.xy(7, 3)); //---- parserItalicButton ---- parserItalicButton.setText("Italic"); parserItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(parserItalicButton, cc.xy(9, 3)); //---- label27 ---- label27.setText("Lexer References:"); tabSyntax.add(label27, cc.xy(3, 5)); //======== lexerColorPanel ======== { lexerColorPanel.setForeground(Color.black); lexerColorPanel.setPreferredSize(new Dimension(70, 20)); lexerColorPanel.setBackground(new Color(255, 255, 51)); lexerColorPanel.setBorder(LineBorder.createBlackLineBorder()); lexerColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(lexerColorPanel, cc.xy(5, 5)); //---- lexerBoldButton ---- lexerBoldButton.setText("Bold"); lexerBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(lexerBoldButton, cc.xy(7, 5)); //---- lexerItalicButton ---- lexerItalicButton.setText("Italic"); lexerItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(lexerItalicButton, cc.xy(9, 5)); //---- label28 ---- label28.setText("Labels:"); tabSyntax.add(label28, cc.xy(3, 7)); //======== labelColorPanel ======== { labelColorPanel.setForeground(Color.black); labelColorPanel.setPreferredSize(new Dimension(70, 20)); labelColorPanel.setBackground(new Color(255, 255, 51)); labelColorPanel.setBorder(LineBorder.createBlackLineBorder()); labelColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(labelColorPanel, cc.xy(5, 7)); //---- labelsBoldButton ---- labelsBoldButton.setText("Bold"); labelsBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(labelsBoldButton, cc.xy(7, 7)); //---- labelsItalicButton ---- labelsItalicButton.setText("Italic"); labelsItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(labelsItalicButton, cc.xy(9, 7)); //---- label29 ---- label29.setText("References in action:"); tabSyntax.add(label29, cc.xy(3, 9)); //======== refsActionColorPanel ======== { refsActionColorPanel.setForeground(Color.black); refsActionColorPanel.setPreferredSize(new Dimension(70, 20)); refsActionColorPanel.setBackground(new Color(255, 255, 51)); refsActionColorPanel.setBorder(LineBorder.createBlackLineBorder()); refsActionColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(refsActionColorPanel, cc.xy(5, 9)); //---- refsActionBoldButton ---- refsActionBoldButton.setText("Bold"); refsActionBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(refsActionBoldButton, cc.xy(7, 9)); //---- refsActionItalicButton ---- refsActionItalicButton.setText("Italic"); refsActionItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(refsActionItalicButton, cc.xy(9, 9)); //---- label38 ---- label38.setText("Blocks:"); tabSyntax.add(label38, cc.xy(3, 11)); //======== blockLabelsColorPanel ======== { blockLabelsColorPanel.setForeground(Color.black); blockLabelsColorPanel.setPreferredSize(new Dimension(70, 20)); blockLabelsColorPanel.setBackground(new Color(255, 255, 51)); blockLabelsColorPanel.setBorder(LineBorder.createBlackLineBorder()); blockLabelsColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(blockLabelsColorPanel, cc.xy(5, 11)); //---- blockLabelsBoldButton ---- blockLabelsBoldButton.setText("Bold"); blockLabelsBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(blockLabelsBoldButton, cc.xy(7, 11)); //---- blockLabelsItalicButton ---- blockLabelsItalicButton.setText("Italic"); blockLabelsItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(blockLabelsItalicButton, cc.xy(9, 11)); //---- label30 ---- label30.setText("Comments:"); tabSyntax.add(label30, cc.xy(3, 13)); //======== commentsColorPanel ======== { commentsColorPanel.setForeground(Color.black); commentsColorPanel.setPreferredSize(new Dimension(70, 20)); commentsColorPanel.setBackground(new Color(255, 255, 51)); commentsColorPanel.setBorder(LineBorder.createBlackLineBorder()); commentsColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(commentsColorPanel, cc.xy(5, 13)); //---- commentsBoldButton ---- commentsBoldButton.setText("Bold"); commentsBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(commentsBoldButton, cc.xy(7, 13)); //---- commentsItalicButton ---- commentsItalicButton.setText("Italic"); commentsItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(commentsItalicButton, cc.xy(9, 13)); //---- label31 ---- label31.setText("Strings:"); tabSyntax.add(label31, cc.xy(3, 15)); //======== stringsColorPanel ======== { stringsColorPanel.setForeground(Color.black); stringsColorPanel.setPreferredSize(new Dimension(70, 20)); stringsColorPanel.setBackground(new Color(255, 255, 51)); stringsColorPanel.setBorder(LineBorder.createBlackLineBorder()); stringsColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(stringsColorPanel, cc.xy(5, 15)); //---- stringsBoldButton ---- stringsBoldButton.setText("Bold"); stringsBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(stringsBoldButton, cc.xy(7, 15)); //---- stringsItalicButton ---- stringsItalicButton.setText("Italic"); stringsItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(stringsItalicButton, cc.xy(9, 15)); //---- label32 ---- label32.setText("Keywords:"); tabSyntax.add(label32, cc.xy(3, 17)); //======== keywordsColorPanel ======== { keywordsColorPanel.setForeground(Color.black); keywordsColorPanel.setPreferredSize(new Dimension(70, 20)); keywordsColorPanel.setBackground(new Color(255, 255, 51)); keywordsColorPanel.setBorder(LineBorder.createBlackLineBorder()); keywordsColorPanel.setLayout(new FlowLayout()); } tabSyntax.add(keywordsColorPanel, cc.xy(5, 17)); //---- keywordsBoldButton ---- keywordsBoldButton.setText("Bold"); keywordsBoldButton.setFont(new Font("Lucida Grande", Font.BOLD, 13)); tabSyntax.add(keywordsBoldButton, cc.xy(7, 17)); //---- keywordsItalicButton ---- keywordsItalicButton.setText("Italic"); keywordsItalicButton.setFont(new Font("Lucida Grande", Font.ITALIC, 13)); tabSyntax.add(keywordsItalicButton, cc.xy(9, 17)); //---- syntaxDefaultButton ---- syntaxDefaultButton.setText("Default"); tabSyntax.add(syntaxDefaultButton, cc.xy(13, 19)); } tabbedPane1.addTab("Syntax", tabSyntax); //======== tabCompiler ======== { tabCompiler .setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.DEFAULT_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.DEFAULT_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- jikesRadio ---- jikesRadio.setText("jikes"); tabCompiler.add(jikesRadio, cc.xywh(3, 7, 2, 1)); //---- integratedRadio ---- integratedRadio.setText("com.sun.tools.javac"); integratedRadio.setActionCommand("integrated"); tabCompiler.add(integratedRadio, cc.xywh(3, 11, 3, 1)); //---- javacRadio ---- javacRadio.setText("javac"); javacRadio.setSelected(true); tabCompiler.add(javacRadio, cc.xywh(3, 3, 2, 1)); //---- javacCustomPathButton ---- javacCustomPathButton.setText("Path:"); javacCustomPathButton.setToolTipText( "Check to specify a custom path if the default system path doesn't include javac"); tabCompiler.add(javacCustomPathButton, cc.xywh(4, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); tabCompiler.add(javacPathField, cc.xy(5, 5)); //---- browseJavacPath ---- browseJavacPath.setText("Browse..."); tabCompiler.add(browseJavacPath, cc.xy(6, 5)); //---- label4 ---- label4.setText("Path:"); tabCompiler.add(label4, cc.xywh(4, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); tabCompiler.add(jikesPathField, cc.xy(5, 9)); //---- browseJikesPath ---- browseJikesPath.setText("Browse..."); tabCompiler.add(browseJikesPath, cc.xy(6, 9)); //---- label9 ---- label9.setText("Classpath:"); tabCompiler.add(label9, cc.xy(3, 15)); //---- classpathSystemButton ---- classpathSystemButton.setText("System"); tabCompiler.add(classpathSystemButton, cc.xy(4, 15)); //---- classpathCustomButton ---- classpathCustomButton.setText("Custom:"); tabCompiler.add(classpathCustomButton, cc.xy(4, 17)); tabCompiler.add(customClasspathField, cc.xy(5, 17)); //---- browseCustomClassPathButton ---- browseCustomClassPathButton.setText("Browse..."); tabCompiler.add(browseCustomClassPathButton, cc.xy(6, 17)); } tabbedPane1.addTab("Compiler", tabCompiler); //======== tabDebugger ======== { tabDebugger.setLayout(new FormLayout(new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(default;20dlu)"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label33 ---- label33.setText("Default local port:"); tabDebugger.add(label33, cc.xy(3, 3)); //---- debugDefaultLocalPortField ---- debugDefaultLocalPortField.setText("491000"); tabDebugger.add(debugDefaultLocalPortField, cc.xy(5, 3)); //---- label34 ---- label34.setText("Remote parser launch time-out:"); tabDebugger.add(label34, cc.xy(9, 3)); //---- debugLaunchTimeoutField ---- debugLaunchTimeoutField.setText("5"); tabDebugger.add(debugLaunchTimeoutField, cc.xy(11, 3)); //---- label35 ---- label35.setText("seconds"); tabDebugger.add(label35, cc.xy(13, 3)); //---- label12 ---- label12.setText("Non-consumed token:"); label12.setHorizontalAlignment(SwingConstants.RIGHT); tabDebugger.add(label12, cc.xy(3, 7)); //======== debugNonConsumedColorPanel ======== { debugNonConsumedColorPanel.setForeground(Color.black); debugNonConsumedColorPanel.setPreferredSize(new Dimension(70, 20)); debugNonConsumedColorPanel.setBackground(new Color(255, 255, 51)); debugNonConsumedColorPanel.setBorder(LineBorder.createBlackLineBorder()); debugNonConsumedColorPanel.setLayout(new FlowLayout()); } tabDebugger.add(debugNonConsumedColorPanel, cc.xy(5, 7)); //---- label13 ---- label13.setText("Consumed token:"); label13.setHorizontalAlignment(SwingConstants.RIGHT); tabDebugger.add(label13, cc.xy(3, 9)); //======== debugConsumedColorPanel ======== { debugConsumedColorPanel.setForeground(Color.black); debugConsumedColorPanel.setPreferredSize(new Dimension(70, 20)); debugConsumedColorPanel.setBackground(new Color(255, 255, 51)); debugConsumedColorPanel.setBorder(LineBorder.createBlackLineBorder()); debugConsumedColorPanel.setLayout(new FlowLayout()); } tabDebugger.add(debugConsumedColorPanel, cc.xy(5, 9)); //---- label14 ---- label14.setText("Hidden token:"); label14.setHorizontalAlignment(SwingConstants.RIGHT); tabDebugger.add(label14, cc.xy(3, 11)); //======== debugHiddenColorPanel ======== { debugHiddenColorPanel.setForeground(Color.black); debugHiddenColorPanel.setPreferredSize(new Dimension(70, 20)); debugHiddenColorPanel.setBackground(new Color(255, 255, 51)); debugHiddenColorPanel.setBorder(LineBorder.createBlackLineBorder()); debugHiddenColorPanel.setLayout(new FlowLayout()); } tabDebugger.add(debugHiddenColorPanel, cc.xy(5, 11)); //---- label15 ---- label15.setText("Dead token:"); label15.setHorizontalAlignment(SwingConstants.RIGHT); tabDebugger.add(label15, cc.xy(3, 13)); //======== debugDeadColorPanel ======== { debugDeadColorPanel.setForeground(Color.black); debugDeadColorPanel.setPreferredSize(new Dimension(70, 20)); debugDeadColorPanel.setBackground(new Color(255, 255, 51)); debugDeadColorPanel.setBorder(LineBorder.createBlackLineBorder()); debugDeadColorPanel.setLayout(new FlowLayout()); } tabDebugger.add(debugDeadColorPanel, cc.xy(5, 13)); //---- label16 ---- label16.setText("Lookahead token:"); label16.setHorizontalAlignment(SwingConstants.RIGHT); tabDebugger.add(label16, cc.xy(3, 15)); //======== debugLTColorPanel ======== { debugLTColorPanel.setForeground(Color.black); debugLTColorPanel.setPreferredSize(new Dimension(70, 20)); debugLTColorPanel.setBackground(new Color(255, 255, 51)); debugLTColorPanel.setBorder(LineBorder.createBlackLineBorder()); debugLTColorPanel.setLayout(new FlowLayout()); } tabDebugger.add(debugLTColorPanel, cc.xy(5, 15)); //---- label36 ---- label36.setText("Detachable panels:"); tabDebugger.add(label36, cc.xy(3, 19)); //---- detachablePanelChildrenButton ---- detachablePanelChildrenButton.setText("Children of project's window"); tabDebugger.add(detachablePanelChildrenButton, cc.xywh(5, 19, 5, 1)); //---- askGenButton ---- askGenButton.setText("Ask before generating and compiling"); tabDebugger.add(askGenButton, cc.xywh(5, 21, 5, 1)); } tabbedPane1.addTab("Debugger", tabDebugger); //======== panel1 ======== { panel1.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label8 ---- label8.setText("Display alerts:"); panel1.add(label8, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); //---- checkGrammarSuccessButton ---- checkGrammarSuccessButton.setText("Successfull check grammar"); panel1.add(checkGrammarSuccessButton, cc.xy(5, 3)); //---- generateCodeSuccessButton ---- generateCodeSuccessButton.setText("Successfull code generation"); panel1.add(generateCodeSuccessButton, cc.xy(5, 5)); //---- fileModifiedOnDiskButton ---- fileModifiedOnDiskButton.setText("File modified on disk"); panel1.add(fileModifiedOnDiskButton, cc.xy(5, 7)); //---- interpreterLimitationButton ---- interpreterLimitationButton.setText("Interpreter limitations"); panel1.add(interpreterLimitationButton, cc.xy(5, 9)); //---- label6 ---- label6.setText("Console:"); panel1.add(label6, cc.xywh(3, 11, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); //---- clearConsoleBeforeCheckButton ---- clearConsoleBeforeCheckButton.setText("Clear before checking grammar"); panel1.add(clearConsoleBeforeCheckButton, cc.xy(5, 11)); } tabbedPane1.addTab("Advanced", panel1); //======== tabUpdates ======== { tabUpdates.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label7 ---- label7.setText("Check for ANTLRWorks updates:"); label7.setHorizontalAlignment(SwingConstants.LEFT); tabUpdates.add(label7, cc.xy(3, 3)); //---- updateTypeCombo ---- updateTypeCombo.setModel(new DefaultComboBoxModel( new String[] { "Manually", "At startup", "Daily", "Weekly" })); tabUpdates.add(updateTypeCombo, cc.xywh(3, 5, 4, 1)); //---- checkForUpdatesButton ---- checkForUpdatesButton.setText("Check Now"); tabUpdates.add(checkForUpdatesButton, cc.xy(7, 5)); //---- label10 ---- label10.setText("Download path:"); label10.setHorizontalAlignment(SwingConstants.LEFT); tabUpdates.add(label10, cc.xy(3, 9)); tabUpdates.add(downloadPathField, cc.xywh(3, 11, 3, 1)); //---- browseUpdateDownloadPathButton ---- browseUpdateDownloadPathButton.setText("Browse..."); browseUpdateDownloadPathButton.setActionCommand("Browse"); tabUpdates.add(browseUpdateDownloadPathButton, cc.xy(7, 11)); } tabbedPane1.addTab("Updates", tabUpdates); //======== tabTestRig ======== { tabTestRig.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.UNRELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) })); //---- label17 ---- label17.setText("Test Rig for:"); tabTestRig.add(label17, cc.xywh(3, 3, 3, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); //---- testRigLanguageComboBox ---- testRigLanguageComboBox .setModel(new DefaultComboBoxModel(new String[] { "Java", "Python" })); tabTestRig.add(testRigLanguageComboBox, cc.xy(7, 3)); //---- testRigDefaultRadio ---- testRigDefaultRadio.setText("Use default Test Rig Template"); testRigDefaultRadio.setSelected(true); tabTestRig.add(testRigDefaultRadio, cc.xywh(5, 5, 5, 1)); //---- testRigTextRadio ---- testRigTextRadio.setText("Text:"); tabTestRig.add(testRigTextRadio, cc.xywh(5, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== scrollPane1 ======== { scrollPane1.setViewportView(testTextArea); } tabTestRig.add(scrollPane1, cc.xywh(7, 7, 3, 1)); } tabbedPane1.addTab("Test Rig", tabTestRig); } contentPane.add(tabbedPane1, cc.xywh(1, 1, 2, 1)); } dialogPane.add(contentPane, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout( new FormLayout(new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- applyButton ---- applyButton.setText("Apply"); buttonBar.add(applyButton, cc.xy(2, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane2.add(dialogPane, BorderLayout.CENTER); pack(); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.archiviststoolkit.dialog.ErrorDialog.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); cardPanel = new JPanel(); contentPanel = new JPanel(); panel2 = new JPanel(); label2 = new JLabel(); label1 = new JLabel(); errorMessageScrollPane2 = new JScrollPane(); errorMessageBozo = new JTextArea(); panel1 = new JPanel(); toggleDetails = new JToggleButton(); toggleDetailsLabel = new JLabel(); errorTextScrollPane = new JScrollPane(); errorText = new JTextArea(); errorPanel = new JPanel(); label3 = new JLabel(); label4 = new JLabel(); errorMessageScrollPane = new JScrollPane(); errorMessage = new JTextArea(); buttonBar = new JPanel(); submitBugReport = new JButton(); okButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setModal(true);//from w ww. j av a 2s . c o m Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setBackground(new Color(200, 205, 232)); dialogPane.setLayout(new BorderLayout()); //======== cardPanel ======== { cardPanel.setOpaque(false); cardPanel.setLayout(new CardLayout()); //======== contentPanel ======== { contentPanel.setOpaque(false); contentPanel.setPreferredSize(new Dimension(682, 450)); contentPanel.setLayout(new FormLayout(ColumnSpec.decodeSpecs("max(default;600px):grow"), new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) })); //======== panel2 ======== { panel2.setOpaque(false); panel2.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- label2 ---- label2.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/bug.png"))); panel2.add(label2, cc.xy(1, 1)); //---- label1 ---- label1.setText("An error has occured"); panel2.add(label1, cc.xywh(3, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); } contentPanel.add(panel2, cc.xy(1, 1)); //======== errorMessageScrollPane2 ======== { errorMessageScrollPane2.setOpaque(false); errorMessageScrollPane2.setBorder(null); //---- errorMessageBozo ---- errorMessageBozo.setBackground(new Color(200, 205, 232)); errorMessageBozo.setBorder(null); errorMessageBozo.setLineWrap(true); errorMessageBozo.setWrapStyleWord(true); errorMessageBozo.setRows(2); errorMessageBozo.setEditable(false); errorMessageScrollPane2.setViewportView(errorMessageBozo); } contentPanel.add(errorMessageScrollPane2, cc.xy(1, 3)); //======== panel1 ======== { panel1.setOpaque(false); panel1.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- toggleDetails ---- toggleDetails.setOpaque(false); toggleDetails.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/toggleDown.png"))); toggleDetails.setBorder(null); toggleDetails.setSelectedIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/toggleUp.png"))); toggleDetails.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { toggleDetailsActionPerformed(); } }); panel1.add(toggleDetails, cc.xy(1, 1)); //---- toggleDetailsLabel ---- toggleDetailsLabel.setText("Show Details"); panel1.add(toggleDetailsLabel, cc.xy(3, 1)); } contentPanel.add(panel1, cc.xy(1, 5)); //======== errorTextScrollPane ======== { errorTextScrollPane .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); //---- errorText ---- errorText.setRows(15); errorText.setLineWrap(true); errorText.setEditable(false); errorTextScrollPane.setViewportView(errorText); } contentPanel.add(errorTextScrollPane, cc.xywh(1, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); } cardPanel.add(contentPanel, "bozo"); //======== errorPanel ======== { errorPanel.setOpaque(false); errorPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) })); //---- label3 ---- label3.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/error.png"))); errorPanel.add(label3, cc.xy(1, 1)); //---- label4 ---- label4.setText("An error has occured"); errorPanel.add(label4, cc.xywh(3, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== errorMessageScrollPane ======== { errorMessageScrollPane.setOpaque(false); errorMessageScrollPane.setBorder(null); //---- errorMessage ---- errorMessage.setBackground(new Color(200, 205, 232)); errorMessage.setBorder(null); errorMessage.setLineWrap(true); errorMessage.setWrapStyleWord(true); errorMessage.setRows(4); errorMessage.setEditable(false); errorMessageScrollPane.setViewportView(errorMessage); } errorPanel.add(errorMessageScrollPane, cc.xywh(1, 3, 3, 1)); } cardPanel.add(errorPanel, "error"); } dialogPane.add(cardPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setOpaque(false); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- submitBugReport ---- submitBugReport.setText("Submit Bug Report"); submitBugReport.setOpaque(false); submitBugReport.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { submitBugReportActionPerformed(e); } }); buttonBar.add(submitBugReport, cc.xy(2, 1)); //---- okButton ---- okButton.setText("OK"); okButton.setOpaque(false); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); buttonBar.add(okButton, cc.xy(6, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents toggleDetails.setSelected(true); toggleTextAndView(); }