|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.shapes.CurveShape
public class CurveShape
Nested Class Summary | |
---|---|
class |
CurveShape.CurveIterator
|
class |
CurveShape.CurvePoint
A curve point representing a location in (x, y) coordinate space, specified in double precision. |
static class |
CurveShape.CurveShapePropertiesNames
|
class |
CurveShape.NoDrawIterator
|
Field Summary | |
---|---|
protected java.awt.geom.AffineTransform |
_aff
|
protected CurveShape.CurvePoint |
currentPoint
|
protected boolean |
drawNewOnly
|
protected long |
iteratorMaxIndex
|
protected long |
iteratorMinIndex
|
protected long |
lastDrawnIndex
|
protected ListenerManager |
listeners
|
protected long |
localMaxIndex
|
protected long |
localMinIndex
|
protected double |
localRangeDeviation
Local standard deviation: |
protected double |
localRangeIntegral
Local integral: |
protected CurveShape.CurvePoint |
localRangeMaxPoint
|
protected double |
localRangeMean
Local mean: |
protected CurveShape.CurvePoint |
localRangeMinPoint
|
protected long |
localRangeNbPoints
|
static double |
LOG_MIN
Smallest arbitrarily-close-to-zero value allowed. |
static double |
LOG10_VALUE
The value of ln(10), used to compute LOG10_VALUE |
protected boolean |
logx
|
protected boolean |
logy
|
protected long |
max
|
protected double |
maxx
|
protected double |
maxy
|
protected long |
min
|
protected double |
orgx
|
protected double |
orgy
|
protected CurveShape.CurvePoint |
referencePoint
|
protected double |
scalex
|
protected double |
scaley
|
static int |
SLOP_LENGTH
|
protected boolean |
useCache
|
protected double[] |
xCache
|
protected DataSource |
xSource
|
protected boolean |
xSourceChanged
|
protected long |
xSourceNewLastIndex
|
protected long |
xSourceNewStartIndex
|
protected double[] |
yCache
|
protected DataSource |
ySource
|
protected double[] |
ySourceCache
|
protected boolean |
ySourceChanged
|
protected long |
ySourceNewLastIndex
|
protected long |
ySourceNewStartIndex
|
Constructor Summary | |
---|---|
CurveShape()
|
|
CurveShape(DataSource xSource,
DataSource ySource)
|
Method Summary | |
---|---|
void |
addListener(CurveShapeListener csl)
|
java.lang.Object |
clone()
|
protected void |
computeLocalRangeIndex(double xmin,
double xmax)
|
void |
computeStatistics(double xmin,
double xmax)
Method computeCurveStatisticsAndIntegral Compute min, max, mean, and integral for a function y=f(x) in a specified interval [xmin, xmax] Data source attached to X values must be sorted, otherwise no compute is performed. |
void |
computeYLocalRange(double xmin,
double xmax)
|
boolean |
contains(double x,
double y)
|
boolean |
contains(double x,
double y,
double w,
double h)
|
boolean |
contains(java.awt.geom.Point2D p)
|
boolean |
contains(java.awt.geom.Rectangle2D r)
|
void |
DataSourceIndexRangeChanged(DataSource ds,
long startIndex,
long lastIndex)
Called when the range of valid index changed |
void |
DataSourceInfoChanged(DataSource ds,
DataInfo newInfo)
Called when the information about the data source changed |
void |
DataSourceOrderChanged(DataSource ds,
int newOrder)
If defined, called when the order of the source changed. |
void |
DataSourceReplaced(DataSource oldData,
DataSource newData)
Called when a data source is replaced by another one |
void |
DataSourceValueChanged(DataSource ds,
long minIndex,
long maxIndex)
Called when at least a value changed in the data source. |
void |
DataSourceValueRangeChanged(DataSource ds)
Called when the range of possible values changed, if defined. |
void |
draw(java.awt.Graphics2D g2,
double ox,
double oy,
double mx,
double my,
double sx,
double sy,
boolean showPoints,
boolean drawBars,
int barHeight)
Draws it |
void |
drawMagnetizedPoint(java.awt.Graphics2D g2,
double ox,
double oy,
double sx,
double sy)
Draws the computed magnetized point into the graphic |
void |
drawReferencePoint(java.awt.Graphics2D g2,
double ox,
double oy,
double sx,
double sy)
|
java.awt.Rectangle |
getBounds()
|
java.awt.geom.Rectangle2D |
getBounds2D()
|
CurveShape.CurvePoint |
getCurrentPoint()
|
java.lang.String |
getCurveInformation(double xmin,
double xmax)
|
java.awt.geom.Rectangle2D |
getDrawNewOnlyArea()
|
double |
getLocalDeviationValue()
|
double |
getLocalIntegralValue()
|
long |
getLocalNbPoints()
|
CurveShape.CurvePoint |
getLocalRangeMaxPoint()
|
double |
getLocalRangeMean()
|
CurveShape.CurvePoint |
getLocalRangeMinPoint()
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
|
CurveShape.CurvePoint |
getReferencePoint()
|
DataSource |
getXSource()
|
DataSource |
getYSource()
|
boolean |
intersects(double x,
double y,
double w,
double h)
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
|
boolean |
isDrawNewOnly()
|
protected void |
notifyChange()
|
void |
removeListener(CurveShapeListener csl)
|
void |
setCurrentPoint(double pos_x)
Get curve point the closest to X mouse position Set this point as current point. |
void |
setData(DataSource xSource,
DataSource ySource)
|
void |
setLogsProperties(boolean _logx,
boolean _logy)
Method setLogsProperties Summary: Use this method to set logarithmic modes on curve axis. |
void |
setReferencePoint(CurveShape.CurvePoint curvePoint)
|
void |
setSlice(long min,
long max)
|
boolean |
tryDrawNewOnly()
Sets the drawNewOnly. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient DataSource xSource
protected transient DataSource ySource
protected long min
protected long max
protected transient double orgx
protected transient double orgy
protected transient double maxx
protected transient double maxy
protected transient double scalex
protected transient double scaley
protected transient boolean useCache
protected transient double[] xCache
protected transient double[] yCache
protected transient double[] ySourceCache
protected transient ListenerManager listeners
protected boolean drawNewOnly
protected transient long iteratorMinIndex
protected transient long iteratorMaxIndex
protected transient boolean xSourceChanged
protected transient boolean ySourceChanged
protected transient long xSourceNewStartIndex
protected transient long xSourceNewLastIndex
protected transient long ySourceNewStartIndex
protected transient long ySourceNewLastIndex
protected transient long lastDrawnIndex
protected transient boolean logx
protected transient boolean logy
public static final double LOG10_VALUE
public static final double LOG_MIN
public static final int SLOP_LENGTH
protected transient long localRangeNbPoints
protected transient CurveShape.CurvePoint localRangeMaxPoint
protected transient CurveShape.CurvePoint localRangeMinPoint
protected transient long localMinIndex
protected transient long localMaxIndex
protected transient double localRangeMean
protected transient double localRangeIntegral
protected transient double localRangeDeviation
protected transient CurveShape.CurvePoint currentPoint
protected transient CurveShape.CurvePoint referencePoint
protected java.awt.geom.AffineTransform _aff
Constructor Detail |
---|
public CurveShape()
public CurveShape(DataSource xSource, DataSource ySource)
Method Detail |
---|
public void setData(DataSource xSource, DataSource ySource)
public DataSource getXSource() throws DataException
DataException
public DataSource getYSource() throws DataException
DataException
public void setSlice(long min, long max)
public boolean contains(double x, double y)
contains
in interface java.awt.Shape
public boolean contains(double x, double y, double w, double h)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Point2D p)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Rectangle2D r)
contains
in interface java.awt.Shape
public boolean intersects(double x, double y, double w, double h)
intersects
in interface java.awt.Shape
public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface java.awt.Shape
public java.awt.Rectangle getBounds()
getBounds
in interface java.awt.Shape
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
public void drawReferencePoint(java.awt.Graphics2D g2, double ox, double oy, double sx, double sy)
g2
- - the current graphicsox
- oy
- sx
- sy
- public void drawMagnetizedPoint(java.awt.Graphics2D g2, double ox, double oy, double sx, double sy)
g2
- the current graphicspublic void setLogsProperties(boolean _logx, boolean _logy)
_logx
- True to use logarithmic mode on x axis. False otherwise._logy
- True to use logarithmic mode on y axis. False otherwise.public void draw(java.awt.Graphics2D g2, double ox, double oy, double mx, double my, double sx, double sy, boolean showPoints, boolean drawBars, int barHeight)
g2
- the current graphicspublic java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
getPathIterator
in interface java.awt.Shape
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void DataSourceValueChanged(DataSource ds, long minIndex, long maxIndex)
DataSourceListener
DataSourceValueChanged
in interface DataSourceListener
ds
- The data source that changedminIndex
- Lower bound of the range where values changedmaxIndex
- Higher bound of the range where values changedpublic void DataSourceIndexRangeChanged(DataSource ds, long startIndex, long lastIndex)
DataSourceListener
DataSourceIndexRangeChanged
in interface DataSourceListener
ds
- The data source that changedstartIndex
- The new start IndexlastIndex
- The new last indexpublic void DataSourceInfoChanged(DataSource ds, DataInfo newInfo)
DataSourceListener
DataSourceInfoChanged
in interface DataSourceListener
ds
- The data source that changedpublic void DataSourceValueRangeChanged(DataSource ds)
DataSourceListener
DataSourceValueRangeChanged
in interface DataSourceListener
ds
- The data source that changedpublic void DataSourceOrderChanged(DataSource ds, int newOrder)
DataSourceListener
DataSourceOrderChanged
in interface DataSourceListener
ds
- The data source that changedpublic void DataSourceReplaced(DataSource oldData, DataSource newData)
DataSourceListener
DataSourceReplaced
in interface DataSourceListener
public void addListener(CurveShapeListener csl)
public void removeListener(CurveShapeListener csl)
protected void notifyChange()
public boolean isDrawNewOnly()
public boolean tryDrawNewOnly()
drawNewOnly
- The drawNewOnly to setpublic java.awt.geom.Rectangle2D getDrawNewOnlyArea()
protected void computeLocalRangeIndex(double xmin, double xmax) throws DataException
DataException
public void computeYLocalRange(double xmin, double xmax) throws DataException
DataException
public void computeStatistics(double xmin, double xmax) throws DataException
xmin
- fisrt bound of interval in which compute is performedxmax
- last bound of interval in which compute is performed
DataException
public void setReferencePoint(CurveShape.CurvePoint curvePoint)
public void setCurrentPoint(double pos_x) throws DataException
DataException
public CurveShape.CurvePoint getLocalRangeMaxPoint()
public CurveShape.CurvePoint getLocalRangeMinPoint()
public long getLocalNbPoints()
public double getLocalRangeMean()
public CurveShape.CurvePoint getCurrentPoint()
public CurveShape.CurvePoint getReferencePoint()
public double getLocalIntegralValue()
public double getLocalDeviationValue()
public java.lang.String getCurveInformation(double xmin, double xmax)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |