1 14 package org.compiere.apps; 15 16 import java.awt.*; 17 import java.awt.event.*; 18 import java.util.*; 19 import javax.swing.*; 20 import java.sql.*; 21 22 import org.compiere.apps.*; 23 import org.compiere.model.*; 24 import org.compiere.util.*; 25 import org.compiere.plaf.*; 26 27 35 public class AWindow extends JFrame 36 { 37 40 public AWindow () 41 { 42 super(); 43 this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 45 CompiereColor.setBackground(this); 46 this.setIconImage(org.compiere.Compiere.getImage16()); 48 this.getContentPane().add(m_APanel, BorderLayout.CENTER); 49 this.setGlassPane(m_glassPane); 50 } 52 53 private AGlassPane m_glassPane = new AGlassPane(); 54 55 private APanel m_APanel = new APanel(); 56 57 63 protected boolean initWorkbench (int AD_Workbench_ID, boolean isSOTrx) 64 { 65 this.setName("AWindow_WB_" + AD_Workbench_ID); 66 boolean loadedOK = m_APanel.initPanel (AD_Workbench_ID, 0, null, isSOTrx); 67 commonInit(); 69 return loadedOK; 70 } 72 79 public boolean initWindow (int AD_Window_ID, MQuery query, boolean isSOTrx) 80 { 81 this.setName("AWindow_" + AD_Window_ID); 82 boolean loadedOK = m_APanel.initPanel (0, AD_Window_ID, query, isSOTrx); 84 commonInit(); 85 return loadedOK; 86 } 88 92 private void commonInit() 93 { 94 this.setJMenuBar(m_APanel.getMenuBar()); 95 this.setTitle(m_APanel.getTitle()); 96 } 98 99 100 104 public void setBusy (boolean busy) 105 { 106 if (busy == m_glassPane.isVisible()) 107 return; 108 Log.trace(Log.l1_User, "AWindow.setBusy - " + busy); 109 m_glassPane.setMessage(null); 110 m_glassPane.setVisible(busy); 111 m_glassPane.requestFocus(); 112 } 114 118 public void setBusyMessage (String AD_Message) 119 { 120 m_glassPane.setMessage(AD_Message); 121 } 123 127 public void setBusyTimer (int time) 128 { 129 m_glassPane.setBusyTimer (time); 130 } 132 136 protected void processWindowEvent(WindowEvent e) 137 { 138 super.processWindowEvent(e); 139 } 143 146 public void dispose() 147 { 148 Log.trace(Log.l1_User, "AWindow.dispose"); 149 if (m_APanel != null) 150 m_APanel.dispose(); 151 m_APanel = null; 152 this.removeAll(); 153 super.dispose(); 154 } 157 161 public String toString() 162 { 163 return getName(); 164 } 166 } | Popular Tags |