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


Java JCheckBox.getPreferredSize方法代码示例

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


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

示例1: createNamePanel

import javax.swing.JCheckBox; //导入方法依赖的package包/类
protected JPanel createNamePanel(final JPanel panel)
{
	final JLabel nameLabel = new JLabel(CurrentLocale.get("com.tle.admin.workflow.editor.nodeeditor.name"));

	nameField = new I18nTextField(BundleCache.getLanguages());

	reject = new JCheckBox(CurrentLocale.get("com.tle.admin.workflow.editor.nodeeditor.reject"));

	final int height1 = nameLabel.getPreferredSize().height;
	final int height2 = nameField.getPreferredSize().height;
	final int height3 = reject.getPreferredSize().height;

	final int[] rows = {height1, height2, height3};
	final int[] cols = {300};

	panel.setLayout(new TableLayout(rows, cols));

	panel.add(nameLabel, new Rectangle(0, 0, 1, 1));
	panel.add(nameField, new Rectangle(0, 1, 1, 1));
	panel.add(reject, new Rectangle(0, 2, 1, 1));

	changeDetector.watch(nameField);
	changeDetector.watch(reject);

	return panel;
}
 
开发者ID:equella,项目名称:Equella,代码行数:27,代码来源:NodeEditor.java

示例2: NetworkPanel

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public NetworkPanel()
{
	super(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrictip"), //$NON-NLS-1$
		false);

	titleLabel = new JLabel(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.ipbased")); //$NON-NLS-1$
	selectable = new JCheckBox(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.selectable")); //$NON-NLS-1$
	networks = new NetworkShuffleList();

	final int height1 = titleLabel.getMinimumSize().height;
	final int height2 = networks.getMinimumSize().height;
	final int height3 = selectable.getPreferredSize().height;
	final int[] rows = {height1, height2, height3};
	final int[] cols = {TableLayout.FILL};

	setInnerLayout(new TableLayout(rows, cols, 5, 5));
	addInner(titleLabel, new Rectangle(0, 0, 1, 1));
	addInner(networks, new Rectangle(0, 1, 1, 1));
	addInner(selectable, new Rectangle(0, 2, 1, 1));

	setSelected(false);
}
 
开发者ID:equella,项目名称:Equella,代码行数:25,代码来源:DRMAccessControlTab.java

示例3: SearchSetInheritance

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public SearchSetInheritance(final EntityCache cache, final ClientService clientService)
{
	final JLabel schemasLabel = new JLabel(
		getString("searchset.searchsetinheritance.inheritschemas")); //$NON-NLS-1$
	final JLabel itemDefsLabel = new JLabel(
		getString("searchset.searchsetinheritance.inheritcollections")); //$NON-NLS-1$

	inheritFreetext = new JCheckBox(
		getString("searchset.searchsetinheritance.inheritfreetext")); //$NON-NLS-1$
	schemasModel = new InheritedTableModel<Schema, SchemaScript>(cache.getSchemaMap(), SchemaScript.class,
		getString("searchset.searchsetinheritance.schema")); //$NON-NLS-1$
	itemDefsModel = new InheritedTableModel<ItemDefinition, ItemDefinitionScript>(cache.getItemDefinitionMap(),
		ItemDefinitionScript.class,
		getString("searchset.searchsetinheritance.collection")); //$NON-NLS-1$

	final JTable schemasTable = generateTable(schemasModel, clientService);
	final JTable itemDefTable = generateTable(itemDefsModel, clientService);

	final int height1 = inheritFreetext.getPreferredSize().height;
	final int height2 = schemasLabel.getPreferredSize().height;

	final int[] rows = {height1, height2, TableLayout.FILL, height2, TableLayout.FILL,};
	final int[] cols = {TableLayout.FILL,};

	setLayout(new TableLayout(rows, cols));

	add(inheritFreetext, new Rectangle(0, 0, 1, 1));

	add(schemasLabel, new Rectangle(0, 1, 1, 1));
	add(new JScrollPane(schemasTable), new Rectangle(0, 2, 1, 1));

	add(itemDefsLabel, new Rectangle(0, 3, 1, 1));
	add(new JScrollPane(itemDefTable), new Rectangle(0, 4, 1, 1));

	changeDetector = new ChangeDetector();
	changeDetector.watch(inheritFreetext);
	changeDetector.watch(schemasModel);
	changeDetector.watch(itemDefsModel);
}
 
开发者ID:equella,项目名称:Equella,代码行数:40,代码来源:SearchSetInheritance.java

示例4: UserGroupPanel

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public UserGroupPanel(RemoteUserService userService)
{
	super(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrict"), //$NON-NLS-1$
		false);

	userLabel = new JLabel(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.users")); //$NON-NLS-1$
	groupLabel = new JLabel(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.groups")); //$NON-NLS-1$

	userList = new FilteredShuffleList<NameValue>(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrictusers"), //$NON-NLS-1$
		new FilterUserModel(userService));
	groupList = new FilteredShuffleList<NameValue>(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrictgroups"), //$NON-NLS-1$
		new FilterGroupModel(userService));

	selectable = new JCheckBox(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.selectable")); //$NON-NLS-1$

	final int height1 = userLabel.getMinimumSize().height;
	final int height2 = userList.getMinimumSize().height;
	final int height3 = selectable.getPreferredSize().height;
	final int[] rows = {height1, height2, height1, height2, height3};
	final int[] cols = {TableLayout.FILL};

	setInnerLayout(new TableLayout(rows, cols, 5, 5));
	addInner(userLabel, new Rectangle(0, 0, 1, 1));
	addInner(userList, new Rectangle(0, 1, 1, 1));
	addInner(groupLabel, new Rectangle(0, 2, 1, 1));
	addInner(groupList, new Rectangle(0, 3, 1, 1));
	addInner(selectable, new Rectangle(0, 4, 1, 1));

	setSelected(false);
}
 
开发者ID:equella,项目名称:Equella,代码行数:36,代码来源:DRMAccessControlTab.java

示例5: createGUI

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void createGUI()
{
	JLabel title = new JLabel(CurrentLocale.get(plugPrefix + "drmconfigtab.select")); //$NON-NLS-1$

	String[] usageOptionsStrings = new String[USAGE_OPTIONS_KEYS.length];
	for( int i = 0; i < USAGE_OPTIONS_KEYS.length; ++i )
	{
		usageOptionsStrings[i] = CurrentLocale.get(plugPrefix + USAGE_OPTIONS_KEYS[i]);
	}

	usageOptions = new JShuffleBox<String>(usageOptionsStrings, CurrentLocale.get(plugPrefix
		+ "drmconfigtab.available"), //$NON-NLS-1$
		CurrentLocale.get(plugPrefix + "drmconfigtab.selected")); //$NON-NLS-1$

	acceptBeforeSummary = new JCheckBox(CurrentLocale.get(plugPrefix + "drmconfigtab.requireusers")); //$NON-NLS-1$
	ownerMustAlsoAccept = new JCheckBox(CurrentLocale.get(plugPrefix + "drmconfigtab.requireowner")); //$NON-NLS-1$
	showLicenceInComposition = new JCheckBox(CurrentLocale.get(plugPrefix + "drmconfigtab.requirestudents")); //$NON-NLS-1$
	previewBeforeAccepting = new JCheckBox(CurrentLocale.get(plugPrefix + "drmconfigtab.allow")); //$NON-NLS-1$

	final int height1 = title.getPreferredSize().height;
	final int height2 = acceptBeforeSummary.getPreferredSize().height;
	final int[] rows = {height1, TableLayout.PREFERRED, height2, height2, height2, height2, TableLayout.FILL,};
	final int[] cols = {TableLayout.FILL,};

	setLayout(new TableLayout(rows, cols, 5, 5));
	setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

	add(title, new Rectangle(0, 0, 1, 1));
	add(usageOptions, new Rectangle(0, 1, 1, 1));
	add(acceptBeforeSummary, new Rectangle(0, 2, 1, 1));
	add(ownerMustAlsoAccept, new Rectangle(0, 3, 1, 1));
	add(showLicenceInComposition, new Rectangle(0, 4, 1, 1));
	add(previewBeforeAccepting, new Rectangle(0, 5, 1, 1));
}
 
开发者ID:equella,项目名称:Equella,代码行数:35,代码来源:DRMConfigTab.java

示例6: CalConfigPanel

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public CalConfigPanel()
{
	JLabel actErrLabel = new JLabel(getString("activationerror"));
	JLabel inactErrLabel = new JLabel(getString("inactiveerror"));
	JLabel percentageLabel = new JLabel(getString("percentagerequirement"));
	JLabel percentageSign = new JLabel("%");
	activationError = new I18nTextArea(BundleCache.getLanguages());
	inactiveError = new I18nTextArea(BundleCache.getLanguages());
	restrictiveValidation = new JCheckBox(getString("restrictiveValidation"));
	useCitationAsName = new JCheckBox(getString("usecitationasname"));
	perCourseValidation = new JCheckBox(getString("perCourseValidation"));
	percentageField = new JSpinner(new SpinnerNumberModel(10.0d, 0d, 100.0d, 1d));

	initUploadPanel();

	final int labelHeight = actErrLabel.getPreferredSize().height;
	final int checkBoxHeight = restrictiveValidation.getPreferredSize().height;
	final int agreementGroupHeight = agreementGroup.getPreferredSize().height;
	final int percentageFieldHeight = (int) Math.ceil(percentageField.getPreferredSize().getHeight());
	final int fillRow = 3;
	final int oneCell = 1;
	int row = 0;

	final int[] rows = {checkBoxHeight, percentageFieldHeight, labelHeight, TableLayout.FILL, 10, labelHeight,
			TableLayout.FILL, checkBoxHeight, checkBoxHeight, checkBoxHeight, agreementGroupHeight};
	final int[] cols = {50, 50, TableLayout.FILL,};

	setLayout(new TableLayout(rows, cols, 5, 5));

	add(percentageLabel, new Rectangle(0, row++, fillRow, 1));
	// percentage row
	add(percentageField, new Rectangle(0, row, oneCell, 1));
	add(percentageSign, new Rectangle(1, row++, oneCell, 1));
	// activation error
	add(actErrLabel, new Rectangle(0, row++, fillRow, 1));
	add(activationError, new Rectangle(0, row++, fillRow, 1));
	row = row + 1;
	add(inactErrLabel, new Rectangle(0, row++, fillRow, 1));
	add(inactiveError, new Rectangle(0, row++, fillRow, 1));

	add(restrictiveValidation, new Rectangle(0, row++, fillRow, 1));
	add(perCourseValidation, new Rectangle(0, row++, fillRow, 1));
	add(useCitationAsName, new Rectangle(0, row++, fillRow, 1));
	add(agreementGroup, new Rectangle(0, row++, fillRow, 1));

}
 
开发者ID:equella,项目名称:Equella,代码行数:47,代码来源:CalConfigPanel.java

示例7: setupGui

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void setupGui(RemoteUserService userService)
{

	unanimous = new JCheckBox(CurrentLocale.get("com.tle.admin.workflow.editor.moderatorstab.all")); //$NON-NLS-1$
	unanimous.addActionListener(this);

	allowEditing = new JCheckBox(CurrentLocale.get("com.tle.admin.workflow.editor.moderatorstab.allow")); //$NON-NLS-1$

	final int height1 = allowEditing.getPreferredSize().height;

	group = new ButtonGroup();

	finderControl = new MultipleFinderControl(userService);
	finderControl.addActionListener(this);

	staticGroup = GroupBox.withRadioButton(getString("modtab.choosestatic"), false); //$NON-NLS-1$
	staticGroup.getInnerPanel().setLayout(new GridLayout(1, 1));
	staticGroup.add(finderControl);
	staticGroup.addToGroup(group);

	dynamicUserPath = new SingleTargetChooser(schemaModel, null);

	schemaList = new JComboBox();
	schemaList.addItemListener(this);
	for( final NameValue schema : BundleCache.getNameUuidValues(schemaService.listAll()) )
	{
		schemaList.addItem(schema);
	}

	final JLabel dynamicUserPathLabel = new JLabel(
		CurrentLocale.get("com.tle.admin.workflow.editor.autoassigntab.label.target")); //$NON-NLS-1$

	final JLabel schemaLabel = new JLabel(
		CurrentLocale.get("com.tle.admin.workflow.editor.autoassigntab.label.schema")); //$NON-NLS-1$

	final int pathHeight = schemaList.getPreferredSize().height;
	final int pathLabelWidth = schemaLabel.getPreferredSize().width;
	final int[] pathRows = new int[]{pathHeight, pathHeight};
	final int[] pathCols = new int[]{pathLabelWidth, TableLayout.FILL};
	pathGroup = GroupBox.withRadioButton(getString("modtab.choosepath"), false); //$NON-NLS-1$
	pathGroup.getInnerPanel().setLayout(new TableLayout(pathRows, pathCols, 5, 5));
	pathGroup.add(schemaLabel, new Rectangle(0, 0, 1, 1));
	pathGroup.add(schemaList, new Rectangle(1, 0, 1, 1));
	pathGroup.add(dynamicUserPathLabel, new Rectangle(0, 1, 1, 1));
	pathGroup.add(dynamicUserPath, new Rectangle(1, 1, 1, 1));
	pathGroup.addToGroup(group);

	int pathGroupHeight = pathGroup.getPreferredSize().height;
	final int[] rows = {TableLayout.FILL, pathGroupHeight, height1, height1,};
	final int[] cols = {TableLayout.FILL,};

	setLayout(new TableLayout(rows, cols));
	setBorder(AppletGuiUtils.DEFAULT_BORDER);

	add(staticGroup, new Rectangle(0, 0, 1, 1));
	add(pathGroup, new Rectangle(0, 1, 1, 1));
	add(unanimous, new Rectangle(0, 2, 1, 1));
	add(allowEditing, new Rectangle(0, 3, 1, 1));

	updateUnanimousity();
}
 
开发者ID:equella,项目名称:Equella,代码行数:62,代码来源:ModeratorsTab.java

示例8: setupGUI

import javax.swing.JCheckBox; //导入方法依赖的package包/类
@SuppressWarnings("nls")
private void setupGUI()
{
	JPanel all = new JPanel();

	allowNonSequential = new JCheckBox(
		getString("wizard.editor.allowNonSequential.label"));

	showPageTitlesNextPrev = new JCheckBox(
		getString("wizard.editor.showPageTitlesNextPrev.label"));

	JLabel cssLabel = new JLabel(
		getString("wizard.editor.additionalCssClass.label"));
	additionalCssClass = new JTextField();
	JLabel cssHelp = new JLabel(
		getString("wizard.editor.additionalCssClass.help"));
	cssHelp.setFont(all.getFont());
	accessibilityHelpTitle = new JLabel(
		getString("wizard.editor.accesshelp.title"));
	accessibilityHelp = new JTextArea(
		getString("wizard.editor.accesshelp.text"));
	accessibilityHelp.setEditable(false);
	accessibilityHelp.setBackground(all.getBackground());
	accessibilityHelp.setFont(all.getFont());

	JSeparator separator1 = new JSeparator();
	JSeparator separator2 = new JSeparator();
	int sh = separator1.getPreferredSize().height;

	final int columns[] = {cssLabel.getPreferredSize().width, TableLayout.FILL};
	final int rows[] = {allowNonSequential.getPreferredSize().height,
			showPageTitlesNextPrev.getPreferredSize().height, sh, additionalCssClass.getPreferredSize().height,
			cssHelp.getPreferredSize().height, sh, accessibilityHelpTitle.getPreferredSize().height,
			accessibilityHelp.getPreferredSize().height};

	all.setLayout(new TableLayout(rows, columns, 5, 5));
	all.add(allowNonSequential, new Rectangle(0, 0, 2, 1));
	all.add(showPageTitlesNextPrev, new Rectangle(0, 1, 2, 1));
	all.add(separator1, new Rectangle(0, 2, 2, 1));
	all.add(cssLabel, new Rectangle(0, 3, 1, 1));
	all.add(additionalCssClass, new Rectangle(1, 3, 1, 1));
	all.add(cssHelp, new Rectangle(0, 4, 2, 1));
	all.add(separator2, new Rectangle(0, 5, 2, 1));
	all.add(accessibilityHelpTitle, new Rectangle(0, 6, 2, 1));
	all.add(accessibilityHelp, new Rectangle(0, 7, 2, 1));

	addSection(all);
}
 
开发者ID:equella,项目名称:Equella,代码行数:49,代码来源:WizardEditor.java

示例9: setupGUI

import javax.swing.JCheckBox; //导入方法依赖的package包/类
@SuppressWarnings("nls")
private void setupGUI(Node privNode, PrivilegeList accessModel)
{
	JButton add = new JButton(addAction);
	JButton remove = new JButton(removeAction);
	JButton up = new JTextlessButton(upAction);
	JButton down = new JTextlessButton(downAction);

	privilegeModel = new MyTableModel(privNode, accessModel);
	privilegeTable = new JTable(privilegeModel);
	privilegeTable.addMouseListener(new TablePopupListener(privilegeTable, actions));

	ListSelectionModel selectionModel = privilegeTable.getSelectionModel();
	selectionModel.addListSelectionListener(this);
	selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

	TableColumn actionColumn = privilegeTable.getColumnModel().getColumn(0);
	actionColumn.setCellRenderer(new ActionTableCellRenderer());
	actionColumn.setCellEditor(new ActionTableCellEditor());

	TableColumn whoColumn = privilegeTable.getColumnModel().getColumn(1);
	whoColumn.setCellRenderer(new ExpressionTableCellRenderer(userService));
	whoColumn.setCellEditor(new WhoTableCellEditor(userService, this));

	JScrollPane scroller = new JScrollPane(privilegeTable);

	final int height1 = add.getPreferredSize().height;
	final int width1 = remove.getPreferredSize().width;
	final int[] rows = {height1, height1, height1, height1, TableLayout.FILL,};
	final int[] cols = {TableLayout.FILL, width1,};

	JPanel all = new JPanel(new TableLayout(rows, cols));
	all.add(scroller, new Rectangle(0, 0, 1, 5));
	all.add(add, new Rectangle(1, 0, 1, 1));
	all.add(remove, new Rectangle(1, 1, 1, 1));
	all.add(up, new Rectangle(1, 2, 1, 1));
	all.add(down, new Rectangle(1, 3, 1, 1));

	showOverrides = new JCheckBox(
		CurrentLocale.get("com.tle.admin.security.editors.advancededitorpanel.overriding"));
	showDefaults = new JCheckBox(CurrentLocale.get("com.tle.admin.security.editors.advancededitorpanel.default"));

	showOverrides.addActionListener(this);
	showDefaults.addActionListener(this);

	final int mainHeight1 = showOverrides.getPreferredSize().height;
	final int[] mainRows = {TableLayout.INVISIBLE, TableLayout.FILL, TableLayout.INVISIBLE, mainHeight1,};
	final int[] mainCols = {TableLayout.FILL, TableLayout.FILL, width1,};
	layout = new TableLayout(mainRows, mainCols);
	setLayout(layout);

	add(new JLabel(CurrentLocale.get("com.tle.admin.security.editors.advancededitorpanel.overrides")),
		new Rectangle(2, 0, 1, 1));
	add(all, new Rectangle(0, 1, 3, 1));
	add(new JLabel(CurrentLocale.get("com.tle.admin.security.editors.advancededitorpanel.defaults")),
		new Rectangle(2, 2, 1, 1));
	add(showOverrides, new Rectangle(0, 3, 1, 1));
	add(showDefaults, new Rectangle(1, 3, 1, 1));

	updateButtons();
}
 
开发者ID:equella,项目名称:Equella,代码行数:62,代码来源:AdvancedEditorPanel.java


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