Example usage for javax.swing JSplitPane setContinuousLayout

List of usage examples for javax.swing JSplitPane setContinuousLayout

Introduction

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

Prototype

@BeanProperty(description = "Whether the child components are continuously redisplayed and laid out during user intervention.")
public void setContinuousLayout(boolean newContinuousLayout) 

Source Link

Document

Sets the value of the continuousLayout property, which must be true for the child components to be continuously redisplayed and laid out during user intervention.

Usage

From source file:com.sri.ai.praise.demo.ChurchPanel.java

private void initialize() {
    setLayout(new BorderLayout(0, 0));

    JPanel rootPanel = new JPanel();
    add(rootPanel, BorderLayout.CENTER);
    rootPanel.setLayout(new BorderLayout(0, 0));

    JSplitPane splitPane = new JSplitPane();
    splitPane.setContinuousLayout(true);
    splitPane.setResizeWeight(0.5);/*from   w  w w .  j ava 2  s  .  c  o  m*/
    splitPane.setOneTouchExpandable(true);
    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    rootPanel.add(splitPane, BorderLayout.CENTER);

    JPanel churchPanel = new JPanel();
    churchPanel.setLayout(new BorderLayout(0, 0));

    JLabel lblNewLabel = new JLabel("Church Program");
    churchPanel.add(lblNewLabel, BorderLayout.NORTH);

    churchEditor = new ChurchEditor();
    churchPanel.add(churchEditor, BorderLayout.CENTER);

    splitPane.setLeftComponent(churchPanel);

    JPanel hogmPanel = new JPanel();
    hogmPanel.setLayout(new BorderLayout(0, 0));

    JLabel lblNewLabel_1 = new JLabel("Generated Model (Read Only)");
    hogmPanel.add(lblNewLabel_1, BorderLayout.NORTH);

    hogmEditor = new RuleEditor();
    hogmEditor.setEditable(false);
    hogmPanel.add(hogmEditor, BorderLayout.CENTER);

    splitPane.setRightComponent(hogmPanel);
}

From source file:com.choicemaker.cm.modelmaker.gui.panels.HoldVsAccuracyPlotPanel.java

private void layoutPanel() {
    GridBagLayout layout = new GridBagLayout();
    setLayout(layout);/*from  w  w  w .  j  av a2 s  . c o m*/
    layout.columnWeights = new double[] { 1f, 0f };
    layout.columnWidths = new int[] { 200, 300 };
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(2, 2, 5, 10);

    //Row 0..........................................................
    //histo
    c.gridy = 0;
    c.gridx = 0;
    c.gridwidth = 1;
    c.weighty = 1;
    c.fill = GridBagConstraints.BOTH;
    ChartPanel p = new ChartPanel(chart, false, false, false, true, true);
    //      p.setHorizontalZoom(true);
    //      p.setVerticalZoom(true);
    add(p, c);

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setDividerSize(2);
    splitPane.setContinuousLayout(true);
    splitPane.setDividerLocation(0.5d);
    splitPane.setResizeWeight(0.5f);
    splitPane.setOneTouchExpandable(true);
    splitPane.setTopComponent(accuracyPanel);
    splitPane.setBottomComponent(hrPanel);

    c.gridx = 1;
    c.gridheight = 1;
    add(splitPane, c);
}

From source file:ja.lingo.application.gui.main.settings.dictionaries.add.AddPanel.java

public AddPanel(JDialog parentDialog, IEngine engine) {
    Arguments.assertNotNull("parentDialog", parentDialog);
    Arguments.assertNotNull("engine", engine);

    this.parentDialog = parentDialog;
    this.engine = engine;

    fileChooser = new FileChooser();

    encodingComboBox = new JComboBox();
    encodingAutoComboBox = new JComboBox(new String[] { resources.text("encoding_auto") });
    encodingAutoComboBox.setEnabled(false);

    encodingCardPanel = new CardPanel();
    encodingCardPanel.add(encodingComboBox);
    encodingCardPanel.add(encodingAutoComboBox);

    readerList = Components/*from   w ww. ja va  2 s .  co m*/
            .list(new StaticListModel<IDictionaryReader>(new ReaderLabelBuilder(), engine.getReaders()));
    readerList.setSelectedIndex(0);

    editorPane = Components.editorPane();
    editorPane.addHyperlinkListener(new HyperlinkListener() {
        public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                Browser.openUrl(e.getURL().toExternalForm());
            }
        }
    });

    continueButton = Buttons.continue1();
    continueButton.setDefaultCapable(true);

    closeButton = Buttons.cancel();

    JPanel buttonPanel = new JPanel(new GridLayout(1, 2, GAP5, GAP5));
    buttonPanel.add(continueButton);
    buttonPanel.add(closeButton);

    JPanel listReaderPanel = new JPanel(new BorderLayout());
    listReaderPanel.add(resources.label("reader"), BorderLayout.NORTH);
    listReaderPanel.add(new JScrollPane(readerList), BorderLayout.CENTER);

    readerList.setPreferredSize(new Dimension(50, 50));
    listReaderPanel.setPreferredSize(new Dimension(100, 100));

    JPanel descriptionReaderPanel = new JPanel(new BorderLayout());
    descriptionReaderPanel.add(resources.label("readerDescription"), BorderLayout.NORTH);
    descriptionReaderPanel.add(new JScrollPane(editorPane), BorderLayout.CENTER);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listReaderPanel, descriptionReaderPanel);
    splitPane.setContinuousLayout(true);
    splitPane.setDividerLocation(130);

    gui = new JPanel(new TableLayout(new double[][] { { TableLayout.PREFERRED, GAP5, TableLayout.FILL },
            { TableLayout.FILL, // 0: reader panel
                    GAP5, TableLayout.PREFERRED, // 2: file
                    GAP5, TableLayout.PREFERRED, // 4: encoding
                    GAP5 * 2, TableLayout.PREFERRED // 6: button panel
            } }));

    gui.add(splitPane, "0, 0, 2, 0");

    gui.add(resources.label("file"), "0, 2");
    gui.add(fileChooser.getGui(), "2, 2");

    gui.add(resources.label("encoding"), "0, 4");
    gui.add(encodingCardPanel.getGui(), "2, 4");

    gui.add(buttonPanel, "0, 6, 2, 6, right, center");

    Gaps.applyBorder7(gui);

    ActionBinder.bind(this);

    if (encodingComboBox.getModel().getSize() > 0) {
        encodingComboBox.setSelectedIndex(0);
    }

    // filters
    for (IDictionaryReader reader : engine.getReaders()) {
        fileChooser.getChooser().addChoosableFileFilter(reader.getFileFilter());
    }

    onReaderSelected();
    onFileFieldEdited();
}

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);/*from   w  ww.  j a  v a 2s .co  m*/
    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:hermes.browser.actions.AbstractFIXBrowserDocumentComponent.java

protected void init() {
    headerScrollPane.setViewportView(getHeaderComponent());

    bottomPanel.add(new FilterablePanel(), BorderLayout.NORTH);
    bottomPanel.add(getStatusPanel(), BorderLayout.SOUTH);

    getTopPanel().setLayout(new BorderLayout());

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);

    splitPane.setDividerLocation(200);/*from  www  .ja  v a2  s  .  co  m*/
    splitPane.setOneTouchExpandable(false);
    splitPane.setContinuousLayout(false);
    splitPane.add(headerScrollPane, "top");
    splitPane.add(messageTabbedPane, "bottom");

    messageTabbedPane.setTabPlacement(JTabbedPane.BOTTOM);

    getTopPanel().add(splitPane, BorderLayout.CENTER);
    getTopPanel().add(getBottomComponent(), BorderLayout.SOUTH);

    HermesBrowser.getBrowser().addDocumentComponent(this);

    addDocumentComponentListener(this);

    updateTableRows(true);
}

