本文整理匯總了Java中java.awt.GridBagConstraints.NORTHWEST屬性的典型用法代碼示例。如果您正苦於以下問題:Java GridBagConstraints.NORTHWEST屬性的具體用法?Java GridBagConstraints.NORTHWEST怎麽用?Java GridBagConstraints.NORTHWEST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.GridBagConstraints
的用法示例。
在下文中一共展示了GridBagConstraints.NORTHWEST屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addRow
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++;
}
示例2: createPanel
private JPanel createPanel() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.NORTHWEST;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1.0;
c.gridx = 0;
createSection(getBorderSection(), "LBL_Border", panel, c); // NOI18N
createSection(getTitleSection(), "LBL_Header_Footer", panel, c); // NOI18N
createSection(getTextSection(), "LBL_Text", panel, c); // NOI18N
createSection(getZoomSection(), "LBL_Zoom", panel, c); // NOI18N
updateControl();
return panel;
}
示例3: addButton
private CategoryButton addButton (CategoryModel.Category category) {
int index = buttons.size ();
CategoryButton button = isNimbus || isGTK
? new NimbusCategoryButton(category)
: new CategoryButton(category);
// add shortcut
if (!isMac) {
KeyStroke keyStroke = KeyStroke.getKeyStroke(button.getDisplayedMnemonic(), KeyEvent.ALT_MASK);
getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(keyStroke, button);
getActionMap().put(button, new SelectAction(category));
}
GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 0.0;
gbc.weighty = 0.0;
gbc.gridx = index;
gbc.gridy = 0;
pCategories2.add(button, gbc);
buttons.put (category.getID(), button);
return button;
}
示例4: setArrowLocation
void setArrowLocation( int arrowLocation) {
this.arrowLocation = arrowLocation;
if( arrowLocation == GridBagConstraints.NORTHEAST || arrowLocation == GridBagConstraints.NORTHWEST ) {
setBorder( BorderFactory.createEmptyBorder(0, 0, Y_OFFSET, btnDismiss.getWidth()));
} else {
setBorder( BorderFactory.createEmptyBorder(Y_OFFSET, 0, 0, btnDismiss.getWidth()));
}
}
示例5: addComponent
private static void addComponent (Container container, Component component) {
GridBagConstraints c = new GridBagConstraints();
c.gridx = c.gridy = GridBagConstraints.RELATIVE;
c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.NORTHWEST;
c.weightx = c.weighty = 1.0;
((GridBagLayout)container.getLayout()).setConstraints (component,c);
container.add (component);
}
示例6: getResizable
private static JComponent getResizable(JPanel panel, int fill) {
JPanel mainPanel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.weightx = 1.0;
c.weighty = 1.0;
c.fill = fill;
c.insets = new Insets(0, LARGE_SIZE, 0, LARGE_SIZE);
c.anchor = GridBagConstraints.NORTHWEST;
mainPanel.add(panel, c);
// panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.red));
// mainPanel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.blue));
return mainPanel;
}
示例7: initGUI
private void initGUI () {
this.setLayout (new GridBagLayout());
GridBagConstraints c = new GridBagConstraints ();
c.gridx = GridBagConstraints.RELATIVE;
c.gridy = GridBagConstraints.RELATIVE;
c.gridwidth = GridBagConstraints.REMAINDER;
c.gridheight = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.NORTHWEST;
c.weightx = 1.0;
c.weighty = 1.0;
JComponent component = this.createComponent ();
((GridBagLayout)this.getLayout()).setConstraints(component, c);
this.add (component);
}
示例8: addSlidingView
public void addSlidingView (SlidingView view) {
Set<SlidingView> slidingViews = getSlidingViews();
if (slidingViews.contains(view)) {
return;
}
slidingViews.add(view);
GridBagConstraints constraint = new GridBagConstraints();
constraint.fill = GridBagConstraints.BOTH;
if (Constants.BOTTOM.equals(view.getSide())) {
constraint.gridx = 0;
constraint.gridy = 2;
constraint.gridwidth = 3;
constraint.anchor = GridBagConstraints.SOUTHWEST;
} else if (Constants.LEFT.equals(view.getSide())) {
constraint.gridx = 0;
constraint.gridy = 1;
constraint.gridheight = 1;
constraint.anchor = GridBagConstraints.NORTHWEST;
} else if (Constants.RIGHT.equals(view.getSide())) {
constraint.gridx = 2;
constraint.gridy = 1;
constraint.gridheight = 1;
constraint.anchor = GridBagConstraints.NORTHEAST;
} else if (Constants.TOP.equals(view.getSide())) {
constraint.gridx = 1;
constraint.gridy = 0;
constraint.gridheight = 1;
constraint.gridwidth = 2;
constraint.anchor = GridBagConstraints.NORTHWEST;
}
desktop.add(view.getComponent(), constraint);
if( Constants.BOTTOM.equals( view.getSide()) && view.getComponent() instanceof JPanel ) {
JPanel panel = ( JPanel ) view.getComponent();
MainWindow.getInstance().setStatusBarContainer( panel );
}
// #45033 fix - invalidate isn't enough, revalidate is correct
layeredPane.revalidate();
}
示例9: addComponent
private static void addComponent(Container container, Component component) {
GridBagConstraints c = new GridBagConstraints();
c.gridx = c.gridy = GridBagConstraints.RELATIVE;
c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.NORTHWEST;
c.weightx = c.weighty = 1.0;
((GridBagLayout)container.getLayout()).setConstraints(component,c);
container.add(component);
}
示例10: initialize
@Override
protected void initialize() {
super.initialize();
// --- Insert time format setter above series settings table
// --- Move table
GridBagLayout layoutManager = (GridBagLayout) getLayout();
GridBagConstraints gbcTable = layoutManager.getConstraints(getSpTblSeriesSettings());
int oldY = gbcTable.gridy;
gbcTable.gridy = oldY + 1;
layoutManager.setConstraints(getSpTblSeriesSettings(), gbcTable);
// --- Add label
GridBagConstraints gbcLblTimeFormatSelector = new GridBagConstraints();
gbcLblTimeFormatSelector.gridx = 0;
gbcLblTimeFormatSelector.gridy = oldY;
gbcLblTimeFormatSelector.anchor = GridBagConstraints.NORTHWEST;
gbcLblTimeFormatSelector.insets = new Insets(8, 5, 5, 5);
this.add(getLblTimeFormatSelector(), gbcLblTimeFormatSelector);
// --- Add format selector component
GridBagConstraints gbcTimeFormatSelector = new GridBagConstraints();
gbcTimeFormatSelector.gridx = 1;
gbcTimeFormatSelector.gridy = oldY;
gbcTimeFormatSelector.anchor = GridBagConstraints.WEST;
gbcTimeFormatSelector.fill = GridBagConstraints.HORIZONTAL;
gbcTimeFormatSelector.insets = new Insets(3, 0, 0, 0);
this.add(getTimeFormatSelector(), gbcTimeFormatSelector);
}
示例11: StereoMatchingFrame
/** Creates new form StereoMatchingViewer */
public StereoMatchingFrame(AEChip chip, int maxDisp) {
this.chip = chip;
this.maxDisp = maxDisp;
initComponents();
GridBagLayout layout = new GridBagLayout();
GridBagConstraints layoutConstraints = new GridBagConstraints();
layoutConstraints.anchor = GridBagConstraints.NORTHWEST;
layoutConstraints.gridwidth = GridBagConstraints.REMAINDER;
setLayout(layout);
labelDisp = new Label("Disparity: " + 0);
layout.setConstraints(labelDisp, layoutConstraints);
add(labelDisp);
labelSmc = new Label("Matching matrix");
layout.setConstraints(labelSmc, layoutConstraints);
add(labelSmc);
smc = new StereoMatchingCanvas(chip);
layout.setConstraints(smc, layoutConstraints);
add(smc);
labelScd = new Label("Accumulated disparity values");
layout.setConstraints(labelScd, layoutConstraints);
add(labelScd);
sdc = new StereoDisparitiesCanvas(maxDisp);
layout.setConstraints(sdc, layoutConstraints);
add(sdc);
setPreferredSize(null);
pack();
}
示例12: addComponent
private static void addComponent(Container container, Component component) {
GridBagConstraints c = new GridBagConstraints();
c.gridx = c.gridy = GridBagConstraints.RELATIVE;
c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.NORTHWEST;
c.weightx = c.weighty = 1.0;
((GridBagLayout) container.getLayout()).setConstraints(component, c);
container.add(component);
}
示例13: setInsideLocation
final public ExtendedGridBagConstraints setInsideLocation(int intPinsideLocation) {
switch (intPinsideLocation) {
case GridBagConstraints.PAGE_START:
case GridBagConstraints.PAGE_END:
case GridBagConstraints.LINE_START:
case GridBagConstraints.LINE_END:
case GridBagConstraints.FIRST_LINE_START:
case GridBagConstraints.FIRST_LINE_END:
case GridBagConstraints.LAST_LINE_START:
case GridBagConstraints.LAST_LINE_END:
case GridBagConstraints.BASELINE:
case GridBagConstraints.BASELINE_LEADING:
case GridBagConstraints.BASELINE_TRAILING:
case GridBagConstraints.ABOVE_BASELINE:
case GridBagConstraints.ABOVE_BASELINE_LEADING:
case GridBagConstraints.ABOVE_BASELINE_TRAILING:
case GridBagConstraints.BELOW_BASELINE:
case GridBagConstraints.BELOW_BASELINE_LEADING:
case GridBagConstraints.BELOW_BASELINE_TRAILING:
Tools.err("strange grid anchor value : ", intPinsideLocation);
//$FALL-THROUGH$
case GridBagConstraints.CENTER:
case GridBagConstraints.NORTH:
case GridBagConstraints.NORTHWEST:
case GridBagConstraints.NORTHEAST:
case GridBagConstraints.SOUTH:
case GridBagConstraints.SOUTHWEST:
case GridBagConstraints.SOUTHEAST:
case GridBagConstraints.WEST:
case GridBagConstraints.EAST:
this.anchor = intPinsideLocation;
break;
default:
Tools.err("bad grid anchor value : ", intPinsideLocation);
}
return this;
}
示例14: initialize
/**
* Initialize.
*/
private void initialize() {
ButtonGroup bgMetrics = new ButtonGroup();
bgMetrics.add(this.getJRadioButtonPredictive());
bgMetrics.add(this.getJRadioButtonReal());
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{0, 0};
gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0};
gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE};
setLayout(gridBagLayout);
GridBagConstraints gbc_jLabelMetricExplanation = new GridBagConstraints();
gbc_jLabelMetricExplanation.anchor = GridBagConstraints.NORTHWEST;
gbc_jLabelMetricExplanation.fill = GridBagConstraints.HORIZONTAL;
gbc_jLabelMetricExplanation.insets = new Insets(10, 10, 5, 0);
gbc_jLabelMetricExplanation.gridx = 0;
gbc_jLabelMetricExplanation.gridy = 0;
this.add(getJTextAreaMetricExplanation(), gbc_jLabelMetricExplanation);
GridBagConstraints gbc_jLabelPredictive = new GridBagConstraints();
gbc_jLabelPredictive.anchor = GridBagConstraints.NORTHWEST;
gbc_jLabelPredictive.insets = new Insets(10, 10, 5, 0);
gbc_jLabelPredictive.gridx = 0;
gbc_jLabelPredictive.gridy = 1;
this.add(getJLabelPredictive(), gbc_jLabelPredictive);
GridBagConstraints gbc_jRadioButtonPredictive = new GridBagConstraints();
gbc_jRadioButtonPredictive.insets = new Insets(5, 10, 5, 0);
gbc_jRadioButtonPredictive.anchor = GridBagConstraints.NORTHWEST;
gbc_jRadioButtonPredictive.gridx = 0;
gbc_jRadioButtonPredictive.gridy = 2;
this.add(getJRadioButtonPredictive(), gbc_jRadioButtonPredictive);
GridBagConstraints gbc_jRadioButtonReal = new GridBagConstraints();
gbc_jRadioButtonReal.insets = new Insets(0, 10, 5, 0);
gbc_jRadioButtonReal.anchor = GridBagConstraints.NORTHWEST;
gbc_jRadioButtonReal.gridx = 0;
gbc_jRadioButtonReal.gridy = 3;
this.add(getJRadioButtonReal(), gbc_jRadioButtonReal);
GridBagConstraints gbc_jLabelHeaderMetrics = new GridBagConstraints();
gbc_jLabelHeaderMetrics.anchor = GridBagConstraints.NORTHWEST;
gbc_jLabelHeaderMetrics.insets = new Insets(10, 10, 10, 0);
gbc_jLabelHeaderMetrics.gridx = 0;
gbc_jLabelHeaderMetrics.gridy = 4;
this.add(getJLabelHeaderMetrics(), gbc_jLabelHeaderMetrics);
GridBagConstraints gbc_jScrollPaneMetric = new GridBagConstraints();
gbc_jScrollPaneMetric.insets = new Insets(5, 10, 10, 10);
gbc_jScrollPaneMetric.anchor = GridBagConstraints.NORTHWEST;
gbc_jScrollPaneMetric.fill = GridBagConstraints.BOTH;
gbc_jScrollPaneMetric.gridx = 0;
gbc_jScrollPaneMetric.gridy = 5;
this.add(getJScrollPaneMetric(), gbc_jScrollPaneMetric);
GridBagConstraints gbc_jButtonCopyReal = new GridBagConstraints();
gbc_jButtonCopyReal.insets = new Insets(10, 10, 10, 10);
gbc_jButtonCopyReal.anchor = GridBagConstraints.EAST;
gbc_jButtonCopyReal.gridx = 0;
gbc_jButtonCopyReal.gridy = 6;
this.add(getJButtonCopyReal(), gbc_jButtonCopyReal);
getJRadioButtonPredictive().setText(Language.translate(buttonPredictiveString));
getJRadioButtonReal().setText(Language.translate(buttonRealString));
getJButtonCopyReal().setText(Language.translate(buttonCopyRealString));
getJLabelPredictive().setText(Language.translate(labelPredictiveString));
getJLabelHeaderMetrics().setText(Language.translate(headerMetricsString));
getJTextAreaMetricExplanation().setText(Language.translate(metricExplanationString));
this.currProject.getAgentClassLoadMetrics().loadMetricsFromProject();
jRadioButtonReal.setSelected(currProject.getAgentClassLoadMetrics().isUseRealLoadMetric());
jRadioButtonPredictive.setSelected(!currProject.getAgentClassLoadMetrics().isUseRealLoadMetric());
}
示例15: OptionsPanel
OptionsPanel(JList<?> list) {
// set up components
formatPng = new JRadioButton("PNG");
formatGif = new JRadioButton("GIF");
formatJpg = new JRadioButton("JPEG");
ButtonGroup bgroup = new ButtonGroup();
bgroup.add(formatPng);
bgroup.add(formatGif);
bgroup.add(formatJpg);
formatPng.setSelected(true);
slider = new JSlider(SwingConstants.HORIZONTAL, -3 * SLIDER_DIVISIONS, 3 * SLIDER_DIVISIONS, 0);
slider.setMajorTickSpacing(10);
slider.addChangeListener(this);
curScale = new JLabel("222%");
curScale.setHorizontalAlignment(SwingConstants.RIGHT);
curScale.setVerticalAlignment(SwingConstants.CENTER);
curScaleDim = new Dimension(curScale.getPreferredSize());
curScaleDim.height = Math.max(curScaleDim.height, slider.getPreferredSize().height);
stateChanged(null);
printerView = new JCheckBox();
printerView.setSelected(true);
// set up panel
gridbag = new GridBagLayout();
gbc = new GridBagConstraints();
setLayout(gridbag);
// now add components into panel
gbc.gridy = 0;
gbc.gridx = GridBagConstraints.RELATIVE;
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.insets = new Insets(5, 0, 5, 0);
gbc.fill = GridBagConstraints.NONE;
addGb(new JLabel(Strings.get("labelCircuits") + " "));
gbc.fill = GridBagConstraints.HORIZONTAL;
addGb(new JScrollPane(list));
gbc.fill = GridBagConstraints.NONE;
gbc.gridy++;
addGb(new JLabel(Strings.get("labelImageFormat") + " "));
Box formatsPanel = new Box(BoxLayout.Y_AXIS);
formatsPanel.add(formatPng);
formatsPanel.add(formatGif);
formatsPanel.add(formatJpg);
addGb(formatsPanel);
gbc.gridy++;
addGb(new JLabel(Strings.get("labelScale") + " "));
addGb(slider);
addGb(curScale);
gbc.gridy++;
addGb(new JLabel(Strings.get("labelPrinterView") + " "));
addGb(printerView);
}