Search in sources :

Example 16 with Box

use of javax.swing.Box in project adempiere by adempiere.

the class PAPanel method init.

/**
	 * 	Static/Dynamic Init
	 */
private void init() {
    /* BOXES:
		 * 
		 *  boxV   Header
		 *        ********
		 *          boxH
		 *
		 *  boxH  *		  *       *
		 *  	  * boxV1 * boxV2 *  
		 *        *       *       *
		 *
		 *  boxV1   dial1
		 *        ********
		 *          dial2
		 *          
		 *  boxV2   HTML
		 *        ********
		 *          boxH1
		 *        
		 *  boxH1 *		  *       *
		 *  	  * bar1  * bar2  *  
		 *        *       *       *
		 *        
		 *        
		 *   V1 + HTML in scrollpane
		 */
    this.setLayout(new BorderLayout());
    // HEADER
    Box boxV = Box.createVerticalBox();
    // DIALS/HTML+Bars
    Box boxH = Box.createHorizontalBox();
    // DIALS
    Box boxV1 = Box.createVerticalBox();
    // HTML/Bars
    Box boxV2 = Box.createVerticalBox();
    // barChart
    Box boxH1 = Box.createHorizontalBox();
    //boxH_V.setPreferredSize(new Dimension(180, 1500));
    //boxH1.setPreferredSize(new Dimension(400, 180));		
    boxV2.setPreferredSize(new Dimension(120, 120));
    // DIALS below HEADER, LEFT
    for (int i = 0; i < m_goals.length; i++) {
        PerformanceIndicator pi = new PerformanceIndicator(m_goals[i]);
        pi.addActionListener(this);
        boxV1.add(pi, BorderLayout.NORTH);
    }
    boxV1.add(Box.createVerticalGlue(), BorderLayout.CENTER);
    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.getViewport().add(boxV1, BorderLayout.CENTER);
    scrollPane.setMinimumSize(new Dimension(190, 180));
    // RIGHT, HTML + Bars
    HtmlDashboard contentHtml = new HtmlDashboard("http:///local/home", m_goals, true);
    boxV2.add(contentHtml, BorderLayout.CENTER);
    for (int i = 0; i < java.lang.Math.min(2, m_goals.length); i++) {
        if (//MGoal goal = pi.getGoal();
        m_goals[i].getMeasure() != null)
            boxH1.add(new Graph(m_goals[i]), BorderLayout.SOUTH);
    }
    boxV2.add(boxH1, BorderLayout.SOUTH);
    // below HEADER
    boxH.add(scrollPane, BorderLayout.WEST);
    //space
    boxH.add(Box.createHorizontalStrut(5));
    boxH.add(boxV2, BorderLayout.CENTER);
    // HEADER + below
    HtmlDashboard t = new HtmlDashboard("http:///local/logo", null, false);
    t.setMaximumSize(new Dimension(2000, 80));
    //t.setPreferredSize(new Dimension(200,10));
    //t.setMaximumSize(new Dimension(2000,10));
    boxV.add(t, BorderLayout.NORTH);
    //space		
    boxV.add(Box.createVerticalStrut(5));
    boxV.add(boxH, BorderLayout.CENTER);
    boxV.add(Box.createVerticalGlue());
    // WINDOW
    add(boxV, BorderLayout.CENTER);
}
Also used : JScrollPane(javax.swing.JScrollPane) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) Dimension(java.awt.Dimension)

Example 17 with Box

use of javax.swing.Box in project adempiere by adempiere.

the class Find method addSelectionColumn.

//	initFind
/**
	 * 	Add Selection Column to first Tab
	 * 	@param mField field
	 */
