当前位置: 首页>>代码示例>>Java>>正文


Java ParallelGroup.addComponent方法代码示例

本文整理汇总了Java中javax.swing.GroupLayout.ParallelGroup.addComponent方法的典型用法代码示例。如果您正苦于以下问题:Java ParallelGroup.addComponent方法的具体用法?Java ParallelGroup.addComponent怎么用?Java ParallelGroup.addComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.GroupLayout.ParallelGroup的用法示例。


在下文中一共展示了ParallelGroup.addComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updatePanels

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
private void updatePanels() {
	jFiltersPanel.removeAll();
	GroupLayout groupLayout = new GroupLayout(jFiltersPanel);
	jFiltersPanel.setLayout(groupLayout);
	groupLayout.setAutoCreateGaps(true);
	groupLayout.setAutoCreateContainerGaps(false);
	ParallelGroup horizontalGroup = groupLayout.createParallelGroup();
	SequentialGroup verticalGroup = groupLayout.createSequentialGroup();
	for (LocationPanel locationPanel : locationPanels) {
		horizontalGroup.addComponent(locationPanel.getPanel());
		verticalGroup.addComponent(locationPanel.getPanel());
	}
	jFiltersPanel.setVisible(!locationPanels.isEmpty());
	groupLayout.setHorizontalGroup(horizontalGroup);
	groupLayout.setVerticalGroup(verticalGroup);
	autoValidate();
	this.getDialog().pack();
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:19,代码来源:StockpileDialog.java

示例2: generateJFreeChart

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
/**
 * Generate a vertical list of JFreeCharts
 * 
 * @param labels
 *            - the labels for the values
 * @param index
 *            - the index
 * @param values
 * @return
 */
public static String generateJFreeChart(List<String> labels,
        List<Double> index, List<List<Double>> values) {
    JPanel panel = new JPanel();
    // create a layout
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    SequentialGroup sgv = layout.createSequentialGroup();
    layout.setVerticalGroup(sgv);
    ParallelGroup pgh = layout.createParallelGroup();
    layout.setHorizontalGroup(pgh);
    for (int i = 0; i != labels.size(); i++) {
        XYSeries xys = new XYSeries(labels.get(i));
        for (int j = 0; j != index.size(); j++) {
            xys.add(index.get(j), values.get(i).get(j));
        }
        XYSeriesCollection xysc = new XYSeriesCollection(xys);
        JFreeChart chart =
                ChartFactory.createXYLineChart(labels.get(i), "Time",
                        "Focus", xysc, PlotOrientation.VERTICAL, false,
                        false, false);
        chart.setBackgroundPaint(Color.white);
        chart.getTitle().setFont(new Font("Tahoma", Font.BOLD, 14));
        ChartPanel cp = new ChartPanel(chart);
        sgv.addComponent(cp);
        pgh.addComponent(cp);
    }
    JFrame frame = new JFrame();
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
    return null;
}
 
开发者ID:Xapagy,项目名称:Xapagy,代码行数:45,代码来源:tdVisualizationGenerator.java

示例3: makeHorizontalGroup

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
private ParallelGroup makeHorizontalGroup( GroupLayout layout ) {
	ParallelGroup removeButtonGroup = layout.createParallelGroup( GroupLayout.Alignment.LEADING );
	for ( JButton removeRowButton : removeRowButtons ) {
		removeButtonGroup.addComponent( removeRowButton );
	}
	removeButtonGroup.addComponent( addRelationshipButton );

	ParallelGroup subjectCBGroup = layout.createParallelGroup( GroupLayout.Alignment.LEADING );
	subjectCBGroup.addComponent( subjectJLabel );
	for ( UriComboBox subjectCB : subjectComboBoxes ) {
		subjectCBGroup.addComponent( subjectCB );
	}
	subjectCBGroup.addComponent( maxExportLimitLabel );

	ParallelGroup relationCBGroup = layout.createParallelGroup( GroupLayout.Alignment.LEADING );
	relationCBGroup.addComponent( relationJLabel );
	for ( UriComboBox relationCB : relationComboBoxes ) {
		relationCBGroup.addComponent( relationCB );
	}

	ParallelGroup objectCBGroup = layout.createParallelGroup( GroupLayout.Alignment.LEADING );
	objectCBGroup.addComponent( objectJLabel );
	for ( UriComboBox objectCB : objectComboBoxes ) {
		objectCBGroup.addComponent( objectCB );
	}

	ParallelGroup horizontalGroup = layout.createParallelGroup( GroupLayout.Alignment.TRAILING )
			.addGroup( layout.createSequentialGroup()
					.addGroup( removeButtonGroup )
					.addGroup( subjectCBGroup )
					.addGroup( relationCBGroup )
					.addGroup( objectCBGroup )
			)
			.addGroup( layout.createSequentialGroup()
					.addComponent( togrid )
					.addComponent( exportButton ) );

	return horizontalGroup;
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:40,代码来源:ExportSpecificRelationshipsToLoadingSheetAction.java

示例4: doLayout

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
private void doLayout() {
	autoValidate();
	jFilters.removeAll();
	
	GroupLayout layout = new GroupLayout(jFilters);
	jFilters.setLayout(layout);
	layout.setAutoCreateGaps(true);
	layout.setAutoCreateContainerGaps(false);

	ParallelGroup horizontalGroup = layout.createParallelGroup();
	SequentialGroup verticalGroup = layout.createSequentialGroup();
	for (FilterPanel ownerPanel : ownerPanels) {
		horizontalGroup.addComponent(ownerPanel.getPanel());
		verticalGroup.addComponent(ownerPanel.getPanel());
	}

	for (FilterPanel flagPanel : flagPanels) {
		horizontalGroup.addComponent(flagPanel.getPanel());
		verticalGroup.addComponent(flagPanel.getPanel());
	}

	for (FilterPanel containerPanel : containerPanels) {
		horizontalGroup.addComponent(containerPanel.getPanel());
		verticalGroup.addComponent(containerPanel.getPanel());
	}

	layout.setVerticalGroup(verticalGroup);
	layout.setHorizontalGroup(horizontalGroup);
	getDialog().pack();
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:31,代码来源:StockpileDialog.java

示例5: createLayout

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
private void createLayout() {
	this.setLayout(layout = new GroupLayout(this));

	setFloatable(false);
	
	SequentialGroup hGroup = layout.createSequentialGroup();
	ParallelGroup pGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE);
	
	boolean isSubst = LookAndFeelManager.isSubstance();
	
	for(int i = 0; i < BUTTONCOUNT; i++) {
		if (isSubst) {
			hGroup.addComponent(buttons[i], sizes[i], buttons[i].getPreferredSize().width, Short.MAX_VALUE);
			pGroup.addComponent(buttons[i], 0, buttons[i].getPreferredSize().height, Short.MAX_VALUE);
		} else {
			hGroup.addComponent(buttons[i]);
			pGroup.addComponent(buttons[i]);
		}
		
		hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, Short.MAX_VALUE);
		final int fi = i;
		buttons[i].addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				onClick(fi);
			}
		});
	}
	
	if (isSubst) {
		hGroup.addGap(4);
	}
	
	layout.setHorizontalGroup(hGroup);
	
	layout.setVerticalGroup(pGroup);
}
 
