Search in sources :

Example 1 with StatusBar

use of org.compiere.apps.StatusBar 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)

Aggregations

Dimension (java.awt.Dimension)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 POSTable (org.adempiere.pos.POSTable)1 StatusBar (org.compiere.apps.StatusBar)1 CPanel (org.compiere.swing.CPanel)1 CScrollPane (org.compiere.swing.CScrollPane)1