📄 acctviewer.java
字号:
/******************************************************************************
* The contents of this file are subject to the Compiere License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the License at http://www.compiere.org/license.html
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is Compiere ERP & CRM Business Solution
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
* Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
* created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
* Contributor(s): ______________________________________.
*****************************************************************************/
package org.compiere.acct;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.util.*;
import java.sql.*;
import org.compiere.apps.*;
import org.compiere.util.*;
import org.compiere.report.core.*;
import org.compiere.model.*;
import org.compiere.apps.search.*;
import org.compiere.grid.ed.*;
import org.compiere.plaf.*;
import org.compiere.swing.*;
/**
* Account Viewer
*
* @author Jorg Janke
* @version $Id: AcctViewer.java,v 1.19 2002/12/06 04:42:03 jjanke Exp $
*/
public class AcctViewer extends JFrame implements ActionListener, ChangeListener
{
/**
* Default constructor
*/
public AcctViewer()
{
this (0, 0, 0);
} // AcctViewer
/**
* Detail Constructor
*
* @param AD_Client_ID Client
* @param AD_Table_ID Table
* @param Record_ID Record
*/
public AcctViewer(int AD_Client_ID, int AD_Table_ID, int Record_ID)
{
super (Msg.getMsg(Env.getCtx(), "AcctViewer"));
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
m_data = new AcctViewerData(Env.createWindowNo(this), AD_Client_ID);
try
{
jbInit();
dynInit(AD_Table_ID, Record_ID);
AEnv.showCenterScreen(this);
}
catch(Exception e)
{
Log.error("AcctViewer", e);
dispose();
}
} // AcctViewer
/** State Info */
private AcctViewerData m_data = null;
/** @todo Display Record Info & Zoom */
//
private CPanel mainPanel = new CPanel();
private CTabbedPane tabbedPane = new CTabbedPane();
private CPanel query = new CPanel();
private BorderLayout mainLayout = new BorderLayout();
private JScrollPane result = new JScrollPane();
private ResultTable table = new ResultTable();
private CPanel southPanel = new CPanel();
private CButton bQuery = new CButton();
private CLabel statusLine = new CLabel();
private BorderLayout southLayout = new BorderLayout();
private BorderLayout queryLayout = new BorderLayout();
private CPanel selectionPanel = new CPanel();
private CPanel displayPanel = new CPanel();
private TitledBorder displayBorder;
private TitledBorder selectionBorder;
private GridBagLayout displayLayout = new GridBagLayout();
private CCheckBox displayQty = new CCheckBox();
private CCheckBox displaySourceAmt = new CCheckBox();
private CPanel graphPanel = new CPanel();
private CCheckBox displayDocumentInfo = new CCheckBox();
private CLabel lSort = new CLabel();
private CComboBox sortBy1 = new CComboBox();
private CComboBox sortBy2 = new CComboBox();
private CComboBox sortBy3 = new CComboBox();
private CCheckBox group1 = new CCheckBox();
private CCheckBox group2 = new CCheckBox();
private CCheckBox group3 = new CCheckBox();
private CLabel lGroup = new CLabel();
private GridBagLayout selectionLayout = new GridBagLayout();
private CComboBox selAcctSchema = new CComboBox();
private CCheckBox selDocument = new CCheckBox();
private CComboBox selTable = new CComboBox();
private CButton selRecord = new CButton();
private CLabel lOrg = new CLabel();
private CComboBox selOrg = new CComboBox();
private CLabel lAcct = new CLabel();
private CButton selAcct = new CButton();
private CLabel lDate = new CLabel();
private CLabel lacctSchema = new CLabel();
private VDate selDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom"));
private VDate selDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo"));
private CLabel lsel1 = new CLabel();
private CLabel lsel2 = new CLabel();
private CLabel lsel3 = new CLabel();
private CLabel lsel4 = new CLabel();
private CLabel lsel5 = new CLabel();
private CLabel lsel6 = new CLabel();
private CLabel lsel7 = new CLabel();
private CLabel lsel8 = new CLabel();
private CButton sel1 = new CButton();
private CButton sel2 = new CButton();
private CButton sel3 = new CButton();
private CButton sel4 = new CButton();
private CButton sel5 = new CButton();
private CButton sel6 = new CButton();
private CButton sel7 = new CButton();
private CButton sel8 = new CButton();
private CButton bRePost = new CButton();
private CComboBox sortBy4 = new CComboBox();
private CCheckBox group4 = new CCheckBox();
/**
* Static Init.
* <pre>
* - mainPanel
* - tabbedPane
* - query
* - result
* - graphPanel
* </pre>
* @throws Exception
*/
private void jbInit() throws Exception
{
CompiereColor.setBackground(this);
ImageIcon ii = new ImageIcon(org.compiere.Compiere.class.getResource("images/InfoAccount16.gif"));
setIconImage(ii.getImage());
//
mainLayout.setHgap(5);
mainLayout.setVgap(5);
mainPanel.setLayout(mainLayout);
selectionPanel.setLayout(selectionLayout);
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
mainPanel.add(tabbedPane, BorderLayout.CENTER);
// Selection
selectionBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(148, 145, 140)),"Selection");
selectionPanel.setBorder(selectionBorder);
lacctSchema.setLabelFor(selAcctSchema);
lacctSchema.setText(Msg.translate(Env.getCtx(), "C_AcctSchema_ID"));
selDocument.setText(Msg.getMsg(Env.getCtx(), "SelectDocument"));
selDocument.addActionListener(this);
lOrg.setLabelFor(selOrg);
lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
lAcct.setLabelFor(selAcct);
lAcct.setText(Msg.translate(Env.getCtx(), "Account_ID"));
lDate.setLabelFor(selDateFrom);
lDate.setText(Msg.translate(Env.getCtx(), "DateAcct"));
lsel1.setLabelFor(sel1);
lsel2.setLabelFor(sel2);
lsel3.setLabelFor(sel3);
lsel4.setLabelFor(sel4);
lsel5.setLabelFor(sel5);
lsel6.setLabelFor(sel6);
lsel7.setLabelFor(sel7);
lsel8.setLabelFor(sel8);
// Display
displayBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(148, 145, 140)),"Display");
displayPanel.setBorder(displayBorder);
displayPanel.setLayout(displayLayout);
displayQty.setText(Msg.getMsg(Env.getCtx(), "DisplayQty"));
displaySourceAmt.setText(Msg.getMsg(Env.getCtx(), "DisplaySourceInfo"));
displayDocumentInfo.setText(Msg.getMsg(Env.getCtx(), "DisplayDocumentInfo"));
lSort.setText(Msg.getMsg(Env.getCtx(), "SortBy"));
lGroup.setText(Msg.getMsg(Env.getCtx(), "GroupBy"));
//
displayPanel.add(displaySourceAmt, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(displayDocumentInfo, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(lSort, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(sortBy1, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(sortBy2, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(group1, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(group2, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(lGroup, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(displayQty, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
displayPanel.add(sortBy3, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(group3, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(sortBy4, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
displayPanel.add(group4, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
//
selectionPanel.add(selDocument, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(selTable, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
selectionPanel.add(selRecord, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
selectionPanel.add(lOrg, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0));
selectionPanel.add(selOrg, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lAcct, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(selAcct, new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(selAcctSchema, new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
selectionPanel.add(lacctSchema, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
selectionPanel.add(lDate, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
selectionPanel.add(selDateFrom, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
selectionPanel.add(selDateTo, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
selectionPanel.add(lsel1, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lsel2, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lsel3, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel1, new GridBagConstraints(1, 6, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel2, new GridBagConstraints(1, 7, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel3, new GridBagConstraints(1, 8, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lsel4, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel4, new GridBagConstraints(1, 9, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lsel5, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel5, new GridBagConstraints(1, 10, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lsel6, new GridBagConstraints(0, 11, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel6, new GridBagConstraints(1, 11, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lsel7, new GridBagConstraints(0, 12, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel7, new GridBagConstraints(1, 12, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(lsel8, new GridBagConstraints(0, 13, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
selectionPanel.add(sel8, new GridBagConstraints(1, 13, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
//
queryLayout.setHgap(5);
queryLayout.setVgap(5);
query.setLayout(queryLayout);
query.add(selectionPanel, BorderLayout.CENTER);
query.add(displayPanel, BorderLayout.EAST);
//
/** @todo ResultPane still in flat color */
// tabbedPane.add(query, Msg.getMsg(Env.getCtx(), "ViewerQuery"));
// tabbedPane.add(result, Msg.getMsg(Env.getCtx(), "ViewerResult"));
// tabbedPane.add(graphPanel, Msg.getMsg(Env.getCtx(), "ViewerGraph"));
tabbedPane.add(query, Msg.getMsg(Env.getCtx(), "ViewerQuery"));
tabbedPane.add(result, Msg.getMsg(Env.getCtx(), "ViewerResult"));
// tabbedPane.add(graphPanel, Msg.getMsg(Env.getCtx(), "ViewerGraph"));
tabbedPane.addChangeListener(this);
result.getViewport().add(table, null);
// South
southLayout.setHgap(5);
southLayout.setVgap(5);
southPanel.setLayout(southLayout);
statusLine.setForeground(Color.blue);
statusLine.setBorder(BorderFactory.createLoweredBevelBorder());
southPanel.add(statusLine, BorderLayout.CENTER);
bQuery.setIcon(new ImageIcon(org.compiere.Compiere.class.getResource("images/Refresh16.gif")));
bQuery.setToolTipText(Msg.getMsg(Env.getCtx(), "QueryExecute"));
bQuery.addActionListener(this);
bRePost.setText(Msg.getMsg(Env.getCtx(), "RePost"));
bRePost.setToolTipText(Msg.getMsg(Env.getCtx(), "RePostInfo"));
bRePost.addActionListener(this);
bRePost.setVisible(false);
southPanel.add(bQuery, BorderLayout.EAST);
southPanel.add(bRePost, BorderLayout.WEST);
this.getContentPane().add(southPanel, BorderLayout.SOUTH);
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -