use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class XComponentPeer method getParentTopLevel.
XWindowPeer getParentTopLevel() {
AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
Container parent = (target instanceof Container) ? ((Container) target) : (compAccessor.getParent(target));
// Search for parent window
while (parent != null && !(parent instanceof Window)) {
parent = compAccessor.getParent(parent);
}
if (parent != null) {
return (XWindowPeer) compAccessor.getPeer(parent);
} else {
return null;
}
}
use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class XComponentPeer method addTree.
private void addTree(Collection order, Set set, Container cont) {
for (int i = 0; i < cont.getComponentCount(); i++) {
Component comp = cont.getComponent(i);
ComponentPeer peer = comp.getPeer();
if (peer instanceof XComponentPeer) {
Long window = Long.valueOf(((XComponentPeer) peer).getWindow());
if (!set.contains(window)) {
set.add(window);
order.add(window);
}
} else if (comp instanceof Container) {
// It is lightweight container, it might contain heavyweight components attached to this
// peer
addTree(order, set, (Container) comp);
}
}
}
use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class XComponentPeer method isObscured.
public boolean isObscured() {
Container container = (target instanceof Container) ? (Container) target : target.getParent();
if (container == null) {
return true;
}
Container parent;
while ((parent = container.getParent()) != null) {
container = parent;
}
if (container instanceof Window) {
XWindowPeer wpeer = (XWindowPeer) (container.getPeer());
if (wpeer != null) {
return (wpeer.winAttr.visibilityState != wpeer.winAttr.AWT_UNOBSCURED);
}
}
return true;
}
use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class WPageDialog method addNotify.
@Override
@SuppressWarnings("deprecation")
public void addNotify() {
synchronized (getTreeLock()) {
Container parent = getParent();
if (parent != null && parent.getPeer() == null) {
parent.addNotify();
}
if (getPeer() == null) {
ComponentPeer peer = ((WToolkit) Toolkit.getDefaultToolkit()).createWPageDialog(this);
setPeer(peer);
}
super.addNotify();
}
}
use of java.awt.Container in project JMRI by JMRI.
the class NodeConfigFrame method initComponents.
/**
* Initialize the config window
*/
@Override
public void initComponents() {
setTitle(rb.getString("WindowTitle"));
Container contentPane = getContentPane();
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
// Set up node address and node type
JPanel panel1 = new JPanel();
panel1.setLayout(new BoxLayout(panel1, BoxLayout.Y_AXIS));
// panel11 is the node address and type
JPanel panel11 = new JPanel();
panel11.setLayout(new FlowLayout());
panel11.add(new JLabel(rb.getString("LabelNodeAddress") + " "));
panel11.add(nodeAddrField);
nodeAddrField.setToolTipText(rb.getString("TipNodeAddress"));
nodeAddrField.setText("0");
panel11.add(nodeAddrStatic);
nodeAddrStatic.setVisible(false);
panel11.add(new JLabel(" " + rb.getString("LabelNodeType") + " "));
nodeTypeBox = new JComboBox<String>(SerialNode.getBoardNames());
panel11.add(nodeTypeBox);
nodeTypeBox.setToolTipText(rb.getString("TipNodeType"));
contentPane.add(panel11);
// Set up the notes panel
JPanel panel3 = new JPanel();
panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
JPanel panel31 = new JPanel();
panel31.setLayout(new FlowLayout());
statusText1.setText(stdStatus1);
statusText1.setVisible(true);
panel31.add(statusText1);
JPanel panel32 = new JPanel();
panel32.setLayout(new FlowLayout());
statusText2.setText(stdStatus2);
statusText2.setVisible(true);
panel32.add(statusText2);
JPanel panel33 = new JPanel();
panel33.setLayout(new FlowLayout());
statusText3.setText(stdStatus3);
statusText3.setVisible(true);
panel33.add(statusText3);
panel3.add(panel31);
panel3.add(panel32);
panel3.add(panel33);
Border panel3Border = BorderFactory.createEtchedBorder();
Border panel3Titled = BorderFactory.createTitledBorder(panel3Border, rb.getString("BoxLabelNotes"));
panel3.setBorder(panel3Titled);
contentPane.add(panel3);
// Set up buttons
JPanel panel4 = new JPanel();
panel4.setLayout(new FlowLayout());
addButton.setText(rb.getString("ButtonAdd"));
addButton.setVisible(true);
addButton.setToolTipText(rb.getString("TipAddButton"));
addButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
addButtonActionPerformed();
}
});
panel4.add(addButton);
editButton.setText(rb.getString("ButtonEdit"));
editButton.setVisible(true);
editButton.setToolTipText(rb.getString("TipEditButton"));
panel4.add(editButton);
editButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
editButtonActionPerformed();
}
});
panel4.add(deleteButton);
deleteButton.setText(rb.getString("ButtonDelete"));
deleteButton.setVisible(true);
deleteButton.setToolTipText(rb.getString("TipDeleteButton"));
panel4.add(deleteButton);
deleteButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
deleteButtonActionPerformed();
}
});
panel4.add(doneButton);
doneButton.setText(rb.getString("ButtonDone"));
doneButton.setVisible(true);
doneButton.setToolTipText(rb.getString("TipDoneButton"));
panel4.add(doneButton);
doneButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
doneButtonActionPerformed();
}
});
panel4.add(updateButton);
updateButton.setText(rb.getString("ButtonUpdate"));
updateButton.setVisible(true);
updateButton.setToolTipText(rb.getString("TipUpdateButton"));
panel4.add(updateButton);
updateButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
updateButtonActionPerformed();
}
});
updateButton.setVisible(false);
panel4.add(cancelButton);
cancelButton.setText(rb.getString("ButtonCancel"));
cancelButton.setVisible(true);
cancelButton.setToolTipText(rb.getString("TipCancelButton"));
panel4.add(cancelButton);
cancelButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
cancelButtonActionPerformed();
}
});
cancelButton.setVisible(false);
contentPane.add(panel4);
// pack for display
pack();
}
Aggregations