当前位置: 首页>>代码示例>>Java>>正文


Java GridBagConstraints.NORTHEAST属性代码示例

本文整理汇总了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);
		}
}
 
开发者ID:etomica,项目名称:etomica,代码行数:23,代码来源:ViewSpeciesSelection.java

示例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);
		}
}
 
开发者ID:etomica,项目名称:etomica,代码行数:23,代码来源:ViewAlkaneLengthSelection.java

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:22,代码来源:CFGOptionsPanel.java

示例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()));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:BalloonManager.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:DesktopImpl.java

示例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;
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:38,代码来源:ExtendedGridBagConstraints.java


注:本文中的java.awt.GridBagConstraints.NORTHEAST属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。