List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints
public CellConstraints()
From source file:ch.zhaw.ias.dito.ui.MethodPanel.java
License:BSD License
public MethodPanel(HelpArea helpArea) { super(ScreenEnum.METHOD, ScreenEnum.QUESTION, ScreenEnum.ANALYSIS); comboModel = new MethodComboModel(DistanceMethodEnum.get(Coding.REAL)); methods = new JComboBox(comboModel); FormLayout layout = new FormLayout( "pref, 5dlu, max(100dlu; pref), 5dlu, max(100dlu; pref), 5dlu, max(100dlu; pref), pref:grow", "pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, fill:pref:grow"); CellConstraints cc = new CellConstraints(); DefaultFormBuilder fb = new DefaultFormBuilder(layout, Translation.INSTANCE.getBundle()); fb.addI15dSeparator("s3.lb.method", cc.xyw(1, 1, 5)); fb.addI15dLabel("s3.lb.coding", cc.xyw(1, 3, 3)); fb.add(codingGroup, cc.xy(5, 3));//from w w w. j a va 2s . c o m codingGroup.addActionListener(this); fb.addI15dLabel("s3.lb.distance", cc.xyw(1, 5, 3)); fb.add(methods, cc.xy(5, 5)); methods.addActionListener(this); fb.addI15dLabel("s3.lb.parameter", cc.xyw(1, 7, 3)); fb.add(parameter, cc.xy(5, 7)); fb.add(formula, cc.xywh(7, 3, 1, 5)); fb.add(ownDefinition, cc.xyw(1, 9, 3)); createDefinition.setText("(a+d)/(a+b+c+d)"); fb.add(createDefinition, cc.xy(5, 9)); plotButton.addActionListener(this); fb.add(plotButton, cc.xy(5, 11)); fb.addI15dSeparator("s3.lb.calculation", cc.xyw(1, 13, 5)); fb.add(randomSample, cc.xyw(1, 15, 5)); fb.addI15dLabel("s3.lb.sampleSize", cc.xy(3, 17)); fb.add(sampleSize, cc.xy(5, 17)); fb.add(parallel, cc.xyw(1, 19, 5)); fb.addI15dLabel("s3.lb.numberOfThreads", cc.xy(3, 21)); fb.add(numberOfThreads, cc.xy(5, 21)); Method m = Config.INSTANCE.getDitoConfig().getMethod(); codingGroup.setSelectedValue(m.getMethod().getCoding()); methods.setSelectedItem(DistanceMethodEnum.get(m.getName())); randomSample.setSelected(m.isUseRandomSample()); randomSample.addActionListener(this); sampleSize.setText(Integer.toString(m.getSampleSize())); parallel.setSelected(m.isParallel()); parallel.addActionListener(this); numberOfThreads.setText(Integer.toString(m.getNumberOfThreads())); this.setLayout(new BorderLayout()); this.add(fb.getPanel(), BorderLayout.CENTER); //set distance matrix to null. this way it can be garbage collected //the distance matrix is probably quite large, and the calculations will need a lot of memory Config.INSTANCE.setDistanceMatrix(null); updateEnabling(); }
From source file:ch.zhaw.ias.dito.ui.OutputPanel.java
License:BSD License
public OutputPanel(HelpArea helpArea) { super(ScreenEnum.OUTPUT, ScreenEnum.ANALYSIS, null); FormLayout layout = new FormLayout( "max(50dlu; pref), 5dlu, max(100dlu; pref), 5dlu, max(50dlu; pref), 5dlu, max(100dlu; pref), 5dlu, max(50dlu; pref)", "pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref"); //layout.setRowGroups(new int[][]{{2, 4, 6}}); CellConstraints cc = new CellConstraints(); DefaultFormBuilder fb = new DefaultFormBuilder(layout, Translation.INSTANCE.getBundle()); browseButton = new JXButton(Translation.INSTANCE.get("s1.bu.browse")); filePath.setName(Translation.INSTANCE.get("s1.lb.file")); fb.addI15dSeparator("s5.title.file", cc.xyw(1, 1, 9)); fb.addI15dLabel("s1.lb.file", cc.xy(1, 3)); fb.add(filePath, cc.xyw(3, 3, 5));//from ww w .j a v a2 s . c om fb.add(browseButton, cc.xy(9, 3)); fb.addI15dLabel("s1.lb.separator", cc.xy(1, 5)); fb.add(separator, cc.xy(7, 5)); fb.addI15dLabel("s5.lb.precision", cc.xy(1, 7)); fb.add(precision, cc.xy(7, 7)); fb.add(saveButton, cc.xy(7, 9)); //validationGroup.add(filePath, Validators.fFILE_MUST_BE_FILE); //validationGroup.add(separator, Validators.REQUIRE_NON_EMPTY_STRING); Output o = Config.INSTANCE.getDitoConfig().getOutput(); filePath.setText(o.getFilename()); separator.setText(Character.toString(o.getSeparator())); precision.setText(Integer.toString(o.getPrecision())); browseButton.addActionListener(this); saveButton.addActionListener(this); this.setLayout(new BorderLayout()); this.add(fb.getPanel(), BorderLayout.CENTER); }
From source file:ch.zhaw.ias.dito.ui.ProcessPanel.java
License:BSD License
public ProcessPanel() { setBorder(BorderFactory.createEtchedBorder()); FormLayout layout = new FormLayout("5dlu, 50dlu:grow, 5dlu", "5dlu, fill:pref, fill:pref:grow, fill:pref, fill:pref:grow, fill:pref, fill:pref:grow, fill:pref, fill:pref:grow, fill:pref, 5dlu, fill:20dlu, 5dlu, fill:8dlu, 5dlu"); int[][] rowGroups = new int[][] { { 2, 4, 6, 8 }, { 3, 5, 7 } }; layout.setRowGroups(rowGroups);//ww w.j av a2 s. c o m CellConstraints cc = new CellConstraints(); PanelBuilder pb = new PanelBuilder(layout); panels.put(ScreenEnum.INPUT, new ProcessStepPanel(ScreenEnum.INPUT, ConfigProperty.INPUT_FILENAME, ConfigProperty.INPUT_SIZE)); panels.put(ScreenEnum.QUESTION, new ProcessStepPanel(ScreenEnum.QUESTION, ConfigProperty.QUESTION_NUMBER)); panels.put(ScreenEnum.METHOD, new ProcessStepPanel(ScreenEnum.METHOD, ConfigProperty.METHOD_NAME, ConfigProperty.RANDOM_SAMPLE)); panels.put(ScreenEnum.ANALYSIS, new ProcessStepPanel(ScreenEnum.ANALYSIS)); panels.put(ScreenEnum.OUTPUT, new ProcessStepPanel(ScreenEnum.OUTPUT, ConfigProperty.OUTPUT_FILENAME, ConfigProperty.OUTPUT_PRECISION)); pb.add(panels.get(ScreenEnum.INPUT), cc.xy(2, 2)); pb.add(new ArrowPanel(), cc.xy(2, 3)); pb.add(panels.get(ScreenEnum.QUESTION), cc.xy(2, 4)); pb.add(new ArrowPanel(), cc.xy(2, 5)); pb.add(panels.get(ScreenEnum.METHOD), cc.xy(2, 6)); pb.add(new ArrowPanel(), cc.xy(2, 7)); pb.add(panels.get(ScreenEnum.ANALYSIS), cc.xy(2, 8)); pb.add(new ArrowPanel(), cc.xy(2, 9)); pb.add(panels.get(ScreenEnum.OUTPUT), cc.xy(2, 10)); pb.add(progress, cc.xy(2, 12)); pb.add(status, cc.xy(2, 14)); this.setLayout(new BorderLayout()); add(pb.getPanel(), BorderLayout.CENTER); Logger.INSTANCE.addInterface(this); }
From source file:ch.zhaw.ias.dito.ui.util.SingleHistogramPanel.java
License:BSD License
public SingleHistogramPanel(Matrix m) { super(new BorderLayout()); this.m = m;//from w ww . j a va2 s .com this.chart = createChart(); this.chartPanel = new ChartPanel(this.chart); Border border = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4), BorderFactory.createEtchedBorder()); this.chartPanel.setBorder(border); add(this.chartPanel, BorderLayout.CENTER); JPanel dashboard = new JPanel(new BorderLayout()); dashboard.setBorder(BorderFactory.createEmptyBorder(0, 4, 4, 4)); this.spinner = new JSpinner(new SpinnerNumberModel(0, 0, m.getColCount() - 1, 1)); spinner.addChangeListener(this); this.slider = new JSlider(0, m.getColCount() - 1, 0); slider.setPaintLabels(true); slider.setMajorTickSpacing(Math.max(50, 10 * Math.round(m.getColCount() / 100))); slider.setPaintTicks(true); this.slider.addChangeListener(this); FormLayout layout = new FormLayout("fill:0:g, max(20dlu; pref)", "top:pref"); CellConstraints cc = new CellConstraints(); DefaultFormBuilder fb = new DefaultFormBuilder(layout, Translation.INSTANCE.getBundle()); fb.add(slider, cc.xy(1, 1)); fb.add(spinner, cc.xy(2, 1)); dashboard.add(fb.getPanel(), BorderLayout.CENTER); add(dashboard, BorderLayout.SOUTH); switchColumn(0); }
From source file:checkerplugin.CheckerSettingsTab.java
License:Open Source License
@Override public JPanel createSettingsPanel() { JPanel panel = new JPanel(new FormLayout( FormFactory.RELATED_GAP_COLSPEC.encode() + "," + FormFactory.PREF_COLSPEC.encode(), "pref")); mAutoStart = new JCheckBox(mLocalizer.msg("autostart", "Run checks at startup")); mAutoStart.setSelected(mSettings.getAutostart()); panel.add(mAutoStart, new CellConstraints().xy(2, 1)); return panel; }
From source file:clipboardplugin.ClipboardSettingsTab.java
License:Open Source License
/** * Creates the SettingsPanel/*from www . j a v a2 s .c om*/ * * @return Settings-Panel */ public JPanel createSettingsPanel() { EnhancedPanelBuilder pb = new EnhancedPanelBuilder( FormFactory.RELATED_GAP_COLSPEC.encode() + ",fill:default:grow"); CellConstraints cc = new CellConstraints(); mConfigPanel = new PluginProgramConfigurationPanel(mPlugin.getSelectedPluginProgramFormatings(), mPlugin.getAvailableLocalPluginProgramFormatings(), ClipboardPlugin.getDefaultFormating(), false, false); pb.addRow(); pb.add(mConfigPanel, cc.xyw(1, pb.getRow(), pb.getColumnCount())); return pb.getPanel(); }
From source file:clockplugin.ClockSettingsTab.java
License:GNU General Public License
public JPanel createSettingsPanel() { FormLayout layout = new FormLayout("5dlu,pref,3dlu,pref,pref:grow,10dlu", "5dlu,pref,pref,pref,pref,5dlu,pref,2dlu,pref," + "pref,10dlu,pref,pref"); PanelBuilder pb = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); mMove = new JCheckBox(mLocalizer.msg("moveonscreen", "Move clock on screen with TV-Browser")); mMove.setSelected(ClockPlugin.getInstance().getMoveOnScreen()); mShowBorder = new JCheckBox(mLocalizer.msg("clockborder", "Clock with border")); mShowBorder.setSelected(ClockPlugin.getInstance().getShowBorder()); mTitleClock = new JCheckBox(mLocalizer.msg("titlebar", "Clock in the title bar")); mTitleClock.setSelected(ClockPlugin.getInstance().getTitleBarClock()); mBox = new JCheckBox(mLocalizer.msg("forever", "Show clock forever")); mBox.setSelected(ClockPlugin.getInstance().getShowForever()); mBox.addActionListener(this); mUsePersonaColors = new JCheckBox(mLocalizer.msg("usePersonaColors", "Use Colors of Persona"), ClockPlugin.getInstance().isUsingPersonaColors()); mUseTransparency = new JCheckBox(mLocalizer.msg("useTransparency", "Clock transparent"), ClockPlugin.getInstance().isUsingTransparentBackground()); mTime = new JSpinner(); mTime.setModel(new SpinnerNumberModel(ClockPlugin.getInstance().getTimeValue(), 5, 30, 1)); mFontSize = new JSpinner(); mFontSize.setModel(new SpinnerNumberModel(ClockPlugin.getInstance().getFontValue(), 10, 30, 1)); pb.add(mMove, cc.xyw(2, 2, 4));/* ww w. java 2 s . c o m*/ pb.add(mShowBorder, cc.xyw(2, 3, 4)); pb.add(mTitleClock, cc.xyw(2, 4, 4)); pb.add(mBox, cc.xyw(2, 5, 4)); int y = 6; try { Class.forName("util.ui.persona.Persona"); layout.insertRow(y, RowSpec.decode("default")); pb.add(mUsePersonaColors, cc.xyw(2, y++, 4)); } catch (ClassNotFoundException e) { } boolean showTransparencySelection = false; GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); GraphicsConfiguration config = devices[0].getDefaultConfiguration(); try { Class<?> awtUtilities = Class.forName("com.sun.awt.AWTUtilities"); Method m = awtUtilities.getMethod("isTranslucencyCapable", new Class<?>[] { GraphicsConfiguration.class }); showTransparencySelection = (Boolean) m.invoke(awtUtilities, new Object[] { config }); } catch (Exception e) { e.printStackTrace(); try { Method m = config.getClass().getMethod("isTranslucencyCapable()", new Class<?>[] { GraphicsConfiguration.class }); showTransparencySelection = (Boolean) m.invoke(config, new Object[0]); } catch (Exception e1) { e1.printStackTrace(); } } if (showTransparencySelection) { layout.insertRow(y, RowSpec.decode("default")); pb.add(mUseTransparency, cc.xyw(2, y++, 4)); } mLabel = pb.addLabel(mLocalizer.msg("desc", "Duration of showing the clock in seconds") + ":", cc.xy(2, ++y)); pb.add(mTime, cc.xy(4, y++)); pb.addLabel(mLocalizer.msg("fsize", "Font size of the clock") + ":", cc.xy(2, ++y)); pb.add(mFontSize, cc.xy(4, y)); y += 3; pb.addLabel(mLocalizer.msg("info1", "To move the clock on screen click it left"), cc.xyw(2, y++, 4)); pb.addLabel(mLocalizer.msg("info2", "and move the mouse with pressed left button."), cc.xyw(2, y, 4)); if (mBox.isSelected()) { mTime.setEnabled(false); mLabel.setEnabled(false); } return pb.getPanel(); }
From source file:com.alcatel_lucent.nz.wnmsextract.WNMSTransformGUI.java
License:Open Source License
/** * buildPanel. Layout input screen/* w w w .j av a 2 s . c o m*/ * @return * r1 | Input Parameters ------------------------------- * r2 | XCM Path+Name [_________] * r3 | XSL Path+Name [_________] * r4 | Logging Outputs--------------------------------- * r5 | Log Console [] Log Level [DEBUG|v] * r6 | Log File [] * r6 | * r7 | [ START ][ EXIT ] * ---+------------------------------------------------- * ||c1 |c2|c3 |c4 |c5|c6 */ private JComponent buildPanel() { FormLayout layout = new FormLayout("left:pref", // 2cols "pref,pref,3dlu,pref,pref,3dlu,pref"); // 3rows PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addSeparator("Input Parameters", cc.xywh(1, 1, 1, 1)); builder.add(buildInputPanel(), cc.xy(1, 2)); builder.addSeparator("Logging Outputs", cc.xywh(1, 4, 1, 1)); builder.add(buildLogPanel(), cc.xy(1, 5)); builder.add(buildButtonPanel(), cc.xy(1, 7, "right,center")); return builder.getPanel(); }
From source file:com.alcatel_lucent.nz.wnmsextract.WNMSTransformGUI.java
License:Open Source License
private JComponent buildInputPanel() { FormLayout layout = new FormLayout("right:pref, 5dlu, 75dlu", //cols "pref, 3dlu, pref"); // rows PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.addLabel("Snapshot Name", cc.xy(1, 1)); builder.add(snapshot, cc.xyw(3, 1, 1)); builder.addLabel("Stylesheet Name", cc.xy(1, 3)); builder.add(stylesheet, cc.xyw(3, 3, 1)); return builder.getPanel(); }
From source file:com.alcatel_lucent.nz.wnmsextract.WNMSTransformGUI.java
License:Open Source License
private JComponent buildLogPanel() { FormLayout layout = new FormLayout("right:pref, 5dlu, pref, 5dlu, right:pref, 5dlu, pref", //cols "pref,pref"); // rows /*FormLayout layout = new FormLayout( "right:pref, 5dlu, pref, pref, 5dlu, pref", //cols "p, 15dlu, 15dlu, p, 15dlu, 3dlu, pref"); // rows *///from w w w.ja v a 2 s . com PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.addLabel("Log Console", cc.xy(1, 1)); builder.add(logcon, cc.xy(3, 1)); builder.addLabel("Log File", cc.xy(1, 2)); builder.add(logfile, cc.xy(3, 2)); builder.addLabel("Log Level", cc.xy(5, 1)); builder.add(loglevel, cc.xy(7, 1)); return builder.getPanel(); }