本文整理匯總了Java中java.awt.GridBagConstraints.REMAINDER屬性的典型用法代碼示例。如果您正苦於以下問題:Java GridBagConstraints.REMAINDER屬性的具體用法?Java GridBagConstraints.REMAINDER怎麽用?Java GridBagConstraints.REMAINDER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.GridBagConstraints
的用法示例。
在下文中一共展示了GridBagConstraints.REMAINDER屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readSettings
@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);
}
示例2: addCheckBox
/**
* Creates and adds a new checkbox to this panel
* @param selected Is the checkbox initially selected
* @param endOfRow Is the box last in the row in the layout
* @return The created checkbox
*/
private JCheckBox addCheckBox(boolean selected, boolean endOfRow) {
JCheckBox box = new JCheckBox();
box.setSelected(selected);
if (endOfRow) {
c.gridwidth = GridBagConstraints.REMAINDER; // use rest of the line
}
else {
c.gridwidth = 1; // default
}
layout.setConstraints(box, c);
add(box);
return box;
}
示例3: GeneralPanel
public GeneralPanel() {
super();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
c.fill = GridBagConstraints.BOTH;
c.insets = panelInsets;
c.weightx = 1.0;
c.weighty = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
pnlPrintService = new PrintServicePanel();
addToGB(pnlPrintService, this, gridbag, c);
c.gridwidth = GridBagConstraints.RELATIVE;
pnlPrintRange = new PrintRangePanel();
addToGB(pnlPrintRange, this, gridbag, c);
c.gridwidth = GridBagConstraints.REMAINDER;
pnlCopies = new CopiesPanel();
addToGB(pnlCopies, this, gridbag, c);
}
示例4: addSeperatorToPanel
protected void addSeperatorToPanel(JPanel addTarget) {
if (!(addTarget.getLayout() instanceof GridBagLayout)) {
throw new RuntimeException("JPanel with GridBagLayout is mandatory!");
}
JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL);
GridBagConstraints itemConstraint = new GridBagConstraints();
itemConstraint.gridx = GridBagConstraints.RELATIVE;
itemConstraint.weightx = 1.0;
itemConstraint.gridwidth = GridBagConstraints.REMAINDER; // end row
itemConstraint.fill = GridBagConstraints.HORIZONTAL;
itemConstraint.insets = new Insets(0, 5, 5, 5);
addTarget.add(separator, itemConstraint);
}
示例5: GlobalInfoPanel
public GlobalInfoPanel() {
setFont(new Font("SansSerif", Font.PLAIN, 12));
constraints = new GridBagConstraints();
//constraints.fill = GridBagConstraints.BOTH;
//constraints.insets = new Insets(10, 10, 10, 10);
setLayout(new GridBagLayout());
JLabel timestepLabel = new JLabel("Timestep: ");
constraints.gridx = 0;
constraints.gridy = 0;
add(timestepLabel, constraints);
constraints.gridx = 1;
constraints.gridy = 0;
constraints.gridwidth = GridBagConstraints.REMAINDER;
timestepData = new JLabel("Foo");
add(timestepData, constraints);
}
示例6: setupTextFields
private JPanel setupTextFields(JLabel[] labels, Component[] components) {
// Lay out the text controls and the labels.
JPanel textControlsPane = new JPanel();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
textControlsPane.setLayout(gridbag);
addLabelTextRows(labels, components, gridbag, textControlsPane);
c.gridwidth = GridBagConstraints.REMAINDER; // last
c.anchor = GridBagConstraints.WEST;
c.weightx = 1.0;
textControlsPane.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Tiedot"), BorderFactory
.createEmptyBorder(5, 5, 5, 5)));
return textControlsPane;
}
示例7: AverageVectorViewer
public AverageVectorViewer(AverageVector vector, IOContainer container) {
setLayout(new GridLayout(1, 1));
this.vector = vector;
JPanel mainPanel = new JPanel();
GridBagLayout layout = new GridBagLayout();
mainPanel.setLayout(layout);
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(11, 11, 11, 11);
c.gridwidth = GridBagConstraints.REMAINDER;
c.weightx = 1.0d;
c.weighty = 0.0d;
JLabel mainLabel = new JLabel("<html><h2>" + getName() + " (" + vector.size() + ")</h2></html>");
layout.setConstraints(mainLabel, c);
mainPanel.add(mainLabel);
for (int i = 0; i < vector.size(); i++) {
Averagable avg = vector.getAveragable(i);
Component visualizationComponent = ResultDisplayTools.createVisualizationComponent(avg, container, "Averagable");
layout.setConstraints(visualizationComponent, c);
mainPanel.add(visualizationComponent);
}
ExtendedJScrollPane scrollPane = new ExtendedJScrollPane(mainPanel);
scrollPane.setBorder(null);
add(scrollPane);
}
示例8: initComponents
/** Inits the subcomponents. Sets layout for this top component and adds {@code BundleEditPanel} to it.
* @see BundleEditPanel */
private void initComponents() {
GridBagLayout gridbag = new GridBagLayout();
setLayout(gridbag);
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.weighty = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
JPanel panel = new BundleEditPanel(bundleStructure, new PropertiesTableModel(bundleStructure));
gridbag.setConstraints(panel, c);
add(panel);
}
示例9: MediaPanel
public MediaPanel() {
super();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
setBorder(BorderFactory.createTitledBorder(strTitle));
cbSize = new JComboBox();
cbSource = new JComboBox();
c.fill = GridBagConstraints.BOTH;
c.insets = compInsets;
c.weighty = 1.0;
c.weightx = 0.0;
lblSize = new JLabel(getMsg("label.size"), JLabel.TRAILING);
lblSize.setDisplayedMnemonic(getMnemonic("label.size"));
lblSize.setLabelFor(cbSize);
addToGB(lblSize, this, gridbag, c);
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
addToGB(cbSize, this, gridbag, c);
c.weightx = 0.0;
c.gridwidth = 1;
lblSource = new JLabel(getMsg("label.source"), JLabel.TRAILING);
lblSource.setDisplayedMnemonic(getMnemonic("label.source"));
lblSource.setLabelFor(cbSource);
addToGB(lblSource, this, gridbag, c);
c.gridwidth = GridBagConstraints.REMAINDER;
addToGB(cbSource, this, gridbag, c);
}
示例10: setGridHeight
final public ExtendedGridBagConstraints setGridHeight(int intPgridHeight) {
if (intPgridHeight > 0 || intPgridHeight == GridBagConstraints.REMAINDER || intPgridHeight == GridBagConstraints.RELATIVE) {
this.gridheight = intPgridHeight;
} else {
Tools.err("Bad vertical width value : ", intPgridHeight);
}
return this;
}
示例11: ObjectInfoPanel
public ObjectInfoPanel() {
setBorder(BorderFactory.createLineBorder(Color.BLACK, 3));
constraints = new GridBagConstraints();
//constraints.insets = new Insets(10, 10, 10, 10);
setLayout(new GridBagLayout());
JLabel name = new JLabel("Information on the selected object");
constraints.insets = new Insets(5, 5, 5, 5);
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(name, constraints);
objectName = new JLabel("Object type/name");
constraints.gridx = 0;
constraints.gridy = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(objectName, constraints);
innerPanel = new InnerObjectPanel();
constraints.gridx = 0;
constraints.gridy = 2;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(innerPanel, constraints);
resourcesPanel = new ResourcesPanel();
constraints.gridx = 0;
constraints.gridy = 3;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(resourcesPanel, constraints);
selectedObject = null;
}
示例12: AbstractConfigurationWizard
/** Creates a new wizard. */
public AbstractConfigurationWizard(String name, ConfigurationListener listener) {
super(RapidMinerGUI.getMainFrame(), name, true);
this.listener = listener;
// button panel
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
buttonPanel.add(previous);
buttonPanel.add(next);
buttonPanel.add(Box.createHorizontalStrut(11));
JButton cancel = new JButton(new ResourceAction("cancel") {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent e) {
cancel();
}
});
buttonPanel.add(cancel);
getContentPane().add(buttonPanel, BorderLayout.SOUTH);
// main panel
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.NORTHWEST;
c.weightx = 1;
c.weighty = 1;
c.gridwidth = GridBagConstraints.REMAINDER;
c.insets = new Insets(11, 11, 11, 11);
this.contentPanel = new JPanel(layout);
layout.setConstraints(mainPanel, c);
contentPanel.add(mainPanel);
getContentPane().add(contentPanel, BorderLayout.CENTER);
setSize(Math.max(640, (int) (0.66d * getOwner().getWidth())), Math.max(480, (int) (0.66d * getOwner().getHeight())));
setLocationRelativeTo(getOwner());
}
示例13: TeamInfoPanel
public TeamInfoPanel(Team team) {
this.team = team;
setBorder(BorderFactory.createLineBorder(team.getTeamColor(), 3));
constraints = new GridBagConstraints();
//constraints.insets = new Insets(10, 10, 10, 10);
setLayout(new GridBagLayout());
JLabel name = new JLabel(team.getLadderName());
constraints.insets = new Insets(1, 1, 1, 1);
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(name, constraints);
JLabel scoreText = new JLabel("Score");
constraints.gridx = 0;
constraints.gridy = 1;
constraints.gridwidth = GridBagConstraints.RELATIVE;
add(scoreText, constraints);
score = new JLabel("0");
constraints.gridx = 1;
constraints.gridy = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(score, constraints);
JLabel FlagText = new JLabel("Flags");
constraints.gridx = 0;
constraints.gridy = 2;
constraints.gridwidth = GridBagConstraints.RELATIVE;
add(FlagText, constraints);
flags = new JLabel("0");
constraints.gridx = 1;
constraints.gridy = 2;
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(flags, constraints);
resourcesPanel = new ResourcesPanel();
constraints.gridx = 0;
constraints.gridy = 3;
add(resourcesPanel, constraints);
damagePanel = new DamagePanel();
constraints.gridx = 0;
constraints.gridy = 4;
add(damagePanel, constraints);
}
示例14: JobAttributesPanel
public JobAttributesPanel() {
super();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
setBorder(BorderFactory.createTitledBorder(strTitle));
c.fill = GridBagConstraints.NONE;
c.insets = compInsets;
c.weighty = 1.0;
cbJobSheets = createCheckBox("checkbox.jobsheets", this);
c.anchor = GridBagConstraints.LINE_START;
addToGB(cbJobSheets, this, gridbag, c);
JPanel pnlTop = new JPanel();
lblPriority = new JLabel(getMsg("label.priority"), JLabel.TRAILING);
lblPriority.setDisplayedMnemonic(getMnemonic("label.priority"));
pnlTop.add(lblPriority);
snModel = new SpinnerNumberModel(1, 1, 100, 1);
spinPriority = new JSpinner(snModel);
lblPriority.setLabelFor(spinPriority);
// REMIND
((JSpinner.NumberEditor)spinPriority.getEditor()).getTextField().setColumns(3);
spinPriority.addChangeListener(this);
pnlTop.add(spinPriority);
c.anchor = GridBagConstraints.LINE_END;
c.gridwidth = GridBagConstraints.REMAINDER;
pnlTop.getAccessibleContext().setAccessibleName(
getMsg("label.priority"));
addToGB(pnlTop, this, gridbag, c);
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.CENTER;
c.weightx = 0.0;
c.gridwidth = 1;
char jmnemonic = getMnemonic("label.jobname");
lblJobName = new JLabel(getMsg("label.jobname"), JLabel.TRAILING);
lblJobName.setDisplayedMnemonic(jmnemonic);
addToGB(lblJobName, this, gridbag, c);
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
tfJobName = new JTextField();
lblJobName.setLabelFor(tfJobName);
tfJobName.addFocusListener(this);
tfJobName.setFocusAccelerator(jmnemonic);
tfJobName.getAccessibleContext().setAccessibleName(
getMsg("label.jobname"));
addToGB(tfJobName, this, gridbag, c);
c.weightx = 0.0;
c.gridwidth = 1;
char umnemonic = getMnemonic("label.username");
lblUserName = new JLabel(getMsg("label.username"), JLabel.TRAILING);
lblUserName.setDisplayedMnemonic(umnemonic);
addToGB(lblUserName, this, gridbag, c);
c.gridwidth = GridBagConstraints.REMAINDER;
tfUserName = new JTextField();
lblUserName.setLabelFor(tfUserName);
tfUserName.addFocusListener(this);
tfUserName.setFocusAccelerator(umnemonic);
tfUserName.getAccessibleContext().setAccessibleName(
getMsg("label.username"));
addToGB(tfUserName, this, gridbag, c);
}
示例15: AssociationRuleTableViewer
public AssociationRuleTableViewer(AssociationRules rules) {
if (rules != null && rules.getNumberOfRules() > 0) {
this.model = new AssociationRuleTableModel(rules);
setLayout(new BorderLayout());
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
splitPane.setBorder(null);
// conclusion list
AssociationRuleFilter filter = new AssociationRuleFilter(rules);
filter.addAssociationRuleFilterListener(this);
filter.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 5));
splitPane.add(filter, 0);
// main panel
{
JPanel mainPanel = new JPanel();
mainPanel.setOpaque(true);
mainPanel.setBackground(Colors.WHITE);
GridBagLayout layout = new GridBagLayout();
mainPanel.setLayout(layout);
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.weightx = 1;
c.weighty = 1;
c.gridwidth = GridBagConstraints.REMAINDER;
c.insets = new Insets(15, 10, 10, 10);
table.setModel(model);
table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
table.setRowHighlighting(true);
JScrollPane tablePane = new ExtendedJScrollPane(table);
tablePane.setBorder(null);
tablePane.setBackground(Colors.WHITE);
tablePane.getViewport().setBackground(Colors.WHITE);
layout.setConstraints(tablePane, c);
mainPanel.add(tablePane);
setColumnSizes();
splitPane.add(mainPanel, 1);
}
filter.triggerFilter();
add(splitPane, BorderLayout.CENTER);
} else {
add(ResultDisplayTools.createErrorComponent("No rules found"), BorderLayout.CENTER);
}
}