From source file:edu.ucla.stat.SOCR.chart.demo.PowerTransformHistogramChart.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);

    binSlider2 = new FloatSlider("Bin Size", 5, 1, 10);
    super.reset_BinSlider();
    binSlider2.setPreferredSize(new Dimension(CHART_SIZE_X / 2 + 150, 80));
    binSlider2.addObserver(this);
    binSlider2.setToolTipText("Slider for adjusting the bin size.");
    sliderPanel.add(this.binSlider2);

    mapDep = false;/*from  ww w.  jav a  2  s. c  o  m*/

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

    toolBar = new JToolBar();
    createActionComponents(toolBar);
    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:edu.ucla.stat.SOCR.chart.demo.PowerTransformationFamilyChart.java

public void init() {

    sliderPanel = new JPanel();

    // ValueSetter(String title, int type int min, int max, int initial,boolean minimumRange10) 
    powerSlider = new edu.ucla.stat.SOCR.util.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);

    mapDep = false;//from   ww w  .j a  va2  s  . co  m
    LEGEND_SWITCH = false;

    super.init();

    indLabel = new JLabel("X");
    depLabel = new JLabel("Y");

    toolBar = new JToolBar();
    createActionComponents(toolBar);
    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);

    depMax = 10; // max number of dependent var
    indMax = 10; // max number of independent var

}

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

