Commit b931f371 authored by claes's avatar claes

Bugfix in rounded rect, and prepared for new layout manager

parent 8dc36d7b
...@@ -136,7 +136,9 @@ void GlowExportJBean::growctx( glow_eExportPass pass, ofstream& fp) ...@@ -136,7 +136,9 @@ void GlowExportJBean::growctx( glow_eExportPass pass, ofstream& fp)
" Graphics2D g = (Graphics2D) g1;" << endl << " Graphics2D g = (Graphics2D) g1;" << endl <<
" float width = getWidth();" << endl << " float width = getWidth();" << endl <<
" float height = getHeight();" << endl << " float height = getHeight();" << endl <<
" g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);" << endl; " g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);" << endl <<
" double scaleWidth = (1.0*width/original_width);" << endl <<
" double scaleHeight = (1.0*height/original_height);" << endl;
if ( ((GrowCtx *)ctx)->subgraph) if ( ((GrowCtx *)ctx)->subgraph)
fp << fp <<
...@@ -164,11 +166,11 @@ void GlowExportJBean::growctx( glow_eExportPass pass, ofstream& fp) ...@@ -164,11 +166,11 @@ void GlowExportJBean::growctx( glow_eExportPass pass, ofstream& fp)
" height/original_height));" << endl; " height/original_height));" << endl;
else else
fp << fp <<
"// g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight));" << endl <<
" AffineTransform save = g.getTransform();" << endl << " AffineTransform save = g.getTransform();" << endl <<
" AffineTransform save_tmp;" << endl <<
" g.setColor(getBackground());" << endl << " g.setColor(getBackground());" << endl <<
" g.fill(new Rectangle(0,0,getWidth(),getHeight()));" << endl; " g.fill(new Rectangle(0,0,getWidth(),getHeight()));" << endl <<
" // xxx g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight));" << endl <<
" AffineTransform save_tmp;" << endl;
if ( strcmp( ((GrowCtx *)ctx)->background_image, "") != 0) if ( strcmp( ((GrowCtx *)ctx)->background_image, "") != 0)
{ {
fp << fp <<
...@@ -834,6 +836,7 @@ void GlowExportJBean::rectrounded( double x0, double y0, double width, double he ...@@ -834,6 +836,7 @@ void GlowExportJBean::rectrounded( double x0, double y0, double width, double he
y0 - dim_y0 + glow_cJBean_Offset + shadow_width << "F, " << y0 - dim_y0 + glow_cJBean_Offset + shadow_width << "F, " <<
width - 2*shadow_width << "F, " << height - 2*shadow_width << "F)," << endl; width - 2*shadow_width << "F, " << height - 2*shadow_width << "F)," << endl;
} }
if ( border)
fp << fp <<
" new RoundRectangle2D.Float(" << x0 - dim_x0 + glow_cJBean_Offset << "F, " << " new RoundRectangle2D.Float(" << x0 - dim_x0 + glow_cJBean_Offset << "F, " <<
y0 - dim_y0 + glow_cJBean_Offset << "F, " << y0 - dim_y0 + glow_cJBean_Offset << "F, " <<
...@@ -947,6 +950,8 @@ void GlowExportJBean::rectrounded( double x0, double y0, double width, double he ...@@ -947,6 +950,8 @@ void GlowExportJBean::rectrounded( double x0, double y0, double width, double he
else else
fp << fp <<
" g.draw( shapes_p" << page << "[" << (*shape_cnt)++ << "]);" << endl; " g.draw( shapes_p" << page << "[" << (*shape_cnt)++ << "]);" << endl;
if ( shadow_width == 0)
(*shape_cnt)++;
} }
break; break;
} }
...@@ -1333,6 +1338,7 @@ void GlowExportJBean::annot( int x0, int y0, int number, ...@@ -1333,6 +1338,7 @@ void GlowExportJBean::annot( int x0, int y0, int number,
fp << fp <<
" g.transform( AffineTransform.getScaleInstance( original_width/width *" << endl << " g.transform( AffineTransform.getScaleInstance( original_width/width *" << endl <<
" height/original_height * 0.75, 1));" << endl << " height/original_height * 0.75, 1));" << endl <<
" if ( annot" << number << " != null)" << endl <<
" g.drawString( annot" << number << ", " << " g.drawString( annot" << number << ", " <<
x0 - int(dim_x0) + glow_cJBean_Offset << x0 - int(dim_x0) + glow_cJBean_Offset <<
" * original_height / height * width / original_width, " << " * original_height / height * width / original_width, " <<
...@@ -1342,6 +1348,7 @@ void GlowExportJBean::annot( int x0, int y0, int number, ...@@ -1342,6 +1348,7 @@ void GlowExportJBean::annot( int x0, int y0, int number,
" g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);" << endl << " g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);" << endl <<
" g.transform( AffineTransform.getScaleInstance( original_width/width *" << endl << " g.transform( AffineTransform.getScaleInstance( original_width/width *" << endl <<
" height/original_height, 1));" << endl << " height/original_height, 1));" << endl <<
" if ( annot" << number << " != null)" << endl <<
" g.drawString( annot" << number << ", " << " g.drawString( annot" << number << ", " <<
x0 - int(dim_x0) + glow_cJBean_Offset << x0 - int(dim_x0) + glow_cJBean_Offset <<
" * original_height / height * width / original_width, " << " * original_height / height * width / original_width, " <<
...@@ -1476,7 +1483,7 @@ void GlowExportJBean::node( double x1, double y1, double x2, double y2, ...@@ -1476,7 +1483,7 @@ void GlowExportJBean::node( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl; " add(" << var_name << ");" << endl;
else else
fp << fp <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
...@@ -1573,7 +1580,7 @@ void GlowExportJBean::image( double x1, double y1, double x2, double y2, ...@@ -1573,7 +1580,7 @@ void GlowExportJBean::image( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl; " add(" << var_name << ");" << endl;
else else
fp << fp <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
...@@ -1671,7 +1678,7 @@ void GlowExportJBean::bar( double x1, double y1, double x2, double y2, ...@@ -1671,7 +1678,7 @@ void GlowExportJBean::bar( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl; " add(" << var_name << ");" << endl;
else else
fp << fp <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
case glow_eExportPass_Draw: case glow_eExportPass_Draw:
...@@ -1775,7 +1782,7 @@ void GlowExportJBean::trend( double x1, double y1, double x2, double y2, ...@@ -1775,7 +1782,7 @@ void GlowExportJBean::trend( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl; " add(" << var_name << ");" << endl;
else else
fp << fp <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
case glow_eExportPass_Draw: case glow_eExportPass_Draw:
...@@ -1884,7 +1891,7 @@ void GlowExportJBean::axis( double x1, double y1, double x2, double y2, ...@@ -1884,7 +1891,7 @@ void GlowExportJBean::axis( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl; " add(" << var_name << ");" << endl;
else else
fp << fp <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
case glow_eExportPass_Draw: case glow_eExportPass_Draw:
...@@ -1939,7 +1946,7 @@ void GlowExportJBean::window( double x1, double y1, double x2, double y2, ...@@ -1939,7 +1946,7 @@ void GlowExportJBean::window( double x1, double y1, double x2, double y2,
(int)(y1 - dim_y0 /* - glow_cJBean_Offset) */) << "," << (int)(y1 - dim_y0 /* - glow_cJBean_Offset) */) << "," <<
(int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," << (int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," <<
(int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl << (int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
case glow_eExportPass_Draw: case glow_eExportPass_Draw:
...@@ -2010,7 +2017,7 @@ void GlowExportJBean::folder( double x1, double y1, double x2, double y2, ...@@ -2010,7 +2017,7 @@ void GlowExportJBean::folder( double x1, double y1, double x2, double y2,
(int)(y1 - dim_y0 /* - glow_cJBean_Offset) */) << "," << (int)(y1 - dim_y0 /* - glow_cJBean_Offset) */) << "," <<
(int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," << (int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," <<
(int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl << (int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
case glow_eExportPass_Draw: case glow_eExportPass_Draw:
...@@ -2094,7 +2101,7 @@ void GlowExportJBean::table( double x1, double y1, double x2, double y2, ...@@ -2094,7 +2101,7 @@ void GlowExportJBean::table( double x1, double y1, double x2, double y2,
(int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," << (int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," <<
(int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl; (int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl;
fp << fp <<
" localPanel.add(" << var_name << ", null);" << endl; " localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
break; break;
} }
case glow_eExportPass_Draw: case glow_eExportPass_Draw:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment