📄 awindow.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.apps;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import java.sql.*;
import org.compiere.apps.*;
import org.compiere.model.*;
import org.compiere.util.*;
import org.compiere.plaf.*;
/**
* Main Application Window.
* - Constructs, initializes and positions JFrame
* - Gets content, menu, title from APanel
*
* @author Jorg Janke
* @version $Id: AWindow.java,v 1.20 2002/11/18 06:09:26 jjanke Exp $
*/
public class AWindow extends JFrame
{
/**
* Standard Constructor - requires initWindow
*/
public AWindow ()
{
super();
this.setIconImage(org.compiere.Compiere.getImage16());
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
CompiereColor.setBackground(this);
} // AWindow
/** The GlassPane */
private AGlassPane m_glassPane = new AGlassPane();
/** Application Window */
private APanel m_APanel = new APanel();
/**
* Dynamic Initialization Workbench
* @param AD_Workbench_ID workbench
* @param isSOTrx sales trx
* @return true if loaded OK
*/
protected boolean initWorkbench (int AD_Workbench_ID, boolean isSOTrx)
{
this.setName("AWindow_WB_" + AD_Workbench_ID);
boolean loadedOK = m_APanel.initPanel (AD_Workbench_ID, 0, null, isSOTrx);
//
commonInit();
return loadedOK;
} // initWorkbench
/**
* Dynamic Initialization Single Window
* @param AD_Window_ID window
* @param query query
* @param isSOTrx sales trx
* @return true if loaded OK
*/
public boolean initWindow (int AD_Window_ID, MQuery query, boolean isSOTrx)
{
this.setName("AWindow_" + AD_Window_ID);
//
boolean loadedOK = m_APanel.initPanel (0, AD_Window_ID, query, isSOTrx);
commonInit();
return loadedOK;
} // initWindow
/**
* Common Init
*/
private void commonInit()
{
this.setJMenuBar(m_APanel.getMenuBar());
this.getContentPane().add(m_APanel, BorderLayout.CENTER);
this.setTitle(m_APanel.getTitle());
//
this.setGlassPane(m_glassPane);
} // commonInit
/*************************************************************************/
/**
* Set Window Busy
* @param busy busy
*/
public void setBusy (boolean busy)
{
if (busy == m_glassPane.isVisible())
return;
Log.trace(Log.l1_User, "AWindow.setBusy - " + busy);
m_glassPane.setMessage(null);
m_glassPane.setVisible(busy);
m_glassPane.requestFocus();
} // setBusy
/**
* Set Busy Message
* @param AD_Message message
*/
public void setBusyMessage (String AD_Message)
{
m_glassPane.setMessage(AD_Message);
} // setBusyMessage
/**
* Set and start Busy Counter
* @param time in seconds
*/
public void setBusyTimer (int time)
{
m_glassPane.setBusyTimer (time);
} // setBusyTimer
/**
* Window Events
* @param e event
*/
protected void processWindowEvent(WindowEvent e)
{
super.processWindowEvent(e);
// System.out.println(">> Apps WE_" + e.getID() // + " Frames=" + getFrames().length
// + " " + e);
} // processWindowEvent
/**
* Dispose
*/
public void dispose()
{
Log.trace(Log.l1_User, "AWindow.dispose");
if (m_APanel != null)
m_APanel.dispose();
m_APanel = null;
this.removeAll();
super.dispose();
// System.gc();
} // dispose
/**
* String Representation
* @return Name
*/
public String toString()
{
return getName();
} // toString
} // AWindow
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -