Example usage for javax.swing JSplitPane HORIZONTAL_SPLIT

List of usage examples for javax.swing JSplitPane HORIZONTAL_SPLIT

Introduction

In this page you can find the example usage for javax.swing JSplitPane HORIZONTAL_SPLIT.

Prototype

int HORIZONTAL_SPLIT

To view the source code for javax.swing JSplitPane HORIZONTAL_SPLIT.

Click Source Link

Document

Horizontal split indicates the Components are split along the x axis.

Usage

From source file:org.jfree.chart.demo.selection.SelectionDemo5Category.java

public SelectionDemo5Category(String title) {
    super(title);
    JPanel chartPanel = createDemoPanel();
    chartPanel.setPreferredSize(new Dimension(500, 270));

    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(chartPanel);//from   w ww  .  j a v  a2 s  .c o  m

    this.model = new DefaultTableModel(new String[] { "row:", "column:", "value:" }, 0);
    this.table = new JTable(this.model);
    TableColumnModel tcm = this.table.getColumnModel();
    JPanel p = new JPanel(new BorderLayout());
    JScrollPane scroller = new JScrollPane(this.table);
    p.add(scroller);
    p.setBorder(BorderFactory.createCompoundBorder(new TitledBorder("Selected Items: "),
            new EmptyBorder(4, 4, 4, 4)));
    split.add(p);
    setContentPane(split);
}

From source file:org.jfree.chart.demo.selection.SelectionDemo4.java

/**
 * Creates a new demo.//from   w  w w.j a v a 2s . co m
 * 
 * @param title  the frame title.
 */
public SelectionDemo4(String title) {
    super(title);
    ChartPanel chartPanel = (ChartPanel) createDemoPanel();
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));

    JFreeChart chart = chartPanel.getChart();
    XYPlot plot = (XYPlot) chart.getPlot();
    this.dataset = (HistogramDataset) plot.getDataset();
    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(chartPanel);

    this.model = new DefaultTableModel(new String[] { "Item:", "Bin Start:", "Bin End:", "Value:" }, 0);
    this.table = new JTable(this.model);
    JPanel p = new JPanel(new BorderLayout());
    JScrollPane scroller = new JScrollPane(this.table);
    p.add(scroller);
    p.setBorder(BorderFactory.createCompoundBorder(new TitledBorder("Selected Items: "),
            new EmptyBorder(4, 4, 4, 4)));
    split.add(p);
    setContentPane(split);
}

From source file:org.jfree.chart.demo.selection.SelectionDemo2.java

/**
 * A demonstration application showing a scatter plot.
 *
 * @param title  the frame title./*  w  w  w.  j  av  a 2s . co m*/
 */
public SelectionDemo2(String title) {
    super(title);
    ChartPanel chartPanel = (ChartPanel) createDemoPanel();
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));

    JFreeChart chart = chartPanel.getChart();
    XYPlot plot = (XYPlot) chart.getPlot();
    this.dataset = (XYSeriesCollection) plot.getDataset();
    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(chartPanel);

    this.model = new DefaultTableModel(new String[] { "Series:", "Item:", "X:", "Y:" }, 0);
    this.table = new JTable(this.model);
    TableColumnModel tcm = this.table.getColumnModel();
    tcm.getColumn(2).setCellRenderer(new NumberCellRenderer());
    tcm.getColumn(3).setCellRenderer(new NumberCellRenderer());
    JPanel p = new JPanel(new BorderLayout());
    JScrollPane scroller = new JScrollPane(this.table);
    p.add(scroller);
    p.setBorder(BorderFactory.createCompoundBorder(new TitledBorder("Selected Items: "),
            new EmptyBorder(4, 4, 4, 4)));
    split.add(p);
    setContentPane(split);
}

From source file:org.jfree.chart.demo.selection.SelectionDemo3.java

/**
 * A demonstration application showing a scatter plot.
 *
 * @param title  the frame title./*  w  w w.ja  v a2 s  . co m*/
 */
