Search in sources :

Example 6 with CScrollPane

use of org.compiere.swing.CScrollPane in project adempiere by adempiere.

the class DeleteSelection method initComponents.

/**
	 * Init Components
	 */
private void initComponents() {
    mainPanel = new CPanel(new BorderLayout(0, 0));
    confirmPanel = new ConfirmPanel(true);
    mainDialog.getContentPane().add(mainPanel);
    //	Add Components
    list = new JList<String>();
    CScrollPane scrollPane = new CScrollPane(list);
    // FR [ 2877111 ]
    list.setListData(getData());
    list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    JEditorPane message = new JEditorPane();
    //	Description
    message.setContentType("text/html");
    message.setEditable(false);
    message.setBackground(Color.white);
    message.setFocusable(true);
    message.setBackground(mainPanel.getBackground());
    message.setText(Msg.getMsg(Env.getCtx(), "DeleteSelectionDescription"));
    //	Add to main panel
    mainPanel.add(message, BorderLayout.NORTH);
    mainPanel.add(scrollPane, BorderLayout.CENTER);
    mainPanel.add(confirmPanel, BorderLayout.SOUTH);
    confirmPanel.addActionListener(this);
    //	Default Selected
    if (isDefaultSelected() && getSelection() != null) {
        list.setSelectedIndices(getSelection());
    }
}
Also used : BorderLayout(java.awt.BorderLayout) CScrollPane(org.compiere.swing.CScrollPane) CPanel(org.compiere.swing.CPanel) JEditorPane(javax.swing.JEditorPane)

Example 7 with CScrollPane

use of org.compiere.swing.CScrollPane in project lar_361 by comitsrl.

the class SubCurrentLine method init.

/**
 * Initialize
 */
public void init() {
    // Content
    setLayout(new MigLayout("fill, ins 0 0"));
    String buttonSize = "w 50!, h 50!,";
    // 
    f_bSearch = createButtonAction("Product", KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.CTRL_MASK));
    f_bSearch.setName("ProductSearch");
    add(f_bSearch, buttonSize);
    CLabel productLabel = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID"));
    add(productLabel, ", flowy, h 15");
    f_productName = new PosTextField(Msg.translate(Env.getCtx(), "M_Product_ID"), p_posPanel, p_pos.getOSK_KeyLayout_ID());
    f_productName.setName("ProductInput");
    f_productName.addActionListener(this);
    f_productName.addFocusListener(this);
    f_productName.requestFocusInWindow();
    add(f_productName, "spanx 4, growx, pushx, h 25!");
    // PAYMENT
    add(new CLabel(), "");
    f_cashPayment = createButtonAction("Payment", null);
    f_cashPayment.setActionCommand("Payment");
    add(f_cashPayment, "w 75!, h 50!, pushx, wrap");
    f_cashPayment.setEnabled(false);
    m_table = new PosTable();
    CScrollPane scroll = new CScrollPane(m_table);
    m_sql = m_table.prepareTable(s_layout, s_sqlFrom, s_sqlWhere, false, "C_Order_LineTax_v") + " ORDER BY Line";
    // m_table.addMouseListener(this);
    m_table.getSelectionModel().addListSelectionListener(this);
    m_table.setColumnVisibility(m_table.getColumn(0), false);
    m_table.getColumn(1).setPreferredWidth(220);
    m_table.getColumn(2).setPreferredWidth(75);
    m_table.getColumn(3).setPreferredWidth(35);
    m_table.getColumn(4).setPreferredWidth(80);
    m_table.getColumn(5).setPreferredWidth(80);
    m_table.getColumn(6).setPreferredWidth(30);
    m_table.setFocusable(false);
    // @Trifon
    m_table.setFillsViewportHeight(true);
    m_table.growScrollbars();
    add(scroll, "growx, spanx, growy, pushy, h 200:300:");
    f_up = createButtonAction("Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0));
    add(f_up, buttonSize);
    f_down = createButtonAction("Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0));
    add(f_down, buttonSize);
    // Product Attributes
    f_productAttr = createButtonAction("PAttribute", KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
    add(f_productAttr, buttonSize);
    f_delete = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, Event.SHIFT_MASK));
    add(f_delete, buttonSize);
    // 
    f_minus = createButtonAction("Minus", null);
    add(f_minus, buttonSize);
    CLabel qtyLabel = new CLabel(Msg.translate(Env.getCtx(), "QtyOrdered"));
    add(qtyLabel, "split 2, flowy, h 15");
    // 
    f_quantity = new PosTextField(Msg.translate(Env.getCtx(), "QtyOrdered"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), DisplayType.getNumberFormat(DisplayType.Quantity));
    f_quantity.setHorizontalAlignment(JTextField.TRAILING);
    f_quantity.addActionListener(this);
    add(f_quantity, "h 30:30:, w 100");
    setQty(Env.ONE);
    // 
    f_plus = createButtonAction("Plus", null);
    add(f_plus, buttonSize);
    CLabel priceLabel = new CLabel(Msg.translate(Env.getCtx(), "PriceActual"));
    add(priceLabel, "split 2, flowy, h 15");
    // 
    f_price = new PosTextField(Msg.translate(Env.getCtx(), "PriceActual"), p_posPanel, p_pos.getOSNP_KeyLayout_ID(), DisplayType.getNumberFormat(DisplayType.Amount));
    f_price.addActionListener(this);
    f_price.addFocusListener(this);
    f_price.setHorizontalAlignment(JTextField.TRAILING);
    add(f_price, "h 30, w 100, wrap");
    setPrice(Env.ZERO);
    enableButtons();
}
Also used : CLabel(org.compiere.swing.CLabel) CScrollPane(org.compiere.swing.CScrollPane) MigLayout(net.miginfocom.swing.MigLayout)

Example 8 with CScrollPane

use of org.compiere.swing.CScrollPane in project adempiere by adempiere.

the class ViewPI method init.

/**
	 * 	Init
	 *	@param WindowNo
	 *	@param frame
	 */
public void init(int WindowNo, FormFrame frame) {
    log.fine("");
    m_WindowNo = WindowNo;
    m_frame = frame;
    try {
        //	Top Selection Panel
        //	m_frame.getContentPane().add(selectionPanel, BorderLayout.NORTH);
        //	Center
        initPanel();
        CScrollPane scroll = new CScrollPane(this);
        m_frame.getContentPane().add(scroll, BorderLayout.CENTER);
        //	South
        confirmPanel.addActionListener(this);
        m_frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH);
    } catch (Exception e) {
        log.log(Level.SEVERE, "", e);
    }
    sizeIt();
}
Also used : CScrollPane(org.compiere.swing.CScrollPane)

Example 9 with CScrollPane

use of org.compiere.swing.CScrollPane in project adempiere by adempiere.

the class POSQuery method initMainPanel.

/**
	 * Init Main Panel
	 * @return void
	 */
private void initMainPanel() {
    statusBarInfo = "";
    //	Instance Panel
    setLayout(new GridBagLayout());
    //	For Table
    posTable = new POSTable();
    mainPanel = new CPanel(new GridBagLayout());
    mainPanel.setFocusCycleRoot(true);
    statusBar = new StatusBar();
    posTable.growScrollbars();
    parameterPanel = new CPanel(new GridBagLayout());
    centerScroll = new CScrollPane(posTable);
    confirmPanel = new CPanel(new GridBagLayout());
    //	
    centerScroll.setPreferredSize(new Dimension(800, 400));
    //	
    //	Create Buttons
    buttonNew = createButtonAction("New", KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));
    buttonEdit = createButtonAction("Edit", KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0));
    buttonReset = createButtonAction("Reset", KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0));
    buttonRefresh = createButtonAction("Refresh", KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
    buttonCancel = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0));
    buttonOk = createButtonAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
    //	
    confirmPanel.add(buttonNew, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
    confirmPanel.add(buttonEdit, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
    confirmPanel.add(buttonReset, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
    confirmPanel.add(buttonRefresh, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
    confirmPanel.add(buttonOk, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
    confirmPanel.add(buttonCancel, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
    //	Add To Main Panel
    mainPanel.add(parameterPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
    mainPanel.add(centerScroll, new GridBagConstraints(0, 1, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
    mainPanel.add(confirmPanel, new GridBagConstraints(0, 2, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
    mainPanel.add(statusBar, new GridBagConstraints(0, 3, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
    //	Add Main Panel to Content
    getContentPane().add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    //	Visible New and Edit
    buttonNew.setVisible(false);
    buttonEdit.setVisible(false);
    // Enable Button Edit
    buttonEdit.setEnabled(false);
    //	Add Listener
    posTable.addMouseListener(this);
    posTable.addKeyListener(this);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) POSTable(org.adempiere.pos.POSTable) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) CScrollPane(org.compiere.swing.CScrollPane) CPanel(org.compiere.swing.CPanel) Dimension(java.awt.Dimension) StatusBar(org.compiere.apps.StatusBar)

Example 10 with CScrollPane

use of org.compiere.swing.CScrollPane in project adempiere by adempiere.

the class POSOrderLinePanel method init.

@Override
public void init() {
    //	Content
    setLayout(new BorderLayout());
    posTable = new POSTable();
    orderLineTableHandle = new POSOrderLineTableHandle(posTable);
    CScrollPane scroll = new CScrollPane(posTable);
    scroll.addKeyListener(this);
    orderLineTableHandle.prepareTable();
    posTable.getModel().addTableModelListener(this);
    posTable.addKeyListener(this);
    posTable.addMouseListener(this);
    //@Trifon
    posTable.setFillsViewportHeight(true);
    posTable.growScrollbars();
    setMaximumSize(new Dimension(50, 50));
    setPreferredSize(new Dimension(50, 50));
    add(scroll, BorderLayout.CENTER);
    addKeyListener(this);
}
Also used : BorderLayout(java.awt.BorderLayout) POSOrderLineTableHandle(org.adempiere.pos.service.POSOrderLineTableHandle) CScrollPane(org.compiere.swing.CScrollPane) Dimension(java.awt.Dimension)

Aggregations

CScrollPane (org.compiere.swing.CScrollPane)15 CPanel (org.compiere.swing.CPanel)9 Dimension (java.awt.Dimension)8 MigLayout (net.miginfocom.swing.MigLayout)6 CLabel (org.compiere.swing.CLabel)5 BorderLayout (java.awt.BorderLayout)3 TitledBorder (javax.swing.border.TitledBorder)3 Color (java.awt.Color)2 Font (java.awt.Font)2 Insets (java.awt.Insets)2 HashMap (java.util.HashMap)2 MImage (org.compiere.model.MImage)2 MPOSKey (org.compiere.model.MPOSKey)2 MPOSKeyLayout (org.compiere.model.MPOSKeyLayout)2 MPrintColor (org.compiere.print.MPrintColor)2 MPrintFont (org.compiere.print.MPrintFont)2 CButton (org.compiere.swing.CButton)2 FlowLayout (java.awt.FlowLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1