[Ejtools-cvs] libraries/graph/src/main/org/ejtools/graph/frame ControlCompositeTrack.java,1.4,1.5 Gr
Brought to you by:
letiemble
|
From: <let...@us...> - 2003-11-27 00:53:35
|
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame
In directory sc8-pr-cvs1:/tmp/cvs-serv10226/graph/src/main/org/ejtools/graph/frame
Modified Files:
ControlCompositeTrack.java GraphInternalFrame.java
Log Message:
Address Todo #800900
Address Todo #803019
Remove @created tags
Index: ControlCompositeTrack.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame/ControlCompositeTrack.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ControlCompositeTrack.java 15 Sep 2003 22:11:22 -0000 1.4
--- ControlCompositeTrack.java 27 Nov 2003 00:53:32 -0000 1.5
***************
*** 173,177 ****
}
! NumberFormat format = new DecimalFormat("0");
Map timeline = new TreeMap();
for (int i = 0; i < allPoints.size(); i++)
--- 173,177 ----
}
! NumberFormat format = new DecimalFormat(resources.getString("export.as.text.column.numeric.format"));
Map timeline = new TreeMap();
for (int i = 0; i < allPoints.size(); i++)
***************
*** 193,197 ****
}
! result.append("Time");
for (int i = 0; i < headers.size(); i++)
{
--- 193,199 ----
}
! result.append(resources.getString("export.as.text.column.absolute.time"));
! result.append(",");
! result.append(resources.getString("export.as.text.column.relative.time"));
for (int i = 0; i < headers.size(); i++)
{
***************
*** 201,204 ****
--- 203,210 ----
result.append("\n");
+ long delay = 0;
+ double[] lasts = new double[headers.size()];
+ Arrays.fill(lasts, 0.0d);
+
for (Iterator it = timeline.keySet().iterator(); it.hasNext(); )
{
***************
*** 206,210 ****
double[] values = (double[]) timeline.get(time);
! result.append(time.toString());
for (int i = 0; i < headers.size(); i++)
--- 212,227 ----
double[] values = (double[]) timeline.get(time);
! long current = Long.parseLong(time);
! result.append(current);
! result.append(",");
! if (delay > 0)
! {
! result.append(current - delay);
! }
! else
! {
! result.append(delay);
! delay = current;
! }
for (int i = 0; i < headers.size(); i++)
***************
*** 214,217 ****
--- 231,239 ----
{
result.append(values[i]);
+ lasts[i] = values[i];
+ }
+ else
+ {
+ result.append(lasts[i]);
}
}
***************
*** 294,298 ****
*
* @author letiembl
- * @created 17 d?cembre 2002
* @version $Revision$
*/
--- 316,319 ----
Index: GraphInternalFrame.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame/GraphInternalFrame.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** GraphInternalFrame.java 15 Sep 2003 22:11:22 -0000 1.4
--- GraphInternalFrame.java 27 Nov 2003 00:53:32 -0000 1.5
***************
*** 8,11 ****
--- 8,12 ----
import java.awt.BorderLayout;
+ import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Hashtable;
***************
*** 29,36 ****
--- 30,39 ----
import org.ejtools.graph.Track;
import org.ejtools.graph.action.ExportAsImageAction;
+ import org.ejtools.graph.action.ExportAsTextAction;
import org.ejtools.graph.renderer.JPanelGraphRenderer;
import org.ejtools.graph.renderer.TriAxisLayoutRenderer;
import org.ejtools.graph.service.GraphConsumer;
import org.ejtools.graph.service.GraphProducer;
+ import org.ejtools.util.export.CSVTools;
import org.ejtools.util.export.PNGTools;
***************
*** 114,126 ****
}));
! // this.add(new ExportAsTextAction(
! // new Command()
! // {
! // public void execute()
! // {
! // StringBuffer buffer = GraphInternalFrame.this.composite.getPointsAsText();
! // logger.debug(buffer.toString());
! // }
! // }));
this.add(new ExportAsImageAction(
--- 117,133 ----
}));
! this.add(new ExportAsTextAction(
! new Command()
! {
! public void execute()
! {
! StringBuffer buffer = GraphInternalFrame.this.composite.getPointsAsText();
! File file = CSVTools.selectCSVFile();
! if (file != null)
! {
! CSVTools.exportAsCVS(buffer, file);
! }
! }
! }));
this.add(new ExportAsImageAction(
***************
*** 129,136 ****
public void execute()
{
File file = PNGTools.selectPNGFile();
if (file != null)
{
! PNGTools.exportAsPNG(GraphInternalFrame.this.printArea, file);
}
}
--- 136,144 ----
public void execute()
{
+ BufferedImage image = PNGTools.paintAsPNG(GraphInternalFrame.this.printArea);
File file = PNGTools.selectPNGFile();
if (file != null)
{
! PNGTools.exportAsPNG(image, file);
}
}
|