IDEMPIERE-4158 Move Swing Client out of core

This commit is contained in:
hengsin 2020-01-30 23:00:58 +08:00
parent 511292c8b9
commit 838b033e07
751 changed files with 2 additions and 123938 deletions

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.adempiere.report.jasper.swing</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,8 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.release=enabled

View File

@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -1,4 +0,0 @@
#Mon Aug 23 13:20:48 MYT 2010
eclipse.preferences.version=1
pluginProject.extensions=true
resolve.requirebundle=false

View File

@ -1,21 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JasperReports Swing Client
Bundle-SymbolicName: org.adempiere.report.jasper.swing;singleton:=true
Bundle-Version: 7.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=11))"
Require-Bundle: org.adempiere.base;bundle-version="0.0.0",
org.adempiere.ui.swing;bundle-version="0.0.0",
org.adempiere.report.jasper;bundle-version="0.0.0"
Import-Package: net.sf.jasperreports.engine,
net.sf.jasperreports.engine.export,
net.sf.jasperreports.swing,
net.sf.jasperreports.view,
org.adempiere.report.jasper,
org.osgi.framework
Service-Component: OSGI-INF/*.xml
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Automatic-Module-Name: org.adempiere.report.jasper.swing
Bundle-Vendor: iDempiere Community

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.compiere.report.SwingJRViewerProvider">
<implementation class="org.compiere.report.SwingJRViewerProvider"/>
<service>
<provide interface="org.adempiere.report.jasper.JRViewerProvider"/>
</service>
</scr:component>

View File

@ -1,6 +0,0 @@
bin.includes = META-INF/,\
OSGI-INF/jrviewerprovider.xml,\
OSGI-INF/,\
.
output.. = target/classes/
source.. = src/

View File

@ -1,12 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.idempiere</groupId>
<artifactId>org.idempiere.parent</artifactId>
<version>7.1.0-SNAPSHOT</version>
<relativePath>../org.idempiere.parent/pom.xml</relativePath>
</parent>
<artifactId>org.adempiere.report.jasper.swing</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View File

@ -1,172 +0,0 @@
/*
* Class JRViewer.
*/
package org.compiere.report;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.logging.Level;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JSeparator;
import javax.swing.SwingConstants;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.export.JRXlsExporter;
import net.sf.jasperreports.swing.JRViewer;
import org.compiere.apps.EMailDialog;
import org.compiere.model.MUser;
import org.compiere.tools.FileUtil;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Msg;
public class JasperReportViewer extends JRViewer {
private static final long serialVersionUID = -7988455595896562947L;
/** Logger */
@SuppressWarnings("unused")
private static CLogger log = CLogger.getCLogger(JasperReportViewer.class);
@SuppressWarnings("unused")
private JasperViewer jasperViewer;
private JasperPrint jasperPrint;
private JComboBox<Object> comboBox;
public JasperReportViewer(final JasperViewer jasperViewer, final JasperPrint jasperPrint) throws JRException {
super( jasperPrint);
this.jasperViewer = jasperViewer;
this.jasperPrint = jasperPrint;
tlbToolBar.add(new JSeparator(SwingConstants.VERTICAL));
JButton btnSendByEmail = new JButton();
btnSendByEmail.setToolTipText(Msg.getMsg(Env.getCtx(), "SendMail"));
btnSendByEmail.setText(Msg.getMsg(Env.getCtx(), "SendMail"));
btnSendByEmail.setPreferredSize(new java.awt.Dimension(85, 23));
btnSendByEmail.setMaximumSize(new java.awt.Dimension(85, 23));
btnSendByEmail.setMinimumSize(new java.awt.Dimension(85, 23));
btnSendByEmail.addActionListener( new SendByEmailListener(jasperViewer, this));
tlbToolBar.add(btnSendByEmail);
tlbToolBar.add(new JSeparator(SwingConstants.VERTICAL));
JButton btnExport = new JButton();
btnExport.setToolTipText(Msg.getMsg(Env.getCtx(), "Export"));
btnExport.setText(Msg.getMsg(Env.getCtx(), "Export"));
btnExport.setPreferredSize(new java.awt.Dimension(85, 23));
btnExport.setMaximumSize(new java.awt.Dimension(85, 23));
btnExport.setMinimumSize(new java.awt.Dimension(85, 23));
btnExport.addActionListener( new ExportListener( this));
tlbToolBar.add(btnExport);
comboBox = new JComboBox<Object>( new String[] {"PDF","HTML", "XLS"});
comboBox.setPreferredSize(new java.awt.Dimension(80, 23));
comboBox.setMaximumSize(new java.awt.Dimension(80, 23));
comboBox.setMinimumSize(new java.awt.Dimension(80, 23));
tlbToolBar.add(comboBox);
// Set default viewer zoom level
//btnFitPage.setSelected(true);
//setZooms();
}
public JasperPrint getJasperPrint() {
return jasperPrint;
}
public String getFormat() {
return (String) comboBox.getSelectedItem();
}
//@Override
protected void paintPage(Graphics2D grx) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(JasperReport.class.getClassLoader());
//super.paintPage(grx);
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
}
class ExportListener implements ActionListener {
private JasperReportViewer viewer;
public ExportListener(JasperReportViewer viewer) {
this.viewer = viewer;
}
public void actionPerformed(ActionEvent event) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setSelectedFile(new File(viewer.getJasperPrint().getName() +
"." + viewer.getFormat().toLowerCase()));
if (fileChooser.showSaveDialog( viewer)==JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
try {
if (viewer.getFormat().equals("PDF")) {
JasperExportManager.exportReportToPdfFile( viewer.getJasperPrint(), file.getAbsolutePath());
} else if (viewer.getFormat().equals("HTML")) {
JasperExportManager.exportReportToHtmlFile( viewer.getJasperPrint(), file.getAbsolutePath());
} else if (viewer.getFormat().equals("XLS")) {
JRXlsExporter exporter = new net.sf.jasperreports.engine.export.JRXlsExporter();
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, file.getAbsolutePath());
exporter.setParameter(JRExporterParameter.JASPER_PRINT, viewer.getJasperPrint());
exporter.exportReport();
}
} catch (JRException e) {
e.printStackTrace();
}
}
}
}
class SendByEmailListener implements ActionListener {
/** Logger */
private static CLogger log = CLogger.getCLogger(SendByEmailListener.class);
private JasperViewer jasperViewer;
private JasperReportViewer viewer;
public SendByEmailListener(JasperViewer jasperViewer, JasperReportViewer viewer) {
this.jasperViewer = jasperViewer;
this.viewer = viewer;
}
public void actionPerformed(ActionEvent event) {
String to = "";
MUser from = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx()));
String subject = viewer.getJasperPrint().getName();
String message = "";
File attachment = null;
try
{
attachment = new File(FileUtil.getTempMailName(subject, ".pdf"));
JasperExportManager.exportReportToPdfFile(viewer.getJasperPrint(), attachment.getAbsolutePath());
}
catch (Exception e)
{
log.log(Level.SEVERE, "", e);
}
@SuppressWarnings("unused")
EMailDialog emd = new EMailDialog ((JFrame)jasperViewer,
Msg.getMsg(Env.getCtx(), "SendMail"),
from, to, subject, message, attachment);
}
}

View File

@ -1,30 +0,0 @@
/**
*
*/
package org.compiere.report;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
/**
* @author hengsin
*
*/
public class JasperReportsClientActivator implements BundleActivator {
/**
* default constructor
*/
public JasperReportsClientActivator() {
super();
}
@Override
public void start(BundleContext arg0) throws Exception {
}
@Override
public void stop(BundleContext arg0) throws Exception {
}
}

View File

