use of java.awt.event.ContainerAdapter in project com.revolsys.open by revolsys.
the class ProjectFrame method initUi.
@Override
protected void initUi() {
setMinimumSize(new Dimension(600, 500));
final JRootPane rootPane = getRootPane();
addSaveActions(rootPane, this.project);
final BoundingBox defaultBoundingBox = getDefaultBoundingBox();
this.project.setViewBoundingBoxAndGeometryFactory(defaultBoundingBox);
Project.set(this.project);
this.project.setPropertyWeak(PROJECT_FRAME, this);
setConnectionRegistries();
newMapPanel();
this.leftTabs.setMinimumSize(new Dimension(100, 300));
this.leftTabs.setPreferredSize(new Dimension(300, 700));
this.mapPanel.setMinimumSize(new Dimension(300, 300));
this.mapPanel.setPreferredSize(new Dimension(700, 700));
this.leftRightSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.leftTabs, this.mapPanel);
this.leftRightSplit.setBorder(BorderFactory.createEmptyBorder());
this.bottomTabs.setBorder(BorderFactory.createEmptyBorder());
this.bottomTabs.setPreferredSize(new Dimension(700, 200));
final ContainerListener listener = new ContainerAdapter() {
@Override
public void componentRemoved(final ContainerEvent e) {
final Component eventComponent = e.getChild();
if (eventComponent instanceof ProjectFramePanel) {
final ProjectFramePanel panel = (ProjectFramePanel) eventComponent;
panel.setProperty(BOTTOM_TAB, null);
}
}
};
this.bottomTabs.addContainerListener(listener);
this.topBottomSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, this.leftRightSplit, this.bottomTabs);
this.bottomTabs.setMinimumSize(new Dimension(600, 100));
this.topBottomSplit.setResizeWeight(1);
add(this.topBottomSplit, BorderLayout.CENTER);
newTabLeftTableOfContents();
newTabLeftCatalogPanel();
addBottomTabs(this.bottomTabs);
setBounds((Object) null, false);
super.initUi();
}
use of java.awt.event.ContainerAdapter in project adempiere by adempiere.
the class SwingTool method addOpaque.
public static void addOpaque(JComponent c, final boolean opaque) {
ContainerAdapter ca = new ContainerAdapter() {
public void componentAdded(ContainerEvent e) {
setOpaque(e.getChild());
}
private void setOpaque(Component c) {
//ignores all selectable items, like buttons
if (c instanceof ItemSelectable) {
return;
} else // sets transparent
if (c instanceof JComponent) {
((JComponent) c).setOpaque(opaque);
} else // recursively calls this method for all container components
if (c instanceof Container) {
for (int i = 0; i > ((Container) c).getComponentCount(); i++) {
setOpaque(((Container) c).getComponent(i));
}
}
}
};
c.addContainerListener(ca);
}
Aggregations