java.awt.GridBagConstraints#clone ( )源码实例Demo

下面列出了java.awt.GridBagConstraints#clone ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码2 项目: TencentKona-8   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码3 项目: jdk8u60   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码4 项目: openjdk-jdk8u   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码5 项目: openjdk-jdk8u-backup   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码6 项目: openjdk-jdk9   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码7 项目: jdk8u-jdk   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码8 项目: hottub   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码9 项目: openjdk-8-source   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码10 项目: openjdk-8   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码11 项目: jdk8u_jdk   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码12 项目: jdk8u-jdk   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码13 项目: jdk8u-dev-jdk   文件: Font2DTest.java
private void addLabeledComponentToGBL( String name,
                                       JComponent c,
                                       GridBagLayout gbl,
                                       GridBagConstraints gbc,
                                       Container target ) {
    LabelV2 l = new LabelV2( name );
    GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone();
    gbcLabel.insets = new Insets( 2, 2, 2, 0 );
    gbcLabel.gridwidth = 1;
    gbcLabel.weightx = 0;

    if ( c == null )
      c = new JLabel( "" );

    gbl.setConstraints( l, gbcLabel );
    target.add( l );
    gbl.setConstraints( c, gbc );
    target.add( c );
}
 
源代码14 项目: arcusplatform   文件: FormView.java
private void init() {
   labelConstraints = new GridBagConstraints();
   labelConstraints.gridx = 0;
   labelConstraints.gridy = 0;
   labelConstraints.weightx = 0.0;
   labelConstraints.weighty = 0.0;
   labelConstraints.fill = GridBagConstraints.NONE;
   labelConstraints.anchor = GridBagConstraints.EAST;

   fieldConstraints = new GridBagConstraints();
   fieldConstraints.gridx = 1;
   fieldConstraints.gridy = 0;
   fieldConstraints.weightx = 1.0;
   fieldConstraints.weighty = 0.0;
   fieldConstraints.fill = GridBagConstraints.HORIZONTAL;
   
   wideLabelConstraints = new GridBagConstraints();
   wideLabelConstraints.gridx = 0;
   wideLabelConstraints.gridy = 0;
   wideLabelConstraints.gridwidth = 2;
   wideLabelConstraints.weightx = 1.0;
   wideLabelConstraints.weighty = 0.0;
   wideLabelConstraints.fill = GridBagConstraints.HORIZONTAL;

   wideFieldConstraints = new GridBagConstraints();
   wideFieldConstraints.gridx = 0;
   wideFieldConstraints.gridy = 0;
   wideFieldConstraints.gridwidth = 2;
   wideFieldConstraints.weightx = 1.0;
   wideFieldConstraints.weighty = 1.0;
   wideFieldConstraints.fill = GridBagConstraints.BOTH;
   
   componentConstraints = (GridBagConstraints) wideFieldConstraints.clone();
   
   GridBagConstraints buttonConstraints = (GridBagConstraints) wideLabelConstraints.clone();
   buttonConstraints.gridy = 1000;
   
   panel.add(buttons, buttonConstraints);
}
 
源代码15 项目: org.alloytools.alloy   文件: OurUtil.java
public static JPanel makeGrid(int cols, GridBagConstraints template, Container... containers) {
    JPanel ans = new JPanel(new GridBagLayout());
    int i = -1;
    for (Container container : containers) {
        for (Component comp : container.getComponents()) {
            i++;
            GridBagConstraints c = (GridBagConstraints) template.clone();
            c.gridx = i % cols;
            c.gridy = i / cols;
            ans.add(comp, c);
        }
    }
    return ans;
}
 
源代码16 项目: thunderstorm   文件: GridBagHelper.java
public Builder(GridBagConstraints gbc) {
    this.gbc = (GridBagConstraints) gbc.clone();
}