List of usage examples for javax.swing JSplitPane HORIZONTAL_SPLIT
int HORIZONTAL_SPLIT
To view the source code for javax.swing JSplitPane HORIZONTAL_SPLIT.
Click Source Link
Component
s are split along the x axis. From source file:com.haulmont.cuba.desktop.gui.components.DesktopSplitPanel.java
@Override public int getOrientation() { return impl.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ? ORIENTATION_HORIZONTAL : ORIENTATION_VERTICAL; }
From source file:org.datacleaner.widgets.result.CategorizationResultSwingRenderer.java
@Override public JComponent render(CategorizationResult analyzerResult) { final DefaultPieDataset dataset = new DefaultPieDataset(); final Collection<String> categoryNames = analyzerResult.getCategoryNames(); for (String categoryName : categoryNames) { final Number count = analyzerResult.getCategoryCount(categoryName); dataset.setValue(categoryName, count); }/*from w w w . j a v a 2s. c o m*/ final DefaultTableModel model = prepareModel(analyzerResult, dataset); final DCTable table = new DCTable(model); table.setColumnControlVisible(false); table.setRowHeight(22); final JFreeChart chart = ChartFactory.createPieChart(null, dataset, true, false, false); ChartUtils.applyStyles(chart); final ChartPanel chartPanel = ChartUtils.createPanel(chart, false); final DCPanel leftPanel = WidgetUtils.decorateWithShadow(chartPanel); final DCPanel rightPanel = new DCPanel(); rightPanel.setLayout(new VerticalLayout()); rightPanel.add(WidgetUtils.decorateWithShadow(table.toPanel())); final JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); split.setOpaque(false); split.add(leftPanel); split.add(rightPanel); split.setDividerLocation(550); return split; }
From source file:gchisto.gui.panels.gcdistribution.ChartPanelSingle.java
/** * It creates a chart for the given dataset and adds the chart to the panel. * * @param dataset The dataset that will provide the values for the chart. *//*from ww w. j ava 2 s. c o m*/ private void addChart() { JFreeChart chart = ChartFactory.createXYBarChart(getTitle(), "Buckets (sec)", false, "Count", dataset, PlotOrientation.VERTICAL, true, true, false); chart.addProgressListener(locker); XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); renderer.setToolTipGenerator(dataset); groupActivatingPanel = new GroupActivatingPanel(dataset, locker); org.jfree.chart.ChartPanel chartPanel = new org.jfree.chart.ChartPanel(chart); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, groupActivatingPanel, chartPanel); splitPane.setDividerLocation(200); mainPanel().add(BorderLayout.CENTER, splitPane); }
From source file:gchisto.gui.panels.gctimeline.ChartPanel.java
/** * It creates a chart for the given dataset and adds the chart to the panel. * * @param dataset The dataset that will provide the values for the chart. *//* www . j a v a2s.c o m*/ private void addChart() { JFreeChart chart = ChartFactory.createXYBarChart(getTitle(), "Elapsed Time (sec)", false, "Time" + unitSuffix(), dataset, PlotOrientation.VERTICAL, true, true, false); chart.addProgressListener(locker); XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer renderer = plot.getRenderer(); renderer.setToolTipGenerator(dataset); groupActivatingTable = new GroupActivatingPanel(dataset, locker); org.jfree.chart.ChartPanel chartPanel = new org.jfree.chart.ChartPanel(chart); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, groupActivatingTable, chartPanel); splitPane.setDividerLocation(200); mainPanel().add(BorderLayout.CENTER, splitPane); }
From source file:com.haulmont.cuba.desktop.gui.components.DesktopSplitPanel.java
@Override public void setOrientation(int orientation) { impl.setOrientation(/* www. j a va 2 s . com*/ orientation == ORIENTATION_HORIZONTAL ? JSplitPane.HORIZONTAL_SPLIT : JSplitPane.VERTICAL_SPLIT); }
From source file:com.diversityarrays.kdxplore.field.TrialLayoutEditPanel.java
public TrialLayoutEditPanel(Closure<TrialLayout> onLayoutComplete) { super(new BorderLayout()); this.onLayoutComplete = onLayoutComplete; plotIdTrialLayoutPane.addPropertyChangeListener(TrialLayoutPane.PROP_LAYOUT_CHANGED, selectionChangedListener);//w w w . j ava2s. c o m xyTrialLayoutPane.addPropertyChangeListener(TrialLayoutPane.PROP_LAYOUT_CHANGED, selectionChangedListener); cardPanel.add(plotIdTrialLayoutPane, CARD_PLOT_ID); cardPanel.add(xyTrialLayoutPane, CARD_X_AND_Y); cardPanel.add(noDateTrialLayoutPane, CARD_NO_DATA); // saveAction.setEnabled(false); // Box buttons = Box.createHorizontalBox(); // buttons.add(new JButton(cancelAction)); // buttons.add(new JButton(saveAction)); splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cardPanel, new JLabel()); splitPane.setResizeWeight(0.0); add(splitPane, BorderLayout.CENTER); // add(buttons, BorderLayout.SOUTH); }
From source file:it.cnr.icar.eric.client.ui.swing.DiscoveryPanel.java
/** * Class Constructor./*from w w w. j av a 2s .c o m*/ */ public DiscoveryPanel() throws JAXRException { GridBagLayout gbl = new GridBagLayout(); setLayout(gbl); findParamsPanel = new FindParamsPanel(this); JPanel findResultsPanel = createFindResultsPanel(); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, findParamsPanel, findResultsPanel); c.gridx = 0; c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.5; c.weighty = 0.5; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; c.insets = new Insets(4, 4, 4, 4); gbl.setConstraints(splitPane, c); add(splitPane); //add listener for 'locale' bound property RegistryBrowser.getInstance().addPropertyChangeListener(RegistryBrowser.PROPERTY_LOCALE, this); }
From source file:com.clank.launcher.dialog.LauncherFrame.java
private void initComponents() { webView = WebpagePanel.forURL(launcher.getNewsURL(), false); splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, instanceScroll, webView); selfUpdateButton.setVisible(false);/*from w w w . j a va 2 s. co m*/ updateCheck.setSelected(true); instancesTable.setModel(instancesModel); launchButton.setFont(launchButton.getFont().deriveFont(Font.BOLD)); splitPane.setDividerLocation(200); splitPane.setDividerSize(4); SwingHelper.flattenJSplitPane(splitPane); buttonsPanel.addElement(refreshButton); buttonsPanel.addElement(updateCheck); buttonsPanel.addGlue(); buttonsPanel.addElement(selfUpdateButton); buttonsPanel.addElement(optionsButton); buttonsPanel.addElement(launchButton); container.setLayout(new BorderLayout()); container.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); container.add(splitPane, BorderLayout.CENTER); add(buttonsPanel, BorderLayout.SOUTH); add(container, BorderLayout.CENTER); instancesModel.addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { if (instancesTable.getRowCount() > 0) { instancesTable.setRowSelectionInterval(0, 0); } } }); instancesTable.addMouseListener(new DoubleClickToButtonAdapter(launchButton)); refreshButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { loadInstances(); checkLauncherUpdate(); } }); selfUpdateButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { selfUpdate(); } }); optionsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { showOptions(); } }); launchButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { launch(); } }); instancesTable.addMouseListener(new PopupMouseAdapter() { @Override protected void showPopup(MouseEvent e) { int index = instancesTable.rowAtPoint(e.getPoint()); Instance selected = null; if (index >= 0) { instancesTable.setRowSelectionInterval(index, index); selected = launcher.getInstances().get(index); } popupInstanceMenu(e.getComponent(), e.getX(), e.getY(), selected); } }); }
From source file:edu.ucla.stat.SOCR.applications.demo.BlackScholesApplication.java
public void init() { updateGraph();//from w w w . ja v a 2 s . c o m s_serie = new XYSeries("S", false); upContainer = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(leftPanel), new JScrollPane(chartPanel)); this.getMainPanel().removeAll(); this.getMainPanel().add(new JScrollPane(upContainer), BorderLayout.CENTER); this.getMainPanel().validate(); }
From source file:ec.nbdemetra.ui.demo.ComponentsDemo.java
public ComponentsDemo() { initStaticResources();/*from w w w . j a va 2 s . c o m*/ final Map<Id, Component> demoData = lookupComponents(); final JPanel main = new JPanel(new BorderLayout()); final JTree tree = new JTree(); tree.setRootVisible(false); tree.setCellRenderer(new IdRenderer(demoData)); IdsTree.fill(tree, Lists.newArrayList(demoData.keySet())); expandAll(tree); tree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent e) { TreePath p = tree.getSelectionPath(); if (p != null) { main.removeAll(); DefaultMutableTreeNode node = (DefaultMutableTreeNode) p.getLastPathComponent(); Id id = IdsTree.translate(node); Component c = demoData.get(id); main.add(c != null ? c : new JPanel()); main.validate(); main.repaint(); } } }); JTsList dragDrop = new JTsList(); dragDrop.setShowHeader(false); dragDrop.setInformation(new ITsList.InfoType[] { ITsList.InfoType.TsIdentifier, ITsList.InfoType.Data }); dragDrop.setPreferredSize(new Dimension(200, 200)); dragDrop.setTsAction(DemoTsActions.DO_NOTHING); JSplitPane left = NbComponents.newJSplitPane(JSplitPane.VERTICAL_SPLIT, NbComponents.newJScrollPane(tree), dragDrop); JSplitPane splitPane = NbComponents.newJSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, main); splitPane.getLeftComponent().setPreferredSize(new Dimension(200, 400)); setLayout(new BorderLayout()); add(splitPane, BorderLayout.CENTER); }