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


Java LayoutStyle类代码示例

本文整理汇总了Java中javax.swing.LayoutStyle的典型用法代码示例。如果您正苦于以下问题:Java LayoutStyle类的具体用法?Java LayoutStyle怎么用?Java LayoutStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createCustomEditorGUI

import javax.swing.LayoutStyle; //导入依赖的package包/类
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
    if (resourcePanelGUI == null)
        return delegateEditor.getCustomEditor();

    JPanel panel = new JPanel();
    Component delComp = delegateEditor.getCustomEditor();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setHorizontalGroup(layout.createParallelGroup()
            .addComponent(delComp)
            .addGroup(layout.createSequentialGroup()
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(resourcePanelGUI)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)));
    layout.setVerticalGroup(layout.createSequentialGroup()
            .addComponent(delComp).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(resourcePanelGUI));

    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ResourceWrapperEditor.java

示例2: getVerticalGroup

import javax.swing.LayoutStyle; //导入依赖的package包/类
private GroupLayout.ParallelGroup getVerticalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (/* XXX huh? GroupLayout.PREFERRED_SIZE*/);
    GroupLayout.SequentialGroup seq = layout.createSequentialGroup ();
    if (hasPrimary) {
        seq.addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 40, 40)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addComponent (tpPrimaryPlugins, GroupLayout.PREFERRED_SIZE, tpPrimaryPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addGap (0, 30, 30);
    }
    if (hasRequired) {
        seq.addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 80, 80)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
                .addComponent (tpDependingPlugins, GroupLayout.PREFERRED_SIZE, tpDependingPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED);
    }
    res.addGroup (seq);
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:OperationDescriptionPanel.java

示例3: init

