Example usage for javax.swing JSplitPane VERTICAL_SPLIT

List of usage examples for javax.swing JSplitPane VERTICAL_SPLIT

Introduction

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

Prototype

int VERTICAL_SPLIT

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

Click Source Link

Document

Vertical split indicates the Components are split along the y axis.

Usage

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_0.CFFswSwing.CFFswSwingFSSFConferenceProfileViewEditJPanel.java

public CFFswSwingFSSFConferenceProfileViewEditJPanel(ICFFswSwingSchema argSchema,
        ICFFswFSSFConferenceProfileObj argFocus) {
    super();//from w w w.jav a2  s.  c  om
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocus(argFocus);
    setSize(1024, 480);
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    attrJPanel = argSchema.getFSSFConferenceProfileFactory().newAttrJPanel(argFocus);
    attrScrollPane = new CFHSlaveJScrollPane(attrJPanel);
    eltJTabbedPane = argSchema.getFSSFConferenceProfileFactory().newEltJTabbedPane(argFocus);
    splitPane.setTopComponent(attrScrollPane);
    splitPane.setBottomComponent(eltJTabbedPane);
    add(splitPane);
    splitPane.setBounds(0, 0, 1024, 455);
    splitPane.setDividerLocation(200);
    if (getSwingFocus() != null) {
        setPanelMode(CFJPanel.PanelMode.View);
    }
    doLayout();
}

From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashSwing.CFGCashSwingISOCountryCurrencyViewEditJPanel.java

public CFGCashSwingISOCountryCurrencyViewEditJPanel(ICFGCashSwingSchema argSchema,
        ICFGCashISOCountryCurrencyObj argFocus) {
    super();//from  w w  w .  j  a v a2 s . co  m
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocus(argFocus);
    setSize(1024, 480);
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    attrJPanel = argSchema.getISOCountryCurrencyFactory().newAttrJPanel(argFocus);
    attrScrollPane = new CFHSlaveJScrollPane(attrJPanel);
    eltJTabbedPane = argSchema.getISOCountryCurrencyFactory().newEltJTabbedPane(argFocus);
    splitPane.setTopComponent(attrScrollPane);
    splitPane.setBottomComponent(eltJTabbedPane);
    add(splitPane);
    splitPane.setBounds(0, 0, 1024, 455);
    splitPane.setDividerLocation(200);
    if (getSwingFocus() != null) {
        setPanelMode(CFJPanel.PanelMode.View);
    }
    doLayout();
}

From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashSwing.CFGCashSwingISOCountryLanguageViewEditJPanel.java

public CFGCashSwingISOCountryLanguageViewEditJPanel(ICFGCashSwingSchema argSchema,
        ICFGCashISOCountryLanguageObj argFocus) {
    super();// ww w . ja v  a 2  s  .com
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocus(argFocus);
    setSize(1024, 480);
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    attrJPanel = argSchema.getISOCountryLanguageFactory().newAttrJPanel(argFocus);
    attrScrollPane = new CFHSlaveJScrollPane(attrJPanel);
    eltJTabbedPane = argSchema.getISOCountryLanguageFactory().newEltJTabbedPane(argFocus);
    splitPane.setTopComponent(attrScrollPane);
    splitPane.setBottomComponent(eltJTabbedPane);
    add(splitPane);
    splitPane.setBounds(0, 0, 1024, 455);
    splitPane.setDividerLocation(200);
    if (getSwingFocus() != null) {
        setPanelMode(CFJPanel.PanelMode.View);
    }
    doLayout();
}

From source file:components.TextComponentDemo.java

public TextComponentDemo() {
    super("TextComponentDemo");

    //Create the text pane and configure it.
    textPane = new JTextPane();
    textPane.setCaretPosition(0);/*from  w  w  w. java  2 s . c om*/
    textPane.setMargin(new Insets(5, 5, 5, 5));
    StyledDocument styledDoc = textPane.getStyledDocument();
    if (styledDoc instanceof AbstractDocument) {
        doc = (AbstractDocument) styledDoc;
        doc.setDocumentFilter(new DocumentSizeFilter(MAX_CHARACTERS));
    } else {
        System.err.println("Text pane's document isn't an AbstractDocument!");
        System.exit(-1);
    }
    JScrollPane scrollPane = new JScrollPane(textPane);
    scrollPane.setPreferredSize(new Dimension(200, 200));

    //Create the text area for the status log and configure it.
    changeLog = new JTextArea(5, 30);
    changeLog.setEditable(false);
    JScrollPane scrollPaneForLog = new JScrollPane(changeLog);

    //Create a split pane for the change log and the text area.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog);
    splitPane.setOneTouchExpandable(true);

    //Create the status area.
    JPanel statusPane = new JPanel(new GridLayout(1, 1));
    CaretListenerLabel caretListenerLabel = new CaretListenerLabel("Caret Status");
    statusPane.add(caretListenerLabel);

    //Add the components.
    getContentPane().add(splitPane, BorderLayout.CENTER);
    getContentPane().add(statusPane, BorderLayout.PAGE_END);

    //Set up the menu bar.
    actions = createActionTable(textPane);
    JMenu editMenu = createEditMenu();
    JMenu styleMenu = createStyleMenu();
    JMenuBar mb = new JMenuBar();
    mb.add(editMenu);
    mb.add(styleMenu);
    setJMenuBar(mb);

    //Add some key bindings.
    addBindings();

    //Put the initial text into the text pane.
    initDocument();
    textPane.setCaretPosition(0);

    //Start watching for undoable edits and caret changes.
    doc.addUndoableEditListener(new MyUndoableEditListener());
    textPane.addCaretListener(caretListenerLabel);
    doc.addDocumentListener(new MyDocumentListener());
}

