本文整理了Java中java.awt.GridBagLayout.getConstraints()
方法的一些代码示例,展示了GridBagLayout.getConstraints()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridBagLayout.getConstraints()
方法的具体详情如下:
包路径:java.awt.GridBagLayout
类名称:GridBagLayout
方法名:getConstraints
[英]Gets the constraints for the specified component. A copy of the actual GridBagConstraints
object is returned.
[中]获取指定组件的约束。返回实际GridBagConstraints
对象的副本。
代码示例来源:origin: libgdx/libgdx
public void setEmbedded () {
GridBagLayout layout = (GridBagLayout)getLayout();
GridBagConstraints constraints = layout.getConstraints(contentPanel);
constraints.insets = new Insets(0, 0, 0, 0);
layout.setConstraints(contentPanel, constraints);
titlePanel.setVisible(false);
}
代码示例来源:origin: libgdx/libgdx
public void setEmbedded () {
GridBagLayout layout = (GridBagLayout)getLayout();
GridBagConstraints constraints = layout.getConstraints(contentPanel);
constraints.insets = new Insets(0, 0, 0, 0);
layout.setConstraints(contentPanel, constraints);
titlePanel.setVisible(false);
}
代码示例来源:origin: libgdx/libgdx
public void setEmbedded () {
GridBagLayout layout = (GridBagLayout)getLayout();
GridBagConstraints constraints = layout.getConstraints(contentPanel);
constraints.insets = new Insets(0, 0, 0, 0);
layout.setConstraints(contentPanel, constraints);
titlePanel.setVisible(false);
}
代码示例来源:origin: libgdx/libgdx
public void setEmbedded () {
GridBagLayout layout = (GridBagLayout)getLayout();
GridBagConstraints constraints = layout.getConstraints(contentPanel);
constraints.insets = new Insets(0, 0, 0, 0);
layout.setConstraints(contentPanel, constraints);
titlePanel.setVisible(false);
}
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !lowMaxSlider.isVisible();
lowMaxSlider.setVisible(visible);
lowRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(lowRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(lowRangeButton, constraints);
Slider slider = visible ? lowMaxSlider : lowMinSlider;
ScaledNumericPanel.this.value.setLowMax(slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !highMaxSlider.isVisible();
highMaxSlider.setVisible(visible);
highRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(highRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(highRangeButton, constraints);
Slider slider = visible ? highMaxSlider : highMinSlider;
value.setHighMax((Float)slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !highMaxSlider.isVisible();
highMaxSlider.setVisible(visible);
highRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(highRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(highRangeButton, constraints);
Slider slider = visible ? highMaxSlider : highMinSlider;
ScaledNumericPanel.this.value.setHighMax(slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !lowMaxSlider.isVisible();
lowMaxSlider.setVisible(visible);
lowRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(lowRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(lowRangeButton, constraints);
Slider slider = visible ? lowMaxSlider : lowMinSlider;
value.setLowMax((Float)slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !lowMaxSlider.isVisible();
lowMaxSlider.setVisible(visible);
lowRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(lowRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(lowRangeButton, constraints);
Slider slider = visible ? lowMaxSlider : lowMinSlider;
value.setLowMax((Float)slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !highMaxSlider.isVisible();
highMaxSlider.setVisible(visible);
highRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(highRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(highRangeButton, constraints);
Slider slider = visible ? highMaxSlider : highMinSlider;
value.setHighMax((Float)slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !lowMaxSlider.isVisible();
lowMaxSlider.setVisible(visible);
lowRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(lowRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(lowRangeButton, constraints);
Slider slider = visible ? lowMaxSlider : lowMinSlider;
ScaledNumericPanel.this.value.setLowMax(slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
boolean visible = !highMaxSlider.isVisible();
highMaxSlider.setVisible(visible);
highRangeButton.setText(visible ? "<" : ">");
GridBagLayout layout = (GridBagLayout)formPanel.getLayout();
GridBagConstraints constraints = layout.getConstraints(highRangeButton);
constraints.gridx = visible ? 5 : 4;
layout.setConstraints(highRangeButton, constraints);
Slider slider = visible ? highMaxSlider : highMinSlider;
ScaledNumericPanel.this.value.setHighMax(slider.getValue());
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 62));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
chart.revalidate();
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 62));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
chart.revalidate();
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 62));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
chart.revalidate();
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 62));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
chart.revalidate();
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 30));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
relativeCheckBox.setVisible(!expanded);
formPanel.setVisible(!expanded);
chart.revalidate();
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 30));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
relativeCheckBox.setVisible(!expanded);
formPanel.setVisible(!expanded);
chart.revalidate();
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 30));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
relativeCheckBox.setVisible(!expanded);
if (hasIndependent)
independentCheckbox.setVisible(!expanded);
formPanel.setVisible(!expanded);
chart.revalidate();
}
});
代码示例来源:origin: libgdx/libgdx
public void actionPerformed (ActionEvent event) {
chart.setExpanded(!chart.isExpanded());
boolean expanded = chart.isExpanded();
GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout();
GridBagConstraints chartConstraints = layout.getConstraints(chart);
GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton);
if (expanded) {
chart.setPreferredSize(new Dimension(150, 200));
expandButton.setText("-");
chartConstraints.weightx = 1;
expandButtonConstraints.weightx = 0;
} else {
chart.setPreferredSize(new Dimension(150, 30));
expandButton.setText("+");
chartConstraints.weightx = 0;
expandButtonConstraints.weightx = 1;
}
layout.setConstraints(chart, chartConstraints);
layout.setConstraints(expandButton, expandButtonConstraints);
relativeCheckBox.setVisible(!expanded);
if (hasIndependent)
independentCheckbox.setVisible(!expanded);
formPanel.setVisible(!expanded);
chart.revalidate();
}
});
内容来源于网络,如有侵权,请联系作者删除!