Java Code Examples for java.awt.BorderLayout#getLayoutComponent()

The following examples show how to use java.awt.BorderLayout#getLayoutComponent() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jdk1.8-source-analysis   File: MetaData.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 2
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 3
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 4
Source Project: jdk8u60   File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 5
Source Project: JDKSourceCode1.8   File: MetaData.java    License: MIT License 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 6
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 7
Source Project: jdk-1.7-annotated   File: MetaData.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 8
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 9
Source Project: Bytecoder   File: MetaData.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 10
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 11
Source Project: jdk8u-jdk   File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 12
Source Project: Java8CN   File: MetaData.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 13
Source Project: hottub   File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 14
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 15
void setRealModel(TableModel model) {
    if (table == null) {
        BorderLayout bl = (BorderLayout)getLayout();
        Component c = bl.getLayoutComponent(BorderLayout.CENTER);
        if (c != null) remove(c);
        
        table = createTable(model);
        add(table, BorderLayout.CENTER);
        
        getParent().invalidate();
        getParent().revalidate();
        getParent().repaint();
    }
    
    table.setModel(model);
    setupTable(table);
    enableTableEvents(table);
    
    link.setEnabled(true);
}
 
Example 16
void setRealModel(TableModel model) {
    if (table == null) {
        BorderLayout bl = (BorderLayout)getLayout();
        Component c = bl.getLayoutComponent(BorderLayout.CENTER);
        if (c != null) remove(c);

        table = createTable(model);
        add(table, BorderLayout.CENTER);

        Container parent = getParent();
        if (parent != null) {
            parent.invalidate();
            parent.revalidate();
            parent.repaint();
        }
    } else {
        table.setModel(model);
    }

    setupTable(table);
    enableTableEvents(table);

    link.setEnabled(true);
}
 
Example 17
Source Project: openjdk-8   File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 18
Source Project: jdk8u_jdk   File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 19
Source Project: jdk8u-jdk   File: MetaData.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance,
                          Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    BorderLayout oldLayout = (BorderLayout) oldInstance;
    BorderLayout newLayout = (BorderLayout) newInstance;
    for (String constraints : CONSTRAINTS) {
        Object oldC = oldLayout.getLayoutComponent(constraints);
        Object newC = newLayout.getLayoutComponent(constraints);
        // Pending, assume any existing elements are OK.
        if (oldC != null && newC == null) {
            invokeStatement(oldInstance, "addLayoutComponent",
                            new Object[] { oldC, constraints }, out);
        }
    }
}
 
Example 20
private void addContents(JComponent container, JComponent contents) {
    BorderLayout layout = (BorderLayout)container.getLayout();
    Component oldContents = layout.getLayoutComponent(BorderLayout.CENTER);
    if (oldContents != contents) {
        if (oldContents != null) container.remove(oldContents);
        container.add(contents, BorderLayout.CENTER);
        contents.requestFocusInWindow();
        container.revalidate();
        container.repaint();
    }
}