use of org.compiere.apps.ALayout in project adempiere by adempiere.
the class InfoGeneral method statInit.
/**
* Static Setup - add fields to parameterPanel (GridLayout)
*/
private void statInit() {
label1.setLabelFor(textField1);
label1.setText("Label1");
label1.setHorizontalAlignment(JLabel.LEADING);
textField1.setBackground(AdempierePLAF.getInfoBackground());
label2.setLabelFor(textField2);
label2.setText("Label2");
label2.setHorizontalAlignment(JLabel.LEADING);
textField2.setBackground(AdempierePLAF.getInfoBackground());
label3.setLabelFor(textField3);
label3.setText("Label3");
label3.setHorizontalAlignment(JLabel.LEADING);
textField3.setBackground(AdempierePLAF.getInfoBackground());
label4.setLabelFor(textField4);
label4.setText("Label4");
label4.setHorizontalAlignment(JLabel.LEADING);
textField4.setBackground(AdempierePLAF.getInfoBackground());
//
p_criteriaGrid.setLayout(new ALayout());
p_criteriaGrid.add(label1, new ALayoutConstraint(0, 0));
p_criteriaGrid.add(label2, null);
p_criteriaGrid.add(label3, null);
p_criteriaGrid.add(label4, null);
//
p_criteriaGrid.add(textField1, new ALayoutConstraint(1, 0));
p_criteriaGrid.add(textField2, null);
p_criteriaGrid.add(textField3, null);
p_criteriaGrid.add(textField4, null);
}
use of org.compiere.apps.ALayout in project adempiere by adempiere.
the class PAttributeInstance method jbInit.
/**
* Static Init
* @throws Exception
*/
private void jbInit() throws Exception {
mainPanel.setLayout(mainLayout);
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
// North
northPanel.setLayout(new ALayout());
northPanel.add(showAll, new ALayoutConstraint(0, 0));
showAll.addActionListener(this);
this.getContentPane().add(northPanel, BorderLayout.NORTH);
// Center
mainPanel.add(centerScrollPane, BorderLayout.CENTER);
centerScrollPane.getViewport().add(m_table, null);
// South
mainPanel.add(confirmPanel, BorderLayout.SOUTH);
mainPanel.setPreferredSize(new Dimension(SCREEN_WIDTH, SCREEN_HEIGHT));
confirmPanel.addActionListener(this);
}
use of org.compiere.apps.ALayout in project adempiere by adempiere.
the class InfoPAttribute method jbInit.
//
/**
* Static Init
* @throws Exception
*/
private void jbInit() throws Exception {
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
mainPanel.setLayout(mainLayout);
mainPanel.add(centerPanel, BorderLayout.CENTER);
mainPanel.add(scrollPane, BorderLayout.CENTER);
centerPanel.setLayout(new ALayout());
scrollPane.getViewport().add(centerPanel, null);
// ConfirmPanel
confirmPanel.addActionListener(this);
mainPanel.add(confirmPanel, BorderLayout.SOUTH);
}
use of org.compiere.apps.ALayout in project adempiere by adempiere.
the class InfoInvoice method statInit.
/**
* Static Setup - add fields to parameterPanel
*/
private void statInit() {
lDocumentNo.setLabelFor(fDocumentNo);
fDocumentNo.setBackground(AdempierePLAF.getInfoBackground());
fDocumentNo.addActionListener(this);
lDescription.setLabelFor(fDescription);
fDescription.setBackground(AdempierePLAF.getInfoBackground());
fDescription.addActionListener(this);
fIsPaid.setSelected(false);
fIsPaid.addActionListener(this);
fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));
fIsSOTrx.addActionListener(this);
//
// C_Invoice.C_BPartner_ID
fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInvoice.Table_Name, MInvoice.COLUMNNAME_C_BPartner_ID), DisplayType.Search));
lBPartner_ID.setLabelFor(fBPartner_ID);
fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground());
fBPartner_ID.addActionListener(this);
// C_Invoice.C_Order_ID
fOrder_ID = new VLookup("C_Order_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInvoice.Table_Name, MInvoice.COLUMNNAME_C_Order_ID), DisplayType.Search));
lOrder_ID.setLabelFor(fOrder_ID);
fOrder_ID.setBackground(AdempierePLAF.getInfoBackground());
fOrder_ID.addActionListener(this);
//
lDateFrom.setLabelFor(fDateFrom);
fDateFrom.setBackground(AdempierePLAF.getInfoBackground());
fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom"));
lDateTo.setLabelFor(fDateTo);
fDateTo.setBackground(AdempierePLAF.getInfoBackground());
fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo"));
lAmtFrom.setLabelFor(fAmtFrom);
fAmtFrom.setBackground(AdempierePLAF.getInfoBackground());
fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom"));
lAmtTo.setLabelFor(fAmtTo);
fAmtTo.setBackground(AdempierePLAF.getInfoBackground());
fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo"));
//
CPanel amtPanel = new CPanel();
CPanel datePanel = new CPanel();
amtPanel.setLayout(new ALayout(0, 0, true));
amtPanel.add(fAmtFrom, new ALayoutConstraint(0, 0));
amtPanel.add(lAmtTo, null);
amtPanel.add(fAmtTo, null);
datePanel.setLayout(new ALayout(0, 0, true));
datePanel.add(fDateFrom, new ALayoutConstraint(0, 0));
datePanel.add(lDateTo, null);
datePanel.add(fDateTo, null);
// First Row
p_criteriaGrid.add(lDocumentNo, new ALayoutConstraint(0, 0));
p_criteriaGrid.add(fDocumentNo, null);
p_criteriaGrid.add(lBPartner_ID, null);
p_criteriaGrid.add(fBPartner_ID, null);
p_criteriaGrid.add(fIsSOTrx, new ALayoutConstraint(0, 5));
// 2nd Row
p_criteriaGrid.add(lDescription, new ALayoutConstraint(1, 0));
p_criteriaGrid.add(fDescription, null);
p_criteriaGrid.add(lDateFrom, null);
p_criteriaGrid.add(datePanel, null);
p_criteriaGrid.add(fIsPaid, new ALayoutConstraint(1, 5));
// 3rd Row
p_criteriaGrid.add(lOrder_ID, new ALayoutConstraint(2, 0));
p_criteriaGrid.add(fOrder_ID, null);
p_criteriaGrid.add(lAmtFrom, null);
p_criteriaGrid.add(amtPanel, null);
m_sqlSchedule = scheduleTbl.prepareTable(s_subLayout, s_subFrom, s_subWhere, false, "i");
scheduleTbl.setRowSelectionAllowed(true);
scheduleTbl.setMultiSelection(false);
scheduleTbl.addMouseListener(this);
scheduleTbl.setShowTotals(true);
scheduleTbl.autoSize();
tablePanel.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 255 : 110));
tablePanel.setLayout(new BorderLayout());
tablePanel.add(new JScrollPane(scheduleTbl), BorderLayout.CENTER);
// Add the details to the p_detailPanel
p_detailTaskPane.setTitle(Msg.translate(Env.getCtx(), "C_InvoicePaySchedule_ID"));
p_detailTaskPane.add(tablePanel, BorderLayout.CENTER);
p_detailTaskPane.setVisible(true);
}
use of org.compiere.apps.ALayout in project adempiere by adempiere.
the class Info method jbInit.
/**
* Static Init
* @throws Exception
*/
protected void jbInit() throws Exception {
this.getContentPane().add(parameterPanel, BorderLayout.NORTH);
this.getContentPane().add(scrollPane, BorderLayout.CENTER);
this.getContentPane().add(southPanel, BorderLayout.SOUTH);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//
AppsAction aa = new AppsAction(ConfirmPanel.A_RESET, null, "reset");
bReset = (CButton) aa.getButton();
bReset.setMargin(ConfirmPanel.s_insets);
bReset.setSize(bReset.getHeight(), bReset.getHeight());
Dimension bSize = bReset.getSize();
bSize.height = bReset.getHeight();
bSize.width = bReset.getHeight();
// Make it square
bReset.setMaximumSize(bSize);
bReset.addActionListener(this);
//
buttonPanel = new CPanel(new FlowLayout(FlowLayout.LEFT));
buttonPanel.add(bReset, FlowLayout.LEFT);
//
// p_criteriaGrid is filled by the subordinate class
p_criteriaGrid.setLayout(new ALayout());
//
parameterPanel.setLayout(new BorderLayout());
parameterPanel.add(buttonPanel, BorderLayout.WEST);
parameterPanel.add(p_criteriaGrid, BorderLayout.CENTER);
//
// Setup the detail panel if used
p_detailTaskPane.setVisible(false);
p_detailTaskPane.setCollapsed(true);
p_detailTaskPane.setLayout(new BorderLayout());
p_detailTaskPane.setUI(new AdempiereTaskPaneUI());
p_detailTaskPane.getContentPane().setBackground(new ColorUIResource(251, 248, 241));
p_detailTaskPane.getContentPane().setForeground(new ColorUIResource(251, 0, 0));
addonPanel.setLayout(new BorderLayout());
// Allow auto resizing of the panel
addonPanel.add(p_detailTaskPane, BorderLayout.CENTER);
southPanel.setLayout(southLayout);
southPanel.add(addonPanel, BorderLayout.NORTH);
southPanel.add(confirmPanel, BorderLayout.CENTER);
southPanel.add(statusBar, BorderLayout.SOUTH);
scrollPane.getViewport().add(p_table, null);
//
confirmPanel.addActionListener(this);
confirmPanel.getResetButton().setVisible(hasReset());
confirmPanel.getCustomizeButton().setVisible(hasCustomize());
confirmPanel.getHistoryButton().setVisible(hasHistory());
confirmPanel.getZoomButton().setVisible(hasZoom());
// Only show the OK button if we intend to save
confirmPanel.setOKVisible(p_saveResults);
//
JButton print = ConfirmPanel.createPrintButton(true);
print.addActionListener(this);
confirmPanel.addButton(print);
//
checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setName("AutoQuery");
checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
checkAutoQuery.addActionListener(this);
// Index 0 is OK-Cancel on the right
CPanel leftButtons = (CPanel) confirmPanel.getComponent(1);
// Add the check box on the very left before the refresh icon
leftButtons.add(checkAutoQuery, 0);
//
popup.add(zoomMenu);
zoomMenu.setText(Msg.getMsg(Env.getCtx(), "Zoom"));
zoomMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Zoom16.gif")));
zoomMenu.addActionListener(this);
//
popup.add(calcMenu);
calcMenu.setText(Msg.getMsg(Env.getCtx(), "Calculator"));
calcMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Calculator16.gif")));
calcMenu.addActionListener(this);
//
// Table Selection (Invoked before setting column class so that row selection is enabled)
p_table.setKeyColumnIndex(-1);
p_table.setCellSelectionEnabled(false);
p_table.setColumnSelectionAllowed(false);
p_table.setRowSelectionAllowed(true);
// Override the Enter key input and action map
if (p_saveResults) {
p_table.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "doDispose");
} else {
p_table.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "doNothing");
}
p_table.getActionMap().put("doDispose", doDispose);
// To enable buttons
((ListSelectionModel) p_table.getSelectionModel()).addListSelectionListener(this);
p_table.addMouseListener(this);
// Listen to changes in the table
p_table.addPropertyChangeListener("p_table_update", this);
((ListSelectionModel) p_table.getSelectionModel()).addListSelectionListener(this);
//
// Set default location where focus will go. See property change listener.
m_parentPanel = p_criteriaGrid;
//
enableButtons();
}
Aggregations