Improved plotting capabilities.

This commit is contained in:
Andreas Dräger
2010-09-20 15:10:27 +00:00
parent 59ce3e693b
commit ded074f31b
3 changed files with 33 additions and 17 deletions

View File

@@ -27,7 +27,6 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.io.Serializable; import java.io.Serializable;
import java.net.URL; import java.net.URL;
import java.util.Properties;
import java.util.Set; import java.util.Set;
import java.util.Vector; import java.util.Vector;
@@ -41,7 +40,6 @@ import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JProgressBar; import javax.swing.JProgressBar;
import javax.swing.JRadioButtonMenuItem; import javax.swing.JRadioButtonMenuItem;
import javax.swing.JScrollPane;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import javax.swing.JWindow; import javax.swing.JWindow;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;

View File

@@ -122,6 +122,10 @@ public class FunctionArea extends DArea implements Serializable {
notifyNegLog = true; notifyNegLog = true;
} }
/*
* (non-Javadoc)
* @see javax.swing.JComponent#getToolTipText(java.awt.event.MouseEvent)
*/
@Override @Override
public String getToolTipText(MouseEvent event) { public String getToolTipText(MouseEvent event) {
if (isShowGraphToolTips()) { if (isShowGraphToolTips()) {
@@ -136,6 +140,10 @@ public class FunctionArea extends DArea implements Serializable {
} else return null; } else return null;
} }
/*
* (non-Javadoc)
* @see javax.swing.JComponent#getToolTipLocation(java.awt.event.MouseEvent)
*/
@Override @Override
public Point getToolTipLocation(MouseEvent event) { public Point getToolTipLocation(MouseEvent event) {
if (isShowGraphToolTips()) { if (isShowGraphToolTips()) {

View File

@@ -214,6 +214,17 @@ public class DArea extends JComponent implements DParent, Printable {
return 0; 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 // * 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 // * 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 ); // 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 * method returns the minimal rectangle which is set as the visible when all
* elements are removed and the area is on auto focus * elements are removed and the area is on auto focus
@@ -310,6 +310,10 @@ public class DArea extends JComponent implements DParent, Printable {
return srect; return srect;
} }
public DFunction getYScale() {
return measures.y_scale;
}
/** /**
* returns if the auto grid is switched on * returns if the auto grid is switched on
* *
@@ -338,6 +342,16 @@ public class DArea extends JComponent implements DParent, Printable {
return auto_focus; 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 * paints the DArea by a Graphics object
* *
@@ -798,10 +812,6 @@ public class DArea extends JComponent implements DParent, Printable {
repaint(); repaint();
} }
public DFunction getYScale() {
return measures.y_scale;
}
/** /**
* sets a new scale function to the y-axis That means that not the standard * sets a new scale function to the y-axis That means that not the standard
* linear scale is shown but the image of the linear scale under the given * linear scale is shown but the image of the linear scale under the given