@ -1,144 +0,0 @@
/*
* Class JasperViewer.
*/
package org.compiere.report;
import java.awt.BorderLayout;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import org.compiere.db.CConnection;
import org.compiere.model.PrintInfo;
public class JasperViewer extends javax.swing.JFrame {
private static final long serialVersionUID = 1192807883081180999L;
private String m_title;
private PrintInfo m_printInfo;
/** Creates new form JasperViewer */
/**
* @param jasperPrint report to display
* @param frameTitle Title to be displayed
* @throws JRException
*/
protected JasperViewer(JasperPrint jasperPrint,String frameTitle, PrintInfo printInfo) throws JRException {
this.m_title = frameTitle;
initComponents();
JasperReportViewer viewer = new JasperReportViewer(this, jasperPrint);
this.pnlMain.add(viewer, BorderLayout.CENTER);
m_printInfo = printInfo;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents()//GEN-BEGIN:initComponents
{
pnlMain = new javax.swing.JPanel();
setTitle(m_title);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm();
}
});
addKeyListener( new KeyAdapter() {
public void keyPressed(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.VK_ESCAPE) exitForm();
}
public void keyTyped(KeyEvent event) {
super.keyTyped(event);
}
});
pnlMain.setLayout(new java.awt.BorderLayout());
getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER);
pack();
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setSize(new java.awt.Dimension(750, 550));
setLocation((screenSize.width - 750) / 2, (screenSize.height - 550) / 2);
}//GEN-END:initComponents
/** Exit the Application */
private void exitForm() {//GEN-FIRST:event_exitForm
setVisible(false);
dispose();
}//GEN-LAST:event_exitForm
/**
*
*/
public static void viewReport(JasperPrint jasperPrint, PrintInfo printInfo) throws JRException {
JasperViewer jasperViewer = new JasperViewer(jasperPrint,"JasperReport", printInfo);
jasperViewer.setVisible(true);
}
public static void viewReport(JasperPrint jasperPrint,String frameTitle, PrintInfo printInfo) throws JRException {
JasperViewer jasperViewer = new JasperViewer(jasperPrint,frameTitle, printInfo);
jasperViewer.setVisible(true);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel pnlMain;
// End of variables declaration//GEN-END:variables
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
try {
JasperReport myjasperReport = (JasperReport) JasperCompileManager.compileReport(args[0] );
JasperPrint myjasperPrint = JasperFillManager.fillReport( myjasperReport, new HashMap<String,Object>(), getConnection());
JasperViewer.viewReport(myjasperPrint, null);
}
catch (Exception e) {
e.printStackTrace();
}
}
public static Connection getConnection(String args[])
{
CConnection compiereConnection = CConnection.get();
try {
DriverManager.registerDriver(compiereConnection.getDatabase().getDriver());
//this is for test only
return DriverManager.getConnection(args[1], args[2], args[3]);
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
public static Connection getConnection() {
CConnection compiereConnection = CConnection.get();
try {
DriverManager.registerDriver(compiereConnection.getDatabase().getDriver());
//this is for test only prefer testingby calling org.compiere.report.JaserViewer JDBC_CONNECTION JDBC_USER JDBC_PASS
return DriverManager.getConnection("jdbc:oracle:thin:@abalone.lesmuids.com:1521:abalone", "adempiere", "adempiere");
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
}

View File

@ -1,17 +0,0 @@
package org.compiere.report;
import org.adempiere.report.jasper.JRViewerProvider;
import org.compiere.model.PrintInfo;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;
public class SwingJRViewerProvider implements JRViewerProvider {
public void openViewer(JasperPrint jasperPrint, String title, PrintInfo printInfo) throws JRException {
JasperViewer jasperViewer = new JasperViewer( jasperPrint, title, printInfo);
jasperViewer.setExtendedState(jasperViewer.getExtendedState() | javax.swing.JFrame.MAXIMIZED_BOTH);
jasperViewer.setVisible(true);
}
}

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.adempiere.ui.swing-feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View File

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -1,20 +0,0 @@
@Echo off
@if not "%JAVA_HOME%" == "" goto JAVA_HOME_OK
@Set JAVA=java
@Echo JAVA_HOME is not set.
@Echo You may not be able to start the server
@Echo Set JAVA_HOME to the directory of your local 1.6 JDK.
goto START
:JAVA_HOME_OK
@Set JAVA=%JAVA_HOME%\bin\java
:START
@Echo =======================================
@Echo Starting Adempiere Client ...
@Echo =======================================
@"%JAVA%" -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dosgi.compatibility.bootdelegation=true -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.ui.swing.client

View File

@ -1,20 +0,0 @@
#!/bin/sh
#
# script parameters are used as VM args. e.g.:
# ./adempiere-client.sh -DPropertyFile=/home/tbayen/idempiere-conf2.properties
# -- tbayen
if [ $JAVA_HOME ]; then
JAVA=$JAVA_HOME/bin/java
else
JAVA=java
echo JAVA_HOME is not set.
echo You may not be able to start the server
echo Set JAVA_HOME to the directory of your local JDK.
fi
echo ===================================
echo Starting Adempiere Client
echo ===================================
$JAVA -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dosgi.compatibility.bootdelegation=true $@ -XX:MaxPermSize=192m -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.ui.swing.client

View File

@ -1,10 +0,0 @@
bin.includes = feature.xml
root.linux.gtk.x86=file:adempiere-client.sh
root.linux.gtk.x86.permissions.755=*.sh,**/*.sh
root.linux.gtk.x86_64=file:adempiere-client.sh
root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh
root.macosx.cocoa.x86=file:adempiere-client.sh
root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh
root.win32.win32.x86=file:adempiere-client.bat
root.solaris.gtk.x86=file:adempiere-client.sh
root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh

View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.adempiere.ui.swing.feature"
label="Swing Client-feature"
version="7.1.0.qualifier"
provider-name="iDempiere Community">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<requires>
<import feature="org.adempiere.base.feature" version="0.0.0"/>
</requires>
<plugin
id="org.adempiere.report.jasper.swing"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.adempiere.ui.swing"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.eclipse.jdt.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@ -1,12 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.idempiere</groupId>
<artifactId>org.idempiere.parent</artifactId>
<version>7.1.0-SNAPSHOT</version>
<relativePath>../org.idempiere.parent/pom.xml</relativePath>
</parent>
<artifactId>org.adempiere.ui.swing.feature</artifactId>
<packaging>eclipse-feature</packaging>
</project>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="Adempiere Swing Client" uid="org.adempiere.ui.swing.product" id="org.adempiere.ui.swing.client_product" application="org.adempiere.ui.swing.client" version="7.1.0" useFeatures="true" includeLaunchers="true">
<configIni use="default">
</configIni>
<launcherArgs>
<programArgs>--launcher.XXMaxPermSize 192m
</programArgs>
<vmArgs>-Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dosgi.compatibility.bootdelegation=true
</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
</launcherArgs>
<launcher name="adempiere-client">
<win useIco="false">
<bmp/>
</win>
</launcher>
<vm>
</vm>
<plugins>
</plugins>
<features>
<feature id="org.adempiere.base.feature" version="7.1.0.qualifier"/>
<feature id="org.adempiere.pipo.feature" version="7.1.0.qualifier"/>
<feature id="org.adempiere.ui.swing.feature" version="7.1.0.qualifier"/>
<feature id="org.idempiere.hazelcast.service.feature" version="7.1.0.qualifier"/>
</features>
<configurations>
<plugin id="org.adempiere.base" autoStart="true" startLevel="4" />
<plugin id="org.adempiere.pipo" autoStart="true" startLevel="0" />
<plugin id="org.adempiere.pipo.handlers" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="3" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="3" />
<plugin id="org.eclipse.osgi.services" autoStart="true" startLevel="3" />
<plugin id="org.idempiere.hazelcast.service" autoStart="true" startLevel="0" />
</configurations>
</product>

View File

@ -1,421 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="org.adempiere.server.application"/>
<booleanAttribute key="askclear" value="false"/>
<booleanAttribute key="automaticAdd" value="false"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/swingclient.product"/>
<booleanAttribute key="default" value="false"/>
<setAttribute key="deselected_workspace_bundles"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/runtime-swingclient.product"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.pde.ui.launcher.PDESourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;sourceLookupDirector&gt;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;classpathContainer path=&amp;quot;org.eclipse.jdt.launching.JRE_CONTAINER&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.classpathContainer&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;default/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#10;&lt;/sourceContainers&gt;&#10;&lt;/sourceLookupDirector&gt;&#10;"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="--add-modules java.se --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Declipse.product=org.adempiere.server.product -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dorg.osgi.framework.bootdelegation=sun.security.ssl,org.w3c.dom.events -Dosgi.compatibility.bootdelegation=true -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-alpn.xml,etc/jetty-http2.xml,etc/jetty-https.xml -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -Dhazelcast.config=hazelcast.xml -Dorg.zkoss.zk.config.path=file://${workspace_loc}/zk.xml"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.adempiere.ui.swing.client_product"/>
<stringAttribute key="productFile" value="/org.adempiere.server-feature/server.product"/>
<setAttribute key="selected_target_bundles">
<setEntry value="bcmail@default:default"/>
<setEntry value="bcpkix@default:default"/>
<setEntry value="bcprov@default:default"/>
<setEntry value="bctsp@default:default"/>
<setEntry value="com.diffplug.osgi.extension.sun.misc@default:false"/>
<setEntry value="com.fasterxml.jackson.core.jackson-annotations*2.9.8@default:default"/>
<setEntry value="com.fasterxml.jackson.core.jackson-core*2.9.8@default:default"/>
<setEntry value="com.fasterxml.jackson.core.jackson-databind*2.9.8@default:default"/>
<setEntry value="com.fasterxml.jackson.dataformat.jackson-dataformat-xml@default:default"/>
<setEntry value="com.fasterxml.jackson.datatype.jackson-datatype-guava*2.9.8@default:default"/>
<setEntry value="com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default"/>
<setEntry value="com.fasterxml.jackson.datatype.jackson-datatype-json-org@default:default"/>
<setEntry value="com.fasterxml.jackson.jaxrs.jackson-jaxrs-base*2.9.8@default:default"/>
<setEntry value="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider*2.9.8@default:default"/>
<setEntry value="com.fasterxml.jackson.jaxrs.jackson-jaxrs-xml-provider@default:default"/>
<setEntry value="com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default"/>
<setEntry value="com.fasterxml.jackson.module.jackson-module-jsonSchema.source"/>
<setEntry value="com.fasterxml.jackson.module.jackson-module-jsonSchema@default:default"/>
<setEntry value="com.fasterxml.woodstox.woodstox-core@default:default"/>
<setEntry value="com.google.guava*21.0.0.v20170206-1425@default:default"/>
<setEntry value="com.google.zxing.core@default:default"/>
<setEntry value="com.ibm.icu*63.1.0.v20181030-1705@default:default"/>
<setEntry value="com.itextpdf@default:default"/>
<setEntry value="com.jaspersoft.studio.bundles.barbecue@default:default"/>
<setEntry value="com.jaspersoft.studio.bundles.itext@default:default"/>
<setEntry value="com.sun.activation.jakarta.activation@default:default"/>
<setEntry value="com.sun.istack.commons-runtime.source"/>
<setEntry value="com.sun.istack.commons-runtime@default:default"/>
<setEntry value="com.sun.mail.gimap@default:default"/>
<setEntry value="com.sun.mail.imap@default:default"/>
<setEntry value="com.sun.mail.jakarta.mail@default:default"/>
<setEntry value="com.sun.mail.smtp@default:default"/>
<setEntry value="com.sun.org.apache.xml.internal.resolver@default:default"/>
<setEntry value="com.sun.xml.bind.jaxb-impl@default:default"/>
<setEntry value="com.sun.xml.bind.jaxb-osgi@default:default"/>
<setEntry value="com.sun.xml.fastinfoset.FastInfoset@default:default"/>
<setEntry value="com.sun.xml.messaging.saaj.impl@default:default"/>
<setEntry value="com.sun.xml.stream.buffer.streambuffer@default:default"/>
<setEntry value="com.sun.xml.ws.jaxws-rt@default:default"/>
<setEntry value="com.sun.xml.ws.policy@default:default"/>
<setEntry value="groovy-ant@default:false"/>
<setEntry value="groovy-cli-commons@default:false"/>
<setEntry value="groovy-cli-picocli@default:false"/>
<setEntry value="groovy-console@default:false"/>
<setEntry value="groovy-datetime@default:false"/>
<setEntry value="groovy-docgenerator@default:false"/>
<setEntry value="groovy-groovydoc@default:false"/>
<setEntry value="groovy-groovysh@default:false"/>
<setEntry value="groovy-jmx@default:false"/>
<setEntry value="groovy-json@default:false"/>
<setEntry value="groovy-jsr223@default:false"/>
<setEntry value="groovy-macro@default:false"/>
<setEntry value="groovy-nio@default:false"/>
<setEntry value="groovy-servlet@default:false"/>
<setEntry value="groovy-sql@default:false"/>
<setEntry value="groovy-swing@default:false"/>
<setEntry value="groovy-xml@default:false"/>
<setEntry value="groovy@default:default"/>
<setEntry value="jakarta.jws-api@default:default"/>
<setEntry value="jakarta.mail.api@default:default"/>
<setEntry value="jakarta.ws.rs-api@default:default"/>
<setEntry value="jakarta.xml.bind-api@default:default"/>
<setEntry value="jakarta.xml.soap-api@default:default"/>
<setEntry value="jakarta.xml.ws-api@default:default"/>
<setEntry value="javax.annotation-api@default:default"/>
<setEntry value="javax.enterprise.cdi-api@default:default"/>
<setEntry value="javax.inject@default:default"/>
<setEntry value="javax.interceptor-api@default:default"/>
<setEntry value="javax.jms@default:default"/>
<setEntry value="javax.jws@default:default"/>
<setEntry value="javax.persistence@default:default"/>
<setEntry value="javax.servlet@default:default"/>
<setEntry value="javax.transaction-api@default:default"/>
<setEntry value="javax.transaction@default:false"/>
<setEntry value="javax.validation.api@default:default"/>
<setEntry value="javax.websocket-api@default:default"/>
<setEntry value="javax.wsdl@default:default"/>
<setEntry value="joda-time@default:default"/>
<setEntry value="json@default:default"/>
<setEntry value="net.sf.jasperreports.engine@default:default"/>
<setEntry value="net.sf.supercsv.super-csv@default:default"/>
<setEntry value="org.antlr.runtime*4.7.1.v20181120-0808@default:default"/>
<setEntry value="org.aopalliance@default:default"/>
<setEntry value="org.apache.activemq.activemq-core@default:default"/>
<setEntry value="org.apache.activemq.kahadb@default:default"/>
<setEntry value="org.apache.ant*1.10.5.v20180808-0324@default:default"/>
<setEntry value="org.apache.aries.spifly.dynamic.bundle@default:default"/>
<setEntry value="org.apache.aries.util@default:default"/>
<setEntry value="org.apache.batik.anim*1.9.1.v20181015-1528@default:default"/>
<setEntry value="org.apache.batik.bridge*1.9.1.v20181015-1528@default:default"/>
<setEntry value="org.apache.batik.codec@default:default"/>
<setEntry value="org.apache.batik.constants*1.10.0.v20180703-1553@default:default"/>
<setEntry value="org.apache.batik.css*1.10.0.v20180703-1553@default:default"/>
<setEntry value="org.apache.batik.dom*1.9.1.v20181015-1528@default:default"/>
<setEntry value="org.apache.batik.dom.svg*1.9.1.v20181015-1528@default:default"/>
<setEntry value="org.apache.batik.ext.awt@default:default"/>
<setEntry value="org.apache.batik.extension@default:default"/>
<setEntry value="org.apache.batik.gvt@default:default"/>
<setEntry value="org.apache.batik.i18n*1.10.0.v20180703-1553@default:default"/>
<setEntry value="org.apache.batik.parser@default:default"/>
<setEntry value="org.apache.batik.pdf@default:default"/>
<setEntry value="org.apache.batik.script@default:default"/>
<setEntry value="org.apache.batik.svggen@default:default"/>
<setEntry value="org.apache.batik.swing*1.9.1.v20181015-1528@default:default"/>
<setEntry value="org.apache.batik.transcoder*1.9.1.v20181015-1528@default:default"/>
<setEntry value="org.apache.batik.util*1.10.0.v20180703-1553@default:default"/>
<setEntry value="org.apache.batik.util.gui@default:default"/>
<setEntry value="org.apache.batik.xml@default:default"/>
<setEntry value="org.apache.commons.beanutils@default:default"/>
<setEntry value="org.apache.commons.codec*1.10.0.v20180409-1845@default:default"/>
<setEntry value="org.apache.commons.collections@default:default"/>
<setEntry value="org.apache.commons.commons-collections4@default:default"/>
<setEntry value="org.apache.commons.commons-configuration2@default:default"/>
<setEntry value="org.apache.commons.compress*1.18.0.v20181121-2221@default:default"/>
<setEntry value="org.apache.commons.digester@default:default"/>
<setEntry value="org.apache.commons.discovery*0.5.0@default:default"/>
<setEntry value="org.apache.commons.fileupload*1.3.3@default:default"/>
<setEntry value="org.apache.commons.io*2.6.0@default:default"/>
<setEntry value="org.apache.commons.jxpath@default:default"/>
<setEntry value="org.apache.commons.lang3@default:default"/>
<setEntry value="org.apache.commons.lang@default:default"/>
<setEntry value="org.apache.commons.logging*1.2.0.v20180409-1502@default:default"/>
<setEntry value="org.apache.commons.net@default:default"/>
<setEntry value="org.apache.cxf.cxf-core@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-bindings-soap@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-bindings-xml@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-databinding-jaxb@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-databinding-xmlbeans@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-frontend-jaxrs@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-frontend-jaxws@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-frontend-simple@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-rs-extension-providers@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-rs-service-description@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-security@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-transports-http-jetty@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-transports-http@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-ws-addr@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-ws-policy@default:default"/>
<setEntry value="org.apache.cxf.cxf-rt-wsdl@default:default"/>
<setEntry value="org.apache.cxf.rt-ws-transfer@default:default"/>
<setEntry value="org.apache.felix.gogo.runtime*1.1.0.v20180713-1646@default:default"/>
<setEntry value="org.apache.felix.gogo.shell*1.1.0.v20180713-1646@default:default"/>
<setEntry value="org.apache.felix.scr@1:true"/>
<setEntry value="org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec@default:default"/>
<setEntry value="org.apache.httpcomponents.httpclient*4.5.6@default:default"/>
<setEntry value="org.apache.httpcomponents.httpcore*4.4.9.v20180409-1525@default:default"/>
<setEntry value="org.apache.lucene.analysis@default:default"/>
<setEntry value="org.apache.lucene.core*3.5.0.v20120725-1805@default:default"/>
<setEntry value="org.apache.neethi*3.1.1@default:default"/>
<setEntry value="org.apache.poi.poi-ooxml-schemas@default:default"/>
<setEntry value="org.apache.poi.poi-ooxml@default:default"/>
<setEntry value="org.apache.poi.poi@default:default"/>
<setEntry value="org.apache.servicemix.bundles.cglib.source"/>
<setEntry value="org.apache.servicemix.bundles.cglib@default:default"/>
<setEntry value="org.apache.servicemix.bundles.jaxen@default:default"/>
<setEntry value="org.apache.servicemix.bundles.rhino@default:default"/>
<setEntry value="org.apache.servicemix.bundles.spring-aop@default:default"/>
<setEntry value="org.apache.servicemix.bundles.spring-beans@default:default"/>
<setEntry value="org.apache.servicemix.bundles.spring-context-support@default:default"/>
<setEntry value="org.apache.servicemix.bundles.spring-context@default:default"/>
<setEntry value="org.apache.servicemix.bundles.spring-core@default:default"/>
<setEntry value="org.apache.servicemix.bundles.spring-expression@default:default"/>
<setEntry value="org.apache.servicemix.bundles.spring-web@default:default"/>
<setEntry value="org.apache.servicemix.bundles.wsdl4j@default:default"/>
<setEntry value="org.apache.servicemix.bundles.xerces@default:default"/>
<setEntry value="org.apache.taglibs.standard-impl@default:default"/>
<setEntry value="org.apache.taglibs.standard-jstlel@default:default"/>
<setEntry value="org.apache.taglibs.standard.glassfish@default:default"/>
<setEntry value="org.apache.taglibs.taglibs-standard-spec@default:default"/>
<setEntry value="org.apache.ws.jaxme@default:default"/>
<setEntry value="org.apache.ws.xmlschema.core@default:default"/>
<setEntry value="org.apache.xalan@default:default"/>
<setEntry value="org.apache.xml.resolver@default:default"/>
<setEntry value="org.apache.xml.serializer@default:default"/>
<setEntry value="org.apache.xmlbeans*3.1.0@default:default"/>
<setEntry value="org.apache.xmlgraphics*2.2.0.v20180809-1640@default:default"/>
<setEntry value="org.atmosphere.runtime@default:default"/>
<setEntry value="org.bouncycastle.bcpkix*1.60.0.v20181107-1520@default:default"/>
<setEntry value="org.bouncycastle.bcprov*1.60.0.v20181107-1520@default:default"/>
<setEntry value="org.cryptacular@default:default"/>
<setEntry value="org.dom4j@default:default"/>
<setEntry value="org.eclipse.ant.core@default:default"/>
<setEntry value="org.eclipse.ant.optional.junit@default:false"/>
<setEntry value="org.eclipse.compare.core@default:default"/>
<setEntry value="org.eclipse.core.commands@default:default"/>
<setEntry value="org.eclipse.core.contenttype@default:default"/>
<setEntry value="org.eclipse.core.databinding.observable@default:default"/>
<setEntry value="org.eclipse.core.databinding.property@default:default"/>
<setEntry value="org.eclipse.core.databinding@default:default"/>
<setEntry value="org.eclipse.core.expressions@default:default"/>
<setEntry value="org.eclipse.core.filesystem.linux.x86_64@default:false"/>
<setEntry value="org.eclipse.core.filesystem@default:default"/>
<setEntry value="org.eclipse.core.jobs@default:default"/>
<setEntry value="org.eclipse.core.net.linux.x86_64@default:false"/>
<setEntry value="org.eclipse.core.net@default:default"/>
<setEntry value="org.eclipse.core.resources@default:default"/>
<setEntry value="org.eclipse.core.runtime@default:true"/>
<setEntry value="org.eclipse.core.variables@default:default"/>
<setEntry value="org.eclipse.e4.core.commands@default:default"/>
<setEntry value="org.eclipse.e4.core.contexts@default:default"/>
<setEntry value="org.eclipse.e4.core.di.annotations@default:default"/>
<setEntry value="org.eclipse.e4.core.di.extensions.supplier@default:default"/>
<setEntry value="org.eclipse.e4.core.di.extensions@default:default"/>
<setEntry value="org.eclipse.e4.core.di@default:default"/>
<setEntry value="org.eclipse.e4.core.services@default:default"/>
<setEntry value="org.eclipse.e4.ui.bindings@default:default"/>
<setEntry value="org.eclipse.e4.ui.css.core@default:default"/>
<setEntry value="org.eclipse.e4.ui.css.swt.theme@default:default"/>
<setEntry value="org.eclipse.e4.ui.css.swt@default:default"/>
<setEntry value="org.eclipse.e4.ui.di@default:default"/>
<setEntry value="org.eclipse.e4.ui.services@default:default"/>
<setEntry value="org.eclipse.e4.ui.swt.gtk@default:false"/>
<setEntry value="org.eclipse.e4.ui.widgets@default:default"/>
<setEntry value="org.eclipse.ecf.filetransfer@default:default"/>
<setEntry value="org.eclipse.ecf.identity@default:default"/>
<setEntry value="org.eclipse.ecf.provider.filetransfer.httpclient4.ssl@default:false"/>
<setEntry value="org.eclipse.ecf.provider.filetransfer.httpclient4@default:default"/>
<setEntry value="org.eclipse.ecf.provider.filetransfer.ssl@default:false"/>
<setEntry value="org.eclipse.ecf.provider.filetransfer@default:default"/>
<setEntry value="org.eclipse.ecf.ssl@default:false"/>
<setEntry value="org.eclipse.ecf@default:default"/>
<setEntry value="org.eclipse.equinox.app@default:default"/>
<setEntry value="org.eclipse.equinox.cm@default:default"/>
<setEntry value="org.eclipse.equinox.common@2:true"/>
<setEntry value="org.eclipse.equinox.concurrent@default:default"/>
<setEntry value="org.eclipse.equinox.console@default:default"/>
<setEntry value="org.eclipse.equinox.ds@1:true"/>
<setEntry value="org.eclipse.equinox.event@default:default"/>
<setEntry value="org.eclipse.equinox.frameworkadmin.equinox@default:default"/>
<setEntry value="org.eclipse.equinox.frameworkadmin@default:default"/>
<setEntry value="org.eclipse.equinox.http.registry@default:default"/>
<setEntry value="org.eclipse.equinox.http.servlet@default:default"/>
<setEntry value="org.eclipse.equinox.launcher.gtk.linux.x86_64@default:false"/>
<setEntry value="org.eclipse.equinox.launcher@default:default"/>
<setEntry value="org.eclipse.equinox.metatype@default:default"/>
<setEntry value="org.eclipse.equinox.p2.artifact.repository@default:default"/>
<setEntry value="org.eclipse.equinox.p2.console@default:default"/>
<setEntry value="org.eclipse.equinox.p2.core@default:default"/>
<setEntry value="org.eclipse.equinox.p2.director.app@default:default"/>
<setEntry value="org.eclipse.equinox.p2.director@default:default"/>
<setEntry value="org.eclipse.equinox.p2.engine@default:default"/>
<setEntry value="org.eclipse.equinox.p2.garbagecollector@default:default"/>
<setEntry value="org.eclipse.equinox.p2.jarprocessor@default:default"/>
<setEntry value="org.eclipse.equinox.p2.metadata.repository@default:default"/>
<setEntry value="org.eclipse.equinox.p2.metadata@default:default"/>
<setEntry value="org.eclipse.equinox.p2.publisher@default:default"/>
<setEntry value="org.eclipse.equinox.p2.repository@default:default"/>
<setEntry value="org.eclipse.equinox.p2.touchpoint.eclipse@default:default"/>
<setEntry value="org.eclipse.equinox.p2.touchpoint.natives@default:default"/>
<setEntry value="org.eclipse.equinox.p2.transport.ecf@default:default"/>
<setEntry value="org.eclipse.equinox.preferences@default:default"/>
<setEntry value="org.eclipse.equinox.region@default:false"/>
<setEntry value="org.eclipse.equinox.registry@default:default"/>
<setEntry value="org.eclipse.equinox.security.linux.x86_64@default:false"/>
<setEntry value="org.eclipse.equinox.security@default:default"/>
<setEntry value="org.eclipse.equinox.simpleconfigurator.manipulator@default:default"/>
<setEntry value="org.eclipse.equinox.simpleconfigurator@1:true"/>
<setEntry value="org.eclipse.equinox.transforms.hook@default:false"/>
<setEntry value="org.eclipse.equinox.util@default:default"/>
<setEntry value="org.eclipse.equinox.weaving.hook@default:false"/>
<setEntry value="org.eclipse.help@default:default"/>
<setEntry value="org.eclipse.jdt.compiler.apt@default:false"/>
<setEntry value="org.eclipse.jdt.compiler.tool@default:false"/>
<setEntry value="org.eclipse.jdt.core@default:default"/>
<setEntry value="org.eclipse.jetty.alpn.api@default:default"/>
<setEntry value="org.eclipse.jetty.alpn.server@default:default"/>
<setEntry value="org.eclipse.jetty.annotations@default:default"/>
<setEntry value="org.eclipse.jetty.apache-jsp@default:default"/>
<setEntry value="org.eclipse.jetty.client@default:default"/>
<setEntry value="org.eclipse.jetty.continuation*9.4.14.v20181114@default:default"/>
<setEntry value="org.eclipse.jetty.deploy@default:default"/>
<setEntry value="org.eclipse.jetty.http*9.4.14.v20181114@default:default"/>
<setEntry value="org.eclipse.jetty.http2.common@default:default"/>
<setEntry value="org.eclipse.jetty.http2.hpack@default:default"/>
<setEntry value="org.eclipse.jetty.http2.server@default:default"/>
<setEntry value="org.eclipse.jetty.io*9.4.14.v20181114@default:default"/>
<setEntry value="org.eclipse.jetty.jaas@default:default"/>
<setEntry value="org.eclipse.jetty.jmx@default:default"/>
<setEntry value="org.eclipse.jetty.jndi@default:default"/>
<setEntry value="org.eclipse.jetty.osgi-servlet-api@default:default"/>
<setEntry value="org.eclipse.jetty.osgi.alpn.fragment@default:false"/>
<setEntry value="org.eclipse.jetty.osgi.boot.jsp@default:false"/>
<setEntry value="org.eclipse.jetty.osgi.boot@default:default"/>
<setEntry value="org.eclipse.jetty.osgi.httpservice@default:default"/>
<setEntry value="org.eclipse.jetty.plus@default:default"/>
<setEntry value="org.eclipse.jetty.security*9.4.14.v20181114@default:default"/>
<setEntry value="org.eclipse.jetty.server*9.4.14.v20181114@default:default"/>
<setEntry value="org.eclipse.jetty.servlet*9.4.14.v20181114@default:default"/>
<setEntry value="org.eclipse.jetty.servlets@default:default"/>
<setEntry value="org.eclipse.jetty.util*9.4.14.v20181114@default:default"/>
<setEntry value="org.eclipse.jetty.util.ajax@default:default"/>
<setEntry value="org.eclipse.jetty.webapp@default:default"/>
<setEntry value="org.eclipse.jetty.websocket.api@default:default"/>
<setEntry value="org.eclipse.jetty.websocket.client@default:default"/>
<setEntry value="org.eclipse.jetty.websocket.common@default:default"/>
<setEntry value="org.eclipse.jetty.websocket.javax.websocket.server@default:default"/>
<setEntry value="org.eclipse.jetty.websocket.javax.websocket@default:default"/>
<setEntry value="org.eclipse.jetty.websocket.server@default:default"/>
<setEntry value="org.eclipse.jetty.websocket.servlet@default:default"/>
<setEntry value="org.eclipse.jetty.xml@default:default"/>
<setEntry value="org.eclipse.jface.databinding@default:default"/>
<setEntry value="org.eclipse.jface@default:default"/>
<setEntry value="org.eclipse.osgi*3.13.200.v20181130-2106@-1:true"/>
<setEntry value="org.eclipse.osgi.compatibility.state@default:false"/>
<setEntry value="org.eclipse.osgi.services@default:default"/>
<setEntry value="org.eclipse.osgi.util@default:default"/>
<setEntry value="org.eclipse.pde.ds.lib@default:default"/>
<setEntry value="org.eclipse.swt.gtk.linux.x86_64@default:false"/>
<setEntry value="org.eclipse.swt@default:default"/>
<setEntry value="org.eclipse.team.core@default:default"/>
<setEntry value="org.eclipse.text@default:default"/>
<setEntry value="org.glassfish.external.management-api@default:default"/>
<setEntry value="org.glassfish.gmbal.gmbal@default:default"/>
<setEntry value="org.glassfish.hk2.api@default:default"/>
<setEntry value="org.glassfish.hk2.locator@default:default"/>
<setEntry value="org.glassfish.hk2.osgi-resource-locator@default:default"/>
<setEntry value="org.glassfish.hk2.utils@default:default"/>
<setEntry value="org.glassfish.jaxb.txw2@default:default"/>
<setEntry value="org.glassfish.jersey.bundles.repackaged.jersey-guava@default:default"/>
<setEntry value="org.glassfish.jersey.core.jersey-common@default:default"/>
<setEntry value="org.glassfish.pfl.pfl-asm@default:default"/>
<setEntry value="org.glassfish.pfl.pfl-basic@default:default"/>
<setEntry value="org.glassfish.pfl.pfl-dynamic@default:default"/>
<setEntry value="org.glassfish.pfl.pfl-tf@default:default"/>
<setEntry value="org.hamcrest.core@default:default"/>
<setEntry value="org.jfree.chart@default:default"/>
<setEntry value="org.jfree.jcommon@default:default"/>
<setEntry value="org.json@default:default"/>
<setEntry value="org.junit@default:default"/>
<setEntry value="org.jvnet.mimepull@default:default"/>
<setEntry value="org.jvnet.staxex.stax-ex@default:default"/>
<setEntry value="org.krysalis.barcode4j@default:default"/>
<setEntry value="org.mortbay.jasper.apache-el.source"/>
<setEntry value="org.mortbay.jasper.apache-el@default:default"/>
<setEntry value="org.mortbay.jasper.apache-jsp@default:default"/>
<setEntry value="org.objectweb.asm*7.0.0.v20181030-2244@default:default"/>
<setEntry value="org.objectweb.asm.commons*7.0.0.v20181030-2244@default:default"/>
<setEntry value="org.objectweb.asm.tree*7.0.0.v20181030-2244@default:default"/>
<setEntry value="org.passay@default:default"/>
<setEntry value="org.sat4j.core@default:default"/>
<setEntry value="org.sat4j.pb@default:default"/>
<setEntry value="org.slf4j.apis.jcl@default:default"/>
<setEntry value="org.slf4j.jcl@default:default"/>
<setEntry value="org.springframework.spring-jcl@default:default"/>
<setEntry value="org.tukaani.xz*1.8.0.v20180207-1613@default:default"/>
<setEntry value="org.w3c.css.sac@default:default"/>
<setEntry value="org.w3c.dom.events@default:default"/>
<setEntry value="org.w3c.dom.smil@default:default"/>
<setEntry value="org.w3c.dom.svg.patch@default:false"/>
<setEntry value="org.w3c.dom.svg@default:default"/>
<setEntry value="slf4j.api@default:default"/>
<setEntry value="slf4j.jcl@default:false"/>
<setEntry value="slf4j.jdk14@default:false"/>
<setEntry value="stax2-api*3.1.4@default:default"/>
<setEntry value="stax2-api*4.1.0@default:default"/>
<setEntry value="zcommon@default:default"/>
<setEntry value="zel@default:default"/>
<setEntry value="zhtml@default:default"/>
<setEntry value="zjavassist@default:default"/>
<setEntry value="zul*8.6.0.1-patched@default:default"/>
<setEntry value="zweb@default:default"/>
</setAttribute>
<setAttribute key="selected_workspace_bundles">
<setEntry value="org.adempiere.base.callout@default:default"/>
<setEntry value="org.adempiere.base.process@default:default"/>
<setEntry value="org.adempiere.base@default:default"/>
<setEntry value="org.adempiere.extend@default:false"/>
<setEntry value="org.adempiere.install@default:default"/>
<setEntry value="org.adempiere.payment.processor@default:default"/>
<setEntry value="org.adempiere.pipo.handlers@default:default"/>
<setEntry value="org.adempiere.pipo@default:default"/>
<setEntry value="org.adempiere.plugin.utils@default:default"/>
<setEntry value="org.adempiere.replication@default:default"/>
<setEntry value="org.adempiere.report.jasper.library@default:false"/>
<setEntry value="org.adempiere.report.jasper@default:default"/>
<setEntry value="org.adempiere.ui.swing@default:default"/>
<setEntry value="org.adempiere.ui@default:default"/>
<setEntry value="org.apache.ecs@default:default"/>
<setEntry value="org.compiere.db.oracle.provider@default:default"/>
<setEntry value="org.compiere.db.postgresql.provider@default:default"/>
<setEntry value="org.idempiere.hazelcast.service@default:default"/>
</setAttribute>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="true"/>
<booleanAttribute key="usefeatures" value="false"/>
</launchConfiguration>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.adempiere.ui.swing.pluginlist</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,4 +0,0 @@
#Wed Mar 17 17:21:50 CET 2010
eclipse.preferences.version=1
pluginProject.extensions=true
resolve.requirebundle=false

View File

@ -1,13 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: PluginList
Bundle-SymbolicName: org.adempiere.ui.swing.pluginlist;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.adempiere.plugin.list.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Eclipse-LazyStart: true
Import-Package: org.osgi.framework;version="1.3.0"
Require-Bundle: org.adempiere.base;bundle-version="0.0.0",
org.adempiere.ui.swing;bundle-version="0.0.0",
org.adempiere.plugin.utils;bundle-version="0.0.0"

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<adempiereAD
Name="PluginList" Version="0.0.0.1" CompVer="all" DataBase="1"
Description="List of Plugins"
creator="-" creatorcontact="-" createddate="2009-03-25 15:52:18" updateddate="2009-03-25 15:52:18" PackOutVer="005">
<menu
ADMenuNameID="Plugin List" ADWindowNameID="" ADProcessNameID="" ADFormNameID="Plugin List" ADTaskNameID="" ADWorkbenchNameID="" ADWorkflowNameID=""
ADParentMenuNameID="System Rules" ADParentSeqno="0" Action="X" Description="Plugin List" EntityType="U" isActive="true" isReadOnly="false" isSOTrx="false" isSummary="false">
<form
ADFormNameID="Plugin List" Classname="osgi://org.adempiere.plugin.list.PluginList"
isBetaFunctionality="false" AccessLevel="6" Description="" isActive="true" EntityType="U" Help="" Name="Plugin List"/>
</menu>
</adempiereAD>

View File

@ -1,5 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.adempiere.apps.Form"
id="org.adempiere.plugin.list.PluginList">
<form
class="org.adempiere.plugin.list.PluginList">
</form>
</extension>
</plugin>

View File

@ -1,19 +0,0 @@
package org.adempiere.plugin.list;
import org.adempiere.plugin.utils.AdempiereActivator;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator extends AdempiereActivator implements BundleActivator {
static private BundleContext ctx;
@Override
public void start() {
ctx = getContext();
}
public static BundleContext getPluginContext() {
return ctx;
}
}

View File

@ -1,141 +0,0 @@
package org.adempiere.plugin.list;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
import java.util.logging.Level;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.table.DefaultTableModel;
import org.compiere.apps.form.FormFrame;
import org.compiere.apps.form.FormPanel;
import org.compiere.minigrid.MiniTable;
import org.compiere.swing.CPanel;
import org.compiere.util.CLogger;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
public class PluginList implements FormPanel, ActionListener {
private static CLogger log = CLogger.getCLogger(PluginList.class);
@SuppressWarnings("unused")
private int m_WindowNo;
private FormFrame m_frame;
private CPanel northPanel = new CPanel();
private CPanel centerPanel = new CPanel();
private CPanel confirmPanel = new CPanel();
private MiniTable pluginTable = new MiniTable();
private JScrollPane centerScrollPane = new JScrollPane();
private JButton refreshButton = new JButton();
@Override
public void dispose() {
if (m_frame != null)
m_frame.dispose();
m_frame = null;
}
@Override
public void init(int WindowNo, FormFrame frame) {
log.info("");
m_WindowNo = WindowNo;
m_frame = frame;
try
{
jbInit();
frame.getContentPane().add(northPanel, BorderLayout.NORTH);
frame.getContentPane().add(centerPanel, BorderLayout.CENTER);
frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH);
}
catch(Exception e)
{
log.log(Level.SEVERE, "init", e);
}
}
private void jbInit() {
centerPanel.add(centerScrollPane, BorderLayout.CENTER);
centerScrollPane.getViewport().add(pluginTable, null);
updatePlugins();
refreshButton.setText("Refresh");
refreshButton.addActionListener(this);
confirmPanel.add(refreshButton);
}
private void updatePlugins() {
DefaultTableModel dataModel = new DefaultTableModel(getData(), getColumnNames());
pluginTable.setModel(dataModel);
pluginTable.autoSize();
}
private Vector<Vector<Object>> getData() {
BundleContext ctx = getContext();
Vector<Vector<Object>> result = new Vector<Vector<Object>>();
for (Bundle bundle : ctx.getBundles()) {
Vector<Object> col = new Vector<Object>();
col.add(bundle.getBundleId());
col.add(state(bundle.getState()));
col.add(bundle.getSymbolicName());
col.add(bundle.getVersion());
result.add(col);
}
return result;
}
private BundleContext getContext() {
return Activator.getPluginContext();
}
private String state(int state) {
switch (state) {
case Bundle.ACTIVE:
return "ACTIVE";
case Bundle.INSTALLED:
return "INSTALLED";
case Bundle.RESOLVED:
return "RESOLVED";
case Bundle.STARTING:
return "STARTING";
case Bundle.STOPPING:
return "STOPPING";
case Bundle.UNINSTALLED:
return "UNINSTALLED";
default:
return "UNKNOWN";
}
}
private Vector<String> getColumnNames() {
Vector<String> result = new Vector<String>();
result.add("Id");
result.add("State");
result.add("Name");
result.add("Version");
return result;
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(refreshButton))
refreshClicked(e);
}
private void refreshClicked(ActionEvent e) {
int row = pluginTable.getSelectedRow();
if (row==-1)
return;
long id = (Long) pluginTable.getValueAt(row, 0);
Bundle bundle = getContext().getBundle(id);
try {
bundle.update();
} catch (BundleException ex) {
log.log(Level.SEVERE, "refresh", ex);
}
}
}

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
<attribute name="add-exports" value="java.desktop/sun.awt=ALL-UNNAMED"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry exported="true" kind="lib" path="lib/jpedal.jar"/>
<classpathentry exported="true" kind="lib" path="lib/looks.jar"/>
<classpathentry exported="true" kind="lib" path="lib/miglayout.jar"/>
<classpathentry exported="true" kind="lib" path="lib/swingx.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.adempiere.ui.swing</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,102 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled

View File

@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -1,122 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: iDempiere Swing Client
Bundle-SymbolicName: org.adempiere.ui.swing;singleton:=true
Bundle-Version: 7.1.0.qualifier
Bundle-ClassPath: .,
lib/jpedal.jar,
lib/looks.jar,
lib/miglayout.jar,
lib/swingx.jar
Export-Package: com.jgoodies.looks,
com.jgoodies.looks.common,
com.jgoodies.looks.plastic,
com.jgoodies.looks.plastic.theme,
com.jgoodies.looks.windows,
de.schaeffer.compiere.tools,
net.miginfocom.layout,
net.miginfocom.swing,
org.adempiere.apps.graph,
org.adempiere.pdf.viewer,
org.adempiere.plaf,
org.adempiere.ui.swing.factory,
org.compiere,
org.compiere.acct,
org.compiere.apps,
org.compiere.apps.form,
org.compiere.apps.search,
org.compiere.apps.wf,
org.compiere.grid,
org.compiere.grid.ed,
org.compiere.grid.tree,
org.compiere.images,
org.compiere.install,
org.compiere.minigrid,
org.compiere.plaf,
org.compiere.pos,
org.compiere.print,
org.compiere.swing,
org.eevolution.form,
org.jdesktop.beans,
org.jdesktop.swingx,
org.jdesktop.swingx.action,
org.jdesktop.swingx.auth,
org.jdesktop.swingx.autocomplete,
org.jdesktop.swingx.border,
org.jdesktop.swingx.calendar,
org.jdesktop.swingx.color,
org.jdesktop.swingx.combobox,
org.jdesktop.swingx.decorator,
org.jdesktop.swingx.error,
org.jdesktop.swingx.event,
org.jdesktop.swingx.geom,
org.jdesktop.swingx.graphics,
org.jdesktop.swingx.hyperlink,
org.jdesktop.swingx.icon,
org.jdesktop.swingx.image,
org.jdesktop.swingx.multislider,
org.jdesktop.swingx.multisplitpane,
org.jdesktop.swingx.painter,
org.jdesktop.swingx.painter.effects,
org.jdesktop.swingx.plaf,
org.jdesktop.swingx.renderer,
org.jdesktop.swingx.rollover,
org.jdesktop.swingx.search,
org.jdesktop.swingx.sort,
org.jdesktop.swingx.table,
org.jdesktop.swingx.tips,
org.jdesktop.swingx.tree,
org.jdesktop.swingx.treetable,
org.jdesktop.swingx.util
Require-Bundle: org.adempiere.base;bundle-version="0.0.0",
org.adempiere.ui;bundle-version="0.0.0",
org.jfree.chart;bundle-version="1.0.19",
org.jfree.jcommon;bundle-version="1.0.23"
Eclipse-ExtensibleAPI: true
Eclipse-RegisterBuddy: org.adempiere.base
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=11))"
Import-Package: groovy.beans;version="2.5.3",
groovy.cli;version="2.5.3",
groovy.grape;version="2.5.3",
groovy.inspect;version="2.5.3",
groovy.inspect.swingui;version="2.5.3",
groovy.io;version="2.5.3",
groovy.json;version="2.5.3",
groovy.lang;version="2.5.3",
groovy.model;version="2.5.3",
groovy.security;version="2.5.3",
groovy.sql;version="2.5.3",
groovy.swing;version="2.5.3",
groovy.swing.binding;version="2.5.3",
groovy.swing.factory;version="2.5.3",
groovy.swing.impl;version="2.5.3",
groovy.time;version="2.5.3",
groovy.transform;version="2.5.3",
groovy.transform.builder;version="2.5.3",
groovy.transform.options;version="2.5.3",
groovy.transform.stc;version="2.5.3",
groovy.ui;version="2.5.3",
groovy.ui.icons;version="2.5.3",
groovy.ui.text;version="2.5.3",
groovy.ui.view;version="2.5.3",
groovy.util;version="2.5.3",
groovy.util.logging;version="2.5.3",
groovy.util.slurpersupport;version="2.5.3",
groovy.xml;version="2.5.3",
groovy.xml.dom;version="2.5.3",
groovy.xml.jaxb;version="2.5.3",
groovy.xml.streamingmarkupsupport;version="2.5.3",
javax.net.ssl,
net.sf.jasperreports.engine,
org.apache.ecs,
org.apache.ecs.xhtml,
org.apache.poi.hssf.usermodel,
org.compiere.css,
org.eclipse.core.runtime;version="3.4.0",
org.eclipse.equinox.app,
org.osgi.framework;version="1.5.0"
Service-Component: OSGI-INF/*.xml
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.adempiere.ui.swing
Bundle-Vendor: iDempiere Community

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.compiere.grid.DefaultCreateFromFactory">
<implementation class="org.compiere.grid.DefaultCreateFromFactory"/>
<service>
<provide interface="org.compiere.grid.ICreateFromFactory"/>
</service>
</scr:component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.factory.DefaultEditorFactory">
<implementation class="org.adempiere.ui.swing.factory.DefaultEditorFactory"/>
<service>
<provide interface="org.adempiere.ui.swing.factory.IEditorFactory"/>
</service>
</scr:component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.factory.DefaultFormFactory">
<implementation class="org.adempiere.ui.swing.factory.DefaultFormFactory"/>
<service>
<provide interface="org.adempiere.ui.swing.factory.IFormFactory"/>
</service>
</scr:component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.factory.DefaultInfoFactory">
<implementation class="org.adempiere.ui.swing.factory.DefaultInfoFactory"/>
<service>
<provide interface="org.adempiere.ui.swing.factory.IInfoFactory"/>
</service>
</scr:component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.compiere.grid.DefaultPaymentFormFactory">
<implementation class="org.compiere.grid.DefaultPaymentFormFactory"/>
<service>
<provide interface="org.compiere.grid.IPaymentFormFactory"/>
</service>
</scr:component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.process.DefaultPrintShippingLabel">
<implementation class="org.adempiere.process.DefaultPrintShippingLabel"/>
<service>
<provide interface="org.adempiere.process.IPrintShippingLabel"/>
</service>
</scr:component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.compiere.print.SwingViewerProvider">
<implementation class="org.compiere.print.SwingViewerProvider"/>
<service>
<provide interface="org.compiere.print.ReportViewerProvider"/>
</service>
</scr:component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.compiere.util.ResourceFinder">
<implementation class="org.compiere.util.ResourceFinder"/>
<service>
<provide interface="org.adempiere.base.IResourceFinder"/>
</service>
</scr:component>

View File

@ -1,19 +0,0 @@
@Title Build Client
@Rem $Header: /cvsroot/adempiere/client/RUN_build.bat,v 1.13 2005/09/16 00:48:35 jjanke Exp $
@CALL ..\utils_dev\myDevEnv.bat
@IF NOT %ADEMPIERE_ENV%==Y GOTO NOBUILD
@echo Cleanup ...
@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main clean
@echo Building ...
@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main clientDistribute
@Echo Done ...
@sleep 60
@exit
:NOBUILD
@Echo Check myDevEnv.bat (copy from myDevEnvTemplate.bat)
@Pause

View File

@ -1,18 +0,0 @@
# Module compiling script
# Ported from Windows script Marek Mosiewicz<marek.mosiewicz@jotel.com.pl>
SAVED_DIR=`pwd` #save current dir
cd `dirname $0`/../utils_dev #change dir to place where script resides - doesn not work with sym links
UTILS_DEV=`pwd` #this is adempiere source
cd $SAVED_DIR #back to the saved directory
. $UTILS_DEV/myDevEnv.sh #call environment
echo done
if [ ! $ADEMPIERE_ENV==Y ] ; then
echo "Can't set developemeent environemnt - check myDevEnv.sh"
exit 1
fi
echo running Ant
$JAVA_HOME/bin/java -Dant.home="." $ANT_PROPERTIES org.apache.tools.ant.Main

View File

@ -1,11 +0,0 @@
@Title Swingset
@Rem $Id: Swingset.bat,v 1.1 2002/03/17 02:29:49 jjanke Exp $
@Rem Put the swing.properties file in the \rje\lib directory
@set JAVA_HOME=D:\j2sdk1.4.0
@Rem
%JAVA_HOME%\jre\bin\java -jar %JAVA_HOME%\demo\jfc\SwingSet2\SwingSet2.jar
@Echo done ...
@Sleep 10

View File

@ -1,10 +0,0 @@
bin.includes = META-INF/,\
plugin.xml,\
OSGI-INF/,\
.,\
lib/jpedal.jar,\
lib/looks.jar,\
lib/miglayout.jar,\
lib/swingx.jar
source.. = src/
output.. = target/classes/

View File

@ -1,5 +0,0 @@
@Rem API Documentation for Base
call ..\doc\documentation.bat src doc -private
@pause

View File

@ -1,11 +0,0 @@
org.compiere.acct
org.compiere.apps
org.compiere.apps.form
org.compiere.apps.search
org.compiere.grid
org.compiere.grid.ed
org.compiere.grid.tree
org.compiere.images
org.compiere.install
org.compiere.minigrid
org.compiere.print

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension-point id="org.adempiere.apps.Form" name="Form" schema="schema/org.adempiere.apps.Form.exsd"/>
<extension
id="org.adempiere.ui.swing.client"
name="Adempiere Swing Client"
point="org.eclipse.core.runtime.applications">
<application>
<run class="org.adempiere.client.Application" />
</application>
</extension>
<extension
id="client_product"
point="org.eclipse.core.runtime.products">
<product
application="org.adempiere.ui.swing.client"
name="Adempiere Swing Client">
<property
name="appName"
value="Adempiere Swing Client">
</property>
</product>
</extension>
</plugin>

View File

@ -1,82 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.idempiere</groupId>
<artifactId>org.idempiere.parent</artifactId>
<version>7.1.0-SNAPSHOT</version>
<relativePath>../org.idempiere.parent/pom.xml</relativePath>
</parent>
<artifactId>org.adempiere.ui.swing</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=367431 -->
<arg>-warn:+forbidden</arg>
<arg>--add-exports</arg>
<arg>java.desktop/sun.awt=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.swinglabs</groupId>
<artifactId>swingx</artifactId>
<version>1.6</version>
</artifactItem>
<artifactItem>
<groupId>com.jgoodies</groupId>
<artifactId>looks</artifactId>
<version>2.0.4</version>
</artifactItem>
<artifactItem>
<groupId>com.miglayout</groupId>
<artifactId>miglayout</artifactId>
<version>3.7.1</version>
</artifactItem>
</artifactItems>
<outputDirectory>lib</outputDirectory>
<stripVersion>true</stripVersion>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>${url.file.srv}/extra.jar/jpedal.jar</url>
<unpack>false</unpack>
<outputDirectory>lib</outputDirectory>
<retries>5</retries>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,133 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.adempiere.client" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.adempiere.client" id="org.adempiere.apps.Form" name="Form"/>
</appinfo>
<documentation>
Extension point to provide FormPanel instance. Use the {extension id} syntax in AD_Form.ClassName to reference the extension that will provide the FormPanel instance ( replace {extension id} with your actual extension id ).
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<choice>
<element ref="form"/>
</choice>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="form">
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
Implementation class name for the org.compiere.apps.form.FormPanel interface
</documentation>
<appinfo>
<meta.attribute kind="java" basedOn=":org.compiere.apps.form.FormPanel"/>
</appinfo>
</annotation>
</attribute>
<attribute name="priority" type="string">
<annotation>
<documentation>
numeric priority value, higher value is of higher priority
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
1.0.0
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
&lt;pre&gt;
&lt;extension
id=&quot;org.adempiere.extend.myForm&quot;
name=&quot;My Form&quot;
point=&quot;org.adempiere.apps.Form&quot;&gt;
&lt;process
class=&quot;org.adempiere.ui.swing.extend.MyForm&quot;&gt;
&lt;/process&gt;
&lt;/extension&gt;
AD_Form.ClassName=&quot;org.adempiere.extend.myForm&quot;
&lt;/pre&gt;
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
The class attribute must represent an implementor of org.compiere.apps.form.FormPanel
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="copyright"/>
</appinfo>
<documentation>
This file is part of Adempiere ERP Bazaar http://www.adempiere.org.
Copyright (C) Heng Sin Low.
Copyright (C) Contributors.
This program is free software; you can redistribute it and/or modify it
under the terms version 2 of the GNU General Public License as published
by the Free Software Foundation. This program is distributed in the hope
that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
</documentation>
</annotation>
</schema>

View File

@ -1,62 +0,0 @@
/**********************************************************************
* This file is part of Adempiere ERP Bazaar *
* http://www.adempiere.org *
* *
* Copyright (C) Jan Roessler - Schaeffer *
* Copyright (C) Contributors *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
* *
* Contributors: *
* - Jan Roessler *
* - Heng Sin Low *
* *
* Sponsors: *
* - Schaeffer *
**********************************************************************/
package de.schaeffer.compiere.tools;
import org.adempiere.util.AbstractDocumentSearch;
import org.compiere.apps.AEnv;
import org.compiere.apps.AWindow;
import org.compiere.model.MQuery;
import org.compiere.util.CLogger;
/**
* Executes search and opens windows for defined transaction codes
*
* @author Jan Roessler, jr@schaeffer-ag.de
*
*/
public class DocumentSearch extends AbstractDocumentSearch {
/** the logger */
@SuppressWarnings("unused")
private static CLogger log = CLogger.getCLogger(DocumentSearch.class);
@Override
protected boolean openWindow(int windowId, MQuery query) {
final AWindow frame = new AWindow(null);
AEnv.addToWindowManager(frame);
if (frame.initWindow(windowId, query)) {
frame.pack();
AEnv.showCenterScreen(frame);
}
return true;
}
}

View File

@ -1,98 +0,0 @@
package org.adempiere.apps.graph;
import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.text.Element;
import javax.swing.text.View;
import javax.swing.text.ViewFactory;
import javax.swing.text.html.HTML;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.ImageView;
public class FCHtmlEditorKit extends HTMLEditorKit {
/**
*
*/
private static final long serialVersionUID = -3371176452691681668L;
public ViewFactory getViewFactory() {
if (defaultFactory == null) {
defaultFactory = new FCHtmlFactory(super.getViewFactory());
}
return defaultFactory;
}
private static class FCHtmlFactory implements ViewFactory {
public FCHtmlFactory(ViewFactory factory) {
oldFactory = factory;
}
public View create(Element elem) {
View result;
result = oldFactory.create(elem);
if (result instanceof ImageView) {
String src = (String)elem.getAttributes().
getAttribute(HTML.Attribute.SRC);
if ("res:".equals(src.substring(0, 4))) {
result = new NewImageView(elem);
}
}
return result;
}
private static class NewImageView extends ImageView {
Element elem;
public NewImageView(Element elem) {
super(elem);
this.elem=elem;
}
public Image getImage() {
//return smile image
//java.awt.Toolkit.getDefaultToolkit().getImage(getImageURL()).flush();
//if (smileImage == null) {
String src = (String)elem.getAttributes().
getAttribute(HTML.Attribute.SRC);
//System.out.println("img load: " + src.substring(4));
URL url = getClass().getClassLoader().
getResource(src.substring(4));
//getResource("at/freecom/apps/images/freecom.gif");
//getResource("javax/swing/text/html/icons/image-delayed.gif");
if (url == null) return null;
smileImage = Toolkit.getDefaultToolkit().getImage(url);
if (smileImage==null) return null;
//forcing image to load synchronously
ImageIcon ii = new ImageIcon();
ii.setImage(smileImage);
//}
return smileImage;
}
public URL getImageURL() {
// here we return url to some image. It might be any
// existing image. we need to move ImageView to the
// state where it thinks that image was loaded.
// ImageView is calling getImage to get image for
// measurement and painting when image was loaded
/*if (false) {
return getClass().getClassLoader().
getResource("javax/swing/text/html/icons/image-delayed.gif");
} else {*/
String src = (String)elem.getAttributes().
getAttribute(HTML.Attribute.SRC);
//System.out.println("img load: " + src.substring(4));
URL url = getClass().getClassLoader().
getResource(src.substring(4));
if (url != null) {
// System.out.println("load image: " + url);
return url;
}
//}
return null;
}
private static Image smileImage = null;
}
private ViewFactory oldFactory;
}
private static ViewFactory defaultFactory = null;
}

View File

@ -1,313 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.apps.graph;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Point;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
import java.util.ArrayList;
import org.compiere.apps.AEnv;
import org.compiere.grid.ed.VLookup;
import org.compiere.model.MGoal;
import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MLookupInfo;
import org.compiere.model.MQuery;
import org.compiere.swing.CPanel;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.jfree.chart.ChartMouseEvent;
import org.jfree.chart.ChartMouseListener;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.entity.CategoryItemEntity;
import org.jfree.chart.entity.ChartEntity;
import org.jfree.chart.entity.PieSectionEntity;
/**
* Graph
*
* @author Jorg Janke
* @version $Id: BarGraph.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
*
* @author Teo Sarca, www.arhipac.ro
* <li>BF [ 2507325 ] BarGraph zoom not working
* @author hengsin
* <li> Add support for other type of graph
*/
public class Graph extends CPanel implements ChartMouseListener
{
/**
*
*/
private static final long serialVersionUID = -4150122585550132822L;
/**
* Constructor
*/
public Graph()
{
super();
this.setLayout(new BorderLayout());
builder = new GraphBuilder();
} // BarGraph
/**
* Constructor
* @param goal goal
*/
public Graph(MGoal goal)
{
this(goal, false);
}
/**
* Constructor
* @param goal goal
*/
public Graph(MGoal goal, boolean userSelection)
{
this();
builder = new GraphBuilder();
builder.setMGoal(goal);
builder.setYAxisLabel(goal.getName());
builder.setXAxisLabel(goal.getXAxisText());
m_userSelection = userSelection;
loadData();
//addComponentListener(this);
} // BarGraph
/** Graph Size */
//private Dimension m_size = null;
/** Zero/Zero Coordinate point */
private Point m_point0_0 = null;
// /** Layout */
// private BarGraphLayout m_layout = new BarGraphLayout(this);
/** Logger */
private static CLogger log = CLogger.getCLogger (Graph.class);
/** Y Axis Target Line */
@SuppressWarnings("unused")
private double m_Y_Target = 0;
/** Y Axis Target Line Label */
private String m_Y_TargetLabel = null;
private static Dimension paneldimension = new Dimension(180, 150);
private GraphBuilder builder;
/**
* Load Performance Data
*/
ArrayList<GraphColumn> list = new ArrayList<GraphColumn>();
private boolean m_userSelection;
private void loadData()
{
list = builder.loadData();
JFreeChart chart = builder.createChart(builder.getMGoal().getChartType());
if (chartPanel != null)
remove(chartPanel);
chartPanel = new ChartPanel(chart);
chartPanel.setSize(getSize());
chartPanel.addChartMouseListener(this);
add(chartPanel,BorderLayout.CENTER);
if (m_userSelection)
{
int AD_Reference_Value_ID = DB.getSQLValue(null, "SELECT AD_Reference_ID FROM AD_Reference WHERE Name = ?", "PA_Goal ChartType");
MLookupInfo info = MLookupFactory.getLookup_List(Env.getLanguage(Env.getCtx()), AD_Reference_Value_ID);
MLookup mLookup = new MLookup(info, 0);
VLookup lookup = new VLookup("ChartType", false, false, true,
mLookup);
lookup.addVetoableChangeListener(new VetoableChangeListener() {
public void vetoableChange(PropertyChangeEvent evt)
throws PropertyVetoException {
Object value = evt.getNewValue();
if (value == null) return;
JFreeChart chart = null;
chart = builder.createChart(value.toString());
if (chart != null)
{
if (chartPanel != null)
remove(chartPanel);
chartPanel = new ChartPanel(chart);
chartPanel.setSize(getSize());
chartPanel.addChartMouseListener(Graph.this);
add(chartPanel,BorderLayout.CENTER);
getParent().validate();
}
}
});
add(lookup, BorderLayout.NORTH);
}
this.setMinimumSize(paneldimension);
} // loadData
private ChartPanel chartPanel;
/**
* Get Point 0_0
* @return point
*/
public Point getPoint0_0()
{
return m_point0_0;
} // getPoint0_0
/**
* @return Returns the x_AxisLabel.
*/
public String getX_AxisLabel ()
{
return builder.getXAxisLabel();
} // getX_AxisLabel
/**
* @param axisLabel The x_AxisLabel to set.
*/
public void setX_AxisLabel (String axisLabel)
{
builder.setXAxisLabel(axisLabel);
} // setX_AxisLabel
/**
* @return Returns the y_AxisLabel.
*/
public String getY_AxisLabel ()
{
return builder.getYAxisLabel();
} // getY_AxisLabel
/**
* @param axisLabel The y_AxisLabel to set.
*/
public void setY_AxisLabel (String axisLabel)
{
builder.setYAxisLabel(axisLabel);
} // setY_AxisLabel
/**
* @return Returns the y_TargetLabel.
*/
public String getY_TargetLabel ()
{
return m_Y_TargetLabel;
} // getY_TargetLabel
/**
* @param targetLabel The y_TargetLabel to set.
*/
public void setY_TargetLabel (String targetLabel, double target)
{
m_Y_TargetLabel = targetLabel;
m_Y_Target = target;
} // setY_TargetLabel
/**
* Get BarGraphColumn for ChartEntity
* @param event
* @return BarGraphColumn or null if not found
*/
private GraphColumn getGraphColumn(ChartMouseEvent event)
{
ChartEntity entity = event.getEntity();
String key = null;
if (entity instanceof CategoryItemEntity)
{
Comparable<?> colKey = ((CategoryItemEntity)entity).getColumnKey();
if (colKey != null)
{
key = colKey.toString();
}
}
else if (entity instanceof PieSectionEntity)
{
Comparable<?> sectionKey = ((PieSectionEntity)entity).getSectionKey();
if (sectionKey != null)
{
key = sectionKey.toString();
}
}
if (key == null)
{
return null;
}
for (int i = 0; i < list.size(); i++)
{
final String label = list.get(i).getLabel();
if (key.equals(label))
{
return list.get(i);
}
}
//
return null;
}
public void chartMouseClicked(ChartMouseEvent event)
{
if ((event.getEntity()!=null) && (event.getTrigger().getClickCount() > 1))
{
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try
{
GraphColumn bgc = getGraphColumn(event);
if (bgc == null)
{
return;
}
MQuery query = bgc.getMQuery(builder.getMGoal());
if (query != null)
AEnv.zoom(query);
else
log.warning("Nothing to zoom to - " + bgc);
}
finally
{
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
}
public void chartMouseMoved(ChartMouseEvent event)
{
}
public GraphColumn[] getGraphColumnList()
{
return list.toArray(new GraphColumn[list.size()]);
}
} // BarGraph

View File

@ -1,170 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.apps.graph;
import java.awt.Color;
import java.util.ArrayList;
import org.compiere.util.CLogger;
/**
* Graphic Utilities
*
* @author Jorg Janke
* @version $Id: GraphUtil.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
*/
public class GraphUtil
{
/** Logger */
@SuppressWarnings("unused")
private static CLogger log = CLogger.getCLogger (GraphUtil.class);
/**
* Get Foreground for back
* @param background back
* @return while or black
*/
public static Color getForeground (Color background)
{
if (background != null && isDark(background))
return Color.white;
return Color.black;
} // getForeground
/**
* Get Column Background
* @param index index
* @return random color
*/
public static Color getBackground (int index)
{
while (s_colors.size() <= index)
{
int rr = (index+1) * 47;
int gg = 100;
while (rr > 255)
{
rr -= 255;
gg += 50;
}
while (gg > 255)
gg -= 255;
s_colors.add(new Color(255-rr, gg, rr));
}
return s_colors.get(index);
} // getBackGround
/** List of Colors */
private static ArrayList<Color> s_colors = new ArrayList<Color>();
/**
* Is the Color dark?
* @param color color
* @return true if dark
*/
public static boolean isDark (Color color)
{
float r = color.getRed() / 255.0f;
float g = color.getGreen() / 255.0f;
float b = color.getBlue() / 255.0f;
double whiteDistance = colorDistance (r, g, b, 1.0, 1.0, 1.0);
double blackDistance = colorDistance (r, g, b, 0.0, 0.0, 0.0);
boolean dark = blackDistance < whiteDistance;
if (r+g+b == 1.0)
dark = false;
// log.info("r=" + r + ",g=" + g + ",b=" + b + " - black=" + blackDistance
// + (dark ? " <dark " : " light> ") + "white=" + whiteDistance
// + " - Alpha=" + color.getAlpha() + ", Trans=" + color.getTransparency());
return dark;
} // isDark
/**
* Is Color more white or black?
* @param r red
* @param g green
* @param b blue
* @return true if dark
*/
public static boolean isDark (double r, double g, double b)
{
double whiteDistance = colorDistance (r, g, b, 1.0, 1.0, 1.0);
double blackDistance = colorDistance (r, g, b, 0.0, 0.0, 0.0);
boolean dark = blackDistance < whiteDistance;
// log.finest("r=" + r + ",g=" + g + ",b=" + b + " - white=" + whiteDistance + ",black=" + blackDistance);
return dark;
} // isDark
/**
* Simple Color Distance.
* (3d point distance)
* @param r1 first red
* @param g1 first green
* @param b1 first blue
* @param r2 second red
* @param g2 second green
* @param b2 second blue
* @return 3d distance for relative comparison
*/
public static double colorDistance (double r1, double g1, double b1,
double r2, double g2, double b2)
{
double a = (r2 - r1) + 0.1;
double b = (g2 - g1) + 0.1;
double c = (b2 - b1) + 0.1;
return Math.sqrt (a*a + b*b + c*c);
} // colorDistance
/**
* Get darker color
* @param color color
* @param factor factor 0..1 (AWT 0.7) the smaller, the darker
* @return darker color
*/
public static Color darker(Color color, double factor)
{
if (factor < 0.0)
factor = 0.7;
else if (factor > 1.0)
factor = 0.7;
return new Color(
Math.max((int)(color.getRed() * factor), 0),
Math.max((int)(color.getGreen() * factor), 0),
Math.max((int)(color.getBlue() * factor), 0));
} // darker
/**
* Get brighter color
* @param color color
* @param factor factor 0..1 (AWT 0.7) the smaller, the lighter
* @return brighter color
*/
public static Color brighter (Color color, double factor)
{
if (factor < 0.0)
factor = 0.7;
else if (factor > 1.0)
factor = 0.7;
return new Color(
Math.min((int)(color.getRed() / factor), 255),
Math.min((int)(color.getGreen() / factor), 255),
Math.min((int)(color.getBlue() / factor), 255));
} // brighter
} // GraphUtil

View File

@ -1,504 +0,0 @@
/**
*
*/
package org.adempiere.apps.graph;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.logging.Level;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.Document;
import org.compiere.apps.AEnv;
import org.compiere.apps.AWindow;
import org.compiere.model.MAchievement;
import org.compiere.model.MDashboardContent;
import org.compiere.model.MDashboardPreference;
import org.compiere.model.MGoal;
import org.compiere.model.MMeasureCalc;
import org.compiere.model.MProjectType;
import org.compiere.model.MQuery;
import org.compiere.model.MRequestType;
import org.compiere.model.MRole;
import org.compiere.swing.CMenuItem;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Ini;
import org.compiere.util.Msg;
import org.compiere.util.Util;
/**
* @author fcsku
*
*/
public class HtmlDashboard extends JPanel implements MouseListener,
ActionListener, HyperlinkListener {
/**
*
*/
private static final long serialVersionUID = 8125801717324723271L;
private static Dimension paneldimensionMin = new Dimension(80, 80);
private JEditorPane html;
private enum PAGE_TYPE {PAGE_HOME, PAGE_PERFORMANCE, PAGE_LOGO};
private static CLogger log = CLogger.getCLogger (HtmlDashboard.class);
MGoal[] m_goals = null;
JPopupMenu popupMenu = new JPopupMenu();
private CMenuItem mRefresh = new CMenuItem(Msg.getMsg(Env.getCtx(), "Refresh"), Env.getImageIcon("Refresh16.gif"));
URL lastUrl = null;
/**
* Constructor
*/
public HtmlDashboard(String url, MGoal[] m_goals, boolean scrolling)
{
super();
//+param VTreePanel treePanel,
//this.treePanel = treePanel;
setName("test title");
this.setLayout( new BorderLayout() );
this.m_goals = m_goals;
// Create an HTML viewer
JEditorPane.registerEditorKitForContentType("text/html", "org.adempiere.apps.graph.FCHtmlEditorKit");
html = new JEditorPane();
html.setContentType("text/html");
html.setEditable( false );
htmlUpdate(url);
JScrollPane scrollPane = null;
if (scrolling)
scrollPane = new JScrollPane();
else
scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.getViewport().add( html, BorderLayout.CENTER );
this.add( scrollPane, BorderLayout.CENTER );
this.setMinimumSize(paneldimensionMin);
addMouseListener(this);
html.addHyperlinkListener( this );
mRefresh.addActionListener(this);
popupMenu.add(mRefresh);
html.addMouseListener(this);
html.setBackground(getBackground());
}
public HtmlDashboard(String url)
{
new HtmlDashboard(url, null, true);
}
private String createHTML(PAGE_TYPE requestPage){
StringBuilder result = new StringBuilder("<html><head>");
// READ CSS
URL url = getClass().getClassLoader().
getResource("org/compiere/css/PAPanel.css");
InputStreamReader ins;
BufferedReader bufferedReader = null;
try {
ins = new InputStreamReader(url.openStream());
bufferedReader = new BufferedReader( ins );
String cssLine;
result.append("<style type=\"text/css\">");
while ((cssLine = bufferedReader.readLine()) != null)
result.append(cssLine).append("\n");
result.append("</style>");
} catch (IOException e1) {
log.log(Level.SEVERE, e1.getLocalizedMessage(), e1);
}
finally{
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (Exception e) {}
bufferedReader = null;
}
}
//System.out.println(result);
switch (requestPage) {
case PAGE_LOGO:
result.append("</head><body class=\"header\">")
.append("<table width=\"100%\"><tr><td>")
.append("<img src=\"res:org/compiere/images/logo_ad.png\">")
.append("</td><td></td><td width=\"290\">")
.append("</td></tr></table>")
.append("</body></html>");
break;
case PAGE_HOME: //**************************************************************
result.append("</head><body><div class=\"content\">\n");// "<link rel=\"stylesheet\" type=\"text/css\" href=\"file:///c:/standard.css\"/>"
queryZoom = null;
queryZoom = new ArrayList<MQuery>();
String appendToHome = null;
try
{
int AD_User_ID = Env.getAD_User_ID(Env.getCtx());
int AD_Role_ID = Env.getAD_Role_ID(Env.getCtx());
MDashboardPreference[] dps = MDashboardPreference.getForSession(AD_User_ID, AD_Role_ID);
if (dps.length == 0)
createDashboardPreference();
dps = MDashboardPreference.getForSession(true, AD_User_ID, AD_Role_ID); // based on user and role
for (final MDashboardPreference dp : dps)
{
MDashboardContent dc = new MDashboardContent(dp.getCtx(), dp.getPA_DashboardContent_ID(), dp.get_TrxName());
if (!Util.isEmpty(dc.getZulFilePath(), true))
continue;
//
appendToHome = dc.get_Translation(MDashboardContent.COLUMNNAME_HTML);
String descriptionTrl = dp.get_Translation(MDashboardContent.COLUMNNAME_Description);
if (appendToHome != null) {
if (descriptionTrl != null)
result.append("<H2>").append(descriptionTrl).append("</H2>\n");
result.append(stripHtml(appendToHome, false)).append("<br>\n");
}
if (dc.getAD_Menu_ID() > 0) {
result.append("<a class=\"hrefNode\" href=\"http:///window/node#");
result.append(String.valueOf(dc.getAD_Window_ID()));// "AD_MENU_ID") fcsku 3.7.07
result.append("\">");
result.append(descriptionTrl.toString());
result.append("</a><br>\n");
}
result.append("<br>\n");
//result += "table id: " + rs.getInt("AD_TABLE_ID");
if (dc.getPA_Goal_ID() > 0)
result.append(goalsDetail(dc.getPA_Goal_ID()));
}
}
catch (Exception e)
{
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
}
finally
{
}
result.append("<br><br><br>\n")
.append("</div>\n</body>\n</html>\n");
break;
default: //**************************************************************
log.warning("Unknown option - "+requestPage);
}
return result.toString();
}
private void createDashboardPreference()
{
if (Env.getAD_User_ID(Env.getCtx()) == 0 && Env.getAD_Role_ID(Env.getCtx()) == 0)
return;
MDashboardContent[] dcs = MDashboardContent.getForSession(0, 0);
for (MDashboardContent dc : dcs)
{
MDashboardPreference preference = new MDashboardPreference(Env.getCtx(), 0, null);
preference.setAD_Org_ID(Env.getAD_Org_ID(Env.getCtx()));
preference.setAD_Role_ID(Env.getAD_Role_ID(Env.getCtx()));
preference.setAD_User_ID(Env.getAD_User_ID(Env.getCtx()));
preference.setColumnNo(dc.getColumnNo());
preference.setIsCollapsedByDefault(dc.isCollapsedByDefault());
preference.setIsShowInDashboard(dc.isShowInDashboard());
preference.setLine(dc.getLine());
preference.setPA_DashboardContent_ID(dc.getPA_DashboardContent_ID());
if (!preference.save()){
StringBuilder msglog = new StringBuilder("Failed to create dashboard preference ").append(preference.toString());
log.log(Level.SEVERE, msglog.toString());
}
}
}
ArrayList<MQuery> queryZoom = null; //new ArrayList<MQuery>();
private String goalsDetail(int AD_Table_ID) { //TODO link to goals
StringBuilder output = new StringBuilder();
if (m_goals==null) return output.toString();
for (int i = 0; i < m_goals.length; i++) {
MMeasureCalc mc = MMeasureCalc.get(Env.getCtx(), m_goals[i].getMeasure().getPA_MeasureCalc_ID());
if (AD_Table_ID == m_goals[i].getPA_Goal_ID()){// mc.getAD_Table_ID()) {
output.append("<table class=\"dataGrid\"><tr>\n<th colspan=\"3\" class=\"label\"><b>").append(m_goals[i].getName()).append("</b></th></tr>\n");
output.append("<tr><td class=\"label\">Target</td><td colspan=\"2\" class=\"tdcontent\">").append(m_goals[i].getMeasureTarget()).append("</td></tr>\n");
output.append("<tr><td class=\"label\">Actual</td><td colspan=\"2\" class=\"tdcontent\">").append(m_goals[i].getMeasureActual()).append("</td></tr>\n");
//if (mc.getTableName()!=null) output += "table: " + mc.getAD_Table_ID() + "<br>\n";
Graph barPanel = new Graph(m_goals[i]);
GraphColumn[] bList = barPanel.getGraphColumnList();
MQuery query = null;
output.append("<tr><td rowspan=\"").append(bList.length).append("\" class=\"label\" valign=\"top\">").append(m_goals[i].getXAxisText()).append("</td>\n");
for (int k=0; k<bList.length; k++) {
GraphColumn bgc = bList[k];
if (k>0) output.append("<tr>");
if (bgc.getAchievement() != null) // Single Achievement
{
MAchievement a = bgc.getAchievement();
query = MQuery.getEqualQuery("PA_Measure_ID", a.getPA_Measure_ID());
}
else if (bgc.getGoal() != null) // Multiple Achievements
{
MGoal goal = bgc.getGoal();
query = MQuery.getEqualQuery("PA_Measure_ID", goal.getPA_Measure_ID());
}
else if (bgc.getMeasureCalc() != null) // Document
{
mc = bgc.getMeasureCalc();
query = mc.getQuery(m_goals[i].getRestrictions(false),
bgc.getMeasureDisplay(), bgc.getDate(),
MRole.getDefault()); // logged in role
}
else if (bgc.getProjectType() != null) // Document
{
MProjectType pt = bgc.getProjectType();
query = pt.getQuery(m_goals[i].getRestrictions(false),
bgc.getMeasureDisplay(), bgc.getDate(), bgc.getID(),
MRole.getDefault()); // logged in role
}
else if (bgc.getRequestType() != null) // Document
{
MRequestType rt = bgc.getRequestType();
query = rt.getQuery(m_goals[i].getRestrictions(false),
bgc.getMeasureDisplay(), bgc.getDate(), bgc.getID(),
MRole.getDefault()); // logged in role
}
output.append("<td class=\"tdcontent\">").append(bgc.getLabel()).append("</td><td class=\"tdcontent\">");
if (query != null) {
output.append("<a class=\"hrefZoom\" href=\"http:///window/zoom#")
.append(queryZoom.size())
.append("\">")
.append(bgc.getValue())
.append("</a><br>\n");
queryZoom.add(query);
}
else {
if (log.isLoggable(Level.INFO)) log.info("Nothing to zoom to - " + bgc);
output.append(bgc.getValue());
}
output.append("</td></tr>");
}
output.append("</tr>")
.append("<tr><td colspan=\"3\">")
.append(m_goals[i].getDescription())
.append("<br>")
.append(stripHtml(m_goals[i].getColorSchema().getDescription(), true))
.append("</td></tr>")
.append("</table>\n");
bList = null;
barPanel = null;
}
}
return output.toString();
}
private String stripHtml(String htmlString, boolean all) {
htmlString = htmlString
.replace("<html>", "")
.replace("</html>", "")
.replace("<body>", "")
.replace("</body>", "")
.replace("<head>", "")
.replace("</head>", "");
if (all)
htmlString = htmlString
.replace(">", "&gt;")
.replace("<", "&lt;");
return htmlString;
}
private void htmlUpdate(String url) {
try {
htmlUpdate( new URL( url ) );
} catch( MalformedURLException e ) {
log.warning("Malformed URL: " + e );
}
}
private void htmlUpdate(URL url) {
if ((url==null) || (url.getPath().equals("/local/home"))){
html.setText(createHTML(PAGE_TYPE.PAGE_HOME));
html.setCaretPosition(0);
lastUrl = url;
}
else if (url.getPath().equals("/local/logo")){
html.setText(createHTML(PAGE_TYPE.PAGE_LOGO));
html.setCaretPosition(0);
lastUrl = url;
}
else if (url.getPath().equals("/local/performance")){
html.setText(createHTML(PAGE_TYPE.PAGE_PERFORMANCE));
}
else if (url.getPath().equals("/window/node")){
/* fcsku 3.7.07
CButton button = new CButton(""); // Create the button
button.setActionCommand(String.valueOf(url.getRef())); //getNode_ID()
button.addActionListener(treePanel); //VTreePanel
//AEnv.zoom(130, 0);
html.setCursor(Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ));
button.doClick();
html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ));
*/
int AD_Window_ID=Integer.parseInt(url.getRef());
AWindow frame = new AWindow(getGraphicsConfiguration());
if (!frame.initWindow(AD_Window_ID, null))//MQuery.getEqualQuery(TableName + "_ID", Record_ID)))
return;
AEnv.addToWindowManager(frame);
if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED))
{
AEnv.showMaximized(frame);
}
else
{
AEnv.showCenterScreen(frame);
}
frame = null;
html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ));
}
else if (url.getPath().equals("/window/zoom")){
int index = Integer.parseInt(String.valueOf(url.getRef()));
if ((index >= 0) && (index < queryZoom.size())) {
html.setCursor(Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ));
AEnv.zoom(queryZoom.get(index));
html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ));
}
}
else if (url != null){
// Load some cursors
Cursor cursor = html.getCursor();
html.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) );
SwingUtilities.invokeLater( new PageLoader( html, url, cursor ) );
lastUrl = url;
}
}
public void hyperlinkUpdate( HyperlinkEvent event )
{
if( event.getEventType() == HyperlinkEvent.EventType.ACTIVATED )
{
//System.out.println("parsed url: " + event.getURL());// +" from: " +event.getDescription());
htmlUpdate(event.getURL());
}
}
/* (non-Javadoc)
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
*/
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e))
popupMenu.show((Component)e.getSource(), e.getX(), e.getY());
}
/* (non-Javadoc)
* @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
*/
public void mouseEntered(MouseEvent e) {
}
/* (non-Javadoc)
* @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
*/
public void mouseExited(MouseEvent e) {
}
/* (non-Javadoc)
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
*/
public void mousePressed(MouseEvent e) {
}
/* (non-Javadoc)
* @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
*/
public void mouseReleased(MouseEvent e) {
}
/* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
if (e.getSource() == mRefresh)
{
if (m_goals != null)
for (int i=0; i < m_goals.length; i++)
m_goals[i].updateGoal(true);
htmlUpdate(lastUrl);
Container parent = getParent();
if (parent != null)
parent.invalidate();
invalidate();
if (parent != null)
parent.repaint();
else
repaint();
}
}
static class PageLoader implements Runnable
{
private JEditorPane html;
private URL url;
private Cursor cursor;
PageLoader( JEditorPane html, URL url, Cursor cursor )
{
this.html = html;
this.url = url;
this.cursor = cursor;
}
public void run()
{
if( url == null )
{
// restore the original cursor
html.setCursor( cursor );
// PENDING(prinz) remove this hack when
// automatic validation is activated.
Container parent = html.getParent();
parent.repaint();
}
else
{
Document doc = html.getDocument();
try {
html.setPage( url );
}
catch( IOException ioe )
{
html.setDocument( doc );
}
finally
{
// schedule the cursor to revert after
// the paint has happended.
url = null;
SwingUtilities.invokeLater( this );
}
}
}
}
}

View File

@ -1,185 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.apps.graph;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import javax.swing.Box;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import org.compiere.model.MGoal;
import org.compiere.swing.CPanel;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
/**
* Performance Analysis Panel.
* Key Performace Indicators
*
* @author Jorg Janke
* @version $Id: PAPanel.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
*/
public class PAPanel extends CPanel implements ActionListener
{
/**
*
*/
private static final long serialVersionUID = 4937417260772233929L;
/**
* Get Panel if User has Perfpormance Goals
* @return panel pr null
*/
public static PAPanel get()
{
int AD_User_ID = Env.getAD_User_ID(Env.getCtx());
MGoal[] goals = MGoal.getUserGoals(Env.getCtx(), AD_User_ID);
if (goals.length == 0)
return null;
return new PAPanel(goals);
} // get
/**************************************************************************
* Constructor
* @param goals
*/
private PAPanel (MGoal[] goals)
{
super ();
m_goals = goals;
init();
} // PAPanel
/** Goals */
private MGoal[] m_goals = null;
/** Logger */
private static CLogger log = CLogger.getCLogger (PAPanel.class);
/**
* Static/Dynamic Init
*/
private void init()
{
/* BOXES:
*
* boxV Header
* ********
* boxH
*
* boxH * * *
* * boxV1 * boxV2 *
* * * *
*
* boxV1 dial1
* ********
* dial2
*
* boxV2 HTML
* ********
* boxH1
*
* boxH1 * * *
* * bar1 * bar2 *
* * * *
*
*
* V1 + HTML in scrollpane
*/
this.setLayout(new BorderLayout());
// HEADER
Box boxV = Box.createVerticalBox();
// DIALS/HTML+Bars
Box boxH = Box.createHorizontalBox();
// DIALS
Box boxV1 = Box.createVerticalBox();
// HTML/Bars
Box boxV2 = Box.createVerticalBox();
// barChart
Box boxH1 = Box.createHorizontalBox();
//boxH_V.setPreferredSize(new Dimension(180, 1500));
//boxH1.setPreferredSize(new Dimension(400, 180));
boxV2.setPreferredSize(new Dimension(120, 120));
// DIALS below HEADER, LEFT
for (int i = 0; i < m_goals.length; i++)
{
PerformanceIndicator pi = new PerformanceIndicator(m_goals[i]);
pi.addActionListener(this);
boxV1.add (pi, BorderLayout.NORTH);
}
boxV1.add(Box.createVerticalGlue(), BorderLayout.CENTER);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.getViewport().add(boxV1, BorderLayout.CENTER );
scrollPane.setMinimumSize(new Dimension(190, 180));
// RIGHT, HTML + Bars
HtmlDashboard contentHtml = new HtmlDashboard("http:///local/home", m_goals, true);
boxV2.add(contentHtml, BorderLayout.CENTER);
for (int i = 0; i < java.lang.Math.min(2, m_goals.length); i++)
{
if (m_goals[i].getMeasure() != null) //MGoal goal = pi.getGoal();
boxH1.add ( new Graph(m_goals[i]), BorderLayout.SOUTH);
}
boxV2.add(boxH1, BorderLayout.SOUTH);
// below HEADER
boxH.add(scrollPane, BorderLayout.WEST );
boxH.add(Box.createHorizontalStrut(5)); //space
boxH.add(boxV2, BorderLayout.CENTER);
// HEADER + below
HtmlDashboard t = new HtmlDashboard("http:///local/logo", null, false);
t.setMaximumSize(new Dimension(2000,80));
//t.setPreferredSize(new Dimension(200,10));
//t.setMaximumSize(new Dimension(2000,10));
boxV.add(t, BorderLayout.NORTH);
boxV.add(Box.createVerticalStrut(5)); //space
boxV.add(boxH, BorderLayout.CENTER);
boxV.add(Box.createVerticalGlue());
// WINDOW
add(boxV, BorderLayout.CENTER);
} // init
/**
* Action Listener for Drill Down
* @param e event
*/
public void actionPerformed (ActionEvent e)
{
if (e.getSource() instanceof PerformanceIndicator)
{
PerformanceIndicator pi = (PerformanceIndicator)e.getSource();
if (log.isLoggable(Level.INFO)) log.info(pi.getName());
MGoal goal = pi.getGoal();
if (goal.getMeasure() != null)
new PerformanceDetail(goal);
}
} // actionPerformed
} // PAPanel

View File

@ -1,83 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.apps.graph;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.compiere.Adempiere;
import org.compiere.apps.AEnv;
import org.compiere.apps.ConfirmPanel;
import org.compiere.model.MGoal;
import org.compiere.swing.CFrame;
/**
* Performance Detail Frame.
* BarPanel for Drill-Down
*
* @author Jorg Janke
* @version $Id: PerformanceDetail.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
*/
public class PerformanceDetail extends CFrame
implements ActionListener
{
/**
*
*/
private static final long serialVersionUID = -5994488373513922522L;
/**
* Constructor.
* Called from PAPanel, ViewPI (Performance Indicator)
* @param goal goal
*/
public PerformanceDetail (MGoal goal)
{
super (goal.getName());
setIconImage(Adempiere.getImage16());
barPanel = new Graph(goal, true);
init();
AEnv.addToWindowManager(this);
AEnv.showCenterScreen(this);
} // PerformanceDetail
Graph barPanel = null;
ConfirmPanel confirmPanel = new ConfirmPanel();
/**
* Static init
*/
private void init()
{
getContentPane().add(barPanel, BorderLayout.CENTER);
getContentPane().add(confirmPanel, BorderLayout.SOUTH);
confirmPanel.addActionListener(this);
} // init
/**
* Action Listener
* @param e event
*/
public void actionPerformed (ActionEvent e)
{
if (e.getActionCommand().equals(ConfirmPanel.A_OK))
dispose();
} // actionPerformed
} // PerformanceDetail