public void init() {

    sliderPanel = new JPanel();

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

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

    super.init();

    toolBar = new JToolBar();
    createActionComponents(toolBar);/*from   w  w w  .jav  a 2 s.c  o  m*/
    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:mekhq.gui.FinancesTab.java

@Override
public void initTab() {
    resourceMap = ResourceBundle.getBundle("mekhq.resources.FinancesTab", new EncodeControl()); //$NON-NLS-1$

    GridBagConstraints gridBagConstraints;

    setLayout(new GridBagLayout());
    ChartPanel financeAmountPanel = (ChartPanel) createGraphPanel(GraphType.BALANCE_AMOUNT);
    ChartPanel financeMonthlyPanel = (ChartPanel) createGraphPanel(GraphType.MONTHLY_FINANCES);

    financeModel = new FinanceTableModel();
    financeTable = new JTable(financeModel);
    financeTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    financeTable.addMouseListener(new FinanceTableMouseAdapter(getCampaignGui(), financeTable, financeModel));
    financeTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    TableColumn column = null;//from   w  w w  . j a v a2  s  .co  m
    for (int i = 0; i < FinanceTableModel.N_COL; i++) {
        column = financeTable.getColumnModel().getColumn(i);
        column.setPreferredWidth(financeModel.getColumnWidth(i));
        column.setCellRenderer(financeModel.getRenderer());
    }
    financeTable.setIntercellSpacing(new Dimension(0, 0));
    financeTable.setShowGrid(false);

    loanModel = new LoanTableModel();
    loanTable = new JTable(loanModel);
    loanTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    loanTable.addMouseListener(new LoanTableMouseAdapter(getCampaignGui(), loanTable, loanModel));
    loanTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    column = null;
    for (int i = 0; i < LoanTableModel.N_COL; i++) {
        column = loanTable.getColumnModel().getColumn(i);
        column.setPreferredWidth(loanModel.getColumnWidth(i));
        column.setCellRenderer(loanModel.getRenderer());
    }
    loanTable.setIntercellSpacing(new Dimension(0, 0));
    loanTable.setShowGrid(false);
    JScrollPane scrollLoanTable = new JScrollPane(loanTable);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    JPanel panBalance = new JPanel(new GridBagLayout());
    panBalance.add(new JScrollPane(financeTable), gridBagConstraints);
    panBalance.setMinimumSize(new java.awt.Dimension(350, 100));
    panBalance.setBorder(BorderFactory.createTitledBorder("Balance Sheet"));
    JPanel panLoan = new JPanel(new GridBagLayout());
    panLoan.add(scrollLoanTable, gridBagConstraints);

    JTabbedPane financeTab = new JTabbedPane();
    financeTab.setMinimumSize(new java.awt.Dimension(450, 300));
    financeTab.setPreferredSize(new java.awt.Dimension(450, 300));

    JSplitPane splitFinances = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panBalance, financeTab);
    splitFinances.setOneTouchExpandable(true);
    splitFinances.setContinuousLayout(true);
    splitFinances.setResizeWeight(1.0);
    splitFinances.setName("splitFinances");

    financeTab.addTab(resourceMap.getString("activeLoans.text"), panLoan);
    financeTab.addTab(resourceMap.getString("cbillsBalanceTime.text"), financeAmountPanel);
    financeTab.addTab(resourceMap.getString("monthlyRevenueExpenditures.text"), financeMonthlyPanel);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(splitFinances, gridBagConstraints);

    JPanel panelFinanceRight = new JPanel(new BorderLayout());

    JPanel pnlFinanceBtns = new JPanel(new GridLayout(2, 2));
    btnAddFunds = new JButton("Add Funds (GM)");
    btnAddFunds.addActionListener(ev -> addFundsActionPerformed());
    btnAddFunds.setEnabled(getCampaign().isGM());
    pnlFinanceBtns.add(btnAddFunds);
    JButton btnGetLoan = new JButton("Get Loan");
    btnGetLoan.addActionListener(e -> showNewLoanDialog());
    pnlFinanceBtns.add(btnGetLoan);

    btnManageAssets = new JButton("Manage Assets (GM)");
    btnManageAssets.addActionListener(e -> manageAssets());
    btnManageAssets.setEnabled(getCampaign().isGM());
    pnlFinanceBtns.add(btnManageAssets);

    panelFinanceRight.add(pnlFinanceBtns, BorderLayout.NORTH);

    areaNetWorth = new JTextArea();
    areaNetWorth.setLineWrap(true);
    areaNetWorth.setWrapStyleWord(true);
    areaNetWorth.setFont(new Font("Courier New", Font.PLAIN, 12));
    areaNetWorth.setText(getCampaign().getFinancialReport());
    areaNetWorth.setEditable(false);

    JScrollPane descriptionScroll = new JScrollPane(areaNetWorth);
    panelFinanceRight.add(descriptionScroll, BorderLayout.CENTER);
    areaNetWorth.setCaretPosition(0);
    descriptionScroll.setMinimumSize(new Dimension(300, 200));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 0.0;
    gridBagConstraints.weighty = 1.0;
    add(panelFinanceRight, gridBagConstraints);
}

From source file:edu.ucla.stat.SOCR.chart.SuperPowerChart.java

public void init() {

    indLabel = new JLabel("X");
    depLabel = new JLabel("Y");

    super.init();

    sliderPanel = new JPanel();
    powerSlider = new edu.ucla.stat.SOCR.util.FloatSlider("Power", 1.0, -10.0, 10.0);
    powerSlider.setPreferredSize(new Dimension(CHART_SIZE_X + 150, 80));
    powerSlider.addObserver(this);
    powerSlider.setToolTipText("Slider for adjusting the value of power.");
    sliderPanel.add(this.powerSlider);
    /* toolBarPanel.add(sliderPanel);
            /*from   w  w w .  j  a  v  a 2s . c om*/
    toolBarPanel = new JPanel();
    JScrollPane toolBarContainer = new JScrollPane(toolBarPanel);      
    toolBarPanel.setLayout(new BoxLayout(graphPanel, BoxLayout.Y_AXIS));*/
    // Create the toolBar

    toolBar = new JToolBar();
    createActionComponents(toolBar);
    JPanel toolBarContainer = new JPanel();
    toolBarContainer.add(toolBar);
    //toolBarPanel.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);

    depMax = 50; // max number of dependent var
    indMax = 50; // max number of independent var

    updateStatus(url);

    resetExample();
    validate();

}