From source file:com.k42b3.sacmis.Sacmis.java

public Sacmis(String path, String file, int exitCode, boolean writerStdIn) throws Exception {
    this.path = path;
    this.file = file;
    this.exitCode = exitCode;
    this.writerStdIn = writerStdIn;

    this.setTitle("sacmis (version: " + ver + ")");

    this.setLocation(100, 100);

    this.setSize(600, 500);

    this.setMinimumSize(this.getSize());

    // arguments/*w  w w .  j  a v a  2 s .c  om*/
    JPanel panelArgs = new JPanel();

    panelArgs.setLayout(new BorderLayout());

    panelArgs.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

    this.args = new Args();

    this.args.setText(file);

    panelArgs.add(this.args, BorderLayout.CENTER);

    this.add(panelArgs, BorderLayout.NORTH);

    // main panel
    JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT);

    this.in = new In();

    JScrollPane scrIn = new JScrollPane(this.in);

    scrIn.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

    scrIn.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    scrIn.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    sp.add(scrIn);

    this.out = new Out();

    JScrollPane scrOut = new JScrollPane(this.out);

    scrOut.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

    scrOut.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    scrOut.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    sp.add(scrOut);

    this.add(sp, BorderLayout.CENTER);

    // toolbar
    this.toolbar = new Toolbar();

    this.toolbar.getRun().addActionListener(new runHandler());
    this.toolbar.getReset().addActionListener(new resetHandler());
    this.toolbar.getAbout().addActionListener(new aboutHandler());
    this.toolbar.getExit().addActionListener(new exitHandler());

    this.getContentPane().add(this.toolbar, BorderLayout.SOUTH);

    this.setVisible(true);

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    this.loadFile();
}

From source file:edu.ucla.stat.SOCR.chart.demo.PowerTransformQQNormalPlotChart.java

public void init() {

    sliderPanel = new JPanel();
    powerSlider = new FloatSlider("Power", 1.0, -10.0, 10.0);
    powerSlider.setPreferredSize(new Dimension(CHART_SIZE_X / 2 + 150, 80));
    powerSlider.addObserver(this);
    powerSlider.setToolTipText("Slider for adjusting the value of power.");
    sliderPanel.add(this.powerSlider);

    super.init();
    depLabel.setText("Data"); // Y

    toolBar = new JToolBar();
    createActionComponents(toolBar);// w  w  w.j ava 2s  .c  om
    JPanel toolBarContainer = new JPanel();
    toolBarContainer.add(toolBar);

    JSplitPane toolContainer = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolBarContainer,
            new JScrollPane(sliderPanel));
    toolContainer.setContinuousLayout(true);
    toolContainer.setDividerLocation(0.6);
    this.getContentPane().add(toolContainer, BorderLayout.NORTH);
}

From source file:ec.nbdemetra.ui.demo.ComponentsDemo.java

