From ded074f31bc09b1a1d36ab36936f5e44bf7698ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Dr=C3=A4ger?= Date: Mon, 20 Sep 2010 15:10:27 +0000 Subject: [PATCH] Improved plotting capabilities. --- src/eva2/client/EvAClient.java | 2 -- src/eva2/gui/FunctionArea.java | 8 +++++++ src/eva2/tools/chart2d/DArea.java | 40 +++++++++++++++++++------------ 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/eva2/client/EvAClient.java b/src/eva2/client/EvAClient.java index 795429ef..e745c236 100644 --- a/src/eva2/client/EvAClient.java +++ b/src/eva2/client/EvAClient.java @@ -27,7 +27,6 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.Serializable; import java.net.URL; -import java.util.Properties; import java.util.Set; import java.util.Vector; @@ -41,7 +40,6 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.JRadioButtonMenuItem; -import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JWindow; import javax.swing.KeyStroke; diff --git a/src/eva2/gui/FunctionArea.java b/src/eva2/gui/FunctionArea.java index 6700a245..27fb89a2 100644 --- a/src/eva2/gui/FunctionArea.java +++ b/src/eva2/gui/FunctionArea.java @@ -122,6 +122,10 @@ public class FunctionArea extends DArea implements Serializable { notifyNegLog = true; } + /* + * (non-Javadoc) + * @see javax.swing.JComponent#getToolTipText(java.awt.event.MouseEvent) + */ @Override public String getToolTipText(MouseEvent event) { if (isShowGraphToolTips()) { @@ -136,6 +140,10 @@ public class FunctionArea extends DArea implements Serializable { } else return null; } + /* + * (non-Javadoc) + * @see javax.swing.JComponent#getToolTipLocation(java.awt.event.MouseEvent) + */ @Override public Point getToolTipLocation(MouseEvent event) { if (isShowGraphToolTips()) { diff --git a/src/eva2/tools/chart2d/DArea.java b/src/eva2/tools/chart2d/DArea.java index 906397c1..0b5aaeb4 100644 --- a/src/eva2/tools/chart2d/DArea.java +++ b/src/eva2/tools/chart2d/DArea.java @@ -214,6 +214,17 @@ public class DArea extends JComponent implements DParent, Printable { return 0; } + /** + * method returns the maximal y-value which can be displayed in the DArea + * + * @return the maximal y-value + */ + public double getMaxY() { + if (max_y != null) + return max_y.doubleValue(); + return 0; + } + // /** // * method sets the maximal rectangle whioch can be viewed with the // * DArea. This method can be used if the area is used with scale functions @@ -248,17 +259,6 @@ public class DArea extends JComponent implements DParent, Printable { // setMaxY( rect.y + rect.height ); // } - /** - * method returns the maximal y-value which can be displayed in the DArea - * - * @return the maximal y-value - */ - public double getMaxY() { - if (max_y != null) - return max_y.doubleValue(); - return 0; - } - /** * method returns the minimal rectangle which is set as the visible when all * elements are removed and the area is on auto focus @@ -310,6 +310,10 @@ public class DArea extends JComponent implements DParent, Printable { return srect; } + public DFunction getYScale() { + return measures.y_scale; + } + /** * returns if the auto grid is switched on * @@ -338,6 +342,16 @@ public class DArea extends JComponent implements DParent, Printable { return auto_focus; } + /** + * Method to check whether or not this {@link DArea} adds a grid to its + * plot. + * + * @return true if this {@link DArea} shows a grid and false otherwise. + */ + public boolean isShowGrid() { + return grid.isVisible(); + } + /** * paints the DArea by a Graphics object * @@ -797,10 +811,6 @@ public class DArea extends JComponent implements DParent, Printable { measures.x_scale = x_s; repaint(); } - - public DFunction getYScale() { - return measures.y_scale; - } /** * sets a new scale function to the y-axis That means that not the standard