org.adempiere.apps.graph package:
* BF [ 1874419 ] JDBC Statement not close in a finally block * replace system.out with logging * minor - HtmlDashboard: select only active PA_DASHBOARDCONTENT * reorganized imports * removed "TODO Auto-generated method stub"
This commit is contained in:
parent
3d2bae2080
commit
53d68602fd
|
@ -16,31 +16,41 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.apps.graph;
|
package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.event.*;
|
import java.awt.Color;
|
||||||
import java.awt.geom.*;
|
import java.awt.Cursor;
|
||||||
import java.util.*;
|
import java.awt.Dimension;
|
||||||
import java.util.logging.*;
|
import java.awt.Point;
|
||||||
import java.math.*;
|
import java.math.BigDecimal;
|
||||||
import java.sql.*;
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.compiere.apps.*;
|
import org.compiere.apps.AEnv;
|
||||||
import org.compiere.model.*;
|
import org.compiere.model.MAchievement;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.model.MGoal;
|
||||||
import org.compiere.util.*;
|
import org.compiere.model.MMeasure;
|
||||||
|
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.model.MStatus;
|
||||||
|
import org.compiere.swing.CPanel;
|
||||||
|
import org.compiere.util.CLogger;
|
||||||
|
import org.compiere.util.DB;
|
||||||
|
import org.compiere.util.Env;
|
||||||
import org.jfree.chart.ChartFactory;
|
import org.jfree.chart.ChartFactory;
|
||||||
import org.jfree.chart.ChartMouseEvent;
|
import org.jfree.chart.ChartMouseEvent;
|
||||||
import org.jfree.chart.ChartMouseListener;
|
import org.jfree.chart.ChartMouseListener;
|
||||||
import org.jfree.chart.ChartPanel;
|
import org.jfree.chart.ChartPanel;
|
||||||
import org.jfree.chart.JFreeChart;
|
import org.jfree.chart.JFreeChart;
|
||||||
import org.jfree.chart.entity.CategoryItemEntity;
|
|
||||||
import org.jfree.chart.entity.ChartEntity;
|
|
||||||
import org.jfree.chart.plot.CategoryPlot;
|
import org.jfree.chart.plot.CategoryPlot;
|
||||||
import org.jfree.chart.plot.PlotOrientation;
|
import org.jfree.chart.plot.PlotOrientation;
|
||||||
import org.jfree.chart.renderer.category.BarRenderer;
|
import org.jfree.chart.renderer.category.BarRenderer;
|
||||||
import org.jfree.data.category.CategoryDataset;
|
|
||||||
import org.jfree.data.category.DefaultCategoryDataset;
|
import org.jfree.data.category.DefaultCategoryDataset;
|
||||||
import org.jfree.data.general.DefaultValueDataset;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bar Graph
|
* Bar Graph
|
||||||
|
@ -120,10 +130,11 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
m_goal.getMeasureDisplay(), null,
|
m_goal.getMeasureDisplay(), null,
|
||||||
MRole.getDefault()); // logged in role
|
MRole.getDefault()); // logged in role
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement (sql, null);
|
pstmt = DB.prepareStatement (sql, null);
|
||||||
ResultSet rs = pstmt.executeQuery ();
|
rs = pstmt.executeQuery ();
|
||||||
ArrayList<Timestamp> dataList = new ArrayList<Timestamp>();
|
ArrayList<Timestamp> dataList = new ArrayList<Timestamp>();
|
||||||
while (rs.next ())
|
while (rs.next ())
|
||||||
{
|
{
|
||||||
|
@ -137,23 +148,15 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
dataList.add(date); // list of dates
|
dataList.add(date); // list of dates
|
||||||
list.add(pos, bgc);
|
list.add(pos, bgc);
|
||||||
}
|
}
|
||||||
rs.close ();
|
|
||||||
pstmt.close ();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log (Level.SEVERE, sql, e);
|
log.log (Level.SEVERE, sql, e);
|
||||||
}
|
}
|
||||||
try
|
finally
|
||||||
{
|
{
|
||||||
if (pstmt != null)
|
DB.close(rs, pstmt);
|
||||||
pstmt.close ();
|
rs = null; pstmt = null;
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (MMeasure.MEASURETYPE_Achievements.equals(measure.getMeasureType()))
|
else if (MMeasure.MEASURETYPE_Achievements.equals(measure.getMeasureType()))
|
||||||
|
@ -188,11 +191,12 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
.append("GROUP BY ").append(trunc)
|
.append("GROUP BY ").append(trunc)
|
||||||
.append(" ORDER BY ").append(trunc);
|
.append(" ORDER BY ").append(trunc);
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement (sql.toString(), null);
|
pstmt = DB.prepareStatement (sql.toString(), null);
|
||||||
pstmt.setInt(1, measure.getPA_Measure_ID());
|
pstmt.setInt(1, measure.getPA_Measure_ID());
|
||||||
ResultSet rs = pstmt.executeQuery ();
|
rs = pstmt.executeQuery ();
|
||||||
while (rs.next ())
|
while (rs.next ())
|
||||||
{
|
{
|
||||||
BigDecimal data = rs.getBigDecimal(1);
|
BigDecimal data = rs.getBigDecimal(1);
|
||||||
|
@ -201,23 +205,15 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
bgc.setLabel(date, m_goal.getMeasureDisplay());
|
bgc.setLabel(date, m_goal.getMeasureDisplay());
|
||||||
list.add(bgc);
|
list.add(bgc);
|
||||||
}
|
}
|
||||||
rs.close ();
|
|
||||||
pstmt.close ();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log (Level.SEVERE, sql.toString(), e);
|
log.log (Level.SEVERE, sql.toString(), e);
|
||||||
}
|
}
|
||||||
try
|
finally
|
||||||
{
|
{
|
||||||
if (pstmt != null)
|
DB.close(rs, pstmt);
|
||||||
pstmt.close ();
|
rs = null; pstmt = null;
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
} // Achievement in time
|
} // Achievement in time
|
||||||
} // Achievement
|
} // Achievement
|
||||||
|
@ -230,10 +226,11 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
m_goal.getMeasureDisplay(), measure.getMeasureDataType(),
|
m_goal.getMeasureDisplay(), measure.getMeasureDataType(),
|
||||||
null, MRole.getDefault()); // logged in role
|
null, MRole.getDefault()); // logged in role
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement (sql, null);
|
pstmt = DB.prepareStatement (sql, null);
|
||||||
ResultSet rs = pstmt.executeQuery ();
|
rs = pstmt.executeQuery ();
|
||||||
while (rs.next ())
|
while (rs.next ())
|
||||||
{
|
{
|
||||||
BigDecimal data = rs.getBigDecimal(1);
|
BigDecimal data = rs.getBigDecimal(1);
|
||||||
|
@ -251,23 +248,15 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
}
|
}
|
||||||
list.add(bgc);
|
list.add(bgc);
|
||||||
}
|
}
|
||||||
rs.close ();
|
|
||||||
pstmt.close ();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log (Level.SEVERE, sql, e);
|
log.log (Level.SEVERE, sql, e);
|
||||||
}
|
}
|
||||||
try
|
finally
|
||||||
{
|
{
|
||||||
if (pstmt != null)
|
DB.close(rs, pstmt);
|
||||||
pstmt.close ();
|
rs = null; pstmt = null;
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
} // Request
|
} // Request
|
||||||
|
|
||||||
|
@ -279,10 +268,11 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
m_goal.getMeasureDisplay(), measure.getMeasureDataType(),
|
m_goal.getMeasureDisplay(), measure.getMeasureDataType(),
|
||||||
null, MRole.getDefault()); // logged in role
|
null, MRole.getDefault()); // logged in role
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement (sql, null);
|
pstmt = DB.prepareStatement (sql, null);
|
||||||
ResultSet rs = pstmt.executeQuery ();
|
rs = pstmt.executeQuery ();
|
||||||
while (rs.next ())
|
while (rs.next ())
|
||||||
{
|
{
|
||||||
BigDecimal data = rs.getBigDecimal(1);
|
BigDecimal data = rs.getBigDecimal(1);
|
||||||
|
@ -292,23 +282,15 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
bgc.setLabel(date, m_goal.getMeasureDisplay());
|
bgc.setLabel(date, m_goal.getMeasureDisplay());
|
||||||
list.add(bgc);
|
list.add(bgc);
|
||||||
}
|
}
|
||||||
rs.close ();
|
|
||||||
pstmt.close ();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log (Level.SEVERE, sql, e);
|
log.log (Level.SEVERE, sql, e);
|
||||||
}
|
}
|
||||||
try
|
finally
|
||||||
{
|
{
|
||||||
if (pstmt != null)
|
DB.close(rs, pstmt);
|
||||||
pstmt.close ();
|
rs = null; pstmt = null;
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
} // Project
|
} // Project
|
||||||
|
|
||||||
|
@ -496,15 +478,10 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public void componentHidden(ComponentEvent e) {
|
public void componentHidden(ComponentEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public void componentMoved(ComponentEvent e) {
|
public void componentMoved(ComponentEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public void componentResized(ComponentEvent e) {
|
public void componentResized(ComponentEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
float aspectRatio = 1.6f;
|
float aspectRatio = 1.6f;
|
||||||
Dimension size = getSize();
|
Dimension size = getSize();
|
||||||
if (size.width > size.height * aspectRatio)
|
if (size.width > size.height * aspectRatio)
|
||||||
|
@ -517,7 +494,6 @@ public class BarGraph extends CPanel implements ChartMouseListener //, Component
|
||||||
java.lang.Math.round(size.width / aspectRatio)));
|
java.lang.Math.round(size.width / aspectRatio)));
|
||||||
}
|
}
|
||||||
public void componentShown(ComponentEvent e) {
|
public void componentShown(ComponentEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
} // BarGraph
|
} // BarGraph
|
||||||
|
|
|
@ -372,7 +372,7 @@ public class BarGraphColumn extends JComponent implements MouseListener
|
||||||
g2D.setColor(getBackground());
|
g2D.setColor(getBackground());
|
||||||
//Dimension size = getPreferredSize();
|
//Dimension size = getPreferredSize();
|
||||||
Dimension size =getSize();
|
Dimension size =getSize();
|
||||||
System.out.println("bgc: " + size.width + " x " + size.height);
|
log.fine("bgc: " + size.width + " x " + size.height);
|
||||||
g2D.fill3DRect(0, 0, size.width, size.height, true);
|
g2D.fill3DRect(0, 0, size.width, size.height, true);
|
||||||
|
|
||||||
// Paint Label & Value
|
// Paint Label & Value
|
||||||
|
|
|
@ -16,10 +16,15 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.apps.graph;
|
package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.Component;
|
||||||
import java.util.*;
|
import java.awt.Container;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.FontMetrics;
|
||||||
|
import java.awt.LayoutManager;
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.CLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bar Graph Layout
|
* Bar Graph Layout
|
||||||
|
@ -117,7 +122,7 @@ public class BarGraphLayout
|
||||||
//
|
//
|
||||||
//Dimension size = m_parent.getPreferredSize();
|
//Dimension size = m_parent.getPreferredSize();
|
||||||
Dimension size =m_parent.getSize();
|
Dimension size =m_parent.getSize();
|
||||||
System.out.println("bgl: " +size.width + " x " + size.height);
|
log.fine("bgl: " +size.width + " x " + size.height);
|
||||||
|
|
||||||
Point point0_0 = m_parent.getPoint0_0();
|
Point point0_0 = m_parent.getPoint0_0();
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
package org.adempiere.apps.graph;
|
package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import javax.swing.*;
|
import java.awt.Image;
|
||||||
import javax.swing.text.*;
|
import java.awt.Toolkit;
|
||||||
import javax.swing.text.html.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.image.*;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.sql.SQLException;
|
|
||||||
|
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 {
|
public class FCHtmlEditorKit extends HTMLEditorKit {
|
||||||
public ViewFactory getViewFactory() {
|
public ViewFactory getViewFactory() {
|
||||||
|
|
|
@ -16,9 +16,10 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.apps.graph;
|
package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.Color;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
import org.compiere.util.*;
|
|
||||||
|
import org.compiere.util.CLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Graphic Utilities
|
* Graphic Utilities
|
||||||
|
|
|
@ -3,10 +3,6 @@
|
||||||
*/
|
*/
|
||||||
package org.adempiere.apps.graph;
|
package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.event.*;
|
|
||||||
import javax.swing.text.Document;
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Container;
|
import java.awt.Container;
|
||||||
|
@ -19,19 +15,25 @@ import java.awt.event.MouseListener;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import javax.swing.JEditorPane;
|
import javax.swing.JEditorPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JPopupMenu;
|
import javax.swing.JPopupMenu;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.SwingUtilities;
|
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.MAchievement;
|
||||||
import org.compiere.model.MGoal;
|
import org.compiere.model.MGoal;
|
||||||
import org.compiere.model.MMeasureCalc;
|
import org.compiere.model.MMeasureCalc;
|
||||||
|
@ -46,9 +48,6 @@ import org.compiere.util.Env;
|
||||||
import org.compiere.util.Ini;
|
import org.compiere.util.Ini;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
|
|
||||||
import org.compiere.apps.AEnv;
|
|
||||||
import org.compiere.apps.AWindow;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author fcsku
|
* @author fcsku
|
||||||
*
|
*
|
||||||
|
@ -119,8 +118,7 @@ public class HtmlDashboard extends JPanel implements MouseListener,
|
||||||
while ((cssLine = bufferedReader.readLine()) != null)
|
while ((cssLine = bufferedReader.readLine()) != null)
|
||||||
result += cssLine + "\n";
|
result += cssLine + "\n";
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
// TODO Auto-generated catch block
|
log.log(Level.SEVERE, e1.getLocalizedMessage(), e1);
|
||||||
e1.printStackTrace();
|
|
||||||
}
|
}
|
||||||
//System.out.println(result);
|
//System.out.println(result);
|
||||||
switch (requestPage) {
|
switch (requestPage) {
|
||||||
|
@ -142,13 +140,15 @@ public class HtmlDashboard extends JPanel implements MouseListener,
|
||||||
String sql = " SELECT x.AD_CLIENT_ID, x.NAME, x.DESCRIPTION, x.AD_WINDOW_ID, x.PA_GOAL_ID, x.LINE, x.HTML, m.AD_MENU_ID"
|
String sql = " SELECT x.AD_CLIENT_ID, x.NAME, x.DESCRIPTION, x.AD_WINDOW_ID, x.PA_GOAL_ID, x.LINE, x.HTML, m.AD_MENU_ID"
|
||||||
+ " FROM PA_DASHBOARDCONTENT x"
|
+ " FROM PA_DASHBOARDCONTENT x"
|
||||||
+ " LEFT OUTER JOIN AD_MENU m ON x.ad_window_id=m.ad_window_id"
|
+ " LEFT OUTER JOIN AD_MENU m ON x.ad_window_id=m.ad_window_id"
|
||||||
+ " WHERE x.AD_Client_ID=0 OR x.AD_Client_ID=?"
|
+ " WHERE (x.AD_Client_ID=0 OR x.AD_Client_ID=?) AND x.IsActive='Y'"
|
||||||
+ " ORDER BY LINE";
|
+ " ORDER BY LINE";
|
||||||
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, Env.getAD_Client_ID(Env.getCtx()));
|
pstmt.setInt(1, Env.getAD_Client_ID(Env.getCtx()));
|
||||||
ResultSet rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
appendToHome = rs.getString("HTML");
|
appendToHome = rs.getString("HTML");
|
||||||
if (appendToHome != null) {
|
if (appendToHome != null) {
|
||||||
|
@ -170,20 +170,22 @@ public class HtmlDashboard extends JPanel implements MouseListener,
|
||||||
result += goalsDetail(rs.getInt("PA_GOAL_ID"));
|
result += goalsDetail(rs.getInt("PA_GOAL_ID"));
|
||||||
//result += goalsDetail(rs.getInt("AD_TABLE_ID"));
|
//result += goalsDetail(rs.getInt("AD_TABLE_ID"));
|
||||||
}
|
}
|
||||||
rs.close();
|
|
||||||
pstmt.close();
|
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
System.out.println("dashboard: " + e); //TODO catch-block
|
log.log(Level.SEVERE, sql, e);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
DB.close(rs, pstmt);
|
||||||
|
rs = null; pstmt = null;
|
||||||
}
|
}
|
||||||
result += "<br><br><br>\n"
|
result += "<br><br><br>\n"
|
||||||
+ "</div>\n</body>\n</html>\n";
|
+ "</div>\n</body>\n</html>\n";
|
||||||
break;
|
break;
|
||||||
default: //**************************************************************
|
default: //**************************************************************
|
||||||
System.out.println("error");
|
log.warning("Unknown option - "+requestPage);
|
||||||
}
|
}
|
||||||
//System.out.println(result);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +288,7 @@ public class HtmlDashboard extends JPanel implements MouseListener,
|
||||||
try {
|
try {
|
||||||
htmlUpdate( new URL( url ) );
|
htmlUpdate( new URL( url ) );
|
||||||
} catch( MalformedURLException e ) {
|
} catch( MalformedURLException e ) {
|
||||||
System.out.println( "Malformed URL: " + e );
|
log.warning("Malformed URL: " + e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +363,6 @@ public class HtmlDashboard extends JPanel implements MouseListener,
|
||||||
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
|
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
|
||||||
*/
|
*/
|
||||||
public void mouseClicked(MouseEvent e) {
|
public void mouseClicked(MouseEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (SwingUtilities.isRightMouseButton(e))
|
if (SwingUtilities.isRightMouseButton(e))
|
||||||
popupMenu.show((Component)e.getSource(), e.getX(), e.getY());
|
popupMenu.show((Component)e.getSource(), e.getX(), e.getY());
|
||||||
}
|
}
|
||||||
|
@ -370,38 +371,30 @@ public class HtmlDashboard extends JPanel implements MouseListener,
|
||||||
* @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
|
* @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
|
||||||
*/
|
*/
|
||||||
public void mouseEntered(MouseEvent e) {
|
public void mouseEntered(MouseEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
|
* @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
|
||||||
*/
|
*/
|
||||||
public void mouseExited(MouseEvent e) {
|
public void mouseExited(MouseEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
|
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
|
||||||
*/
|
*/
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
|
* @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
|
||||||
*/
|
*/
|
||||||
public void mouseReleased(MouseEvent e) {
|
public void mouseReleased(MouseEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||||
*/
|
*/
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (e.getSource() == mRefresh)
|
if (e.getSource() == mRefresh)
|
||||||
{
|
{
|
||||||
if (m_goals != null)
|
if (m_goals != null)
|
||||||
|
|
|
@ -18,13 +18,17 @@ package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.event.*;
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.Box;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.ScrollPaneConstants;
|
||||||
|
|
||||||
import org.compiere.model.*;
|
import org.compiere.model.MGoal;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.CPanel;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.CLogger;
|
||||||
|
import org.compiere.util.Env;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performance Analysis Panel.
|
* Performance Analysis Panel.
|
||||||
|
|
|
@ -16,13 +16,15 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.apps.graph;
|
package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.event.*;
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import org.compiere.*;
|
import org.compiere.Adempiere;
|
||||||
import org.compiere.apps.*;
|
import org.compiere.apps.AEnv;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.apps.ConfirmPanel;
|
||||||
import org.compiere.model.*;
|
import org.compiere.model.MGoal;
|
||||||
|
import org.compiere.swing.CFrame;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,39 +16,40 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.apps.graph;
|
package org.adempiere.apps.graph;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.BasicStroke;
|
||||||
import java.awt.event.*;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.font.*;
|
|
||||||
import java.text.*;
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.border.*;
|
|
||||||
import javax.swing.event.*;
|
|
||||||
|
|
||||||
//vpj-cd e-evolution
|
|
||||||
import java.awt.Color;
|
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.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.Font;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.GradientPaint;
|
import java.awt.event.MouseListener;
|
||||||
import java.awt.Graphics2D;
|
import java.text.DecimalFormat;
|
||||||
import java.awt.geom.Rectangle2D;
|
|
||||||
import java.awt.image.BufferedImage;
|
import javax.swing.BorderFactory;
|
||||||
//import java.awt.R`;
|
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.ChartPanel;
|
||||||
import org.jfree.chart.JFreeChart;
|
import org.jfree.chart.JFreeChart;
|
||||||
import org.jfree.chart.plot.*;
|
import org.jfree.chart.plot.DialShape;
|
||||||
import org.jfree.data.general.*;
|
import org.jfree.chart.plot.MeterInterval;
|
||||||
|
import org.jfree.chart.plot.MeterPlot;
|
||||||
import org.jfree.data.Range;
|
import org.jfree.data.Range;
|
||||||
|
import org.jfree.data.general.DefaultValueDataset;
|
||||||
import org.jfree.ui.RectangleInsets;
|
import org.jfree.ui.RectangleInsets;
|
||||||
//vpj-cd e-evolution
|
|
||||||
|
|
||||||
import org.compiere.model.*;
|
|
||||||
import org.compiere.swing.*;
|
|
||||||
import org.compiere.util.*;
|
|
||||||
import org.compiere.apps.graph.*;
|
|
||||||
import java.net.*;
|
|
||||||
import java.io.*;
|
|
||||||
import org.jfree.chart.ChartUtilities;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performance Indicator
|
* Performance Indicator
|
||||||
|
|
Loading…
Reference in New Issue