View File

@ -1,363 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.apps.graph;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.text.DecimalFormat;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.border.BevelBorder;
import javax.swing.event.EventListenerList;
import org.compiere.model.MColorSchema;
import org.compiere.model.MGoal;
import org.compiere.swing.CMenuItem;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.DialShape;
import org.jfree.chart.plot.MeterInterval;
import org.jfree.chart.plot.MeterPlot;
import org.jfree.data.Range;
import org.jfree.data.general.DefaultValueDataset;
import org.jfree.ui.RectangleInsets;
/**
* Performance Indicator
*
* @author Jorg Janke
* @version $Id: PerformanceIndicator.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
*/
//vpj-cd e-evolution public class PerformanceIndicator extends JComponent
public class PerformanceIndicator extends JPanel
implements MouseListener, ActionListener
{
/**
*
*/
private static final long serialVersionUID = 2267850468607341211L;
/**
* Constructor
* @param goal goal model
*/
public PerformanceIndicator(MGoal goal)
{
super();
m_goal = goal;
setName(m_goal.getName());
//vpj-cd e-evolution getPreferredSize(); // calculate size
init();
//
setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
setOpaque(true);
//vpj-cd e-evolution updateDisplay();
//
mRefresh.addActionListener(this);
popupMenu.add(mRefresh);
//
addMouseListener(this);
} // PerformanceIndicator
private MGoal m_goal = null;
/** The Performance Name */
private String m_text = null;
/** Performance Line */
@SuppressWarnings("unused")
private double m_line = 0;
/** Height */
//private static double s_height = 45;
/** 100% width */
private static double s_width100 = 150;
/** Max width */
//private static double s_widthMax = 250;
/** Integer Number Format */
private static DecimalFormat s_format = DisplayType.getNumberFormat(DisplayType.Integer);
JPopupMenu popupMenu = new JPopupMenu();
private CMenuItem mRefresh = new CMenuItem(Msg.getMsg(Env.getCtx(), "Refresh"), Env.getImageIcon("Refresh16.gif"));
//Insert Pie Graph Kinamo (pelgrim)
//private static Color colorOK = Color.magenta;
//private static Color colorNotOK = Color.lightGray;
private static Dimension indicatordimension = new Dimension(170,120);
private static Dimension paneldimension = new Dimension(180, 150);
ChartPanel chartPanel;
//private static Dimension
/**
* Get Goal
* @return goal
*/
public MGoal getGoal()
{
return m_goal;
} // getGoal
private JFreeChart createChart(){
JFreeChart chart = null;
// Set Text
StringBuilder text = new StringBuilder(m_goal.getName());
if (m_goal.isTarget())
text.append(": ").append(m_goal.getPercent()).append("%");
else
text.append(": ").append(s_format.format(m_goal.getMeasureActual()));
m_text = text.toString();
// ToolTip
text = new StringBuilder();
if (m_goal.getDescription() != null)
text.append(m_goal.getDescription()).append(": ");
text.append(s_format.format(m_goal.getMeasureActual()));
if (m_goal.isTarget())
text.append(" ").append(Msg.getMsg(Env.getCtx(), "of")).append(" ")
.append(s_format.format(m_goal.getMeasureTarget()));
setToolTipText(text.toString());
//
//setBackground(m_goal.getColor());
setForeground(GraphUtil.getForeground(getBackground()));
// Performance Line
int percent = m_goal.getPercent();
if (percent > 100) // draw 100% line
m_line = s_width100;
else // draw Performance Line
m_line = s_width100 * m_goal.getGoalPerformanceDouble();
DefaultValueDataset data = new DefaultValueDataset((float)m_goal.getPercent());
MeterPlot plot = new MeterPlot(data);
MColorSchema colorSchema = m_goal.getColorSchema();
int rangeLo = 0; int rangeHi=0;
for (int i=1; i<=4; i++){
switch (i) {
case 1: rangeHi = colorSchema.getMark1Percent(); break;
case 2: rangeHi = colorSchema.getMark2Percent(); break;
case 3: rangeHi = colorSchema.getMark3Percent(); break;
case 4: rangeHi = colorSchema.getMark4Percent(); break;
}
if (rangeHi==9999)
rangeHi = (int) Math.floor(rangeLo*1.5);
if (rangeLo < rangeHi) {
plot.addInterval(new MeterInterval("Normal", //label
new Range(rangeLo, rangeHi), //range
colorSchema.getColor(rangeHi),
new BasicStroke(7.0f),
//Color.lightGray
new Color(-13091716)
//Color.gray
));
rangeLo = rangeHi;
}
}
plot.setRange(new Range(0,rangeLo));
plot.setDialBackgroundPaint(new Color(-13091716));//Color.GRAY);
plot.setUnits(m_goal.getName());
plot.setDialShape(DialShape.CHORD);//CIRCLE);
//plot.setDialBackgroundPaint(new GradientPaint(0, 0, m_goal.getColor(), 0, 1000, Color.black));
plot.setNeedlePaint(Color.white);
plot.setTickSize(2000);
plot.setTickLabelFont(new Font("SansSerif", Font.BOLD, 12));
plot.setTickLabelPaint(Color.white);
plot.setInsets(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
chart = new JFreeChart( m_text, new Font("SansSerif", Font.BOLD, 15), plot,false);
return chart;
}
/**
* Init Graph Display
* Kinamo (pelgrim)
*/
private void init() {
chartPanel = new ChartPanel(createChart(), //chart
false, //boolean properties
false, // boolean save
false, //boolean print
false, //boolean zoom
true //boolean tooltips
);
chartPanel.setPreferredSize(indicatordimension);
chartPanel.addChartMouseListener( new org.jfree.chart.ChartMouseListener()
{
public void chartMouseClicked(org.jfree.chart.ChartMouseEvent e)
{
//plot p = (MeterPlot) e.getSource();
MouseEvent me = e.getTrigger();
if (SwingUtilities.isLeftMouseButton(me) && me.getClickCount() > 1)
fireActionPerformed(me);
if (SwingUtilities.isRightMouseButton(me))
popupMenu.show((Component)me.getSource(), me.getX(), me.getY());
}
public void chartMouseMoved(org.jfree.chart.ChartMouseEvent e)
{
}
});
this.add(chartPanel, BorderLayout.NORTH);
this.setMinimumSize(paneldimension);
this.setMaximumSize(paneldimension);
//---------------------------------------------
invalidate();
}
/**
* Update Display Data
*/
protected void updateDisplay()
{
chartPanel.setChart(createChart());
invalidate();
} // updateData
/**************************************************************************
* Adds an <code>ActionListener</code> to the indicator.
* @param l the <code>ActionListener</code> to be added
*/
public void addActionListener(ActionListener l)
{
if (l != null)
listenerList.add(ActionListener.class, l);
} // addActionListener
/**
* Removes an <code>ActionListener</code> from the indicator.
* @param l the listener to be removed
*/
public void removeActionListener(ActionListener l)
{
if (l != null)
listenerList.remove(ActionListener.class, l);
} // removeActionListener
/**
* Returns an array of all the <code>ActionListener</code>s added
* to this indicator with addActionListener().
*
* @return all of the <code>ActionListener</code>s added or an empty
* array if no listeners have been added
*/
public ActionListener[] getActionListeners()
{
return (ActionListener[])(listenerList.getListeners(ActionListener.class));
} // getActionListeners
/**
* Notifies all listeners that have registered interest for
* notification on this event type. The event instance
* is lazily created using the <code>event</code>
* parameter.
*
* @param event the <code>ActionEvent</code> object
* @see EventListenerList
*/
protected void fireActionPerformed(MouseEvent event)
{
// Guaranteed to return a non-null array
ActionListener[] listeners = getActionListeners();
ActionEvent e = null;
// Process the listeners first to last
for (int i = 0; i < listeners.length; i++)
{
// Lazily create the event:
if (e == null)
e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
"pi", event.getWhen(), event.getModifiersEx());
listeners[i].actionPerformed(e);
}
} // fireActionPerformed
/**************************************************************************
* Mouse Clicked
* @param e mouse event
*/
public void mouseClicked (MouseEvent e)
{
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() > 1)
fireActionPerformed(e);
if (SwingUtilities.isRightMouseButton(e))
popupMenu.show((Component)e.getSource(), e.getX(), e.getY());
} // mouseClicked
public void mousePressed (MouseEvent e)
{
}
public void mouseReleased (MouseEvent e)
{
}
public void mouseEntered (MouseEvent e)
{
}
public void mouseExited (MouseEvent e)
{
}
/**
* Action Listener.
* Update Display
* @param e event
*/
public void actionPerformed (ActionEvent e)
{
if (e.getSource() == mRefresh)
{
m_goal.updateGoal(true);
updateDisplay();
//
Container parent = getParent();
if (parent != null)
parent.invalidate();
invalidate();
if (parent != null)
parent.repaint();
else
repaint();
}
} // actionPerformed
} // PerformanceIndicator

