Java Code Examples for javax.swing.JCheckBox#setIconTextGap()

The following examples show how to use javax.swing.JCheckBox#setIconTextGap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CityObjectGroupPanel.java    From importer-exporter with Apache License 2.0 6 votes vote down vote up
private void initGui() {
	exportMemberAsXLink = new JCheckBox();
	exportMemberAsXLink.setIconTextGap(10);
	exportMemberAsXLinkDescr = new JLabel();

	setLayout(new GridBagLayout());
	{
		exportGroupPanel = new JPanel();
		add(exportGroupPanel, GuiUtil.setConstraints(0,0,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		exportGroupPanel.setBorder(BorderFactory.createTitledBorder(""));
		exportMemberAsXLinkDescr.setFont(exportMemberAsXLinkDescr.getFont().deriveFont(Font.ITALIC));
		int lmargin = (int)(exportMemberAsXLink.getPreferredSize().getWidth()) + 11;
		exportGroupPanel.setLayout(new GridBagLayout());
		{
			exportGroupPanel.add(exportMemberAsXLink, GuiUtil.setConstraints(0,0,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
			exportGroupPanel.add(exportMemberAsXLinkDescr, GuiUtil.setConstraints(0,1,1.0,0.0,GridBagConstraints.BOTH,0,lmargin,5,5));
		}
	}
}
 
Example 2
Source File: AddressPanel.java    From importer-exporter with Apache License 2.0 6 votes vote down vote up
private void initGui() {
	exportXAL = new JRadioButton();
	exportXAL.setIconTextGap(10);
	exportDB = new JRadioButton();
	exportDB.setIconTextGap(10);
	ButtonGroup exportGroup = new ButtonGroup();
	exportGroup.add(exportXAL);
	exportGroup.add(exportDB);
	exportFallback = new JCheckBox();
	exportFallback.setIconTextGap(10);

	setLayout(new GridBagLayout());
	{
		exportXALPanel = new JPanel();
		add(exportXALPanel, GuiUtil.setConstraints(0,0,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		exportXALPanel.setBorder(BorderFactory.createTitledBorder(""));
		exportXALPanel.setLayout(new GridBagLayout());
		{
			exportXALPanel.add(exportDB, GuiUtil.setConstraints(0,0,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
			exportXALPanel.add(exportXAL, GuiUtil.setConstraints(0,1,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
			exportXALPanel.add(exportFallback, GuiUtil.setConstraints(0,2,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
		}
	}
}
 
Example 3
Source File: XMLValidationPanel.java    From importer-exporter with Apache License 2.0 6 votes vote down vote up
private void initGui() {
	useXMLValidation = new JCheckBox("");
	useXMLValidationDescr = new JLabel("");
	oneError = new JCheckBox("");

	setLayout(new GridBagLayout());
	{
		block1 = new JPanel();
		add(block1, GuiUtil.setConstraints(0,0,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		block1.setBorder(BorderFactory.createTitledBorder(""));
		block1.setLayout(new GridBagLayout());
		useXMLValidation.setIconTextGap(10);
		useXMLValidationDescr.setFont(useXMLValidationDescr.getFont().deriveFont(Font.ITALIC));
		int lmargin = (int)(useXMLValidation.getPreferredSize().getWidth()) + 11;
		oneError.setIconTextGap(10);
		{
			block1.add(useXMLValidation, GuiUtil.setConstraints(0,0,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
			block1.add(useXMLValidationDescr, GuiUtil.setConstraints(0,1,1.0,0.0,GridBagConstraints.BOTH,0,lmargin,5,5));		
			block1.add(oneError, GuiUtil.setConstraints(0,2,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
		}
	}
}
 
Example 4
Source File: XSLTransformationPanel.java    From importer-exporter with Apache License 2.0 6 votes vote down vote up
private void initGui() {
    setLayout(new GridBagLayout());

    panel = new JPanel();
    panel.setBorder(BorderFactory.createTitledBorder(""));
    panel.setLayout(new GridBagLayout());
    add(panel, GuiUtil.setConstraints(0, 0, 1, 0, GridBagConstraints.BOTH, 5, 0, 5, 0));

    applyStylesheets = new JCheckBox();
    applyStylesheets.setIconTextGap(10);
    componentsPanel = new JPanel();
    componentsPanel.setLayout(new GridLayout(0, 1));

    panel.add(applyStylesheets, GuiUtil.setConstraints(0, 0, 1, 0, GridBagConstraints.BOTH, 0, 5, 15, 5));
    panel.add(componentsPanel, GuiUtil.setConstraints(0, 1, 1, 0, GridBagConstraints.BOTH, 0, 5, 0, 5));

    first = new StylesheetComponent(true);
    componentsPanel.add(first.panel);

    applyStylesheets.addActionListener(l -> setEnabledComponents());
}
 
Example 5
Source File: AddressPanel.java    From importer-exporter with Apache License 2.0 5 votes vote down vote up
private void initGui() {
	importXAL = new JCheckBox();
	importXAL.setIconTextGap(10);

	setLayout(new GridBagLayout());
	{
		importXALPanel = new JPanel();
		add(importXALPanel, GuiUtil.setConstraints(0,0,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		importXALPanel.setBorder(BorderFactory.createTitledBorder(""));
		importXALPanel.setLayout(new GridBagLayout());
		{
			importXALPanel.add(importXAL, GuiUtil.setConstraints(0,0,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
		}
	}
}
 
Example 6
Source File: AppearancePanel.java    From importer-exporter with Apache License 2.0 4 votes vote down vote up
private void initGui() {
	overwriteCheck = new JCheckBox();
	noTexturesCheck = new JCheckBox();
	generateUniqueCheck = new JCheckBox();
	exportAll = new JRadioButton();
	noExport = new JRadioButton();

	ButtonGroup expAppRadio = new ButtonGroup();
	expAppRadio.add(noExport);
	expAppRadio.add(exportAll);

	pathLabel = new JLabel();
	pathText = new JTextField();
	browseButton = new JButton();

	useBuckets = new JCheckBox();
	DecimalFormat bucketsFormat = new DecimalFormat("########");
	bucketsFormat.setMaximumIntegerDigits(8);
	bucketsFormat.setMinimumIntegerDigits(1);		
	noOfBuckets = new JFormattedTextField(bucketsFormat);

	PopupMenuDecorator.getInstance().decorate(pathText, noOfBuckets);
	
	browseButton.addActionListener(e -> {
		String path = browseFile(Language.I18N.getString("pref.export.appearance.label.absPath"), pathText.getText());
		if (!path.isEmpty())
			pathText.setText(path);
	});

	setLayout(new GridBagLayout());
	{
		exportBlock = new JPanel();
		add(exportBlock, GuiUtil.setConstraints(0,0,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		exportBlock.setBorder(BorderFactory.createTitledBorder(""));
		exportBlock.setLayout(new GridBagLayout());
		{
			exportAll.setIconTextGap(10);
			noTexturesCheck.setIconTextGap(10);
			noExport.setIconTextGap(10);
			overwriteCheck.setIconTextGap(10);
			generateUniqueCheck.setIconTextGap(10);
			int lmargin = (int) (exportAll.getPreferredSize().getWidth()) + 11;
			{
				exportBlock.add(exportAll, GuiUtil.setConstraints(0, 0, 0, 1, GridBagConstraints.BOTH, 0, 5, 0, 5));
				exportBlock.add(overwriteCheck, GuiUtil.setConstraints(0, 1, 1, 1, GridBagConstraints.BOTH, 0, lmargin, 0, 5));
				exportBlock.add(generateUniqueCheck, GuiUtil.setConstraints(0, 2, 1, 1, GridBagConstraints.BOTH, 0, lmargin, 0, 5));
				exportBlock.add(noTexturesCheck, GuiUtil.setConstraints(0, 3, 1, 1, GridBagConstraints.BOTH, 0, lmargin, 0, 5));
				exportBlock.add(noExport, GuiUtil.setConstraints(0, 4, 0, 1, GridBagConstraints.BOTH, 0, 5, 0, 5));
			}
		}

		pathBlock = new JPanel();
		add(pathBlock, GuiUtil.setConstraints(0,1,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		pathBlock.setBorder(BorderFactory.createTitledBorder(""));
		pathBlock.setLayout(new GridBagLayout());
		{
			pathBlock.add(pathLabel, GuiUtil.setConstraints(0, 0, 0, 0, GridBagConstraints.BOTH, 0, 5, 0, 5));
			pathBlock.add(pathText, GuiUtil.setConstraints(1, 0, 1, 1, GridBagConstraints.BOTH, 0, 5, 0, 5));
			pathBlock.add(browseButton, GuiUtil.setConstraints(2, 0, 0, 1, GridBagConstraints.BOTH, 0, 5, 0, 5));

			Box box = Box.createHorizontalBox();
			box.add(useBuckets);
			box.add(Box.createHorizontalStrut(5));
			box.add(noOfBuckets);
			useBuckets.setIconTextGap(10);
			pathBlock.add(box, GuiUtil.setConstraints(0, 1, 2, 1, 0, 0, GridBagConstraints.BOTH, 5, 5, 5, 5));
		}

	}

	noExport.addActionListener(e -> setEnabledTextureExport());
	exportAll.addActionListener(e -> setEnabledTextureExport());
	overwriteCheck.addActionListener(e -> {if (overwriteCheck.isSelected()) noTexturesCheck.setSelected(false); });
	noTexturesCheck.addActionListener(e -> {if (noTexturesCheck.isSelected()) overwriteCheck.setSelected(false); });
	useBuckets.addActionListener(e -> noOfBuckets.setEnabled(useBuckets.isSelected()));
	
	noOfBuckets.addPropertyChangeListener(evt -> {
		if (((Number)noOfBuckets.getValue()).intValue() < 0)
			noOfBuckets.setValue(-((Number)noOfBuckets.getValue()).intValue());
	});
}