use of javax.swing.JSplitPane 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 javax.swing.JSplitPane in project cayenne by apache.
the class SelectQueryOrderingTab method initView.
protected void initView() {
messagePanel = new JPanel(new BorderLayout());
cardLayout = new CardLayout();
Preferences detail = Application.getInstance().getPreferencesNode(this.getClass(), "");
int defLocation = Application.getFrame().getHeight() / 2;
int location = detail != null ? detail.getInt(getDividerLocationProperty(), defLocation) : defLocation;
// As of CAY-888 #3 main pane is now a JSplitPane. Top component is a bit larger.
JSplitPane mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
mainPanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, this);
mainPanel.setDividerLocation(location);
mainPanel.setTopComponent(createEditorPanel());
mainPanel.setBottomComponent(createSelectorPanel());
setLayout(cardLayout);
add(mainPanel, REAL_PANEL);
add(messagePanel, PLACEHOLDER_PANEL);
}
use of javax.swing.JSplitPane in project cayenne by apache.
the class PreferenceDialogView method init.
private void init() {
split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
split.setBorder(TopBorder.create());
list = new JList<>();
list.setCellRenderer(new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
setBorder(BorderFactory.createEmptyBorder(5, 8, 5, 0));
return this;
}
});
list.setFont(new JLabel().getFont().deriveFont(Font.BOLD, 12));
detailLayout = new CardLayout();
detailPanel = new JPanel(detailLayout);
saveButton = new JButton("Save");
cancelButton = new JButton("Cancel");
// assemble
Container leftContainer = new JPanel(new BorderLayout());
JScrollPane scrollPane = new JScrollPane(list);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
leftContainer.add(scrollPane);
leftContainer.setPreferredSize(new Dimension(180, 400));
split.setLeftComponent(leftContainer);
split.setRightComponent(detailPanel);
split.setDividerSize(3);
JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
buttons.add(cancelButton);
buttons.add(saveButton);
buttons.setBorder(TopBorder.create());
getContentPane().setLayout(new BorderLayout());
getContentPane().add(split, BorderLayout.CENTER);
getContentPane().add(buttons, BorderLayout.SOUTH);
setTitle("Edit Preferences");
}
use of javax.swing.JSplitPane in project cayenne by apache.
the class EditorView method initView.
private void initView() {
setBorder(BorderFactory.createEmptyBorder(1, 0, 0, 1));
// init widgets
actionManager.getAction(CollapseTreeAction.class).setAlwaysOn(true);
actionManager.getAction(FilterAction.class).setAlwaysOn(true);
actionManager.getAction(FilterAction.class).resetDialog();
JToolBar barPanel = new JToolBar();
barPanel.setFloatable(false);
barPanel.setMinimumSize(new Dimension(75, 30));
barPanel.setBorder(BorderFactory.createEmptyBorder());
barPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
JButton collapseButton = getAction(CollapseTreeAction.class).buildButton(1);
JButton filterButton = getAction(FilterAction.class).buildButton(3);
filterButton.setPreferredSize(new Dimension(30, 30));
collapseButton.setPreferredSize(new Dimension(30, 30));
barPanel.add(filterButton);
barPanel.add(collapseButton);
treePanel = new ProjectTreeView(eventController);
treePanel.setMinimumSize(new Dimension(75, 180));
JPanel treeNavigatePanel = new JPanel();
treeNavigatePanel.setMinimumSize(new Dimension(75, 220));
treeNavigatePanel.setLayout(new BorderLayout());
treeNavigatePanel.add(treePanel, BorderLayout.CENTER);
detailPanel = new JPanel();
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
splitPane.setDividerSize(2);
splitPane.setBorder(BorderFactory.createEmptyBorder());
leftPanel = new JPanel(new BorderLayout());
// assemble...
detailLayout = new CardLayout();
detailPanel.setLayout(detailLayout);
// some but not all panels must be wrapped in a scroll pane
// those that are not wrapped usually have there own scrollers
// in subpanels...
detailPanel.add(new JPanel(), EMPTY_VIEW);
dataDomainView = new DataDomainTabbedView(eventController);
detailPanel.add(dataDomainView, DOMAIN_VIEW);
DataNodeEditor nodeController = new DataNodeEditor(eventController);
detailPanel.add(nodeController.getView(), NODE_VIEW);
dataNodeView = nodeController.getTabComponent();
dataMapView = new DataMapTabbedView(eventController);
detailPanel.add(dataMapView, DATA_MAP_VIEW);
procedureView = new ProcedureTabbedView(eventController);
detailPanel.add(procedureView, PROCEDURE_VIEW);
selectQueryView = new SelectQueryTabbedView(eventController);
detailPanel.add(selectQueryView, SELECT_QUERY_VIEW);
sqlTemplateView = new SQLTemplateTabbedView(eventController);
detailPanel.add(sqlTemplateView, SQL_TEMPLATE_VIEW);
Component procedureQueryView = new ProcedureQueryView(eventController);
detailPanel.add(new JScrollPane(procedureQueryView), PROCEDURE_QUERY_VIEW);
ejbqlQueryView = new EjbqlTabbedView(eventController);
detailPanel.add(ejbqlQueryView, EJBQL_QUERY_VIEW);
embeddableView = new EmbeddableTabbedView(eventController);
detailPanel.add(embeddableView, EMBEDDABLE_VIEW);
objDetailView = new ObjEntityTabbedView(eventController);
detailPanel.add(objDetailView, OBJ_VIEW);
dbDetailView = new DbEntityTabbedView(eventController);
detailPanel.add(dbDetailView, DB_VIEW);
leftPanel.add(barPanel, BorderLayout.NORTH);
leftPanel.setBorder(BorderFactory.createEmptyBorder());
JScrollPane scrollPane = new JScrollPane(treeNavigatePanel);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
leftPanel.add(scrollPane, BorderLayout.CENTER);
splitPane.setLeftComponent(leftPanel);
splitPane.setRightComponent(detailPanel);
setLayout(new BorderLayout());
add(splitPane, BorderLayout.CENTER);
}
use of javax.swing.JSplitPane 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);
}
Aggregations