public ComponentsDemo() {
    initStaticResources();/*from  w w  w  .j av  a2  s  .  co  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);
}

From source file:events.ListSelectionDemo.java

public ListSelectionDemo() {
    super(new BorderLayout());

    String[] listData = { "one", "two", "three", "four", "five", "six", "seven" };
    String[] columnNames = { "French", "Spanish", "Italian" };
    list = new JList(listData);

    listSelectionModel = list.getSelectionModel();
    listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
    JScrollPane listPane = new JScrollPane(list);

    JPanel controlPane = new JPanel();
    String[] modes = { "SINGLE_SELECTION", "SINGLE_INTERVAL_SELECTION", "MULTIPLE_INTERVAL_SELECTION" };

    final JComboBox comboBox = new JComboBox(modes);
    comboBox.setSelectedIndex(2);//from  w ww  .j  a v a2  s .  c om
    comboBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String newMode = (String) comboBox.getSelectedItem();
            if (newMode.equals("SINGLE_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            } else if (newMode.equals("SINGLE_INTERVAL_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            } else {
                listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            }
            output.append("----------" + "Mode: " + newMode + "----------" + newline);
        }
    });
    controlPane.add(new JLabel("Selection mode:"));
    controlPane.add(comboBox);

    //Build output area.
    output = new JTextArea(1, 10);
    output.setEditable(false);
    JScrollPane outputPane = new JScrollPane(output, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    //Do the layout.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    add(splitPane, BorderLayout.CENTER);

    JPanel topHalf = new JPanel();
    topHalf.setLayout(new BoxLayout(topHalf, BoxLayout.LINE_AXIS));
    JPanel listContainer = new JPanel(new GridLayout(1, 1));
    listContainer.setBorder(BorderFactory.createTitledBorder("List"));
    listContainer.add(listPane);

    topHalf.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
    topHalf.add(listContainer);
    //topHalf.add(tableContainer);

    topHalf.setMinimumSize(new Dimension(100, 50));
    topHalf.setPreferredSize(new Dimension(100, 110));
    splitPane.add(topHalf);

    JPanel bottomHalf = new JPanel(new BorderLayout());
    bottomHalf.add(controlPane, BorderLayout.PAGE_START);
    bottomHalf.add(outputPane, BorderLayout.CENTER);
    //XXX: next line needed if bottomHalf is a scroll pane:
    //bottomHalf.setMinimumSize(new Dimension(400, 50));
    bottomHalf.setPreferredSize(new Dimension(450, 135));
    splitPane.add(bottomHalf);
}

From source file:TreeIconDemo.java

public TreeIconDemo() {
    super(new GridLayout(1, 0));

    // Create the nodes.
    DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
    createNodes(top);//w  w w .ja  v  a 2s . c  om

    // Create a tree that allows one selection at a time.
    tree = new JTree(top);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    // Set the icon for leaf nodes.
    ImageIcon leafIcon = createImageIcon("images/middle.gif");
    if (leafIcon != null) {
        DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
        renderer.setLeafIcon(leafIcon);
        tree.setCellRenderer(renderer);
    } else {
        System.err.println("Leaf icon missing; using default.");
    }

    // Listen for when the selection changes.
    tree.addTreeSelectionListener(this);

    // Create the scroll pane and add the tree to it.
    JScrollPane treeView = new JScrollPane(tree);

    // Create the HTML viewing pane.
    htmlPane = new JEditorPane();
    htmlPane.setEditable(false);
    initHelp();
    JScrollPane htmlView = new JScrollPane(htmlPane);

    // Add the scroll panes to a split pane.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(treeView);
    splitPane.setBottomComponent(htmlView);

    Dimension minimumSize = new Dimension(100, 50);
    htmlView.setMinimumSize(minimumSize);
    treeView.setMinimumSize(minimumSize);
    splitPane.setDividerLocation(100); // XXX: ignored in some releases
    // of Swing. bug 4101306
    // workaround for bug 4101306:
    // treeView.setPreferredSize(new Dimension(100, 100));

    splitPane.setPreferredSize(new Dimension(500, 300));

    // Add the split pane to this panel.
    add(splitPane);
}

From source file:components.TreeIconDemo.java

public TreeIconDemo() {
    super(new GridLayout(1, 0));

    //Create the nodes.
    DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
    createNodes(top);//  w w w  . ja  v a 2  s  . c  om

    //Create a tree that allows one selection at a time.
    tree = new JTree(top);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    //Set the icon for leaf nodes.
    ImageIcon leafIcon = createImageIcon("images/middle.gif");
    if (leafIcon != null) {
        DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
        renderer.setLeafIcon(leafIcon);
        tree.setCellRenderer(renderer);
    } else {
        System.err.println("Leaf icon missing; using default.");
    }

    //Listen for when the selection changes.
    tree.addTreeSelectionListener(this);

    //Create the scroll pane and add the tree to it. 
    JScrollPane treeView = new JScrollPane(tree);

    //Create the HTML viewing pane.
    htmlPane = new JEditorPane();
    htmlPane.setEditable(false);
    initHelp();
    JScrollPane htmlView = new JScrollPane(htmlPane);

    //Add the scroll panes to a split pane.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(treeView);
    splitPane.setBottomComponent(htmlView);

    Dimension minimumSize = new Dimension(100, 50);
    htmlView.setMinimumSize(minimumSize);
    treeView.setMinimumSize(minimumSize);
    splitPane.setDividerLocation(100); //XXX: ignored in some releases
                                       //of Swing. bug 4101306
                                       //workaround for bug 4101306:
                                       //treeView.setPreferredSize(new Dimension(100, 100)); 

    splitPane.setPreferredSize(new Dimension(500, 300));

    //Add the split pane to this panel.
    add(splitPane);
}