Search in sources :

Example 6 with ComponentGeometry

use of org.apache.cayenne.modeler.pref.ComponentGeometry in project cayenne by apache.

the class CayenneModelerFrame method initStatusBar.

protected void initStatusBar() {
    status = new JLabel();
    status.setFont(status.getFont().deriveFont(Font.PLAIN, 10));
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setBorder(TopBorder.create());
    splitPane.getInsets().left = 5;
    splitPane.getInsets().right = 5;
    splitPane.setResizeWeight(0.7);
    // Moving this to try-catch block per CAY-940. Exception will be stack-traced
    try {
        ComponentGeometry geometry = new ComponentGeometry(this.getClass(), "splitPane/divider");
        geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 400);
    } catch (Exception ex) {
        LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
    }
    JPanel statusBar = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 1));
    statusBar.setBorder(TopBorder.create());
    // add placeholder
    statusBar.add(Box.createVerticalStrut(16));
    statusBar.add(status);
    if (getContentPane() instanceof JPanel) {
        ((JPanel) getContentPane()).setBorder(BorderFactory.createEmptyBorder());
    }
    getContentPane().add(splitPane, BorderLayout.CENTER);
    getContentPane().add(statusBar, BorderLayout.SOUTH);
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) ComponentGeometry(org.apache.cayenne.modeler.pref.ComponentGeometry) JLabel(javax.swing.JLabel) JSplitPane(javax.swing.JSplitPane)

Aggregations

ComponentGeometry (org.apache.cayenne.modeler.pref.ComponentGeometry)6 JSplitPane (javax.swing.JSplitPane)3 BorderLayout (java.awt.BorderLayout)2 FlowLayout (java.awt.FlowLayout)1 Transferable (java.awt.datatransfer.Transferable)1 DropTarget (java.awt.dnd.DropTarget)1 DropTargetAdapter (java.awt.dnd.DropTargetAdapter)1 DropTargetDropEvent (java.awt.dnd.DropTargetDropEvent)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 FilterController (org.apache.cayenne.modeler.dialog.datadomain.FilterController)1