public SelectionDemo3(String title) {
    super(title);
    ChartPanel chartPanel = (ChartPanel) createDemoPanel();
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));

    JFreeChart chart = chartPanel.getChart();
    XYPlot plot = (XYPlot) chart.getPlot();
    this.dataset = (XYSeriesCollection) plot.getDataset();
    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(chartPanel);

    this.model = new DefaultTableModel(new String[] { "Series:", "Item:", "X:", "Y:" }, 0);
    this.table = new JTable(this.model);
    TableColumnModel tcm = this.table.getColumnModel();
    tcm.getColumn(2).setCellRenderer(new NumberCellRenderer());
    tcm.getColumn(3).setCellRenderer(new NumberCellRenderer());
    JPanel p = new JPanel(new BorderLayout());
    JScrollPane scroller = new JScrollPane(this.table);
    p.add(scroller);
    p.setBorder(BorderFactory.createCompoundBorder(new TitledBorder("Selected Items: "),
            new EmptyBorder(4, 4, 4, 4)));
    split.add(p);
    setContentPane(split);
}

From source file:org.jfree.chart.demo.selection.SelectionDemo1.java

/**
 * A demonstration application showing how to create a simple time series
 * chart. This example uses monthly data.
 * /*w w  w.j  a  va2 s . c  o  m*/
 * @param title  the frame title.
 */
public SelectionDemo1(String title) {
    super(title);
    ChartPanel chartPanel = (ChartPanel) createDemoPanel();
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));

    JFreeChart chart = chartPanel.getChart();
    XYPlot plot = (XYPlot) chart.getPlot();
    this.dataset = (TimeSeriesCollection) plot.getDataset();
    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(chartPanel);

    this.model = new DefaultTableModel(new String[] { "Series:", "Item:", "Period:", "Value:" }, 0);
    this.table = new JTable(this.model);
    TableColumnModel tcm = this.table.getColumnModel();
    tcm.getColumn(3).setCellRenderer(new NumberCellRenderer());
    JPanel p = new JPanel(new BorderLayout());
    JScrollPane scroller = new JScrollPane(this.table);
    p.add(scroller);
    p.setBorder(BorderFactory.createCompoundBorder(new TitledBorder("Selected Items: "),
            new EmptyBorder(4, 4, 4, 4)));
    split.add(p);
    setContentPane(split);

}

From source file:components.SplitPaneDemo.java

public SplitPaneDemo() {

    //Create the list of images and put it in a scroll pane.

    list = new JList(imageNames);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.setSelectedIndex(0);/*w  w w.j  av  a2 s .c om*/
    list.addListSelectionListener(this);

    JScrollPane listScrollPane = new JScrollPane(list);
    picture = new JLabel();
    picture.setFont(picture.getFont().deriveFont(Font.ITALIC));
    picture.setHorizontalAlignment(JLabel.CENTER);

    JScrollPane pictureScrollPane = new JScrollPane(picture);

    //Create a split pane with the two scroll panes in it.
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listScrollPane, pictureScrollPane);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);

    //Provide minimum sizes for the two components in the split pane.
    Dimension minimumSize = new Dimension(100, 50);
    listScrollPane.setMinimumSize(minimumSize);
    pictureScrollPane.setMinimumSize(minimumSize);

    //Provide a preferred size for the split pane.
    splitPane.setPreferredSize(new Dimension(400, 200));
    updateLabel(imageNames[list.getSelectedIndex()]);
}

From source file:org.jfree.expdemo.SelectionDemo4.java

/**
 * Creates a new demo./*from www. j  av a 2  s . co m*/
 * 
 * @param title
 *            the frame title.
 */