View File

@ -1,148 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.apps.graph;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import javax.swing.BoxLayout;
import org.compiere.apps.ConfirmPanel;
import org.compiere.apps.form.FormFrame;
import org.compiere.apps.form.FormPanel;
import org.compiere.model.MGoal;
import org.compiere.swing.CPanel;
import org.compiere.swing.CScrollPane;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
/**
* View Performance Indicators
*
* @author Jorg Janke
* @version $Id: ViewPI.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
*/
public class ViewPI extends CPanel
implements FormPanel, ActionListener
{
/**
*
*/
private static final long serialVersionUID = 8022906851004145960L;
/**
* Init
* @param WindowNo
* @param frame
*/
public void init (int WindowNo, FormFrame frame)
{
log.fine("");
m_WindowNo = WindowNo;
m_frame = frame;
try
{
// Top Selection Panel
// m_frame.getContentPane().add(selectionPanel, BorderLayout.NORTH);
// Center
initPanel();
CScrollPane scroll = new CScrollPane (this);
m_frame.getContentPane().add(scroll, BorderLayout.CENTER);
// South
confirmPanel.addActionListener(this);
m_frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH);
}
catch(Exception e)
{
log.log(Level.SEVERE, "", e);
}
sizeIt();
} // init
/**
* Size Window
*/
private void sizeIt()
{
// Frame
m_frame.pack();
// Dimension size = m_frame.getPreferredSize();
// size.width = WINDOW_WIDTH;
// m_frame.setSize(size);
} // size
/**
* Dispose
*/
public void dispose()
{
if (m_frame != null)
m_frame.dispose();
m_frame = null;
removeAll();
} // dispose
/** Window No */
@SuppressWarnings("unused")
private int m_WindowNo = 0;
/** FormFrame */
private FormFrame m_frame;
/** Logger */
private static CLogger log = CLogger.getCLogger (ViewPI.class);
/** Confirmation Panel */
private ConfirmPanel confirmPanel = new ConfirmPanel();
/**
* Init Panel
*/
private void initPanel()
{
@SuppressWarnings("unused")
BoxLayout layout = new BoxLayout(this, BoxLayout.PAGE_AXIS);
MGoal[] goals = MGoal.getGoals(Env.getCtx());
for (int i = 0; i < goals.length; i++)
{
PerformanceIndicator pi = new PerformanceIndicator(goals[i]);
pi.addActionListener(this);
add (pi);
}
} // initPanel
/**
* Action Listener for Drill Down
* @param e event
*/
public void actionPerformed (ActionEvent e)
{
if (e.getActionCommand().equals(ConfirmPanel.A_OK))
dispose();
else if (e.getSource() instanceof PerformanceIndicator)
{
PerformanceIndicator pi = (PerformanceIndicator)e.getSource();
if (log.isLoggable(Level.INFO)) log.info(pi.getName());
MGoal goal = pi.getGoal();
if (goal.getMeasure() != null)
new PerformanceDetail(goal);
}
} // actionPerformed
} // ViewPI

View File

@ -1,23 +0,0 @@
package org.adempiere.client;
import org.compiere.Adempiere;
import org.compiere.util.CLogger;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
public class Application implements IApplication {
private static CLogger log = CLogger.getCLogger(Application.class);
public Object start(IApplicationContext ctx) throws Exception {
log.info("Starting client");
//
Adempiere.startup(true);
org.compiere.AdempiereClient.main(new String[]{});
return IApplication.EXIT_OK;
}
public void stop() {
}
}

View File

@ -1,52 +0,0 @@
/******************************************************************************
* This file is part of Adempiere ERP Bazaar *
* http://www.adempiere.org *
* *
* Copyright (C) Jorg Viola *
* Copyright (C) Contributors *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* *
* Contributors: *
* - Heng Sin Low *
*****************************************************************************/
package org.adempiere.client;
import java.util.List;
import org.adempiere.base.Service;
import org.adempiere.ui.swing.factory.IFormFactory;
import org.compiere.apps.form.FormPanel;
/**
*
* @author viola
* @author hengsin
*/
public class Client {
/**
* @param formId
* @return new form instance
*/
public static FormPanel getFormPanel(String formId) {
List<IFormFactory> factories = Service.locator().list(IFormFactory.class).getServices();
if (factories != null) {
for(IFormFactory factory : factories) {
FormPanel form = factory.newFormInstance(formId);
if (form != null)
return form;
}
}
return null;
}
}

View File

