use of org.apache.cayenne.modeler.pref.ComponentGeometry in project cayenne by apache.
the class ObjEntityAttributeRelationshipTab method init.
private void init() {
this.setLayout(new BorderLayout());
attributePanel = new ObjEntityAttributePanel(mediator, this);
relationshipPanel = new ObjEntityRelationshipPanel(mediator, this);
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, attributePanel, relationshipPanel);
splitPane.setOneTouchExpandable(true);
splitPane.setResizeWeight(0.5);
try {
ComponentGeometry geometry = new ComponentGeometry(this.getClass(), "objEntityAttrRelTab/splitPane/divider");
geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, -1);
} catch (Exception ex) {
LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
}
add(splitPane);
}
use of org.apache.cayenne.modeler.pref.ComponentGeometry in project cayenne by apache.
the class CayenneModelerController method initBindings.
protected void initBindings() {
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
PROJECT_STATE_UTIL.saveLastState(projectController);
getApplication().getActionManager().getAction(ExitAction.class).exit();
}
});
// This is in Mac OSX only.
if (System.getProperty("os.name").startsWith("Mac OS")) {
Runnable runner = new Runnable() {
@Override
public void run() {
PROJECT_STATE_UTIL.saveLastState(projectController);
}
};
Runtime.getRuntime().addShutdownHook(new Thread(runner, "Window Prefs Hook"));
}
new DropTarget(frame, new DropTargetAdapter() {
@Override
public void drop(DropTargetDropEvent dtde) {
dtde.acceptDrop(dtde.getDropAction());
Transferable transferable = dtde.getTransferable();
dtde.dropComplete(processDropAction(transferable));
}
});
ComponentGeometry geometry = new ComponentGeometry(frame.getClass(), null);
geometry.bind(frame, 1200, 720, 0);
}
use of org.apache.cayenne.modeler.pref.ComponentGeometry in project cayenne by apache.
the class DbEntityAttributeRelationshipTab method init.
private void init() {
this.setLayout(new BorderLayout());
attributePanel = new DbEntityAttributePanel(mediator, this);
relationshipPanel = new DbEntityRelationshipPanel(mediator, this);
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, attributePanel, relationshipPanel);
splitPane.setOneTouchExpandable(true);
splitPane.setResizeWeight(0.5);
try {
ComponentGeometry geometry = new ComponentGeometry(this.getClass(), "dbEntityAttrRelTab/splitPane/divider");
geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, -1);
} catch (Exception ex) {
LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
}
add(splitPane);
}
use of org.apache.cayenne.modeler.pref.ComponentGeometry in project cayenne by apache.
the class EditorView method initController.
private void initController() {
this.filterController = new FilterController(eventController, treePanel);
eventController.addDomainDisplayListener(this);
eventController.addDataNodeDisplayListener(this);
eventController.addDataMapDisplayListener(this);
eventController.addObjEntityDisplayListener(this);
eventController.addDbEntityDisplayListener(this);
eventController.addProcedureDisplayListener(this);
eventController.addQueryDisplayListener(this);
eventController.addMultipleObjectsDisplayListener(this);
eventController.addEmbeddableDisplayListener(this);
// 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, 150);
} catch (Exception ex) {
LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
}
}
use of org.apache.cayenne.modeler.pref.ComponentGeometry in project cayenne by apache.
the class LogConsole method appear.
/**
* Shows the console, in separate window or in main frame
*/
private void appear() {
if (!getConsoleProperty(DOCKED_PROPERTY)) {
view.setDocked(false);
if (logWindow == null) {
logWindow = new LogConsoleWindow(this);
ComponentGeometry geometry = new ComponentGeometry(getClass(), null);
geometry.bind(logWindow, 600, 300, 0);
}
logWindow.setContentPane(view);
logWindow.validate();
logWindow.setVisible(true);
} else {
view.setDocked(true);
Application.getFrame().setDockComponent(view);
}
}
Aggregations