private void addSelectionColumn(GridField mField) {
    log.config(mField.getHeader());
    int displayLength = mField.getDisplayLength();
    if (displayLength > FIELDLENGTH)
        mField.setDisplayLength(FIELDLENGTH);
    else
        displayLength = 0;
    //	Editor
    VEditor editor = null;
    //#221
    VEditor editor2 = null;
    CLabel label = null;
    if (mField.isLookup()) {
        VLookup vl = new VLookup(mField.getColumnName(), false, false, true, mField.getLookup());
        //setting mField to avoid NPE
        vl.setField(mField);
        vl.setName(mField.getColumnName());
        editor = vl;
        //
        if (//	set it back
        displayLength > 0)
            mField.setDisplayLength(displayLength);
        //
        label = VEditorFactory.getLabel(mField);
        //m_sLine++;
        int lpos = 1;
        int fpos = 2;
        if (isTwoColumns) {
            if (!isPair) {
                lpos = 1;
                fpos = 2;
                m_sLine++;
            } else {
                lpos = 3;
                fpos = 4;
            }
        } else {
            lpos = 1;
            fpos = 2;
            m_sLine++;
        }
        if (//	may be null for Y/N
        label != null)
            scontentPanel.add(label, new GridBagConstraints(lpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0));
        scontentPanel.add((Component) editor, new GridBagConstraints(fpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
    } else {
        if (mField.isRangeLookup()) {
            new Box(BoxLayout.X_AXIS);
            Box box = Box.createHorizontalBox();
            editor = VEditorFactory.getEditor(mField, false);
            label = VEditorFactory.getLabel(mField);
            editor.setMandatory(false);
            editor.setReadWrite(true);
            box.add((Component) editor);
            //#221
            editor2 = VEditorFactory.getEditor(mField, false);
            editor2.setMandatory(false);
            editor2.setReadWrite(true);
            if (editor2 instanceof CTextField) {
                ((CTextField) editor2).addActionListener(this);
            }
            CLabel separator = new CLabel(" - ");
            box.add(separator);
            box.add((Component) editor2);
            if (//	set it back
            displayLength > 0)
                mField.setDisplayLength(displayLength);
            int lpos = 1;
            int fpos = 2;
            if (isTwoColumns) {
                if (!isPair) {
                    lpos = 1;
                    fpos = 2;
                    m_sLine++;
                } else {
                    lpos = 3;
                    fpos = 4;
                }
            } else {
                lpos = 1;
                fpos = 2;
                m_sLine++;
            }
            if (//	may be null for Y/N
            label != null)
                scontentPanel.add(label, new GridBagConstraints(lpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0));
            scontentPanel.add((Component) box, new GridBagConstraints(fpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
        } else {
            editor = VEditorFactory.getEditor(mField, false);
            editor.setMandatory(false);
            editor.setReadWrite(true);
            label = VEditorFactory.getLabel(mField);
            //
            if (//	set it back
            displayLength > 0)
                mField.setDisplayLength(displayLength);
            int lpos = 1;
            int fpos = 2;
            if (isTwoColumns) {
                if (!isPair) {
                    lpos = 1;
                    fpos = 2;
                    m_sLine++;
                } else {
                    lpos = 3;
                    fpos = 4;
                }
            } else {
                lpos = 1;
                fpos = 2;
                m_sLine++;
            }
            //
            label = VEditorFactory.getLabel(mField);
            //m_sLine++;
            if (//	may be null for Y/N
            label != null)
                scontentPanel.add(label, new GridBagConstraints(lpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0));
            scontentPanel.add((Component) editor, new GridBagConstraints(fpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
        }
    }
    // Add action listener to custom text fields - teo_sarca [ 1709292 ]
    if (editor instanceof CTextField) {
        ((CTextField) editor).addActionListener(this);
    }
    m_sEditors.add(editor);
    // #221
    m_sEditors2.add(editor2);
}
Also used : CLabel(org.compiere.swing.CLabel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) CTextField(org.compiere.swing.CTextField) VLookup(org.compiere.grid.ed.VLookup) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) CComboBox(org.compiere.swing.CComboBox) VEditor(org.compiere.grid.ed.VEditor)

Example 18 with Box

use of javax.swing.Box in project jmeter by apache.

the class XPathAssertionGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout());
    setBorder(makeBorder());
    Box topBox = Box.createVerticalBox();
    topBox.add(makeTitlePanel());
    topBox.add(createScopePanel(true));
    xml = new XMLConfPanel();
    xml.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString(//$NON-NLS-1$
    "xpath_assertion_option")));
    topBox.add(xml);
    add(topBox, BorderLayout.NORTH);
    // USER_INPUT
    JPanel sizePanel = new JPanel(new BorderLayout());
    sizePanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
    sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), getXPathAttributesTitle()));
    xpath = new XPathPanel();
    sizePanel.add(xpath);
    add(sizePanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box)

Example 19 with Box

use of javax.swing.Box in project jmeter by apache.

the class XPathPanel method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout());
    Box hbox = Box.createHorizontalBox();
    hbox.add(Box.createHorizontalGlue());
    hbox.add(getNegatedCheckBox());
    hbox.add(Box.createHorizontalGlue());
    hbox.add(getCheckXPathButton());
    hbox.add(Box.createHorizontalGlue());
    add(JTextScrollPane.getInstance(getXPathField()), BorderLayout.CENTER);
    add(hbox, BorderLayout.SOUTH);
    setDefaultValues();
}
Also used : BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox)

Example 20 with Box

use of javax.swing.Box in project jmeter by apache.

the class ResultActionGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout());
    setBorder(makeBorder());
    Box box = Box.createVerticalBox();
    box.add(makeTitlePanel());
    errorPanel = new OnErrorPanel();
    box.add(errorPanel);
    add(box, BorderLayout.NORTH);
}
Also used : BorderLayout(java.awt.BorderLayout) OnErrorPanel(org.apache.jmeter.gui.OnErrorPanel) Box(javax.swing.Box)

Aggregations

Box (javax.swing.Box)192 JCheckBox (javax.swing.JCheckBox)95 JLabel (javax.swing.JLabel)93 JPanel (javax.swing.JPanel)87 Dimension (java.awt.Dimension)65 BorderLayout (java.awt.BorderLayout)51 JButton (javax.swing.JButton)48 JComboBox (javax.swing.JComboBox)46 JScrollPane (javax.swing.JScrollPane)42 BoxLayout (javax.swing.BoxLayout)38 ActionEvent (java.awt.event.ActionEvent)31 ActionListener (java.awt.event.ActionListener)28 JTextField (javax.swing.JTextField)25 EmptyBorder (javax.swing.border.EmptyBorder)19 Insets (java.awt.Insets)17 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)14 FlippingSplitPane (pcgen.gui2.tools.FlippingSplitPane)14 TitledBorder (javax.swing.border.TitledBorder)13 FilterBar (pcgen.gui2.filter.FilterBar)13 GridBagConstraints (java.awt.GridBagConstraints)12