@ -1,222 +0,0 @@
/******************************************************************************
* Copyright (C) 2010 Low Heng Sin All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.client;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Dialog;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.util.ResourceBundle;
import javax.swing.JPasswordField;
import javax.swing.SwingConstants;
import org.compiere.Adempiere;
import org.compiere.apps.ConfirmPanel;
import org.compiere.swing.CDialog;
import org.compiere.swing.CLabel;
import org.compiere.swing.CPanel;
import org.compiere.swing.CTextField;
import org.compiere.util.CLogger;
import org.compiere.util.Ini;
/**
*
* @author hengsin
*
*/
public final class ClientCredentialDialog extends CDialog
implements ActionListener
{
/**
* generated serial version Id
*/
private static final long serialVersionUID = 2728290476926236505L;
/**
* Construct the dialog.
* Need to call initLogin for dynamic start
* @param parent parent
*/
public ClientCredentialDialog (Dialog parent)
{
super (parent, "Login", true); // Modal
log.finer("");
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
res = ResourceBundle.getBundle(RESOURCE);
//
try
{
jbInit();
initLogin();
}
catch(Exception e)
{
log.severe(e.toString());
}
// Focus to OK
this.getRootPane().setDefaultButton(confirmPanel.getOKButton());
parent.setIconImage(Adempiere.getImage16());
} // ALogin
protected static final String RESOURCE = "org.compiere.apps.ALoginRes";
private static ResourceBundle res = ResourceBundle.getBundle(RESOURCE);
/** Logger */
private static CLogger log = CLogger.getCLogger(ClientCredentialDialog.class);
private CPanel mainPanel = new CPanel(new BorderLayout());
private CLabel userLabel = new CLabel();
private CTextField userTextField = new CTextField();
private CLabel passwordLabel = new CLabel();
private JPasswordField passwordField = new JPasswordField();
private GridBagLayout loginLayout = new GridBagLayout();
private CPanel loginPanel = new CPanel(loginLayout);
private CPanel southPanel = new CPanel();
private BorderLayout southLayout = new BorderLayout();
private ConfirmPanel confirmPanel = new ConfirmPanel(true, false, false, false, false, false, false);
/** Combo Active */
private boolean m_okPressed = false;
/**************************************************************************
* Component initialization
* @throws Exception
*/
private void jbInit() throws Exception
{
this.setName("Login");
userLabel.setRequestFocusEnabled(false);
userLabel.setLabelFor(userTextField);
passwordLabel.setRequestFocusEnabled(false);
passwordLabel.setLabelFor(passwordField);
southPanel.setLayout(southLayout);
userLabel.setHorizontalAlignment(SwingConstants.RIGHT);
userLabel.setText(res.getString("User"));
userLabel.setLabelFor(userTextField);
loginPanel.add(userLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0));
userTextField.setText("System"); // default
loginPanel.add(userTextField, new GridBagConstraints(1, 3, 3, 1, 1.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0));
passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT);
passwordLabel.setText(res.getString("Password"));
passwordLabel.setLabelFor(passwordField);
loginPanel.add(passwordLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0));
passwordField.setText("System"); // default
loginPanel.add(passwordField, new GridBagConstraints(1, 4, 3, 1, 1.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0));
//
this.getContentPane().add(mainPanel);
mainPanel.add(loginPanel, BorderLayout.CENTER);
mainPanel.setName("loginMainPanel");
mainPanel.add(southPanel, BorderLayout.SOUTH);
//
southPanel.add(confirmPanel, BorderLayout.NORTH);
confirmPanel.addActionListener(this);
} // jbInit
/**
* Set Initial & Ini Parameters
* Optional Automatic login
* @return true, if connected & parameters set
*/
public boolean initLogin()
{
// Application/PWD
userTextField.setText(Ini.getProperty(Ini.P_UID));
if (Ini.isPropertyBool(Ini.P_STORE_PWD))
passwordField.setText(Ini.getProperty(Ini.P_PWD));
else
passwordField.setText("");
return false;
} // initLogin
/**
* Window Events - requestFocus
* @param e event
*/
protected void processWindowEvent(WindowEvent e)
{
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_OPENED)
{
this.toFront();
confirmPanel.getOKButton().requestFocusInWindow();
}
} // processWindowEvent
/*************************************************************************
* Exit action performed
*/
private void appExit()
{
dispose();
} // appExit_actionPerformed
/**
* Did the user press OK
* @return true if user pressed final OK button
*/
public boolean isOKpressed()
{
return m_okPressed;
} // isOKpressed
/**************************************************************************
* Action Event handler
* @param e event
*/
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals(ConfirmPanel.A_OK))
{
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
m_okPressed = true;
appExit();
}
else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL))
{
m_okPressed = false;
appExit();
}
} // actionPerformed
/**
* @return user id
*/
public String getUserId()
{
return userTextField.getText();
}
/**
* @return password
*/
public char[] getPassword()
{
return passwordField.getPassword();
}
}

View File

@ -1,91 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2010 Heng Sin Low *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.client;
import java.awt.Frame;
import java.util.List;
import org.adempiere.base.Service;
import org.adempiere.ui.swing.factory.IInfoFactory;
import org.compiere.apps.search.Info;
import org.compiere.model.GridField;
import org.compiere.model.Lookup;
/**
*
* @author hengsin
*
*/
public class InfoManager
{
/**
* Factory Constructor
* @param frame parent frame
* @param modal new window is modal
* @param lookup Lookup
* @param field Grid field
* @param tableName table name of the search
* @param keyColumn key column of the search
* @param value query value
* @param multiSelection allow to select more than one row
* @param whereClause fully qualified where clause for the search
* @return special or general Info Window
*/
public static Info create(Frame frame, boolean modal, Lookup lookup,
GridField field, String tableName, String keyColumn, String queryValue,
boolean multiSelection, String whereClause)
{
Info info = null;
List<IInfoFactory> factoryList = Service.locator().list(IInfoFactory.class).getServices();
for(IInfoFactory factory : factoryList)
{
info = factory.create(frame, true, lookup, field, tableName, keyColumn,
queryValue, multiSelection, whereClause);
if (info != null)
break;
}
return info;
}
/**
* Factory Constructor
* @param frame parent frame
* @param modal new window is modal
* @param WindowNo window no
* @param tableName table name of the search
* @param keyColumn key column of the search
* @param value query value
* @param multiSelection allow to select more than one row
* @param whereClause fully qualified where clause for the search
* @param lookup
* @return special or general Info Window
*/
public static Info create(Frame frame, boolean modal, int WindowNo,
String tableName, String keyColumn, String value,
boolean multiSelection, String whereClause, boolean lookup)
{
Info info = null;
List<IInfoFactory> factoryList = Service.locator().list(IInfoFactory.class).getServices();
for(IInfoFactory factory : factoryList)
{
info = factory.create(frame, modal, WindowNo, tableName, keyColumn, value,
multiSelection, whereClause, lookup);
if (info != null)
break;
}
//
return info;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1013 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -1,614 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.pdf.viewer;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.FilteredImageSource;
import java.awt.image.RGBImageFilter;
import java.awt.print.PageFormat;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.filechooser.FileFilter;
import org.jpedal.PdfDecoder;
/**
* PDF Viewer using jpedal
* @author Low Heng Sin
*
*/
public class PDFViewerBean extends JPanel {
/**
*
*/
private static final long serialVersionUID = -365936659584244L;
private final PdfDecoder decoder = new PdfDecoder();
private final JScrollPane center = new JScrollPane(decoder);
private final JTextField pageField = new JTextField(2);
private final JLabel pageCountLabel = new JLabel("00");
private final JComboBox<Object> rotationSelect = new JComboBox<Object>(new String[] {
"0", "90", "180", "270"});
private final JComboBox<Object> zoomSelect;
private final float[] zoomFactors = new float[] {
0.25f, 0.33f, 0.50f, 0.75f, 1.00f, 1.50f, 2.00f, 4.00f, 8.00f};
private final Action printAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = -4038401603459821668L;
public void actionPerformed(ActionEvent e) {
print();
}
};
private final Action saveAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = 2556454917786013951L;
public void actionPerformed(ActionEvent e) {
save();
}
};
private final Action goFirstAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = 3012006964079877706L;
public void actionPerformed(ActionEvent e) {
goFirst();
}
};
private final Action goPreviousAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = 7146121058674779580L;
public void actionPerformed(ActionEvent e) {
goPrevious();
}
};
private final Action goNextAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = -535856649012053593L;
public void actionPerformed(ActionEvent e) {
goNext();
}
};
private final Action goLastAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = -9129162509234933692L;
public void actionPerformed(ActionEvent e) {
goLast();
}
};
private final Action zoomInAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = 8712227061870874820L;
public void actionPerformed(ActionEvent e) {
zoomIn();
}
};
private final Action zoomOutAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = -796771923722993041L;
public void actionPerformed(ActionEvent e) {
zoomOut();
}
};
private final Action rotateCClockAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = -5323310183497748731L;
public void actionPerformed(ActionEvent e) {
rotateCClock();
}
};
private final Action rotateClockAction = new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = 7048804716310413300L;
public void actionPerformed(ActionEvent e) {
rotateClock();
}
};
private String filename;
private int currentPage = 1;
private int scaleStep = 3;
private int rotation = 0;
private File tmpFile = null;
public PDFViewerBean() {
final String[] zoomLabels = new String[zoomFactors.length];
for (int i = 0; i < zoomFactors.length; i++) {
zoomLabels[i] = Integer.toString((int) (zoomFactors[i] * 100));
}
zoomSelect = new JComboBox<Object>(zoomLabels);
zoomSelect.addActionListener(new ActionListener() {
private boolean isAdjusting = false;
public void actionPerformed(ActionEvent e) {
if (isAdjusting) {
return;
}
isAdjusting = true;
try {
setScaleStep(zoomSelect.getSelectedIndex());
} finally {
isAdjusting = false;
}
}
});
rotationSelect.addActionListener(new ActionListener() {
private boolean isAdjusting = false;
public void actionPerformed(ActionEvent e) {
if (isAdjusting) {
return;
}
isAdjusting = true;
try {
setRotation(rotationSelect.getSelectedIndex() * 90);
} finally {
isAdjusting = false;
}
}
});
setLayout(new BorderLayout());
createToolBar();
add(BorderLayout.CENTER, center);
pageField.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent e) {
pageField.selectAll();
}
});
pageField.setHorizontalAlignment(SwingConstants.TRAILING);
pageField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setCurrentPage(Integer.parseInt(pageField.getText()));
}
});
setPreferredSize(new Dimension(480, 0));
}
public void setRotation(int rotation) {
this.rotation = rotation;
rotationSelect.setSelectedIndex(rotation / 90);
updateZoomRotate();
}
public void goFirst() {
setCurrentPage(1);
}
public void goPrevious() {
setCurrentPage(currentPage - 1);
}
public void goNext() {
setCurrentPage(currentPage + 1);
}
public void goLast() {
setCurrentPage(decoder.getPageCount());
}
public void setCurrentPage(int page) {
if (page < 1 || page > decoder.getPageCount()) {
return;
}
final Cursor oldCursor = getCursor();
try {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
decoder.setPageParameters(zoomFactors[scaleStep], page);
decoder.decodePage(page);
setRotation(decoder.getPdfPageData().getRotation(page));
currentPage = page;
} catch (Exception e) {
e.printStackTrace();
return;
} finally {
setCursor(oldCursor);
}
goFirstAction.setEnabled(currentPage > 1);
goPreviousAction.setEnabled(currentPage > 1);
goNextAction.setEnabled(currentPage < decoder.getPageCount());
goLastAction.setEnabled(currentPage < decoder.getPageCount());
pageField.setText(Integer.toString(currentPage));
}
public void zoomIn() {
setScaleStep(scaleStep + 1);
}
public void zoomOut() {
setScaleStep(scaleStep - 1);
}
public void rotateCClock() {
rotationSelect.setSelectedIndex(
(rotationSelect.getSelectedIndex() + 3) % 4);
}
public void rotateClock() {
rotationSelect.setSelectedIndex(
(rotationSelect.getSelectedIndex() + 1) % 4);
}
public void save() {
final JFileChooser fc = new JFileChooser();
fc.setFileFilter(new FileFilter() {
public String getDescription() {
return "PDF File";
}
public boolean accept(File f) {
return f.isDirectory()
|| f.getName().toLowerCase().endsWith(".pdf");
}
});
if (fc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) {
return;
}
File targetFile = fc.getSelectedFile();
if (!targetFile.getName().toLowerCase().endsWith(".pdf")) {
targetFile =
new File(targetFile.getParentFile(), targetFile.getName() + ".pdf");
}
if (targetFile.exists()) {
if (JOptionPane.showConfirmDialog(this,
"Do you want to overwrite the file?")
!= JOptionPane.YES_OPTION) {
return;
}
}
try {
final InputStream is = new FileInputStream(filename);
try {
final OutputStream os = new FileOutputStream(targetFile);
try {
final byte[] buffer = new byte[32768];
for (int read; (read = is.read(buffer)) != -1; ) {
os.write(buffer, 0, read);
}
} finally {
os.close();
}
} finally {
is.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
public void print() {
PrinterJob printJob = PrinterJob.getPrinterJob();
//decoder.enableScaledPrinting(false);
printJob.setPageable(decoder);
final PageFormat pf = printJob.defaultPage();
decoder.setPageFormat(pf);
decoder.setTextPrint(PdfDecoder.TEXTGLYPHPRINT);
printJob.setPrintable(decoder, pf);
if (printJob.printDialog()) {
final Cursor oldCursor = getCursor();
try {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
printJob.print();
} catch (PrinterException e) {
e.printStackTrace();
} finally {
setCursor(oldCursor);
}
}
}
protected void createToolBar() {
final JToolBar bar = new JToolBar();
bar.add(createActionButton(printAction,
null,
"22x22/document-print.png",
"Print document"));
bar.add(createActionButton(saveAction,
null,
"22x22/document-save.png",
"Save document"));
//bar.addSeparator(new Dimension(10,0));
bar.add(createActionButton(goFirstAction,
null,
"22x22/go-first.png",
"First page"));
bar.add(createActionButton(goPreviousAction,
null,
"22x22/go-previous.png",
"Previos page"));
final JPanel pagePanel = createToolbarItemPanel(pageField);
bar.add(pagePanel);
//bar.add(new JLabel("/"));
//bar.add(pageCountLabel);
bar.add(createActionButton(goNextAction,
null,
"22x22/go-next.png",
"Next page"));
bar.add(createActionButton(goLastAction,
null,
"22x22/go-last.png",
"Last page"));
//bar.addSeparator(new Dimension(10,0));
bar.add(createActionButton(zoomOutAction,
null,
"22x22/zoom-out.png",
"Next page"));
bar.add(createToolbarItemPanel(zoomSelect));
bar.add(createActionButton(zoomInAction,
null,
"22x22/zoom-in.png",
"Next page"));
//bar.addSeparator(new Dimension(10,0));
bar.add(createActionButton(rotateCClockAction,
null,
"22x22/rotate-cclock.png",
"Next page"));
bar.add(createToolbarItemPanel(rotationSelect));
bar.add(createActionButton(rotateClockAction,
null,
"22x22/rotate-clock.png",
"Next page"));
bar.setFloatable(false);
add(BorderLayout.NORTH, bar);
}
protected JPanel createToolbarItemPanel(JComponent component) {
final JPanel pagePanel = new JPanel(new GridBagLayout());
pagePanel.add(component);
pagePanel.setMaximumSize(pagePanel.getPreferredSize());
return pagePanel;
}
public void loadPDF(String filename) {
this.filename = filename;
try {
decoder.closePdfFile();
decoder.openPdfFile(filename);
pageCountLabel.setText(decoder.getPageCount() + " ");
setCurrentPage(1);
} catch (Exception e) {
e.printStackTrace();
}
}
protected JButton createActionButton(Action action,
String text,
String image,
String tooltip) {
final ImageIcon icon =
new ImageIcon(getClass().getResource(image));
final double colorFactor = 0.9;
final RGBImageFilter filter = new RGBImageFilter() {
public int filterRGB(int x, int y, int rgb) {
final int alpha = (rgb >> 24) & 0xff;
final int red = (rgb >> 16) & 0xff;
final int green = (rgb >> 8) & 0xff;
final int blue = (rgb ) & 0xff;
return ((int) (alpha * colorFactor) << 24)
| ((int) (red * colorFactor) << 16)
| ((int) (green * colorFactor) << 8)
| ((int) (blue * colorFactor));
}
};
final ImageIcon darkerIcon = new ImageIcon(
Toolkit.getDefaultToolkit().createImage(
new FilteredImageSource(icon.getImage().getSource(),
filter)));
final JButton result = new JButton();
result.setAction(action);
result.setText(text);
result.setIcon(darkerIcon);
result.setBorderPainted(false);
result.setHorizontalTextPosition(SwingConstants.CENTER);
result.setVerticalTextPosition(SwingConstants.BOTTOM);
result.setMnemonic(0);
result.setToolTipText(tooltip);
final Dimension dim = result.getPreferredSize();
result.setMaximumSize(new Dimension(32, dim.height));
result.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent me) {
result.setBorderPainted(true);
result.setIcon(icon);
}
public void mouseExited(MouseEvent me) {
result.setBorderPainted(false);
result.setIcon(darkerIcon);
}
});
result.setBorderPainted(false);
result.setFocusPainted(false);
return result;
}
public int getCurrentPage() {
return currentPage;
}
public void clearDocument() {
decoder.closePdfFile();
if (tmpFile != null) {
tmpFile.delete();
tmpFile = null;
}
}
public void setScaleStep(int scaleStep) {
if (scaleStep < 0 || zoomFactors.length <= scaleStep) {
return;
}
this.scaleStep = scaleStep;
zoomSelect.setSelectedIndex(scaleStep);
updateZoomRotate();
}
protected void updateZoomRotate() {
final Cursor oldCursor = getCursor();
try {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
decoder.setPageParameters(zoomFactors[scaleStep],
currentPage,
rotation);
decoder.invalidate();
decoder.repaint();
zoomInAction.setEnabled(scaleStep < zoomFactors.length - 1);
zoomOutAction.setEnabled(scaleStep > 0);
} finally {
setCursor(oldCursor);
}
}
public void setScale(int percent) {
int step;
for (step = 0; step < zoomFactors.length - 1; step++) {
if (zoomFactors[step] * 100 >= percent) {
break;
}
}
setScaleStep(step);
}
public void loadPDF(InputStream is) {
if (tmpFile != null) {
tmpFile.delete();
}
try {
tmpFile = File.createTempFile("adempiere", ".pdf");
tmpFile.deleteOnExit();
} catch (IOException e) {
e.printStackTrace();
return;
}
try {
final OutputStream os = new FileOutputStream(tmpFile);
try {
final byte[] buffer = new byte[32768];
for (int read; (read = is.read(buffer)) != -1; ) {
os.write(buffer, 0, read);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
os.close();
}
} catch (IOException e) {
e.printStackTrace();
}
loadPDF(tmpFile.getAbsolutePath());
}
protected void finalize() throws Throwable {
if (tmpFile != null) {
tmpFile.delete();
}
decoder.closePdfFile();
}
}

View File

@ -1,102 +0,0 @@
/******************************************************************************
* 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.adempiere.plaf;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
import javax.swing.AbstractButton;
import javax.swing.InputMap;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.plaf.ComponentInputMapUIResource;
import javax.swing.plaf.basic.BasicButtonListener;
/**
* Button Listener
*
* @author Jorg Janke
* @version $Id: CompiereButtonListener.java,v 1.1 2005/12/05 02:38:28 jjanke Exp $
*/
public class AdempiereButtonListener extends BasicButtonListener
{
/**
* Adempiere Button Listener
* @param b button
*/
public AdempiereButtonListener (AbstractButton b)
{
super (b);
} // AdempiereButtonListener
/**
* Install Keyboard Actions
* @param c component
*/
public void installKeyboardActions (JComponent c)
{
super.installKeyboardActions (c);
updateMnemonicBindingX ((AbstractButton)c);
} // installKeyboardActions
/**
* Property Change
* @param e event
*/
public void propertyChange (PropertyChangeEvent e)
{
String prop = e.getPropertyName();
if (prop.equals(AbstractButton.MNEMONIC_CHANGED_PROPERTY))
updateMnemonicBindingX ((AbstractButton)e.getSource());
else
super.propertyChange (e);
} // propertyChange
/**
* Update Mnemonic Binding
* @param b button
*/
void updateMnemonicBindingX (AbstractButton b)
{
int m = b.getMnemonic();
if (m != 0)
{
InputMap map = SwingUtilities.getUIInputMap(b, JComponent.WHEN_IN_FOCUSED_WINDOW);
if (map == null)
{
map = new ComponentInputMapUIResource(b);
SwingUtilities.replaceUIInputMap(b, JComponent.WHEN_IN_FOCUSED_WINDOW, map);
}
map.clear();
String className = b.getClass().getName();
int mask = ActionEvent.ALT_MASK; // Default Buttons
if (b instanceof JCheckBox // In Tab
|| className.indexOf("VButton") != -1)
mask = ActionEvent.SHIFT_MASK + ActionEvent.CTRL_MASK;
map.put(KeyStroke.getKeyStroke(m, mask, false), "pressed");
map.put(KeyStroke.getKeyStroke(m, mask, true), "released");
map.put(KeyStroke.getKeyStroke(m, 0, true), "released");
}
else
{
InputMap map = SwingUtilities.getUIInputMap(b, JComponent.WHEN_IN_FOCUSED_WINDOW);
if (map != null)
map.clear();
}
} // updateMnemonicBindingX
} // AdempiereButtonListener

View File

@ -1,109 +0,0 @@
/******************************************************************************
* 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.adempiere.plaf;
import java.awt.event.MouseListener;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.ComboPopup;
import javax.swing.plaf.metal.MetalComboBoxButton;
import com.jgoodies.looks.plastic.PlasticComboBoxUI;
/**
* Compiere ComboBox UI.
* The ComboBox is opaque - with opaque arrow button and textfield background
*
* @author Jorg Janke
* @version $Id: CompiereComboBoxUI.java,v 1.10 2005/10/09 19:01:37 jjanke Exp $
*/
public class AdempiereComboBoxUI extends PlasticComboBoxUI
{
/**
* Create UI
* @param c
* @return new instance of CompiereComboBoxUI
*/
public static ComponentUI createUI(JComponent c)
{
return new AdempiereComboBoxUI();
} // CreateUI
/*************************************************************************/
static int s_no = 0;
/**
* Install UI - Set ComboBox opaque.
* Bug in Metal: arrowButton gets Mouse Events, so add the JComboBox
* MouseListeners to the arrowButton
* @see org.compiere.swing.CComboBox#addMouseListener(MouseListener)
* @param c componrnt
*/
public void installUI (JComponent c)
{
MouseListener[] ml = c.getMouseListeners();
super.installUI(c);
//c.setOpaque(false);
//
for (int i = 0; i < ml.length; i++)
{
// System.out.println("adding " + c.getClass().getName());
arrowButton.addMouseListener(ml[i]);
}
} // installUI
/*************************************************************************/
/**
* Create opaque button
* @return opaque button
*/
protected JButton createArrowButton()
{
JButton button = super.createArrowButton();
return button;
} // createArrowButton
public JButton getArrowButton()
{
return arrowButton;
}
/**
* Set Icon of arrow button
* @param defaultIcon
*/
public void setIcon(Icon defaultIcon)
{
((MetalComboBoxButton)arrowButton).setComboIcon(defaultIcon);
} // setIcon
/*************************************************************************/
/**
* Create Popup
* @return AdempiereComboPopup
*/
protected ComboPopup createPopup()
{
AdempiereComboPopup newPopup = new AdempiereComboPopup( comboBox );
newPopup.getAccessibleContext().setAccessibleParent(comboBox);
return newPopup;
} // createPopup
} // AdempiereComboBoxUI

View File