import javax.swing.LayoutStyle; //导入依赖的package包/类
private void init() {
    errorLabel.setText(" "); // NOI18N
    GroupLayout containerPanelLayout = new GroupLayout(containerPanel);
    containerPanel.setLayout(containerPanelLayout);
    GroupLayout.ParallelGroup horizontalGroup = containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    GroupLayout.SequentialGroup verticalGroup = containerPanelLayout.createSequentialGroup();
    containerPanelLayout.setHorizontalGroup(horizontalGroup);
    containerPanelLayout.setVerticalGroup(
        containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(verticalGroup)
    );
    for (CssPreprocessorUIImplementation.Options options : allOptions) {
        JComponent component = options.getComponent();
        Parameters.notNull("component", component); // NOI18N
        horizontalGroup.addComponent(component, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
        verticalGroup.addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CssPrepOptionsPanel.java

示例4: searchingPanel

import javax.swing.LayoutStyle; //导入依赖的package包/类
private static JPanel searchingPanel(JLabel progressLabel, JComponent progressComponent) {
    JPanel panel = new JPanel();
    progressLabel.setLabelFor(progressComponent);
    javax.swing.GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                .addComponent(progressLabel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(progressComponent, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(96, 96, 96)
            .addComponent(progressLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(progressComponent, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(109, Short.MAX_VALUE))
    );
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:SwingAppLibDownloader.java

示例5: layoutDisplay

import javax.swing.LayoutStyle; //导入依赖的package包/类
void layoutDisplay( int clockTop )
{
	displayLayout.setHorizontalGroup(
		displayLayout.createParallelGroup( GroupLayout.Alignment.CENTER)
			.addComponent(piePanel)
			.addComponent( ((clockTop==1)?timePanel:messagePanel) )
			.addComponent(datePanel)
			.addComponent(((clockTop==1)?messagePanel:timePanel)));
	
	displayLayout.setVerticalGroup(
		displayLayout.createSequentialGroup()
			.addComponent(piePanel)
			.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
			.addComponent(((clockTop==1)?timePanel:messagePanel))
			.addComponent(datePanel)
			.addComponent(((clockTop==1)?messagePanel:timePanel)));
	
	displayPanel.validate();
}
 
开发者ID:folarinmartins,项目名称:stage-monitor,代码行数:20,代码来源:Monitor.java

示例6: setButtonPanelLayout

import javax.swing.LayoutStyle; //导入依赖的package包/类
private void setButtonPanelLayout()
{

    GroupLayout buttonPanelLayout = new GroupLayout( buttonPanel );

    buttonPanel.setLayout( buttonPanelLayout );

    buttonPanelLayout.setHorizontalGroup( buttonPanelLayout.createParallelGroup( GroupLayout.Alignment.LEADING )
            .addGroup(
                    GroupLayout.Alignment.TRAILING,
                    buttonPanelLayout.createSequentialGroup().addContainerGap( 248, Short.MAX_VALUE ).addComponent(
                            okButton ).addPreferredGap( LayoutStyle.ComponentPlacement.UNRELATED ).addComponent(
                            detailsButton ).addGap( 20, 20, 20 ) ) );

    buttonPanelLayout.setVerticalGroup( buttonPanelLayout.createParallelGroup( GroupLayout.Alignment.LEADING )
            .addGroup(
                    GroupLayout.Alignment.TRAILING,
                    buttonPanelLayout.createSequentialGroup().addContainerGap( GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE ).addGroup(
                            buttonPanelLayout.createParallelGroup( GroupLayout.Alignment.BASELINE ).addComponent(
                                    okButton ).addComponent( detailsButton ) ).addContainerGap() ) );
}
 
开发者ID:Comcast,项目名称:cats,代码行数:23,代码来源:ErrorConsole.java

示例7: initGUI

import javax.swing.LayoutStyle; //导入依赖的package包/类
private void initGUI() {
	// Fill dropdown.
	String[] items = this.classnames.keySet().toArray(new String[0]);
	this.dropdown = new JComboBox<String>(items);
	
	// Select current generator in dropdown.
	for(int i = 0; i < items.length; i++) {
		if (this.generator.getName().equals(items[i])) {
			this.dropdown.setSelectedIndex(i);
		}
	}

	// Create label.
	JLabel dropdownLabel = new JLabel("Generator:");
	dropdownLabel.setLabelFor(this.dropdown);
	dropdownLabel.setHorizontalAlignment(JLabel.TRAILING);
	
	// Initialize layout and add components to GUI.
	GroupLayout layout = new GroupLayout(this.panel);
	this.panel.setLayout(layout);
	layout.setAutoCreateGaps(true);
	layout.setAutoCreateContainerGaps(true);
	layout.setHorizontalGroup(layout
			.createSequentialGroup()
			.addComponent(dropdownLabel)
			.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
			.addComponent(this.dropdown)
	);
	layout.setVerticalGroup(layout
			.createParallelGroup(GroupLayout.Alignment.BASELINE)
			.addComponent(dropdownLabel)
			.addComponent(this.dropdown)
	);
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:35,代码来源:MultiAlgoScenarioWizard.java

示例8: createAttachment

import javax.swing.LayoutStyle; //导入依赖的package包/类
private void createAttachment (AttachmentInfo newAttachment) {
    AttachmentPanel attachment = new AttachmentPanel(nbCallback);
    attachment.setBackground(UIUtils.getSectionPanelBackground());
    horizontalGroup.addComponent(attachment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    verticalGroup.addComponent(attachment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    if (noneLabel.isVisible()) {
        noneLabel.setVisible(false);
        switchHelper();
        updateButtonText(false);
    }
    attachment.addPropertyChangeListener(getDeletedListener());
    
    if (newAttachment != null) {
        attachment.setAttachment(newAttachment.getFile(), newAttachment.getDescription(),
                newAttachment.getContentType(), newAttachment.isPatch());
    }
    if(nbCallback != null) {
        File f = new File(Places.getUserDirectory(), nbCallback.getLogFilePath()); 
        if(f.exists()) {
            attachment.setAttachment(f, nbCallback.getLogFileDescription(), nbCallback.getLogFileContentType(), false); // NOI18N
        }
        attachment.browseButton.setEnabled(false);
        attachment.fileField.setEnabled(false);
        attachment.fileTypeCombo.setEnabled(false);
        attachment.patchChoice.setEnabled(false);
    } else {
        attachment.viewButton.setVisible(false);
    }

    newAttachments.add(attachment);
    UIUtils.keepFocusedComponentVisible(attachment, parentPanel);
    revalidate();
    attachment.addChangeListener(getChangeListener());
    attachment.fileField.requestFocus();
    if (nbCallback != null) {
        supp.fireChange();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:AttachmentsPanel.java

示例9: createCustomEditorGUI

import javax.swing.LayoutStyle; //导入依赖的package包/类
@Override
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
    if (resourcePanelGUI == null && ResourceSupport.isResourceableProperty(property)) {
        // not usable for full resourcing, only for internationalization
        // add a NOI18N checkbox so the user can mark the property as not to be internationalized
        Component customEd = delegateEditor.getCustomEditor();
        JPanel panel = new JPanel();
        GroupLayout layout = new GroupLayout(panel);
        panel.setLayout(layout);
        noI18nCheckbox = new JCheckBox();
        Mnemonics.setLocalizedText(noI18nCheckbox, NbBundle.getMessage(StringEditor.class, "CTL_NOI18NCheckBox")); // NOI18N
        noI18nCheckbox.getAccessibleContext().setAccessibleDescription(
                NbBundle.getBundle(
                    StringEditor.class).getString("ACD_NOI18NCheckBox")); //NOI18N
        
        layout.setHorizontalGroup(layout.createParallelGroup()
                .addComponent(customEd)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap().addComponent(noI18nCheckbox).addContainerGap()));
        layout.setVerticalGroup(layout.createSequentialGroup()
                .addComponent(customEd).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(noI18nCheckbox));
        return panel;
    }
    else {
        noI18nCheckbox = null;
        return super.createCustomEditorGUI(resourcePanelGUI);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:StringEditor.java

示例10: makeVerticalStrut

import javax.swing.LayoutStyle; //导入依赖的package包/类
private Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    LayoutStyle.ComponentPlacement relatedUnrelated) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        this);
    return Box.createVerticalStrut(height);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:CommitPanel.java

示例11: makeHorizontalStrut

import javax.swing.LayoutStyle; //导入依赖的package包/类
private Component makeHorizontalStrut(JComponent compA,
                                      JComponent compB,
                                      LayoutStyle.ComponentPlacement relatedUnrelated) {
    int width = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        WEST,
                        this);
    return Box.createHorizontalStrut(width);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:CommitPanel.java

示例12: makeVerticalStrut

import javax.swing.LayoutStyle; //导入依赖的package包/类
private static Component makeVerticalStrut(JComponent compA,
                                           JComponent compB) {
    LayoutStyle layoutStyle = LayoutStyle.getInstance();
    return Box.createVerticalStrut(
            layoutStyle.getPreferredGap(compA,
                                        compB,
                                        UNRELATED,
                                        SOUTH,
                                        compA.getParent()));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ExpandableMessage.java

示例13: makeVerticalStrut

import javax.swing.LayoutStyle; //导入依赖的package包/类
static Component makeVerticalStrut(JComponent compA,
                                    JComponent compB,
                                    ComponentPlacement relatedUnrelated, 
                                    JPanel parent) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        SOUTH,
                        parent);
    return Box.createVerticalStrut(height);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:VCSCommitPanel.java

示例14: makeHorizontalStrut

import javax.swing.LayoutStyle; //导入依赖的package包/类
static Component makeHorizontalStrut(JComponent compA,
                                          JComponent compB,
                                          ComponentPlacement relatedUnrelated,
                                          JPanel parent) {
        int width = LayoutStyle.getInstance().getPreferredGap(
                            compA,
                            compB,
                            relatedUnrelated,
                            WEST,
                            parent);
        return Box.createHorizontalStrut(width);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:VCSCommitPanel.java

示例15: layoutHeaderPanel

import javax.swing.LayoutStyle; //导入依赖的package包/类
private void layoutHeaderPanel(JPanel headerPanel, JLabel iconLabel, JLabel leftLabel, JLabel commentLabel, JLabel rightLabel, LinkButton replyButton, LinkButton mailtoButton, JLabel stateLabel) {
    GroupLayout layout = new GroupLayout(headerPanel);
    headerPanel.setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup()
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(stateLabel);
    }
    hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(commentLabel,0, 0, Short.MAX_VALUE)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(rightLabel)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(mailtoButton);
    }
    layout.setHorizontalGroup(hGroup);
    
    GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        vGroup.addComponent(stateLabel);
    }
    vGroup.addComponent(commentLabel)
          .addComponent(rightLabel)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        vGroup.addComponent(mailtoButton);
    }
    layout.setVerticalGroup(vGroup);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:CommentsPanel.java


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