📄 compiere.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 Smart Business Solution. The Initial
* Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
* are Copyright (C) 1999-2005 Jorg Janke.
* All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved.
* Contributor(s): ______________________________________.
*****************************************************************************/
package org.compiere;
import java.awt.*;
import java.io.*;
import java.net.*;
import javax.jnlp.*;
import javax.swing.*;
import org.compiere.db.*;
import org.compiere.model.*;
import org.compiere.plaf.*;
import org.compiere.util.*;
import com.qoppa.pdf.*;
/**
* Compiere Control Class
*
* @author Jorg Janke
* @version $Id: Compiere.java,v 1.98 2006/01/23 04:55:23 jjanke Exp $
*/
public final class Compiere
{
/** Timestamp */
static public final String ID = "$Id: Compiere.java,v 1.98 2006/01/23 04:55:23 jjanke Exp $";
/** Main Version String */
static public final String MAIN_VERSION = "Release 2.5.3b";
/** Detail Version as date Used for Client/Server */
static public final String DATE_VERSION = "2006-01-20";
/** Database Version as date Compared with AD_System */
static public final String DB_VERSION = "2006-01-20";
/** Product Name */
static public final String NAME = "Compiere\u00AE";
/** URL of Product */
static public final String URL = "www.compiere-china.com";
/** 16*16 Product Image.
/** Removing/modifying the Compiere logo is a violation of the license */
static private final String s_File16x16 = "images/C16.gif";
/** 32*32 Product Image.
/** Removing/modifying the Compiere logo is a violation of the license */
static private final String s_file32x32 = "images/C32.gif";
/** 100*30 Product Image.
/** Removing/modifying the Compiere logo is a violation of the license */
static private final String s_file100x30 = "images/C10030.png";
/** Removing/modifying the Compiere logo is a violation of the license */
static private final String s_file100x30HR = "images/C10030HR.png";
/** 48*15 Product Image.
/** Removing/modifying the Compiere logo is a violation of the license */
static private final String s_file48x15 = "images/Compiere.png";
/** Removing/modifying the Compiere logo is a violation of the license */
static private final String s_file48x15HR = "images/CompiereHR.png";
/** Support Email */
static private String s_supportEmail = "";
/** Subtitle */
static public final String SUB_TITLE = " Smart ERP & CRM ";
/** Compiere is a wordwide registered Trademark
* - Don't modify this - Program will fail unexpectedly */
static public final String COMPIERE_R = "Compiere\u00AE";
/** Copyright Notice - Don't modify this - Program will fail unexpectedly
* it also violates the license and you'll be held liable for any damage claims */
static public final String COPYRIGHT = "\u00A9 1999-2006 Compiere \u00AE";
static private String s_ImplementationVersion = null;
static private String s_ImplementationVendor = null;
static private Image s_image16;
static private Image s_image48x15;
static private Image s_imageLogo;
static private ImageIcon s_imageIcon32;
static private ImageIcon s_imageIconLogo;
/** Logging */
private static CLogger log = null;
/**
* Get Product Name
* @return Application Name
*/
public static String getName()
{
return NAME;
} // getName
/**
* Get Product Version
* @return Application Version
*/
public static String getVersion()
{
return MAIN_VERSION + " - " + DATE_VERSION;
} // getVersion
/**
* Short Summary (Windows)
* @return summary
*/
public static String getSum()
{
StringBuffer sb = new StringBuffer();
sb.append(NAME).append(" ").append(MAIN_VERSION).append(SUB_TITLE);
return sb.toString();
} // getSum
/**
* Summary (Windows).
* Removing/modifying the Compiere copyright notice is a violation of the license
* Compiere(tm) Version 2.5.1a_2004-03-15 - Smart ERP & CRM - Copyright (c) 1999-2005 Jorg Janke; Implementation: 2.5.1a 20040417-0243 - (C) 1999-2005 Jorg Janke, ComPiere Inc. USA
* @return Summary in Windows character set
*/
public static String getSummary()
{
StringBuffer sb = new StringBuffer();
sb.append(NAME).append(" ")
.append(MAIN_VERSION).append("_").append(DATE_VERSION)
.append(" -").append(SUB_TITLE)
.append("- ").append(COPYRIGHT)
.append("; Implementation: ").append(getImplementationVersion())
.append(" - ").append(getImplementationVendor());
return sb.toString();
} // getSummary
/**
* Set Package Info
*/
private static void setPackageInfo()
{
if (s_ImplementationVendor != null)
return;
Package compierePackage = Package.getPackage("org.compiere");
s_ImplementationVendor = compierePackage.getImplementationVendor();
s_ImplementationVersion = compierePackage.getImplementationVersion();
if (s_ImplementationVendor == null)
{
s_ImplementationVendor = "not supported";
s_ImplementationVersion = "unknown";
}
} // setPackageInfo
/**
* Get Jar Implementation Version
* @return Implementation-Version
*/
public static String getImplementationVersion()
{
if (s_ImplementationVersion == null)
setPackageInfo();
return s_ImplementationVersion;
} // getImplementationVersion
/**
* Get Jar Implementation Vendor
* @return Implementation-Vendor
*/
public static String getImplementationVendor()
{
if (s_ImplementationVendor == null)
setPackageInfo();
return s_ImplementationVendor;
} // getImplementationVendor
/**
* Get Checksum
* @return checksum
*/
public static int getCheckSum()
{
return getSum().hashCode();
} // getCheckSum
/**
* Summary in ASCII
* @return Summary in ASCII
*/
public static String getSummaryAscii()
{
String retValue = getSummary();
// Registered Trademark
retValue = Util.replace(retValue, "\u00AE", "(r)");
// Trademark
retValue = Util.replace(retValue, "\u2122", "(tm)");
// Copyright
retValue = Util.replace(retValue, "\u00A9", "(c)");
// Cr
retValue = Util.replace(retValue, Env.NL, " ");
retValue = Util.replace(retValue, "\n", " ");
return retValue;
} // getSummaryAscii
/**
* Get Java VM Info
* @return VM info
*/
public static String getJavaInfo()
{
return System.getProperty("java.vm.name")
+ " " + System.getProperty("java.vm.version");
} // getJavaInfo
/**
* Get Operating System Info
* @return OS info
*/
public static String getOSInfo()
{
return System.getProperty("os.name") + " "
+ System.getProperty("os.version") + " "
+ System.getProperty("sun.os.patch.level");
} // getJavaInfo
/**
* Get full URL
* @return URL
*/
public static String getURL()
{
return "http://" + URL;
} // getURL
/**
* Get Sub Title
* @return Subtitle
*/
public static String getSubtitle()
{
return SUB_TITLE;
} // getSubitle
/**
* Get 16x16 Image.
* Removing/modifying the Compiere logo is a violation of the license
* @return Image Icon
*/
public static Image getImage16()
{
if (s_image16 == null)
{
Toolkit tk = Toolkit.getDefaultToolkit();
URL url = org.compiere.Compiere.class.getResource(s_File16x16);
// System.out.println(url);
if (url == null)
return null;
s_image16 = tk.getImage(url);
}
return s_image16;
} // getImage16
/**
* Get 28*15 Logo Image.
* Removing/modifying the Compiere logo is a violation of the license
* @return Image Icon
*/
public static Image getImageLogoSmall(boolean hr)
{
if (s_image48x15 == null)
{
Toolkit tk = Toolkit.getDefaultToolkit();
URL url = null;
if (hr)
url = org.compiere.Compiere.class.getResource(s_file48x15HR);
else
url = org.compiere.Compiere.class.getResource(s_file48x15);
// System.out.println(url);
if (url == null)
return null;
s_image48x15 = tk.getImage(url);
}
return s_image48x15;
} // getImageLogoSmall
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -