本文整理匯總了Java中java.awt.GridBagConstraints.NORTHEAST屬性的典型用法代碼示例。如果您正苦於以下問題:Java GridBagConstraints.NORTHEAST屬性的具體用法?Java GridBagConstraints.NORTHEAST怎麽用?Java GridBagConstraints.NORTHEAST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.GridBagConstraints
的用法示例。
在下文中一共展示了GridBagConstraints.NORTHEAST屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addComponentLeftRightRows
private void addComponentLeftRightRows(JComponent[] ComponentLeft,
JComponent[] ComponentRight,
GridBagLayout gridbag,
Container container) {
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.NORTHEAST;
int numLabels = ComponentLeft.length;
for (int i = 0; i < numLabels; i++) {
c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
c.fill = GridBagConstraints.NONE; //reset to default
c.weightx = 0.0;
c.insets = new Insets(0,10,0,0);//reset to default
container.add(ComponentLeft[i], c);
c.gridwidth = GridBagConstraints.REMAINDER; //end row
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0.0;
c.insets = new Insets(0,10,3,0);
container.add(ComponentRight[i], c);
}
}
示例2: addLeftRightComponents
private void addLeftRightComponents(JComponent[] ComponentLeft,
JComponent[] ComponentRight,
GridBagLayout gridbag,
Container container) {
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.NORTHEAST;
int numLabels = ComponentLeft.length;
for (int i = 0; i < numLabels; i++) {
c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
c.fill = GridBagConstraints.NONE; //reset to default
c.weightx = 0.0;
c.insets = new Insets(0,10,0,0);//reset to default
container.add(ComponentLeft[i], c);
c.gridwidth = GridBagConstraints.REMAINDER; //end row
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0.0;
c.insets = new Insets(0,10,3,0);
container.add(ComponentRight[i], c);
}
}
示例3: addFlagsEditor
private void addFlagsEditor(JComponent c, String displayName) {
GridBagLayout layout = (GridBagLayout)c.getLayout();
GridBagConstraints constraints = new GridBagConstraints();
constraints.insets = new Insets(3, 3, 3, 3);
constraints.weightx = 0.0;
constraints.fill = GridBagConstraints.NONE;
constraints.anchor = GridBagConstraints.NORTHEAST;
FlagsEditor flagsEditor = new FlagsEditor();
JLabel flagsLabel = new JLabel(displayName, JLabel.TRAILING);
flagsLabel.setVerticalAlignment(SwingConstants.TOP);
layout.setConstraints(flagsLabel, constraints);
c.add(flagsLabel);
constraints.weightx = 1.0;
constraints.weighty = 1.0;
constraints.fill = GridBagConstraints.BOTH;
constraints.anchor = GridBagConstraints.CENTER;
constraints.gridwidth = GridBagConstraints.REMAINDER;
layout.setConstraints(flagsEditor, constraints);
c.add(flagsEditor);
elements.add(flagsEditor);
flagsLabel.setLabelFor(flagsEditor);
}
示例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: 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();
}
示例6: 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;
}