public SelectionDemo4(String title) {
    super(title);
    ChartPanel chartPanel = (ChartPanel) createDemoPanel();
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));

    JFreeChart chart = chartPanel.getChart();
    XYPlot plot = (XYPlot) chart.getPlot();
    this.dataset = (SimpleHistogramDataset) plot.getDataset();
    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(chartPanel);

    this.model = new DefaultTableModel(new String[] { "Item:", "Bin Start::", "Bin End:", "Value:" }, 0);
    this.table = new JTable(this.model);
    JPanel p = new JPanel(new BorderLayout());
    JScrollPane scroller = new JScrollPane(this.table);
    p.add(scroller);
    p.setBorder(BorderFactory.createCompoundBorder(new TitledBorder("Selected Items: "),
            new EmptyBorder(4, 4, 4, 4)));
    split.add(p);
    setContentPane(split);
}

From source file:de.huberlin.cuneiform.compiler.debug.DebugDispatcher.java

public DebugDispatcher(File buildDir, File logFile, String dagid) {

    super(buildDir, logFile, dagid);

    JSplitPane splitPane;/* w  ww  .j  av a2 s.  c o m*/

    frame = new JFrame("Cuneiform Debug Interface");
    frame.setSize(700, 500);
    frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    frame.setLayout(new BorderLayout());

    addMenu();

    invocOverview = new InvocOverview(this);
    contentOverview = new ContentOverview(frame);

    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, invocOverview, contentOverview);
    // splitPane.setResizeWeight( .5 );
    splitPane.setDividerLocation(350);

    frame.add(splitPane, BorderLayout.CENTER);

}

From source file:hr.fer.zemris.vhdllab.platform.support.SimplisticEclipseBasedApplicationPage.java

@Override
protected JComponent createControl() {
    projectExplorerPane = new JPanel(new BorderLayout());
    editorsPane = new JPanel(new BorderLayout());
    viewsTabbedPane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT);
    viewsTabbedPane.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            // if we're adding a component, ignore change of active
            // component
            if (!addingView && getViewsTabbedPane().getSelectedIndex() >= 0) {
                setActiveComponent(getComponent(getViewsTabbedPane().getSelectedIndex()));
            }/*from  w  ww  .j a  v  a2 s  . c o m*/
        }
    });

    final double horizontalLocation = 0.15;
    final double verticalLocation = 0.75;
    final JSplitPane horizontalPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, projectExplorerPane,
            editorsPane);
    horizontalPane.setDividerLocation(horizontalLocation);
    final JSplitPane verticalPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, horizontalPane, viewsTabbedPane);
    verticalPane.setDividerLocation(verticalLocation);

    JPanel maximizedPanel = new JPanel(new BorderLayout());
    maximizedPanel.add(verticalPane, BorderLayout.CENTER);
    JPanel control = new JPanel(new BorderLayout());
    control.add(maximizedPanel, BorderLayout.CENTER);
    control.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            horizontalPane.setDividerLocation(horizontalLocation);
            verticalPane.setDividerLocation(verticalLocation);
        }
    });

    this.getPageDescriptor().buildInitialLayout(this);

    if (viewsTabbedPane.getTabCount() > 0) {
        viewsTabbedPane.setSelectedIndex(0);
    }

    Logger.getRootLogger().addAppender(new AppenderSkeleton() {
        @Override
        public boolean requiresLayout() {
            return false;
        }

        @Override
        public void close() {
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void append(LoggingEvent event) {
            if (event.getLevel().equals(Level.INFO)) {
                Object message = event.getMessage();
                if (message != null) {
                    getActiveWindow().getStatusBar().setMessage(message.toString());
                }
            }
        }
    });
    return control;
}

From source file:com.dal.a.ui.DalAppConsole.java

private void coreSetup() {
    setLayout(new BorderLayout());
    setJMenuBar(initializeMenu());//  ww w.  j  av a2s  .c  om
    add(new DalStatusBar(), BorderLayout.SOUTH);

    parentPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    parentPane.setTopComponent(treeView);
    parentPane.setBottomComponent(centerPane);

    centerPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    centerPane.setLeftComponent(listView);
    centerPane.setRightComponent(detailView);

    add(parentPane, BorderLayout.CENTER);
}