Java 类java.awt.GridBagConstraints 实例源码
项目:openjdk-jdk10
文件:java_awt_GridBagConstraints.java
protected GridBagConstraints getObject() {
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 2;
gbc.gridwidth = 3;
gbc.gridheight = 4;
gbc.weightx = 0.1;
gbc.weighty = 0.2;
gbc.anchor = GridBagConstraints.NORTH;
gbc.fill = GridBagConstraints.VERTICAL;
gbc.insets.top = 1;
gbc.insets.left = 2;
gbc.insets.right = 3;
gbc.insets.bottom = 4;
gbc.ipadx = -1;
gbc.ipady = -2;
return gbc;
}
项目:incubator-netbeans
文件:BasicSearchForm.java
public void addRow(JComponent label, JComponent component) {
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.anchor = GridBagConstraints.NORTHWEST;
c.gridy = row;
c.weightx = 0;
c.weighty = 0;
c.insets = new Insets(5, 5, 5, 5);
add(label, c);
c.gridx = 1;
c.weightx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
add(component, c);
row++;
}
项目:AgentWorkbench
文件:DynFormText.java
/**
* This method initializes this
* @return void
*/
private void initialize() {
GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
gridBagConstraints11.gridx = 0;
gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints11.weightx = 1.0;
gridBagConstraints11.gridy = 1;
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.fill = GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.gridwidth = 1;
this.setSize(300, 200);
this.setLayout(new GridBagLayout());
this.add(getJScrollPaneTextVersion(), gridBagConstraints);
this.add(getJPanelBottom(), gridBagConstraints11);
}
项目:rapidminer
文件:ManageDatabaseDriversDialog.java
private void add(String labelKey, JComponent component, JComponent button) {
GridBagConstraints c = new GridBagConstraints();
c.anchor = 23;
c.weightx = 0.5D;
c.weighty = 1.0D;
c.fill = 1;
c.gridheight = 1;
ResourceLabel label = new ResourceLabel("manage_database_drivers." + labelKey, new Object[0]);
label.setLabelFor(component);
c.gridwidth = 0;
this.add(label, c);
c.insets = new Insets(0, 0, 5, 0);
if(button == null) {
c.gridwidth = 0;
this.add(component, c);
} else {
c.gridwidth = -1;
c.weightx = 1.0D;
this.add(component, c);
c.gridwidth = 0;
c.weightx = 0.0D;
c.insets = new Insets(0, 5, 5, 0);
this.add(button, c);
}
}
项目:rapidminer
文件:SimilarityTable.java
public SimilarityTable(DistanceMeasure measure, ExampleSet exampleSet) {
GridBagLayout layout = new GridBagLayout();
setLayout(layout);
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.weightx = 1;
c.weighty = 1;
c.gridwidth = GridBagConstraints.REMAINDER;
similarityTable = new ExtendedJTable();
SimilarityTableModel model = new SimilarityTableModel(measure, exampleSet);
similarityTable.setModel(model);
JScrollPane tablePane = new ExtendedJScrollPane(similarityTable);
tablePane.setBorder(null);
layout.setConstraints(tablePane, c);
add(tablePane);
}
项目:incubator-netbeans
文件:HierarchyTopComponent.java
@NonNull
private static Pair<JComponent, GridBagConstraints> constrainedComponent(
@NonNull final JComponent component,
final int fill,
final double weightx,
@NonNull final Insets insets) {
final GridBagConstraints c = new GridBagConstraints();
c.gridx = GridBagConstraints.RELATIVE;
c.gridy = 0;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = weightx;
c.weighty = 0;
c.anchor = GridBagConstraints.WEST;
c.fill = fill;
c.insets = insets;
return Pair.<JComponent,GridBagConstraints>of(component,c);
}
项目:oxygen-dita-translation-package-builder
文件:ShowModifiedFilesDialog.java
/**
* Private constructor
*/
private ShowModifiedFilesDialog() {
setLayout(new GridBagLayout());
modifiedFiles = new JTextArea(10, 40);
modifiedFiles.setLineWrap(true);
modifiedFiles.setWrapStyleWord(true);
modifiedFiles.setEditable(false);
JScrollPane scroll = new JScrollPane(modifiedFiles);
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.gridheight = 1;
gbc.weightx = 0;
gbc.weighty = 0;
gbc.fill = GridBagConstraints.BOTH;
gbc.anchor = GridBagConstraints.LINE_START;
add(scroll , gbc);
}
项目:incubator-netbeans
文件:DetectPanel.java
@Override
public void readSettings(WizardDescriptor settings) {
sources = null;
sourcesString = null;
javadoc = null;
javadocString = null;
this.wiz = settings;
this.component.progressPanel.setVisible (true);
this.component.progressLabel.setVisible (true);
this.progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(DetectPanel.class,"TXT_PlatfromDetectProgress"));
this.component.progressPanel.removeAll();
this.component.progressPanel.setLayout (new GridBagLayout ());
GridBagConstraints c = new GridBagConstraints ();
c.gridx = c.gridy = GridBagConstraints.RELATIVE;
c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1.0;
JComponent pc = ProgressHandleFactory.createProgressComponent(this.progressHandle);
((GridBagLayout)this.component.progressPanel.getLayout ()).setConstraints(pc,c);
this.component.progressPanel.add (pc);
this.progressHandle.start ();
task.schedule(0);
}
项目:rapidminer
文件:CardHeaderPanel.java
public CardHeaderPanel(String i18nKey) {
this.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.insets = new Insets(20, 0, 20, 0);
JLabel label = new JLabel(I18N.getGUILabel(i18nKey, new Object[0])) {
private static final long serialVersionUID = 1L;
public void paintComponent(Graphics g) {
SwingTools.disableClearType(this);
((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
super.paintComponent(g);
}
};
label.setFont(OPEN_SANS_SEMIBOLD_18);
label.setHorizontalTextPosition(2);
this.add(label, gbc);
++gbc.gridx;
gbc.fill = 2;
gbc.weightx = 1.0D;
this.add(new JLabel(), gbc);
this.setOpaque(false);
this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 20, 30, 20), BorderFactory.createMatteBorder(0, 0, 1, 0, GettingStartedDialog.VERY_LIGHT_GRAY)));
}
项目:LogisticApp
文件:MenuContratacaoTransporteFrame.java
private void initializeComboBoxes() throws Exception {
List<LocalidadeVO> localidades = this.contratacaoTransporte.recuperarLocalidades();
this.cboxOrigem = new JComboBox<LocalidadeVO>();
GridBagConstraints gbc_comboBox = new GridBagConstraints();
gbc_comboBox.gridwidth = 2;
gbc_comboBox.fill = GridBagConstraints.BOTH;
gbc_comboBox.insets = new Insets(0, 0, 5, 5);
gbc_comboBox.gridx = 7;
gbc_comboBox.gridy = 3;
this.panelSecond.add(this.cboxOrigem, gbc_comboBox);
this.startComboBoxValues(this.cboxOrigem, localidades);
this.cboxDestino = new JComboBox<LocalidadeVO>();
GridBagConstraints gbc_comboBox_1 = new GridBagConstraints();
gbc_comboBox_1.gridwidth = 2;
gbc_comboBox_1.insets = new Insets(0, 0, 5, 5);
gbc_comboBox_1.fill = GridBagConstraints.HORIZONTAL;
gbc_comboBox_1.gridx = 7;
gbc_comboBox_1.gridy = 7;
this.panelSecond.add(this.cboxDestino, gbc_comboBox_1);
this.startComboBoxValues(this.cboxDestino, localidades);
}
项目:LogisticApp
文件:LocalidadeFrame.java
private void initializeButtons() {
this.btnVoltar = new JButton("< Voltar");
GridBagConstraints gbc_button = new GridBagConstraints();
gbc_button.gridwidth = 2;
gbc_button.insets = new Insets(0, 0, 5, 5);
gbc_button.gridx = 2;
gbc_button.gridy = 1;
this.panelFirst.add(this.btnVoltar, gbc_button);
this.btnFeito = new JButton("Feito");
GridBagConstraints gbc_btnFeito = new GridBagConstraints();
gbc_btnFeito.insets = new Insets(0, 0, 5, 5);
gbc_btnFeito.gridx = 8;
gbc_btnFeito.gridy = 1;
this.panelFirst.add(this.btnFeito, gbc_btnFeito);
this.btnFeito.addActionListener(this);
this.btnVoltar.addActionListener(this);
}
项目:openjdk-jdk10
文件:PolicyTool.java
/**
* display the warning log
*/
void displayWarningLog(Window w) {
ToolDialog wd = new ToolDialog
(PolicyTool.getMessage("Warning"), tool, this, true);
// find the location of the PolicyTool gui
Point location = ((w == null) ?
getLocationOnScreen() : w.getLocationOnScreen());
//wd.setBounds(location.x + 50, location.y + 50, 500, 100);
wd.setLayout(new GridBagLayout());
JTextArea ta = new JTextArea();
ta.setEditable(false);
for (int i = 0; i < tool.warnings.size(); i++) {
ta.append(tool.warnings.elementAt(i));
ta.append(PolicyTool.getMessage("NEWLINE"));
}
addNewComponent(wd, ta, 0,
0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
BOTTOM_PADDING);
ta.setFocusable(false);
JButton okButton = new JButton(PolicyTool.getMessage("OK"));
ActionListener okListener = new CancelButtonListener(wd);
okButton.addActionListener(okListener);
addNewComponent(wd, okButton, 1,
0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
LR_PADDING);
wd.getRootPane().setDefaultButton(okButton);
wd.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);
wd.pack();
wd.setLocationRelativeTo(w);
wd.setVisible(true);
}
项目:incubator-netbeans
文件:ProgressPanel.java
/** Creates new form ProgressPanel */
public ProgressPanel() {
initComponents();
handle = ProgressHandleFactory.createHandle(
NbBundle.getMessage(ImportProjectAction.class, "CTL_ProgressDialogTitle")); // NOI18N
progress = ProgressHandleFactory.createProgressComponent(handle);
setLayout(new GridBagLayout());
setPreferredSize(new Dimension(450, 80));
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new Insets(0, 5, 0, 5);
add(progress, gridBagConstraints);
}
项目:incubator-netbeans
文件:DesktopImpl.java
private void setViewComponent( Component component) {
if (viewComponent == component) {
return;
}
if (viewComponent != null) {
desktop.remove(viewComponent);
}
viewComponent = component;
if (viewComponent != null) {
GridBagConstraints constr = new GridBagConstraints();
constr.gridx = 1;
constr.gridy = 1;
constr.fill = GridBagConstraints.BOTH;
constr.weightx = 1;
constr.weighty = 1;
constr.anchor = GridBagConstraints.CENTER;
Insets insets = UIManager.getInsets("nb.desktop.view.insets"); //NOI18N
if( null != insets )
constr.insets = insets;
desktop.add(component, constr);
}
layeredPane.revalidate();
layeredPane.repaint();
}
项目:oxygen-git-plugin
文件:ChangesPanel.java
/**
* Adds the switchView button the the panel
*
* @param gbc
* - the constraints used for this component
*/
private void addSwitchViewButton(GridBagConstraints gbc) {
gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
gbc.anchor = GridBagConstraints.EAST;
gbc.fill = GridBagConstraints.NONE;
gbc.gridx = 2;
gbc.gridy = 0;
gbc.weightx = 0;
gbc.weighty = 0;
JToolBar toolbar = new JToolBar();
switchViewButton = new ToolbarButton(null, false);
switchViewButton.setToolTipText(translator.getTranslation(Tags.CHANGE_TREE_VIEW_BUTTON_TOOLTIP));
URL resource = currentViewMode == ResourcesViewMode.FLAT_VIEW
? getClass().getResource(ImageConstants.TREE_VIEW)
: getClass().getResource(ImageConstants.TABLE_VIEW);
if (resource != null) {
ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
switchViewButton.setIcon(icon);
}
toolbar.add(switchViewButton);
toolbar.setFloatable(false);
toolbar.setOpaque(false);
this.add(toolbar, gbc);
}
项目:Reinickendorf_SER316
文件:TaigaProjectListWizardStep.java
/**
* Create the panel.
*/
public TaigaProjectListWizardStep() {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{365, 0};
gridBagLayout.rowHeights = new int[]{0, 0, 0};
gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
setLayout(gridBagLayout);
JLabel lblChooseAProject = new JLabel("Choose a project from the list below:");
GridBagConstraints gbc_lblChooseAProject = new GridBagConstraints();
gbc_lblChooseAProject.insets = new Insets(0, 0, 5, 0);
gbc_lblChooseAProject.gridx = 0;
gbc_lblChooseAProject.gridy = 0;
add(lblChooseAProject, gbc_lblChooseAProject);
GridBagConstraints gbc_projectList = new GridBagConstraints();
gbc_projectList.fill = GridBagConstraints.BOTH;
gbc_projectList.gridx = 0;
gbc_projectList.gridy = 1;
add(projectList, gbc_projectList);
}
项目:GIFKR
文件:ProgressFrame.java
public ProgressFrame() {
initializeComponents();
addActionListeners();
setLayout(new GridBagLayout());
GridBagConstraints gbc = ViewUtils.createGBC();
gbc.fill = GridBagConstraints.NONE;
add(progressText, gbc);
gbc.gridy++;
add(cancelButton, gbc);
setSize(500, 200);
setLocationRelativeTo(null);
setUndecorated(true);
setBackground(bg);
}
项目:ObsidianSuite
文件:TimelineFrame.java
private JPanel createRightPane()
{
JPanel rightPanel = new JPanel();
rightPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
rightPanel.add(controller.keyframeController.panel,c);
c.gridx = 0;
c.gridy = 1;
c.fill = GridBagConstraints.HORIZONTAL;
rightPanel.add(actionsPanel, c);
return rightPanel;
}
项目:AgentWorkbench
文件:ProjectInfo.java
/**
* Switch JPanel for the version of the project between edit and view mode.
*/
public void switchJPanelVersion() {
GridBagConstraints gbc_jPanelVersion = new GridBagConstraints();
gbc_jPanelVersion.fill = GridBagConstraints.BOTH;
gbc_jPanelVersion.gridheight = 5;
gbc_jPanelVersion.gridx = 0;
gbc_jPanelVersion.gridy = 0;
if (this.isVersionEdit==true) {
this.getJPanelUpdateOptions().remove(this.getJPanelVersionEdit());
this.getJPanelUpdateOptions().add(this.getJPanelVersion(), gbc_jPanelVersion);
this.getLabelVersionInfo().setText(this.currProject.getVersionInformation().toString());
this.isVersionEdit = false;
} else {
this.getJPanelUpdateOptions().remove(this.getJPanelVersion());
this.getJPanelUpdateOptions().add(this.getJPanelVersionEdit(), gbc_jPanelVersion);
this.getJPanelVersionEdit().updateVersionInformation();
this.isVersionEdit = true;
}
this.validate();
this.repaint();
}
项目:incubator-netbeans
文件:InstallationDetailsDialog.java
private void initComponents() {
setLayout(new GridBagLayout());
detailsTreeTable = new NbiTreeTable(new InstallationDetailsTreeTableModel());
detailsTreeTable.setShowVerticalLines(false);
detailsTreeTable.setOpaque(false);
detailsTreeTable.setTableHeader(null);
detailsTreeTable.setRowHeight(detailsTreeTable.getRowHeight() + 4);
detailsTreeTable.setIntercellSpacing(new Dimension(0, 0));
detailsTreeTable.setTreeColumnCellRenderer(new InstallationDetailsTreeColumnCellRenderer(detailsTreeTable));
detailsTreeTable.getColumnModel().getColumn(1).setMaxWidth(200);
detailsTreeTable.getColumnModel().getColumn(1).setMinWidth(200);
detailsTreeTable.getColumnModel().getColumn(1).setCellRenderer(new InstallationStatusCellRenderer());
detailsTreeTable.setRowSelectionAllowed(false);
detailsTreeTable.setColumnSelectionAllowed(false);
detailsTreeTable.setCellSelectionEnabled(false);
detailsScrollPane = new NbiScrollPane(detailsTreeTable);
add(detailsScrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(11, 11, 11, 11), 0, 0));
}
项目:AgentWorkbench
文件:FeaturePanel.java
/**
* Initialize.
*/
private void initialize() {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{0, 0, 0};
gridBagLayout.rowHeights = new int[]{0, 0};
gridBagLayout.columnWeights = new double[]{1.0, 0.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{1.0, Double.MIN_VALUE};
this.setLayout(gridBagLayout);
GridBagConstraints gbc_jScrollPaneProjectFeatures = new GridBagConstraints();
gbc_jScrollPaneProjectFeatures.insets = new Insets(0, 0, 0, 5);
gbc_jScrollPaneProjectFeatures.fill = GridBagConstraints.BOTH;
gbc_jScrollPaneProjectFeatures.gridx = 0;
gbc_jScrollPaneProjectFeatures.gridy = 0;
this.add(this.getJScrollPaneProjectFeatures(), gbc_jScrollPaneProjectFeatures);
GridBagConstraints gbc_jPanelFeatureButtons = new GridBagConstraints();
gbc_jPanelFeatureButtons.insets = new Insets(0, 5, 0, 0);
gbc_jPanelFeatureButtons.fill = GridBagConstraints.BOTH;
gbc_jPanelFeatureButtons.gridx = 1;
gbc_jPanelFeatureButtons.gridy = 0;
this.add(this.getJPanelFeatureButtons(), gbc_jPanelFeatureButtons);
}
项目:AgentWorkbench
文件:EnvironmentModel.java
/**
* Initialize.
*/
private void initialize() {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[] { 0, 0 };
gridBagLayout.rowHeights = new int[] { 0, 0, 0 };
gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
gridBagLayout.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
setLayout(gridBagLayout);
GridBagConstraints gbc_jPanelSimulationEnvironment = new GridBagConstraints();
gbc_jPanelSimulationEnvironment.insets = new Insets(10, 10, 0, 0);
gbc_jPanelSimulationEnvironment.anchor = GridBagConstraints.NORTH;
gbc_jPanelSimulationEnvironment.fill = GridBagConstraints.HORIZONTAL;
gbc_jPanelSimulationEnvironment.gridx = 0;
gbc_jPanelSimulationEnvironment.gridy = 0;
add(getJPanelSimulationEnvironment(), gbc_jPanelSimulationEnvironment);
GridBagConstraints gbc_jPanelTimeModelSelection = new GridBagConstraints();
gbc_jPanelTimeModelSelection.anchor = GridBagConstraints.WEST;
gbc_jPanelTimeModelSelection.insets = new Insets(10, 10, 0, 0);
gbc_jPanelTimeModelSelection.fill = GridBagConstraints.VERTICAL;
gbc_jPanelTimeModelSelection.gridx = 0;
gbc_jPanelTimeModelSelection.gridy = 1;
add(getJPanelTimeModelSelection(), gbc_jPanelTimeModelSelection);
}
项目:incubator-netbeans
文件:Attribute.java
private void setLabelPanel(JPanel panel, GridBagConstraints c) {
// []
c.gridy++;
c.anchor = GridBagConstraints.CENTER;
c.insets = new Insets(0, LARGE_SIZE, TINY_SIZE, 0);
panel.add(new JLabel(), c);
// left
panel.add(createLabel(i18n("LBL_Left")), c); // NOI18N
// center
panel.add(createLabel(i18n("LBL_Center")), c); // NOI18N
// right
panel.add(createLabel(i18n("LBL_Right")), c); // NOI18N
}
项目:jdk8u-jdk
文件:JDK8048887.java
public TestDialog() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
for (int i=0; i < Xs.length; i++) {
gbc.gridx = Xs[i];
gbc.gridy = 100 - gbc.gridx;
panel.add(new MyComponent(), gbc);
}
getRootPane().getContentPane().add(panel);
pack();
}
项目:AgentWorkbench
文件:ThreadMonitorMetricsTableTab.java
/**
* Initialize.
*/
private void initialize() {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{450, 0};
gridBagLayout.rowHeights = new int[] {241, 30, 15, 0};
gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{1.0, 0.0, 0.0, Double.MIN_VALUE};
setLayout(gridBagLayout);
GridBagConstraints gbc_scrollPaneTable = new GridBagConstraints();
gbc_scrollPaneTable.fill = GridBagConstraints.BOTH;
gbc_scrollPaneTable.insets = new Insets(0, 0, 5, 0);
gbc_scrollPaneTable.gridx = 0;
gbc_scrollPaneTable.gridy = 0;
this.add(getScrollPaneTable(), gbc_scrollPaneTable);
GridBagConstraints gbc_JPanelFilter = new GridBagConstraints();
gbc_JPanelFilter.insets = new Insets(0, 0, 5, 0);
gbc_JPanelFilter.anchor = GridBagConstraints.SOUTH;
gbc_JPanelFilter.fill = GridBagConstraints.HORIZONTAL;
gbc_JPanelFilter.gridx = 0;
gbc_JPanelFilter.gridy = 1;
this.add(getJPanelFilter(), gbc_JPanelFilter);
GridBagConstraints gbc_JPanelOptions = new GridBagConstraints();
gbc_JPanelOptions.fill = GridBagConstraints.HORIZONTAL;
gbc_JPanelOptions.anchor = GridBagConstraints.SOUTH;
gbc_JPanelOptions.gridx = 0;
gbc_JPanelOptions.gridy = 2;
add(getJPanelOptions(), gbc_JPanelOptions);
}
项目:oxygen-git-plugin
文件:WorkingCopySelectionPanel.java
/**
* Adds the label to the panel
*
* @param gbc
* - the constraints used for this component
*/
private void addLabel(GridBagConstraints gbc) {
gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
gbc.anchor = GridBagConstraints.WEST;
gbc.fill = GridBagConstraints.NONE;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 0;
gbc.weighty = 0;
this.add(new JLabel(translator.getTranslation(Tags.WORKING_COPY_LABEL)), gbc);
}
项目:jdk8u-jdk
文件:ServiceDialog.java
public SidesPanel() {
super();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
setBorder(BorderFactory.createTitledBorder(strTitle));
c.fill = GridBagConstraints.BOTH;
c.insets = compInsets;
c.weighty = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
ButtonGroup bg = new ButtonGroup();
rbOneSide = new IconRadioButton("radiobutton.oneside",
"oneside.png", true,
bg, this);
rbOneSide.addActionListener(this);
addToGB(rbOneSide, this, gridbag, c);
rbTumble = new IconRadioButton("radiobutton.tumble",
"tumble.png", false,
bg, this);
rbTumble.addActionListener(this);
addToGB(rbTumble, this, gridbag, c);
rbDuplex = new IconRadioButton("radiobutton.duplex",
"duplex.png", false,
bg, this);
rbDuplex.addActionListener(this);
c.gridwidth = GridBagConstraints.REMAINDER;
addToGB(rbDuplex, this, gridbag, c);
}
项目:incubator-netbeans
文件:BasicSearchForm.java
public void addEmptyLine() {
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = row;
c.gridwidth = 2;
c.fill = GridBagConstraints.HORIZONTAL;
c.weighty = 1;
c.weightx = 0.1;
JLabel emptyLabel = new JLabel();
emptyLabel.setPreferredSize(new Dimension(0, 0));
emptyLabel.setMinimumSize(new Dimension(0, 0));
add(emptyLabel, c);
row++;
}
项目:nbreleaseplugin
文件:VersionUpdaterPanel.java
private void insertValue(JComponent value) {
GridBagConstraints c = new GridBagConstraints();
c.gridy = nextrow++;
c.anchor = GridBagConstraints.PAGE_START;
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.weightx = 1.0;
c.ipady = 5;
c.ipadx = 10;
add(value, c);
}
项目:incubator-netbeans
文件:OptionsPanel.java
private void addFakeButton () {
/* i don't know a better workaround */
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.gridy = 0;
pCategories2.add (new javax.swing.JLabel (""), gbc);
}
项目:openjdk-jdk10
文件:ServiceDialog.java
public SidesPanel() {
super();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
setBorder(BorderFactory.createTitledBorder(strTitle));
c.fill = GridBagConstraints.BOTH;
c.insets = compInsets;
c.weighty = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
ButtonGroup bg = new ButtonGroup();
rbOneSide = new IconRadioButton("radiobutton.oneside",
"oneside.png", true,
bg, this);
rbOneSide.addActionListener(this);
addToGB(rbOneSide, this, gridbag, c);
rbTumble = new IconRadioButton("radiobutton.tumble",
"tumble.png", false,
bg, this);
rbTumble.addActionListener(this);
addToGB(rbTumble, this, gridbag, c);
rbDuplex = new IconRadioButton("radiobutton.duplex",
"duplex.png", false,
bg, this);
rbDuplex.addActionListener(this);
c.gridwidth = GridBagConstraints.REMAINDER;
addToGB(rbDuplex, this, gridbag, c);
}
项目:Proj4
文件:JSpaceSettlersInfoPanel.java
public JSpaceSettlersInfoPanel(SpaceSettlersSimulator simulator) {
super();
//setPreferredSize(new Dimension(100, 800));
constraints = new GridBagConstraints();
//constraints.fill = GridBagConstraints.BOTH;
constraints.insets = new Insets(10, 10, 10, 10);
setLayout(new GridBagLayout());
constraints.gridx = 0;
constraints.gridy = 0;
globalInfo = new GlobalInfoPanel();
add(globalInfo, constraints);
teamComponents = new HashMap<String, TeamInfoPanel>();
// populate the team hash map the first time it is called with a valid simulator object
int teamNum = 1;
for (Team team : simulator.getTeams()) {
TeamInfoPanel tInfo = new TeamInfoPanel(team);
teamComponents.put(team.getTeamName(), tInfo);
constraints.gridx = 0;
constraints.gridy = teamNum;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(tInfo, constraints);
teamNum++;
}
objectPanel = new ObjectInfoPanel();
constraints.gridx = 0;
constraints.gridy = simulator.getTeams().size() + 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(objectPanel, constraints);
}
项目:Pixie
文件:GUILabelingTool.java
/**
* Adds a label which is not needed for active purposes. It just aligns
* north all the other components.
*/
private void addButtonsAlignComponent() {
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 100; // put the label as low as possible
gbc.anchor = java.awt.GridBagConstraints.NORTHWEST;
gbc.weighty = 0.5;
jPObjList.add(jLAlignNorth, gbc);
}
项目:incubator-netbeans
文件:RSSFeed.java
private JComponent buildProxyPanel() {
Component header = getContentHeader();
JPanel panel = new JPanel(new GridBagLayout());
panel.setOpaque( false );
int row = 0;
if( null != header ) {
panel.add( header, new GridBagConstraints(0,row++,1,1,1.0,0.0,
GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) );
}
panel.add( new JLabel(BundleSupport.getLabel("ErrCannotConnect")), // NOI18N
new GridBagConstraints(0,row++,1,1,0.0,0.0,
GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) );
if( showProxyButton ) {
JButton button = new JButton();
Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "ProxyConfig" ) ); // NOI18N
button.setOpaque( false );
button.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
HttpProxySettings.getDefault().showConfigurationDialog();
}
});
panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0,
GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) );
}
return panel;
}
项目:incubator-netbeans
文件:StartPageContent.java
public StartPageContent() {
super( new GridBagLayout() );
JComponent tabs = new TabbedPane( new LearnAndDiscoverTab(),
new MyNetBeansTab(),
new WhatsNewTab());
tabs.setBorder(BorderFactory.createEmptyBorder(10,15,15,15));
tabs.setOpaque(false);
add( tabs, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(27,0,0,0), 0, 0) );
add( new JLabel(), new GridBagConstraints(0, 2, 1, 1, 0.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0), 0, 0) );
}
项目:SuperMarketManageSystem
文件:XiaoShouTuiHuoChaXun.java
private void setupComponet(JComponent component, int gridx, int gridy,
int gridwidth, int ipadx, boolean fill) {
final GridBagConstraints gridBagConstrains = new GridBagConstraints();
gridBagConstrains.gridx = gridx;
gridBagConstrains.gridy = gridy;
if (gridwidth > 1)
gridBagConstrains.gridwidth = gridwidth;
if (ipadx > 0)
gridBagConstrains.ipadx = ipadx;
gridBagConstrains.insets = new Insets(5, 1, 3, 1);
if (fill)
gridBagConstrains.fill = GridBagConstraints.HORIZONTAL;
getContentPane().add(component, gridBagConstrains);
}
项目:incubator-netbeans
文件:SortPanel.java
/**
* Creates new form SortPanel
*/
public SortPanel() {
listener = new SortingChangeListener();
initComponents();
initCombos();
pnlAttributes.add(new JLabel(), new GridBagConstraints(0, NUMBER_OF_COMBOS, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 3, 0), 0, 0));
}
项目:rapidminer
文件:PerspectivesPanelBar.java
private PerspectivesPanelBar(Perspectives perspectives) {
setLayout(new GridBagLayout());
setOpaque(false);
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(1, 10, 2, 0);
JToolBar workspaceToolBar = perspectives.getWorkspaceToolBar();
workspaceToolBar.setBackground(getBackgroundColor());
add(workspaceToolBar, gbc);
}
项目:Equella
文件:WhereTargetChooser.java
protected void createGUI()
{
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
target = new JTextField();
target.setEditable(false);
target.setMinimumSize(new Dimension(150, 20));
target.setPreferredSize(new Dimension(150, 20));
target.setMaximumSize(new Dimension(150, 20));
c.gridx = 0;
c.weightx = 1;
c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
gridbag.setConstraints(target, c);
add(target);
search = new JButton("...");
search.setFont(new Font("Sans Serif", Font.PLAIN, 8));
search.addActionListener(this);
search.setMinimumSize(new Dimension(18, 20));
search.setPreferredSize(new Dimension(18, 20));
search.setMaximumSize(new Dimension(18, 20));
c.gridx = 1;
c.weightx = 0;
gridbag.setConstraints(search, c);
add(search);
}
项目:s-store
文件:AbstractViewer.java
public static GridBagConstraints getConstraints() {
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.5;
c.ipadx = 150;
c.ipady = 2;
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.NONE;
c.insets = insets;
c.anchor = GridBagConstraints.LINE_START;
return (c);
}