开发者ID:Mikescher,项目名称:jClipCorn,代码行数:38,代码来源:SmallClipCharSortSelector.java

示例6: buildPledgesH

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
private Group buildPledgesH(GroupLayout layout) {
    ParallelGroup contractsSectionH = layout.createParallelGroup(
            Alignment.CENTER);
    contractsSectionH.addComponent(scrPledge);

    return contractsSectionH;
}
 
开发者ID:pikimix,项目名称:ChatProgram,代码行数:8,代码来源:Changeling.java

示例7: parallelRadioArray

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
public static ParallelGroup parallelRadioArray( GroupLayout layout,
        Component[] array ) {
    ParallelGroup rtn = layout.createParallelGroup();
    for ( int i = 0; i < array.length; i++ ) {
        rtn.addComponent(array[i]);
    }
    return rtn;
}
 
开发者ID:pikimix,项目名称:ChatProgram,代码行数:9,代码来源:Functions.java

示例8: getTableCellRendererComponent

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table,
		Object value, boolean isSelected, boolean hasFocus, int row,
		int column) {

	JPanel panel = new JPanel();
	if (value instanceof String[]) {
		String[] valueArray = (String[]) value;
		if (valueArray.length == 0)
			return panel;
		GroupLayout layout = new GroupLayout(panel);
		panel.setLayout(layout);
		layout.setAutoCreateGaps(true);
		layout.setAutoCreateContainerGaps(true);
		SequentialGroup cols = layout.createSequentialGroup();
		layout.setHorizontalGroup(cols);
		ParallelGroup col1 = layout
				.createParallelGroup(GroupLayout.Alignment.LEADING);
		ParallelGroup col2 = layout
				.createParallelGroup(GroupLayout.Alignment.TRAILING);
		cols.addGroup(col1)
				.addPreferredGap(
						LayoutStyle.ComponentPlacement.RELATED,
						GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addGroup(col2);
		SequentialGroup rows = layout.createSequentialGroup();
		layout.setVerticalGroup(rows);
		for (int i = 0; i < valueArray.length; i++) {
			// the value array has null elements for
			// IdResource/Demand
			if (valueArray[i] != null) {
				/* TODO: Fix ArrayIndexOutofBounds Exception here 
				 * Update: Problem is actually above. Probably linked to resources without setters. */
				//System.out.println("ValueArray: " + valueArray[i]);
				//for (int j = 0; j < resParamNames.size(); j++) { System.out.println("resParamNames: " + resParamNames.get(j)); }
				JLabel label = new JLabel();
				if (resParamNames.get(row).length == 0)
					label.setText("max. param");
				else
					label.setText("max. " + resParamNames.get(row)[i]);
				JTextField tf = new JTextField(3);
				tf.setText(valueArray[i]);
				col1.addComponent(label);
				col2.addComponent(tf, GroupLayout.PREFERRED_SIZE,
						GroupLayout.DEFAULT_SIZE,
						GroupLayout.PREFERRED_SIZE);
				rows.addGroup(layout
						.createParallelGroup(
								GroupLayout.Alignment.CENTER)
						.addComponent(label).addComponent(tf));
			}
		}
	}
	table.setRowHeight(row, Math.max(table.getRowHeight(row),
			(int) panel.getPreferredSize().getHeight()));
	TableColumn cm = table.getColumnModel().getColumn(column);
	cm.setMinWidth(Math.max(cm.getMinWidth(), (int) panel
			.getPreferredSize().getWidth()));
	return panel;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:61,代码来源:ConstraintsGeneratorDialog.java

示例9: getTableCellEditorComponent

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
@Override
public Component getTableCellEditorComponent(JTable table,
		Object value, boolean isSelected, int row, int column) {
	panel = new JPanel();
	if (value instanceof String[]) {
		String[] valueArray = (String[]) value;
		if (valueArray.length == 0)
			return panel;
		GroupLayout layout = new GroupLayout(panel);
		panel.setLayout(layout);
		layout.setAutoCreateGaps(true);
		layout.setAutoCreateContainerGaps(true);
		SequentialGroup cols = layout.createSequentialGroup();
		layout.setHorizontalGroup(cols);
		ParallelGroup col1 = layout
				.createParallelGroup(GroupLayout.Alignment.LEADING);
		ParallelGroup col2 = layout
				.createParallelGroup(GroupLayout.Alignment.TRAILING);
		cols.addGroup(col1)
				.addPreferredGap(
						LayoutStyle.ComponentPlacement.RELATED,
						GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addGroup(col2);
		SequentialGroup rows = layout.createSequentialGroup();
		layout.setVerticalGroup(rows);

		for (int i = 0; i < valueArray.length; i++) {
			// create the label. use the resource param name for both
			// resource and demand params as it should be the same. TODO
			JLabel label = new JLabel();
			if (resParamNames.get(row).length == 0)
				label.setText("max. param");
			else
				label.setText("max. " + resParamNames.get(row)[i]);
			JTextField tf = new JTextField(3);
			tf.setText(valueArray[i]);
			tf.setEditable(true);
			col1.addComponent(label);
			col2.addComponent(tf, GroupLayout.PREFERRED_SIZE,
					GroupLayout.DEFAULT_SIZE,
					GroupLayout.PREFERRED_SIZE);
			rows.addGroup(layout
					.createParallelGroup(GroupLayout.Alignment.CENTER)
					.addComponent(label).addComponent(tf));
		}
	}
	table.setRowHeight(row, Math.max(table.getRowHeight(row),
			(int) panel.getPreferredSize().getHeight()));
	TableColumn cm = table.getColumnModel().getColumn(column);
	cm.setMinWidth(Math.max(cm.getMinWidth(), (int) panel
			.getPreferredSize().getWidth()));
	return panel;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:54,代码来源:ConstraintsGeneratorDialog.java

示例10: graphChoiceEvolution

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
/**
 * Generates the graph which plots the three choice scores (independent,
 * dependent and mood) for the evolution of a choice in time.
 * 
 * @param tdc
 *            - encompasses the selected choice
 * @param database
 *            - the database of values collected
 * @param agent
 * @param index
 *            - a list of time points which will be plotted on the x axis
 * @param choiceRange
 *            - the y axis will be [0, choiceRange]
 */
public static void graphChoiceEvolution(tdComponent tdc,
        tdDataBase database, Agent agent, List<Double> index,
        double choiceRange) {
    String label = xwChoice.xwConcise(new TwFormatter(), tdc.getChoice(), agent);

    // create a general purpose xy collection for jfreechart
    XYSeriesCollection xysc = new XYSeriesCollection();
    // focus and memory
    xysc.addSeries(new XYSeries("ChoiceScoreIndependent"));
    xysc.addSeries(new XYSeries("ChoiceScoreDependent"));
    xysc.addSeries(new XYSeries("ChoiceScoreMood"));
    // Fill in the values
    for (Double time : index) {
        double dtime = time;
        double valueChoiceScoreIndependent =
                database.getChoiceScoreDependent(tdc.getIdentifier(), time);
        xysc.getSeries("ChoiceScoreIndependent").add(dtime,
                valueChoiceScoreIndependent);
        double valueChoiceScoreDependent =
                database.getChoiceScoreDependent(tdc.getIdentifier(), time);
        xysc.getSeries("ChoiceScoreDependent").add(dtime,
                valueChoiceScoreDependent);
        double valueChoiceScoreMood =
                database.getChoiceScoreDependent(tdc.getIdentifier(), time);
        xysc.getSeries("ChoiceScoreMood").add(dtime, valueChoiceScoreMood);
    }
    //
    // ok, now let us create a graph
    //
    JPanel panel = new JPanel();
    // create a layout
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    SequentialGroup sgv = layout.createSequentialGroup();
    layout.setVerticalGroup(sgv);
    ParallelGroup pgh = layout.createParallelGroup();
    layout.setHorizontalGroup(pgh);
    //
    // the graph with the focus and the memory
    //
    XYSeriesCollection xysFM = new XYSeriesCollection();
    xysFM.addSeries(xysc.getSeries("ChoiceScoreIndependent"));
    xysFM.addSeries(xysc.getSeries("ChoiceScoreDependent"));
    xysFM.addSeries(xysc.getSeries("ChoiceScoreMood"));
    JFreeChart chart =
            ChartFactory.createXYLineChart(label + " - Choice", "Time",
                    "Value", xysFM, PlotOrientation.VERTICAL, true, false,
                    false);
    GraphEvolution.setChartProperties(chart,
            GraphEvolution.lineStylesColorful);
    ChartPanel cp = new ChartPanel(chart);
    sgv.addComponent(cp);
    pgh.addComponent(cp);
    JFrame frame = new JFrame();
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
开发者ID:Xapagy,项目名称:Xapagy,代码行数:75,代码来源:GraphEvolution.java

示例11: graphLinksBetweenVis

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
/**
 * Graphs the evolution of the links of all types (PRED, SUCC, SUMMARY,
 * CONTEXT etc) between two Vis.
 * 
 * @param fromVi
 * @param toVi
 * @param tdb
 * @param agent
 * @param index
 *            - a list of time points which will be plotted on the x axis
 */
public static void graphLinksBetweenVis(tdComponent fromVi,
        tdComponent toVi, tdDataBase tdb, Agent agent, List<Double> index) {
    String label =
            "Links between " + fromVi.getIdentifier() + " and "
                    + toVi.getIdentifier();
    // create a general purpose xy collection for jfreechart
    XYSeriesCollection xysc = new XYSeriesCollection();
    // add a series for each link type
    for (String linkName : agent.getLinks().getLinkTypeNames()) {
        XYSeries linkSeries = new XYSeries(linkName);
        xysc.addSeries(linkSeries);
        // now fill in the series with values
        for (Double time : index) {
            double dtime = time;
            double linkValue =
                    tdb.getLinkValue(fromVi.getIdentifier(),
                            toVi.getIdentifier(), linkName, time);
            linkSeries.add(dtime, linkValue);
        }
    }
    //
    // ok, now let us create a graph
    //
    JPanel panel = new JPanel();
    // create a layout
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    SequentialGroup sgv = layout.createSequentialGroup();
    layout.setVerticalGroup(sgv);
    ParallelGroup pgh = layout.createParallelGroup();
    layout.setHorizontalGroup(pgh);
    JFreeChart chart =
            ChartFactory.createXYLineChart(label, "Time", "Value", xysc,
                    PlotOrientation.VERTICAL, true, false, false);
    GraphEvolution.setChartProperties(chart,
            GraphEvolution.lineStylesColorful);
    ChartPanel cp = new ChartPanel(chart);
    sgv.addComponent(cp);
    pgh.addComponent(cp);
    JFrame frame = new JFrame();
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
}
 
开发者ID:Xapagy,项目名称:Xapagy,代码行数:58,代码来源:GraphEvolution.java

示例12: updateDetails

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
/**
 * Update the controls of the detail panel.
 */
void updateDetails() {
	bottomPanel.removeAll();
	GroupLayout gl = (GroupLayout)bottomPanel.getLayout();
	
	ParallelGroup c1 = gl.createParallelGroup();
	ParallelGroup c2 = gl.createParallelGroup();
	
	SequentialGroup r1 = gl.createSequentialGroup();
	
	c1.addComponent(keyLabel);
	c2.addComponent(keyField);
	
	r1.addGroup(
		gl.createParallelGroup(Alignment.BASELINE)
		.addComponent(keyLabel)
		.addComponent(keyField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
	);
	
	textAreas.clear();
	
	for (final String lang : context.dataManager().languages()) {
		JLabel lbl = new JLabel(lang);
		JTextArea ta = new JTextArea();
		
		final CEValueBox<JTextArea> vta = CEValueBox.of("", ta);
		vta.validator = new Action1<JTextArea>() {
			@Override
			public void invoke(JTextArea value) {
				validateLabelField(vta);
			}
		};
		
		textAreas.put(lang, vta);
		
		c1.addComponent(lbl);
		c2.addComponent(vta);
		r1.addGroup(
			gl.createParallelGroup(Alignment.BASELINE)
			.addComponent(lbl)
			.addComponent(vta, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
		);
	}
	
	
	gl.setHorizontalGroup(
		gl.createSequentialGroup()
		.addGroup(c1)
		.addGroup(c2)
	);
	gl.setVerticalGroup(
		r1
	);
}
 
开发者ID:akarnokd,项目名称:open-ig,代码行数:57,代码来源:CELabelsPanel.java

示例13: createReferencesPanel

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
/** @return The referenced main data files panel. */
JPanel createReferencesPanel() {
	JPanel p = new JPanel();
	
	GroupLayout gl = new GroupLayout(p);
	p.setLayout(gl);
	gl.setAutoCreateContainerGaps(true);
	gl.setAutoCreateGaps(true);
	
	SequentialGroup rows = gl.createSequentialGroup();
	ParallelGroup col1 = gl.createParallelGroup();
	ParallelGroup col2 = gl.createParallelGroup();
	ParallelGroup col3 = gl.createParallelGroup();

	for (String a : ELEMENT_NAMES) {
		JLabel indicator = new JLabel();
		JLabel caption = new JLabel(get("definition.ref_" + a));
		JTextField textField = new JTextField();
		
		indicators.put(a, indicator);
		fields.put(a, textField);
		
		ParallelGroup pg = gl.createParallelGroup(Alignment.BASELINE);
		
		col1.addComponent(caption);
		col2.addComponent(textField);
		col3.addComponent(indicator, 20, 20, 20);
		
		pg.addComponent(caption);
		pg.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
		pg.addComponent(indicator, 20, 20, 20);
		
		rows.addGroup(pg);
	}
	
	gl.setHorizontalGroup(
		gl.createSequentialGroup()
		.addGroup(col1)
		.addGroup(col2)
		.addGroup(col3)
	);
	gl.setVerticalGroup(rows);
	
	return p;
}
 
开发者ID:akarnokd,项目名称:open-ig,代码行数:46,代码来源:CEDefinitionPanel.java

示例14: createPropertiesPanel

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
/**
 * @return the properties listing panel
 */
JPanel createPropertiesPanel() {
	JPanel p = new JPanel();
	
	GroupLayout gl = new GroupLayout(p);
	p.setLayout(gl);
	gl.setAutoCreateContainerGaps(true);
	gl.setAutoCreateGaps(true);
	
	SequentialGroup rows = gl.createSequentialGroup();
	ParallelGroup col1 = gl.createParallelGroup();
	ParallelGroup col2 = gl.createParallelGroup();
	ParallelGroup col3 = gl.createParallelGroup();
	
	for (String a : PARAM_NAMES) {
		JLabel indicator = new JLabel();
		JLabel caption = new JLabel(get("definition.refprop_" + a));
		JTextField textField = new JTextField(10);
		textField.setHorizontalAlignment(JTextField.RIGHT);
		caption.setToolTipText(get("definition.refprop_" + a + ".tip"));
		textField.setToolTipText(get("definition.refprop_" + a + ".tip"));
		
		indicators.put(a, indicator);
		fields.put(a, textField);
		
		ParallelGroup pg = gl.createParallelGroup(Alignment.BASELINE);
		
		col1.addComponent(caption);
		col2.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
		col3.addComponent(indicator, 20, 20, 20);
		
		pg.addComponent(caption);
		pg.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
		pg.addComponent(indicator, 20, 20, 20);
		
		rows.addGroup(pg);
	}
	
	gl.setHorizontalGroup(
		gl.createSequentialGroup()
		.addGroup(col1)
		.addGroup(col2)
		.addGroup(col3)
	);
	gl.setVerticalGroup(rows);

	
	return p;
}
 
开发者ID:akarnokd,项目名称:open-ig,代码行数:52,代码来源:CEDefinitionPanel.java

示例15: initialize

import javax.swing.GroupLayout.ParallelGroup; //导入方法依赖的package包/类
/**
 * Initializes this panel with GroupLayout and two groups:
 * <ul>
 * <li>horizontal group which has two sub-groups: one for labels and one
 * for spinners. This group positions the elements in two columns.</li>
 * <li>vertical group which has 3 sub-groups - one for every row:
 * <ul>
 * <li>label and {@link #getStartTimeSpinner() spinner} which contains the
 * the point in time (seconds) where the selection starts,</li>
 * <li>label and {@link #getLengthSpinner() spinner} which contains the
 * length in seconds of the selection,
 * <li>if {@link #withChannelSelection} is set - label and {@link
 * #getChannelComboBox() combo-box} which allows to select the channel
 * for the selection (from the list of names)</li></ul>
 * This group positions elements in rows.</li>
 * </ul>
 */
private void initialize() {

	setBorder(new EmptyBorder(3,3,3,3));

	GroupLayout layout = new GroupLayout(this);
	this.setLayout(layout);
	layout.setAutoCreateContainerGaps(false);
	layout.setAutoCreateGaps(true);

	JLabel channelLabel = new JLabel(_("Channel"));
	JLabel startTimeLabel = new JLabel(_("Start time"));
	JLabel lengthLabel = new JLabel(_("Length (seconds)"));

	GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();

	ParallelGroup group = layout.createParallelGroup();
	if (withChannelSelection) {
		group.addComponent(channelLabel);
	}
	group.addComponent(startTimeLabel);
	group.addComponent(lengthLabel);

	hGroup.addGroup(group);

	group = layout.createParallelGroup();
	if (withChannelSelection) {
		group.addComponent(getChannelComboBox());
	}
	group.addComponent(getStartTimeSpinner());
	group.addComponent(getLengthSpinner());

	hGroup.addGroup(group);

	layout.setHorizontalGroup(hGroup);

	GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();

	if (withChannelSelection) {
		vGroup.addGroup(
			layout.createParallelGroup(Alignment.BASELINE)
			.addComponent(channelLabel)
			.addComponent(getChannelComboBox())
		);
	}

	vGroup.addGroup(
		layout.createParallelGroup(Alignment.BASELINE)
		.addComponent(startTimeLabel)
		.addComponent(getStartTimeSpinner())
	);

	vGroup.addGroup(
		layout.createParallelGroup(Alignment.BASELINE)
		.addComponent(lengthLabel)
		.addComponent(getLengthSpinner())
	);

	layout.setVerticalGroup(vGroup);

}
 
开发者ID:BrainTech,项目名称:svarog,代码行数:78,代码来源:ChannelSignalSelectionPanel.java


注:本文中的javax.swing.GroupLayout.ParallelGroup.addComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。