Update of /cvsroot/jrobin/src/jrobin/graph
In directory sc8-pr-cvs1:/tmp/cvs-serv5130/src/jrobin/graph
Modified Files:
ValueGrid.java RrdGraph.java Source.java Grapher.java
ValueFormatter.java CustomLine.java
Log Message:
Bug fix:
JRobinComplexDemo crash
Index: ValueGrid.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/graph/ValueGrid.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ValueGrid.java 30 Oct 2003 16:21:12 -0000 1.1
--- ValueGrid.java 4 Nov 2003 22:27:28 -0000 1.2
***************
*** 55,59 ****
* ValueAxisUnit is null, one will be automatically determined.
*/
! ValueGrid( GridRange gr, double lower, double upper, ValueAxisUnit vAxis )
{
double grLower = Double.MAX_VALUE;
--- 55,59 ----
* ValueAxisUnit is null, one will be automatically determined.
*/
! ValueGrid( GridRange gr, double low, double up, ValueAxisUnit vAxis )
{
double grLower = Double.MAX_VALUE;
***************
*** 67,72 ****
}
! this.lower = lower;
! this.upper = upper;
this.vAxis = vAxis;
--- 67,72 ----
}
! this.lower = low;
! this.upper = up;
this.vAxis = vAxis;
***************
*** 77,81 ****
this.lower = ( lower == grLower ? grLower : this.vAxis.getNiceLower( lower ) );
this.upper = ( upper == grUpper ? grUpper : this.vAxis.getNiceHigher( upper ) );
! }
}
--- 77,81 ----
this.lower = ( lower == grLower ? grLower : this.vAxis.getNiceLower( lower ) );
this.upper = ( upper == grUpper ? grUpper : this.vAxis.getNiceHigher( upper ) );
! }
}
***************
*** 108,111 ****
--- 108,116 ----
if ( vAxis != null )
return;
+
+ if ( upper == Double.NaN || upper == Double.MIN_VALUE || upper == Double.MAX_VALUE )
+ upper = 0.9;
+ if ( lower == Double.NaN || lower == Double.MAX_VALUE || lower == Double.MIN_VALUE )
+ lower = 0;
if ( !rigid && upper == 0 && upper == lower )
Index: RrdGraph.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/graph/RrdGraph.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** RrdGraph.java 30 Oct 2003 16:21:12 -0000 1.10
--- RrdGraph.java 4 Nov 2003 22:27:28 -0000 1.11
***************
*** 80,88 ****
/**
* Constructs a new JRobin graph object.
! * @param poolSize Maximum number of concurrent open rrd files in the RrdGraph object.
*/
! public RrdGraph( RrdDbPool pool )
{
! this.pool = pool;
}
--- 80,89 ----
/**
* Constructs a new JRobin graph object.
! * @param usePool True if this should object should use RrdDbPool
*/
! public RrdGraph( boolean usePool )
{
! if ( usePool )
! this.pool = RrdDbPool.getInstance();
}
***************
*** 95,99 ****
public RrdGraph( RrdGraphDef graphDef ) throws IOException, RrdException
{
! this( graphDef, null );
}
--- 96,100 ----
public RrdGraph( RrdGraphDef graphDef ) throws IOException, RrdException
{
! this( graphDef, false );
}
***************
*** 101,111 ****
* Constructs a new JRobin graph from the supplied definition.
* @param graphDef Graph definition.
! * @param poolSize Maximum number of concurrent open rrd files in the RrdGraph object.
* @throws IOException Thrown in case of I/O error.
* @throws RrdException Thrown in case of JRobin specific error.
*/
! public RrdGraph( RrdGraphDef graphDef, RrdDbPool pool ) throws IOException, RrdException
{
! this.pool = pool;
grapher = new Grapher( graphDef, this );
}
--- 102,113 ----
* Constructs a new JRobin graph from the supplied definition.
* @param graphDef Graph definition.
! * @param usePool True if this should object should use RrdDbPool
* @throws IOException Thrown in case of I/O error.
* @throws RrdException Thrown in case of JRobin specific error.
*/
! public RrdGraph( RrdGraphDef graphDef, boolean usePool ) throws IOException, RrdException
{
! if ( usePool )
! this.pool = RrdDbPool.getInstance();
grapher = new Grapher( graphDef, this );
}
Index: Source.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/graph/Source.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Source.java 30 Oct 2003 16:21:12 -0000 1.4
--- Source.java 4 Nov 2003 22:27:28 -0000 1.5
***************
*** 106,113 ****
{
case AGG_MINIMUM:
! return min;
case AGG_MAXIMUM:
! return max;
case AGG_AVERAGE:
--- 106,113 ----
{
case AGG_MINIMUM:
! return ( min != Double.MIN_VALUE && min != Double.MAX_VALUE ? min : Double.NaN );
case AGG_MAXIMUM:
! return ( max != Double.MIN_VALUE && max != Double.MAX_VALUE ? max : Double.NaN );
case AGG_AVERAGE:
Index: Grapher.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/graph/Grapher.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Grapher.java 30 Oct 2003 16:21:12 -0000 1.12
--- Grapher.java 4 Nov 2003 22:27:28 -0000 1.13
***************
*** 466,470 ****
lastPlotType = plotDefs[i].plotType;
}
!
// Reset clipping area, origin and AA settings
graphics.translate( -graphOriginX, -graphOriginY );
--- 466,470 ----
lastPlotType = plotDefs[i].plotType;
}
!
// Reset clipping area, origin and AA settings
graphics.translate( -graphOriginX, -graphOriginY );
Index: ValueFormatter.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/graph/ValueFormatter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ValueFormatter.java 30 Oct 2003 16:21:12 -0000 1.1
--- ValueFormatter.java 4 Nov 2003 22:27:28 -0000 1.2
***************
*** 128,138 ****
{
String valueStr = "" + value;
!
! if ( scale ) {
! scaleValue( scaleIndex );
! valueStr = decFormat.format(scaledValue);
}
- else
- valueStr = decFormat.format(value);
// Fix the formatted string to the correct length
--- 128,140 ----
{
String valueStr = "" + value;
!
! if ( !Double.isNaN(value) ) {
! if ( scale ) {
! scaleValue( scaleIndex );
! valueStr = decFormat.format(scaledValue);
! }
! else
! valueStr = decFormat.format(value);
}
// Fix the formatted string to the correct length
Index: CustomLine.java
===================================================================
RCS file: /cvsroot/jrobin/src/jrobin/graph/CustomLine.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CustomLine.java 30 Oct 2003 16:21:12 -0000 1.1
--- CustomLine.java 4 Nov 2003 22:27:28 -0000 1.2
***************
*** 150,154 ****
// Draw the line
! if ( visible )
g.drawLine( ax, ay, nx, ny );
--- 150,154 ----
// Draw the line
! if ( visible )
g.drawLine( ax, ay, nx, ny );
|