@ -1,97 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.plaf;
import javax.swing.JComboBox;
import javax.swing.plaf.basic.BasicComboPopup;
import org.compiere.swing.CComboBox;
import org.compiere.swing.CField;
/**
* Adempiere Combo Popup - allows to prevent the display of the popup
*
* @author Jorg Janke
* @version $Id: AdempiereComboPopup.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
*/
public class AdempiereComboPopup extends BasicComboPopup
{
/**
*
*/
private static final long serialVersionUID = 274215317393292721L;
/**
* Constructor
* @param combo
*/
public AdempiereComboPopup(JComboBox<Object> combo)
{
super(combo);
} // AdempiereComboPopup
/**
* Conditionally show the Popup.
* If the combo is a CComboBox/CField, the return value of the
* method displayPopup determines if the popup is actually displayed
* @see CComboBox#displayPopup()
* @see CField#displayPopup()
*/
public void show()
{
// Check ComboBox if popup should be displayed
if (comboBox instanceof CComboBox && !((CComboBox<?>)comboBox).displayPopup())
return;
// Check Field if popup should be displayed
if (comboBox instanceof CField && !((CField)comboBox).displayPopup())
return;
super.show();
} // show
/**
* Inform CComboBox<Object> and CField that Popup was hidden
* @see CComboBox.hidingPopup
* @see CField.hidingPopup
*
public void hide()
{
super.hide();
// Inform ComboBox that popup was hidden
if (comboBox instanceof CComboBox)
(CComboBox<Object>)comboBox).hidingPopup();
else if (comboBox instanceof CComboBox)
(CComboBox<Object>)comboBox).hidingPopup();
} // hided
/**/
/**
* @see javax.swing.plaf.basic.BasicComboPopup#getPopupHeightForRowCount(int)
**/
@Override
protected int getPopupHeightForRowCount(int maxRowCount)
{
// ensure the combo box sized for the amount of data to be displayed
int rows = comboBox.getItemCount() < comboBox.getMaximumRowCount()
? comboBox.getItemCount()
: comboBox.getMaximumRowCount() ;
if (rows <= 0 ) rows = 1;
return super.getPopupHeightForRowCount(1) * rows;
}
} // AdempiereComboPopup

View File

@ -1,161 +0,0 @@
/******************************************************************************
* 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.adempiere.plaf;
import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;
import java.awt.event.ActionEvent;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.plaf.ComponentInputMapUIResource;
import javax.swing.plaf.metal.MetalLabelUI;
import org.jdesktop.swingx.UIAction;
/**
* Adempiere Label UI
*
* @author Jorg Janke
* @version $Id: CompiereLabelUI.java,v 1.2 2005/12/05 02:38:28 jjanke Exp $
*/
public class AdempiereLabelUI extends MetalLabelUI
{
/** Singleton */
protected static AdempiereLabelUI adempiereLabelUI = new AdempiereLabelUI();
/**
* Create UI
* @param c component
* @return singleton
*/
public static AdempiereLabelUI createUI(JComponent c)
{
return adempiereLabelUI;
} // createUI
/**
* Install Keyboard Actions
* @param l label
*/
protected void installKeyboardActions (JLabel l)
{
// super.installKeyboardActions(l);
int dka = l.getDisplayedMnemonic();
if (dka != 0)
{
Component lf = l.getLabelFor();
if (lf != null)
{
ActionMap actionMap = l.getActionMap();
actionMap.put(PRESS, ACTION_PRESS);
InputMap inputMap = SwingUtilities.getUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW);
if (inputMap == null)
{
inputMap = new ComponentInputMapUIResource (l);
SwingUtilities.replaceUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
}
inputMap.clear ();
inputMap.put (KeyStroke.getKeyStroke (dka,
ActionEvent.SHIFT_MASK+ActionEvent.CTRL_MASK, false), PRESS);
}
}
} // installKeyboardActions
/** Action Name */
private static final String PRESS = "press";
/** Press Action */
private static PressAction ACTION_PRESS = new PressAction();
/**
* Compiere Label UI Actions
*/
private static class PressAction extends UIAction
{
PressAction ()
{
super (PRESS);
}
public void actionPerformed (ActionEvent e)
{
JLabel label = (JLabel)e.getSource ();
String key = getName ();
if (key.equals(PRESS))
{
doPress (label);
}
} // actionPerformed
/**
* Do Press - Focus the Field
* @param label label
*/
private void doPress (JLabel label)
{
Component labelFor = label.getLabelFor ();
if (labelFor != null && labelFor.isEnabled ())
{
Component owner = label.getLabelFor ();
if (owner instanceof Container
&& ((Container)owner).isFocusCycleRoot ())
{
owner.requestFocus ();
}
else
{
if (owner instanceof Container)
{
Container container = (Container)owner;
if (container.isFocusCycleRoot())
{
FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
Component comp = policy.getDefaultComponent(container);
if (comp != null)
{
comp.requestFocus();
return;
}
}
Container rootAncestor = container.getFocusCycleRootAncestor();
if (rootAncestor != null)
{
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
Component comp = policy.getComponentAfter(rootAncestor, container);
if (comp != null && SwingUtilities.isDescendingFrom(comp, container))
{
comp.requestFocus();
return;
}
}
}
if (owner.isFocusable())
{
owner.requestFocus();
return;
}
// No Forcus
}
}
} // doPress
} // PressAction
} // AdempiereLabelUI

View File

@ -1,218 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.plaf;
import java.awt.Color;
import java.awt.Component;
import javax.swing.UIDefaults;
import com.jgoodies.looks.plastic.PlasticLookAndFeel;
import com.jgoodies.looks.plastic.PlasticTheme;
/**
* Adempiere Look & Feel, based on JGoodies look and feel
* @author vpj-cd, Low Heng Sin
*/
public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.Plastic3DLookAndFeel
{
/**
*
*/
private static final long serialVersionUID = 5681571518701552477L;
/**
* Constructor
*/
public AdempiereLookAndFeel()
{
super();
// System.setProperty("awt.visualbell", "true");
} // CompiereLookAndFeel
/** The name */
public static final String NAME = "Adempiere";
/** The Theme */
private static PlasticTheme s_adempiereTheme = new org.adempiere.plaf.AdempiereTheme();
private static PlasticTheme s_theme = s_adempiereTheme;
/** Paint Round Corners */
protected static boolean ROUND = false;
public static final String TABLEVEL = "TabLevel";
public static final String HIDE_IF_ONE_TAB = "adempiere.hideIfOneTab";
/**
* The Name
* @return Name
*/
public String getName()
{
return NAME;
} // getName
/**
* The ID
* @return Name
*/
public String getID()
{
return NAME;
} // getID
/**
* The Description
* @return description
*/
public String getDescription()
{
return "Adempiere Look & Feel - (c) 2001-2005 Victor Perez";
} // getDescription
/**************************************************************************
* Get/Create Defaults
* @return UI Defaults
*/
public UIDefaults getDefaults()
{
//com.jgoodies.looks.plastic.PlasticLookAndFeel.setCurrentTheme(s_theme);
UIDefaults defaults = super.getDefaults(); // calls init..Defaults
return defaults;
} // getDefaults
/**
* Creates the mapping from UI class IDs to <code>ComponentUI</code> classes,
* putting the ID-<code>ComponentUI</code> pairs in the passed-in defaults table.
* Each <code>JComponent</code> class specifies its own UI class ID string.
*
* @param table UI Defaults
*/
protected void initClassDefaults(UIDefaults table)
{
//System.out.println("AdempiereLookAndFeel.initClassDefaults");
super.initClassDefaults( table);
// Overwrite
putDefault (table, "ComboBoxUI");
putDefault (table, "LabelUI");
putDefault (table, "TabbedPaneUI");
} // initClassDefaults
/**
* Put "uiKey - ClassName" pair in UIDefaults
* @param table
* @param uiKey
*/
private void putDefault (UIDefaults table, String uiKey)
{
try
{
String className = "org.adempiere.plaf.Adempiere" + uiKey;
table.put(uiKey, className);
}
catch (Exception ex)
{
ex.printStackTrace();
}
} // putDefault
/**
* For overwriting Component defaults
* @param table
*/
protected void initSystemColorDefaults (UIDefaults table)
{
super.initSystemColorDefaults( table);
} // initSystemColorDefaults
/**
* For overwriting Component defaults
* @param table
*/
protected void initComponentDefaults (UIDefaults table)
{
super.initComponentDefaults( table);
// ComboBox defaults
Color c = table.getColor("TextField.background");
table.put("ComboBox.background", c);
table.put("ComboBox.listBackground", c);
// globalqss
Class<PlasticLookAndFeel> lf = com.jgoodies.looks.plastic.PlasticLookAndFeel.class;
table.put("Tree.openIcon", makeIcon(lf, "icons/TreeOpen.gif"));
table.put("Tree.closedIcon", makeIcon(lf, "icons/TreeClosed.gif"));
table.put("Tree.leafIcon", makeIcon(lf, "icons/TreeLeaf.gif"));
} // initComponentDefaults
/**
* Set Current Theme
* @param theme metal theme
*/
public static void setCurrentTheme (PlasticTheme theme)
{
if (theme != null) {
s_theme = theme;
PlasticLookAndFeel.setCurrentTheme(s_theme);
}
} // setCurrentTheme
/**
* Get Current Theme
* @return Metal Theme
*/
public static PlasticTheme getCurrentTheme()
{
return s_theme;
} // getCurrentTheme
/**
* Get default adempiere theme
* @return Metal Theme
*/
public static PlasticTheme getDefaultTheme()
{
return s_adempiereTheme;
} // getCurrentTheme
/**
* Error Feedback.
* <p>
* Invoked when the user attempts an invalid operation,
* such as pasting into an uneditable <code>JTextField</code>
* that has focus.
* </p>
* <p>
* If the user has enabled visual error indication on
* the desktop, this method will flash the caption bar
* of the active window. The user can also set the
* property awt.visualbell=true to achieve the same
* results.
* </p>
* @param component Component the error occured in, may be
* null indicating the error condition is
* not directly associated with a
* <code>Component</code>.
*/
public void provideErrorFeedback (Component component)
{
super.provideErrorFeedback (component);
} // provideErrorFeedback
} // AdempiereLookAndFeel

View File

@ -1,24 +0,0 @@
package org.adempiere.plaf;
import org.jdesktop.swingx.plaf.basic.BasicLookAndFeelAddons;
public class AdempiereLookAndFeelAddons extends BasicLookAndFeelAddons {
public void initialize() {
super.initialize();
loadDefaults(getDefaults());
}
public void uninitialize() {
super.uninitialize();
unloadDefaults(getDefaults());
}
private Object[] getDefaults() {
Object[] defaults =
new Object[] {
// "DirectoryChooserUI",
// "org.jdesktop.jdnc.swing.plaf.windows.WindowsDirectoryChooserUI",
};
return defaults;
}
}

View File

@ -1,736 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.plaf;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.Window;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.plaf.metal.MetalTheme;
import org.compiere.plaf.CompiereLookAndFeel;
import org.compiere.plaf.CompiereThemeBlueMetal;
import org.compiere.plaf.CompiereThemeIce;
import org.compiere.swing.CButton;
import org.compiere.swing.ColorBlind;
import org.compiere.swing.ExtendedTheme;
import org.compiere.util.Ini;
import org.compiere.util.ValueNamePair;
import com.jgoodies.looks.plastic.PlasticTheme;
/**
* Variable Pluggable Look And Feel.
* Provides an easy access to the required currently active PLAF information
*
* @author Jorg Janke
* @version $Id: AdempierePLAF.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
*
* @author Low Heng Sin
* @version 2006-11-27
*/
public final class AdempierePLAF
{
/** Logger */
private static Logger log = Logger.getLogger(AdempierePLAF.class.getName());
/****** Background *******************************************************/
/**
* Return Normal field background color "text".
* Windows = white
* @return Color
*/
public static Color getFieldBackground_Normal()
{
// window => white
return ColorBlind.getDichromatColor(UIManager.getColor("text"));
} // getFieldBackground_Normal
/**
* Return Error field background
* @return Color
*/
public static Color getFieldBackground_Error()
{
Color c = UIManager.getColor(ExtendedTheme.ERROR_BG_KEY);
if (c == null)
c = ExtendedTheme.DEFAULT_ERROR_BG;
return ColorBlind.getDichromatColor(c);
} // getFieldBackground_Error
/**
* Return Mandatory field background color
* @return Color
*/
public static Color getFieldBackground_Mandatory()
{
Color c = UIManager.getColor(ExtendedTheme.MANDATORY_BG_KEY);
if (c == null)
c = ExtendedTheme.DEFAULT_MANDATORY_BG;
return ColorBlind.getDichromatColor(c);
} // getFieldBackground_Mandatory
/**
* Return Inactive field background color
* @return Color
*/
public static Color getFieldBackground_Inactive()
{
Color c = UIManager.getColor(ExtendedTheme.INACTIVE_BG_KEY);
if ( c != null )
return ColorBlind.getDichromatColor(c);
else
return getFieldBackground_Normal();
} // getFieldBackground_Inactive
/**
* Return Selected field background color
* @return Color
*/
public static Color getFieldBackground_Selected()
{
Color c = UIManager.getColor(ExtendedTheme.SELECTED_BG_KEY);
if (c == null)
c = ExtendedTheme.DEFAULT_SELECTED_BG;
return ColorBlind.getDichromatColor(c);
} // getFieldBackground_Selected
/**
* Return ReadOnly field background color
* @return Color
*/
public static Color getFieldBackground_ReadOnly()
{
Color c = UIManager.getColor(ExtendedTheme.READONLY_BG_KEY);
if (c == null)
c = ExtendedTheme.DEFAULT_READONLY_BG;
return ColorBlind.getDichromatColor(c);
} // getFieldBackground_ReadOnly
/**
* Return form background color "control".
* Windows = lightGray
* @return Color
*/
public static Color getFormBackground()
{
return ColorBlind.getDichromatColor(UIManager.getColor("control"));
} // getFormBackground
/**
* Info Background Color "info"
* Windows = info (light yellow)
* @return Color
*/
public static Color getInfoBackground()
{
Color c = UIManager.getColor(ExtendedTheme.INFO_BG_KEY);
if (c == null)
c = UIManager.getColor("info");
return ColorBlind.getDichromatColor(c);
} // getInfoBackground
/****** Text *************************************************************/
/**
* Normal field text foreground color "textText"
* Windows = black
* @return Color
*/
public static Color getTextColor_Normal()
{
return ColorBlind.getDichromatColor(UIManager.getColor("textText"));
} // getText_Normal
/**
* OK Text Foreground Color (Theme)
* @return Color
*/
public static Color getTextColor_OK()
{
return getTextColor_Normal();
} // getText_OK
/**
* Issue Text Foreground Color (Theme)
* @return Color
*/
public static Color getTextColor_Issue()
{
Color c = UIManager.getColor(ExtendedTheme.ERROR_FG_KEY);
if (c == null)
c = ExtendedTheme.DEFAULT_ERROR_FG;
return ColorBlind.getDichromatColor(c);
} // getText_Issue
/**
* Label Text foreground Color "controlText"
* Windows = black
* @return Color
*/
public static Color getTextColor_Label()
{
return ColorBlind.getDichromatColor(UIManager.getColor("controlText"));
} // getTextColor_Label
/**
* Get Primary1
* @return primary 1
*/
public static Color getPrimary1()
{
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControlDarkShadow());
}
/**
* Get Primary2
* @return primary 2
*/
public static Color getPrimary2()
{
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControlShadow());
}
/**
* Get Primary3
* @return primary 3
*/
public static Color getPrimary3()
{
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControl());
}
/**
* Get Secondary 1
* @return secondary 1
*/
public static Color getSecondary1()
{
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControlDarkShadow());
}
/**
* Get Secondary 2
* @return secondary 2
*/
public static Color getSecondary2()
{
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControlShadow());
}
/**
* Get Secondary 3
* @return secondary 3
*/
public static Color getSecondary3()
{
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControl());
}
/****** Fonts ************************************************************/
/**
* Get Header Font (window title font)
* @return font
*/
public static Font getFont_Header()
{
return MetalLookAndFeel.getWindowTitleFont();
} // getFont_Header
/**
* Get Field Font
* @return font
*/
public static Font getFont_Field()
{
return UIManager.getFont("TextField.font");
} // getFont_Field
/**
* Get Label Font
* @return font
*/
public static Font getFont_Label()
{
return UIManager.getFont("Label.font");
} // setFont_Label
/**
* Get Small (report) Font
* @return font
*/
public static Font getFont_Small()
{
return MetalLookAndFeel.getSubTextFont();
} // setFont_Small
/****** Available L&F ****************************************************/
/** Available Looks */
private static ValueNamePair[] s_looks = null;
/** Default PLAF */
private static ValueNamePair s_defaultPLAF = null;
/** Available Themes */
private static ValueNamePair[] s_metalThemes = null;
private static ValueNamePair[] s_plasticThemes = null;
//default theme
private static ValueNamePair s_vp_compiereTheme = null;
private static ValueNamePair s_vp_metalTheme = null;
//e-evolution vpj-cd 19102006
private static ValueNamePair s_vp_adempiereTheme = null;
//e-evolution vpj-cd 1910200sky
/**
* Static Initializer.
* - Fill available PLAFs and Themes
*/
static
{
ArrayList<ValueNamePair> plafList = new ArrayList<ValueNamePair>();
//e-evolution vpj-cd 19102006
ValueNamePair vp = null;
ArrayList<ValueNamePair> metalThemes = new ArrayList<ValueNamePair>();
ArrayList<ValueNamePair> plasticThemes = new ArrayList<ValueNamePair>();
try
{
Class.forName("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
vp = new ValueNamePair("org.adempiere.plaf.AdempiereLookAndFeel", org.adempiere.plaf.AdempiereLookAndFeel.NAME);
plafList.add(vp);
s_vp_adempiereTheme = new ValueNamePair("org.adempiere.plaf.AdempiereTheme", AdempiereThemeInnova.NAME);
plasticThemes.add (s_vp_adempiereTheme);
List<?> installedThemes = AdempiereLookAndFeel.getInstalledThemes();
for(Object t : installedThemes) {
MetalTheme theme = (MetalTheme)t;
vp = new ValueNamePair(theme.getClass().getName(), theme.getName());
plasticThemes.add(vp);
}
}
catch (Exception e)
{
log.severe("Plastic look and feel not found");
}
//e-evolution vpj-cd 19102006
vp = new ValueNamePair("org.compiere.plaf.CompiereLookAndFeel", CompiereLookAndFeel.NAME);
plafList.add (vp);
//Metal
s_vp_compiereTheme = new ValueNamePair("org.compiere.plaf.CompiereThemeBlueMetal", CompiereThemeBlueMetal.NAME);
metalThemes.add (s_vp_compiereTheme);
metalThemes.add (new ValueNamePair("org.compiere.plaf.CompiereThemeIce", CompiereThemeIce.NAME));
s_vp_metalTheme = new ValueNamePair("javax.swing.plaf.metal.OceanTheme", "Ocean");
metalThemes.add (s_vp_metalTheme);
metalThemes.add (new ValueNamePair("javax.swing.plaf.metal.DefaultMetalTheme", "Steel"));
metalThemes.add (new ValueNamePair("org.compiere.plaf.AquaTheme", "Aqua"));
metalThemes.add (new ValueNamePair("org.compiere.plaf.CharcoalTheme", "Charcoal"));
metalThemes.add (new ValueNamePair("org.compiere.plaf.ContrastTheme", "Contrast"));
metalThemes.add (new ValueNamePair("org.compiere.plaf.EmeraldTheme", "Emerald"));
metalThemes.add (new ValueNamePair("org.compiere.plaf.RubyTheme", "Ruby"));
// Install discovered PLAFs
for (int i = 0; i < plafList.size(); i++)
{
vp = plafList.get(i);
UIManager.installLookAndFeel(vp.getName(), vp.getValue());
}
// Fill Available PLAFs
plafList = new ArrayList<ValueNamePair>();
UIManager.LookAndFeelInfo[] lfInfo = UIManager.getInstalledLookAndFeels();
for (int i = 0; i < lfInfo.length; i++)
{
vp = new ValueNamePair (lfInfo[i].getClassName(), lfInfo[i].getName());
plafList.add(vp);
if (lfInfo[i].getName().equals(org.adempiere.plaf.AdempiereLookAndFeel.NAME))
{
s_defaultPLAF = vp;
if (log.isLoggable(Level.FINEST)) log.finest(vp.getName() + " (default)");
}
else
if (log.isLoggable(Level.FINEST)) log.finest(vp.getName());
}
s_looks = new ValueNamePair[plafList.size()];
plafList.toArray(s_looks);
// Fill Available Themes
s_metalThemes = new ValueNamePair[metalThemes.size()];
metalThemes.toArray(s_metalThemes);
s_plasticThemes = new ValueNamePair[plasticThemes.size()];
plasticThemes.toArray(s_plasticThemes);
//
// printPLAFDefaults();
} // static Initializer
/**
* Get available Look And Feels
* @return Array of ValueNamePair with name and class of Look and Feel
*/
public static ValueNamePair[] getPLAFs()
{
return s_looks;
} // getPLAFs
/**
* Get the list of available Metal or Plastic Themes.
* @return Array of Strings with Names of Metal Themes
*/
public static ValueNamePair[] getThemes ()
{
LookAndFeel l = UIManager.getLookAndFeel();
if ( l instanceof AdempiereLookAndFeel)
return s_plasticThemes;
else if ( l instanceof MetalLookAndFeel)
return s_metalThemes;
return new ValueNamePair[0];
} // getThemes
/**************************************************************************
* Set PLAF based on Ini Properties
*/
public static void setPLAF ()
{
String look = Ini.getProperty(Ini.P_UI_LOOK);
String lookTheme = Ini.getProperty(Ini.P_UI_THEME);
// Search for PLAF
ValueNamePair plaf = null;
for (int i = 0; i < s_looks.length; i++)
{
if (s_looks[i].getName().equals(look))
{
plaf = s_looks[i];
break;
}
}
// Search for Theme
ValueNamePair theme = null;
for (int i = 0; i < s_metalThemes.length; i++)
{
if (s_metalThemes[i].getName().equals(lookTheme))
{
theme = s_metalThemes[i];
break;
}
}
if (theme == null)
{
for (int i = 0; i < s_plasticThemes.length; i++)
{
if (s_plasticThemes[i].getName().equals(lookTheme))
{
theme = s_plasticThemes[i];
break;
}
}
}
// Set PLAF
setPLAF (plaf == null ? s_defaultPLAF : plaf, theme, true);
} // setPLAF
/**
* Set PLAF and update Ini
*
* @param plaf ValueNamePair of the PLAF to be set
* @param theme Optional Theme name
* @param upateIni Update setting to INI
*/
public static void setPLAF (ValueNamePair plaf, ValueNamePair theme, boolean updateIni)
{
if (plaf == null)
return;
if (log.isLoggable(Level.CONFIG)) log.config(plaf + (theme == null ? "" : (" - " + theme)));
// Look & Feel
Class<?> lafClass = null;
try {
lafClass = Class.forName(plaf.getValue());
}
catch (Exception e)
{
log.severe(e.getMessage());
return;
}
if ( updateIni ) {
Ini.setProperty(Ini.P_UI_LOOK, plaf.getName());
// Optional Theme
Ini.setProperty(Ini.P_UI_THEME, "");
}
// Default Theme
boolean metal = MetalLookAndFeel.class.isAssignableFrom(lafClass);
boolean adempiere = AdempiereLookAndFeel.class.isAssignableFrom(lafClass);
boolean compiere = CompiereLookAndFeel.class.isAssignableFrom(lafClass);
if (theme == null && metal)
{
if (compiere)
theme = s_vp_compiereTheme;
else if (adempiere)
theme = s_vp_adempiereTheme;
else
theme = s_vp_metalTheme;
}
if (theme != null && metal && theme.getValue().length() > 0)
{
try
{
Class<?> c = Class.forName(theme.getValue());
MetalTheme t = (MetalTheme)c.newInstance();
if (compiere)
CompiereLookAndFeel.setCurrentTheme(t);
else if (adempiere && t instanceof PlasticTheme)
AdempiereLookAndFeel.setCurrentTheme((PlasticTheme)t);
else
MetalLookAndFeel.setCurrentTheme(t);
//
if (updateIni)
Ini.setProperty(Ini.P_UI_THEME, theme.getName());
}
catch (Exception e)
{
log.severe("Theme - " + e.getMessage());
}
}
try
{
UIManager.setLookAndFeel((LookAndFeel)lafClass.newInstance());
}
catch (Exception e)
{
log.severe(e.getMessage());
}
if (log.isLoggable(Level.CONFIG)) log.config(plaf + " - " + theme);
// printPLAFDefaults();
} // setPLAF
/**
* Update UI of this and parent Windows
* @param win window
*/
public static void updateUI (Window win)
{
if (win == null)
return;
Window c = win;
do
{
SwingUtilities.updateComponentTreeUI(c);
c.invalidate();
c.pack();
c.validate();
c.repaint();
c = c.getOwner();
}
while (c != null);
} // updateUI
/**
* Reset PLAF Settings
*/
public static void reset ()
{
// Clean Theme Properties
AdempierePLAF.setPLAF ();
} // reset
/**
* Print current UIDefaults
*/
public static void printPLAFDefaults ()
{
System.out.println(UIManager.getLookAndFeel());
Object[] keys = UIManager.getLookAndFeelDefaults().keySet().toArray();
Arrays.sort(keys);
char lastStart = ' ';
for (int i = 0; i < keys.length; i++)
{
StringBuffer sb = new StringBuffer();
sb.append(keys[i]).append(" = ").append(UIManager.get(keys[i]));
if (keys[i].toString().charAt(0) != lastStart)
{
System.out.println();
lastStart = keys[i].toString().charAt(0);
}
System.out.println(sb);
}
} // printPLAFDefaults
/**
* Is AdempiereL&F the active L&F
* @return true if L&F is Adempiere
*/
public static boolean isActive()
{
return UIManager.getLookAndFeel() instanceof AdempiereLookAndFeel;
} // isActive
/*************************************************************************/
static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes");
/**
* Create OK Button
* @return OK button
*/
public static CButton getOKButton()
{
CButton b = new CButton();
b.setIcon(new ImageIcon(AdempierePLAF.class.getResource("icons/Ok24.gif")));
b.setMargin(new Insets(0,10,0,10));
b.setToolTipText (s_res.getString("OK"));
return b;
} // getOKButton
/**
* Create Cancel Button
* @return Cancel button
*/
public static CButton getCancelButton()
{
CButton b = new CButton();
b.setIcon(new ImageIcon(AdempierePLAF.class.getResource("icons/Cancel24.gif")));
b.setMargin(new Insets(0,10,0,10));
b.setToolTipText (s_res.getString("Cancel"));
return b;
} // getCancelButton
/**
* Center Window on Screen and show it
* @param window window
*/
public static void showCenterScreen (Window window)
{
window.pack();
Dimension sSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension wSize = window.getSize();
window.setLocation(((sSize.width-wSize.width)/2), ((sSize.height-wSize.height)/2));
window.toFront();
window.setVisible(true);
} // showCenterScreen
/**
* Invoke the correct method to set current metal based theme.
* Supported look and feel are Metal, Plastic and Compiere.
* @param laf Metal based look and feel
* @param theme Metal based theme
*/
public static void setCurrentMetalTheme(MetalLookAndFeel laf, MetalTheme theme)
{
if (laf instanceof CompiereLookAndFeel)
CompiereLookAndFeel.setCurrentTheme(theme);
else if (laf instanceof AdempiereLookAndFeel && theme instanceof PlasticTheme)
AdempiereLookAndFeel.setCurrentTheme((PlasticTheme)theme);
else
MetalLookAndFeel.setCurrentTheme(theme);
}
/**************************************************************************
* Start Class With Adempiere Look
* @param args first parameter is class to start, if none start PLAF Editor
*/
public static void main (String[] args)
{
String jVersion = System.getProperty("java.version");
if (!(jVersion.startsWith("1.5")))
{
JOptionPane.showMessageDialog (null,
"Require Java Version 1.5 or up - Not " + jVersion,
"AdempierePLAF - Version Conflict",
JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
// set the defined PLAF
Ini.loadProperties (true);
setPLAF ();
//
if (args.length == 0)
{
return;
}
String className = args[0];
// find class
Class<?> startClass = null;
try
{
startClass = Class.forName(className);
}
catch (Exception e)
{
log.severe("Did not find: " + className);
e.printStackTrace();
System.exit(1);
}
// try static main method
try
{
Method[] methods = startClass.getMethods();
if (methods.length > 0)
{
if (Modifier.isStatic(methods[0].getModifiers()) && methods[0].getName().equals("main"))
{
String[] startArgs = new String[args.length-1];
for (int ii = 1; ii < args.length; ii++)
startArgs[ii] = args[ii];
methods[0].invoke(null, new Object[] {startArgs});
}
return;
}
}
catch (Exception ee)
{
log.severe("Problems invoking main");
ee.printStackTrace();
}
// start the class
try
{
startClass.newInstance();
}
catch (Exception e)
{
log.severe("Cannot start: " + className);
e.printStackTrace();
System.exit(1);
}
} // main
} // AdempierePLAF

View File

@ -1,109 +0,0 @@
package org.adempiere.plaf;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import javax.swing.JComponent;
import javax.swing.border.Border;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.ComponentUI;
import org.jdesktop.swingx.JXTaskPane;
import org.jdesktop.swingx.plaf.basic.BasicTaskPaneUI;
public class AdempiereTaskPaneUI extends BasicTaskPaneUI {
public static ComponentUI createUI(JComponent c) {
return new AdempiereTaskPaneUI();
}
protected Border createPaneBorder() {
return new AdempierePaneBorder();
}
/**
* Overriden to paint the background of the component but keeping the
* rounded corners.
*/
public void update(Graphics g, JComponent c) {
if (c.isOpaque()) {
g.setColor(new ColorUIResource(251, 248, 241));
g.fillRect(0, 0, c.getWidth(), c.getHeight());
g.setColor(new ColorUIResource(251, 248, 241));
g.fillRect(0, getRoundHeight(), c.getWidth(), c.getHeight()
- getRoundHeight());
}
paint(g, c);
}
/**
* The border of the taskpane group paints the "text", the "icon", the
* "expanded" status and the "special" type.
*
*/
class AdempierePaneBorder extends PaneBorder {
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
if (group.isSpecial()) {
g.setColor(new ColorUIResource(251, 248, 241));
g.fillRoundRect(0, 0, group.getWidth(), getRoundHeight() * 2,
getRoundHeight(), getRoundHeight());
g.fillRect(0, getRoundHeight(), group.getWidth(), getTitleHeight(group)
- getRoundHeight());
} else {
Paint oldPaint = ((Graphics2D) g).getPaint();
GradientPaint gradient = new GradientPaint(0f, 0f, // group.getWidth()
// / 2,
new ColorUIResource(241, 239, 222), 0f, // group.getWidth(),
getTitleHeight(group), new ColorUIResource(251, 248, 241));
((Graphics2D) g).setRenderingHint(
RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
((Graphics2D) g).setRenderingHint(
RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
((Graphics2D) g).setPaint(gradient);
g.fillRoundRect(0, 0, group.getWidth(), getRoundHeight() * 2,
getRoundHeight(), getRoundHeight());
g.fillRect(0, getRoundHeight(), group.getWidth(), getTitleHeight(group)
- getRoundHeight());
((Graphics2D) g).setPaint(oldPaint);
}
Rectangle oldRect = g.getClipBounds();
g.setClip(0, 0, group.getWidth(), getTitleHeight(group));
g.setColor(borderColor);
g.drawRoundRect(0, 0, group.getWidth() - 1, getTitleHeight(group)
+ getRoundHeight(), getRoundHeight(), getRoundHeight());
g.drawLine(0, getTitleHeight(group) - 1, group.getWidth(), getTitleHeight(group) - 1);
g.setClip(oldRect);
}
protected void paintExpandedControls(JXTaskPane group, Graphics g,
int x, int y, int width, int height) {
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
paintOvalAroundControls(group, g, x, y, width, height);
g.setColor(getPaintColor(group));
paintChevronControls(group, g, x, y, width, height);
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
}
@Override
protected boolean isMouseOverBorder() {
return true;
}
}
}

View File

@ -1,425 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.plaf;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.SystemColor;
import java.awt.Toolkit;
import java.util.logging.Logger;
import javax.swing.UIDefaults;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
import org.compiere.swing.ColorBlind;
import org.compiere.swing.ExtendedTheme;
import com.jgoodies.looks.plastic.PlasticScrollBarUI;
/**
* A theme based on GTK2-Gilouche and tango project iconset.
* It has been optimized to work with Suse SLED 10 default desktop settings.
*
*
* @author vpj-cd
* @version $Revision: 1.0 $
* @author Low Heng Sin
* - Fixed invisible disactive component issue
* - Use red instead of green as background for error field
*/
public class AdempiereTheme extends com.jgoodies.looks.plastic.PlasticTheme {
/**
* Return Theme Name
* @return Theme Name
*/
public String getName()
{
return s_name;
} // getName
/**
* String Representation
* @return info
*/
public String toString ()
{
return getName();
} // toString
/** Static Initializer */
static
{
s_theme = new org.adempiere.plaf.AdempiereTheme();
}
//-------------------------------------------------
/** Theme Name */
protected static String s_name = "Adempiere Theme";
public static final String NAME = s_name;
/** Logger */
protected static Logger log = Logger.getLogger(org.adempiere.plaf.AdempiereTheme.class.getName());
/** Active Theme */
protected static AdempiereTheme s_theme = null;
/** Blue 51,51,102 */
public static ColorUIResource primary0 = new ColorUIResource(103, 152, 203);
/** Blue 102, 102, 153 */
//protected static ColorUIResource primary1;
public static ColorUIResource primary1 = new ColorUIResource( 101, 138, 187);
/** Blue 153, 153, 204 */
public static ColorUIResource primary2 = new ColorUIResource(103, 152, 203);
/** Blue 204, 204, 255 */
public static ColorUIResource primary3= new ColorUIResource(233, 238, 245); //
/** Black */
public final ColorUIResource secondary0 = new ColorUIResource(0, 0, 0);
/** Gray 102, 102, 102 */
public static ColorUIResource secondary1= new ColorUIResource(190, 179, 153);
/** Gray 153, 153, 153 */
public static ColorUIResource secondary2= new ColorUIResource(196, 189, 174);
/** BlueGray 214, 224, 234 - background */
public static ColorUIResource secondary3= new ColorUIResource(251, 248, 241);
/** White */
public final ColorUIResource secondary4 = new ColorUIResource(255, 255, 255);
/** Black */
public static ColorUIResource black = BLACK;
/** White */
public static ColorUIResource white = WHITE;
/** Background for mandatory fields */
//public static ColorUIResource mandatory = new ColorUIResource(233, 238, 245); // blueish
public static ColorUIResource mandatory = new ColorUIResource(205, 225, 245); // BF[ 1640919 ] Adempiere Theme aspect problem
/** Background for fields in error */
//Gree for error is confusing new ColorUIResource(220, 241, 203); // green ;
public static ColorUIResource error = new ColorUIResource(255, 204, 204); // red-isch
/** Background for inactive fields */
public static ColorUIResource inactive = new ColorUIResource(241,239,222); //234, 234, 234);
/** Background for info fields */
public static ColorUIResource info = new ColorUIResource(251, 248, 251); // somewhat white
/** Foreground Text OK */
public static ColorUIResource txt_ok =new ColorUIResource(0, 153, 255); // blue ;
/** Foreground Text Error */
public static ColorUIResource txt_error = new ColorUIResource(255, 0, 51); // red ;
/** Control font */
public static FontUIResource controlFont;
/** System font */
public static FontUIResource systemFont;
/** User font */
public static FontUIResource userFont;
/** Small font */
public static FontUIResource smallFont;
/** Window Title font */
public static FontUIResource windowFont;
/** Menu font */
public static FontUIResource menuFont;
/** Default Font */
public static final String FONT_DEFAULT = "Dialog";
/** Default Font Size */
public static int FONT_SIZE = 12;
static {
//set font size base on screen resolution
try {
Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
if (size.width <= 800)
FONT_SIZE = 9;
else if (size.width <= 1024)
FONT_SIZE = 10;
else if (size.width <= 1280)
FONT_SIZE = 11;
else if (size.width <= 1400)
FONT_SIZE = 12;
else if (size.width <= 1600)
FONT_SIZE = 13;
else
FONT_SIZE = 14;
} catch (Throwable t) {}
}
/**************************************************************************
* Get Primary 1 (blue in default Metal Theme)
* @return color
*/
public ColorUIResource getPrimary1()
{
return ColorBlind.getDichromatColorUIResource(primary1);
}
public ColorUIResource getPrimary2()
{
return ColorBlind.getDichromatColorUIResource(primary2);
}
public ColorUIResource getPrimary3()
{
return ColorBlind.getDichromatColorUIResource(primary3);
}
/**
* Get Secondary 1 (gray in default Metal Theme)
* @return color
*/
public ColorUIResource getSecondary0()
{
return ColorBlind.getDichromatColorUIResource(secondary0);
}
public ColorUIResource getSecondary1()
{
return ColorBlind.getDichromatColorUIResource(secondary1);
}
public ColorUIResource getSecondary2()
{
return ColorBlind.getDichromatColorUIResource(secondary2);
}
public ColorUIResource getSecondary3()
{
return ColorBlind.getDichromatColorUIResource(secondary3);
}
public ColorUIResource getSecondary4()
{
return ColorBlind.getDichromatColorUIResource(secondary4);
}
public ColorUIResource getBlack()
{
return ColorBlind.getDichromatColorUIResource(black);
}
public ColorUIResource getWhite()
{
return ColorBlind.getDichromatColorUIResource(white);
}
/**
* Control Font (plain)
* @return font
*/
protected static FontUIResource _getControlTextFont()
{
if (controlFont == null)
{
try
{
controlFont = new FontUIResource(Font.getFont("swing.plaf.metal.controlFont",
new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE)));
}
catch (Exception e)
{
controlFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE);
}
}
return controlFont;
}
public FontUIResource getControlTextFont() {return _getControlTextFont();}
/**
* System Font
* @return font
*/
protected static FontUIResource _getSystemTextFont()
{
if (systemFont == null)
{
try
{
systemFont = new FontUIResource(Font.getFont("swing.plaf.metal.systemFont",
new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE)));
}
catch (Exception e)
{
systemFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE);
}
}
return systemFont;
}
public FontUIResource getSystemTextFont() {return _getSystemTextFont();}
/**
* User Font
* @return font
*/
protected static FontUIResource _getUserTextFont()
{
if (userFont == null)
{
try
{
userFont = new FontUIResource(Font.getFont("swing.plaf.metal.userFont",
new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE)));
}
catch (Exception e)
{
userFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE);
}
}
return userFont;
}
public FontUIResource getUserTextFont() {return _getUserTextFont();}
/**
* Menu
* @return font
*/
protected static FontUIResource _getMenuTextFont()
{
if (menuFont == null)
{
try
{
menuFont = new FontUIResource(Font.getFont("swing.plaf.metal.menuFont",
new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE)));
}
catch (Exception e)
{
menuFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE);
}
}
return menuFont;
}
public FontUIResource getMenuTextFont() {return _getMenuTextFont();}
/**
* Window Title
* @return font
*/
protected static FontUIResource _getWindowTitleFont()
{
if (windowFont == null)
{
try
{
windowFont = new FontUIResource(Font.getFont("swing.plaf.metal.windowFont",
new Font(FONT_DEFAULT, Font.BOLD, FONT_SIZE+2)));
}
catch (Exception e)
{
windowFont = new FontUIResource(FONT_DEFAULT, Font.BOLD, FONT_SIZE+2);
}
}
return windowFont;
}
public FontUIResource getWindowTitleFont() {return _getWindowTitleFont();}
/**
* Sub Text
* @return font
*/
protected static FontUIResource _getSubTextFont()
{
if (smallFont == null)
{
try
{
smallFont = new FontUIResource(Font.getFont("swing.plaf.metal.smallFont",
new Font(FONT_DEFAULT, Font.PLAIN, FONT_SIZE-2)));
}
catch (Exception e)
{
smallFont = new FontUIResource(FONT_DEFAULT, Font.PLAIN, FONT_SIZE-2);
}
}
return smallFont;
}
public FontUIResource getSubTextFont() {return _getSubTextFont();}
/**
* Parses Color into String representation.
* Required as SystemColors and Alpha Colors have different formats
* @param c Color
* @return [r=102,g=102,b=153,a=255]
* @see #parseColor
*/
public static String getColorAsString (Color c)
{
if (c == null)
c = SystemColor.control;
StringBuffer sb = new StringBuffer("[r=").append(c.getRed())
.append(",g=").append(c.getGreen())
.append(",b=").append(c.getBlue())
.append(",a=").append(c.getAlpha())
.append("]");
// System.out.println(sb.toString());
return sb.toString();
} // getColorAsString
/**
* Set Default Colors
*/
public void setDefault()
{
} // setDefault
//-----------------------------------------------------
public ColorUIResource getFocusColor() {
return getPrimary2();
}
public ColorUIResource getPrimaryControlShadow() {
return getPrimary3();
}
public ColorUIResource getMenuSelectedBackground() {
return getPrimary1();
}
public ColorUIResource getMenuSelectedForeground() {
return WHITE;
}
public ColorUIResource getMenuItemBackground() {
return WHITE;
}
public ColorUIResource getToggleButtonCheckColor() {
return new ColorUIResource( 220, 241, 203);
}
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
Object[] uiDefaults =
{
"ScrollBar.thumbHighlight",
getPrimaryControlHighlight(),
PlasticScrollBarUI.MAX_BUMPS_WIDTH_KEY,
Integer.valueOf(22),
PlasticScrollBarUI.MAX_BUMPS_WIDTH_KEY, Integer.valueOf(30),
//"TabbedPane.selected", getWhite(),
"TabbedPane.selectHighlight", new ColorUIResource(231, 218, 188),
ExtendedTheme.ERROR_BG_KEY,
error,
ExtendedTheme.ERROR_FG_KEY,
txt_error,
ExtendedTheme.INACTIVE_BG_KEY,
inactive,
ExtendedTheme.INFO_BG_KEY,
info,
ExtendedTheme.MANDATORY_BG_KEY,
mandatory
};
table.putDefaults(uiDefaults);
}
}

View File

@ -1,111 +0,0 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.plaf;
import javax.swing.plaf.ColorUIResource;
/**
* Adempiere default Blue Metal Color Theme
*
* @author Jorg Janke, Adam Michau
* @version $Id: AdempiereThemeBlueMetal.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
*/
public class AdempiereThemeInnova extends org.adempiere.plaf.AdempiereTheme
{
/**
* Adempiere default Theme Blue Metal
*/
public AdempiereThemeInnova()
{
setDefault();
s_theme = this;
s_name = NAME;
} // AdempiereThemeBlueMetal
/** Name */
public static final String NAME = "Adempiere Theme";
/**
* Set Defaults
*/
public void setDefault()
{
/** Blue 51,51,102 */
primary0 = new ColorUIResource(103, 152, 203);
/** Blue 102, 102, 153 */
//protected static ColorUIResource primary1;
primary1 = new ColorUIResource( 101, 138, 187);
/** Blue 153, 153, 204 */
primary2 = new ColorUIResource(103, 152, 203);
/** Blue 204, 204, 255 */
primary3= new ColorUIResource(233, 238, 245); //
/** Black */
//secondary0 = new ColorUIResource(0, 0, 0);
/** Gray 102, 102, 102 */
//protected static ColorUIResource secondary1;
secondary1= new ColorUIResource(190, 179, 153);
/** Gray 153, 153, 153 */
//protected static ColorUIResource secondary2;
secondary2= new ColorUIResource(246, 239, 224);
/** BlueGray 214, 224, 234 - background */
//protected static ColorUIResource secondary3;
secondary3= new ColorUIResource(251, 248, 241);
/** White */
//secondary4 = new ColorUIResource(255, 255, 255);
/** Black */
black = BLACK;
/** White */
white = WHITE;
/** Background for mandatory fields */
mandatory = new ColorUIResource(233, 238, 245); // blueish
/** Background for fields in error 180,220,143 */
error = new ColorUIResource(220, 241, 203); // green ;
/** Background for inactive fields */
inactive = new ColorUIResource(241,239,222);//241,239,222
/** Background for info fields */
info = new ColorUIResource(251, 248, 251); // somewhat white
/** Foreground Text OK */
txt_ok =new ColorUIResource(0, 153, 255); // blue ;
/** Foreground Text Error */
txt_error = new ColorUIResource(255, 0, 51); // red ;
/** Black */
// secondary0 = new ColorUIResource(0, 0, 0);
/** Control font */
controlFont = null;
_getControlTextFont();
/** System font */
systemFont = null;
_getSystemTextFont();
/** User font */
userFont = null;
_getUserTextFont();
/** Small font */
smallFont = null;
_getSubTextFont();
/** Window Title font */
windowFont = null;
_getWindowTitleFont();
/** Menu font */
menuFont = null;
_getMenuTextFont();
} // setDefault
} // AdempiereThemeBlueMetal

Some files were not shown because too many files have changed in this diff Show More