Commit 47a70734 authored by Claes Sjofors's avatar Claes Sjofors

Java compile problems for subgraphs with multiple annotations fixed

parent 5a3f5323
......@@ -145,3 +145,4 @@
090916 cs xtt Alarm time viewed in operator window.
090916 cs xtt New xtt command 'show objectlist /class='.
090916 cs xtt New xtt commands 'create opmenuitem' and 'delete opmenuitem' to modify operator window menu..
090930 cs ge Java compile problems for subgraphs with multiple annotations fixed.
\ No newline at end of file
......@@ -228,6 +228,7 @@ void GlowExportJBean::nodeclass( GlowNodeClass *nc, glow_eExportPass pass,
break;
case glow_eExportPass_Init:
{
frc_created = 0;
nc->measure_javabean( &dim_x1, &dim_x0, &dim_y1, &dim_y0);
if ( page <= 1)
......@@ -1370,13 +1371,19 @@ void GlowExportJBean::annot( int x0, int y0, int number,
char adjustmentstr[200];
switch ( adjustment) {
case glow_eAdjustment_Right:
if ( !frc_created) {
frc_created = 1;
fp <<
" FontRenderContext frc = g.getFontRenderContext();" << endl;
}
sprintf( adjustmentstr, "- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()", number);
break;
case glow_eAdjustment_Center:
if ( !frc_created) {
frc_created = 1;
fp <<
" FontRenderContext frc = g.getFontRenderContext();" << endl;
}
sprintf( adjustmentstr, "- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()/2", number);
break;
default:
......
......@@ -33,7 +33,7 @@ class GlowNodeClass;
class GlowExportJBean {
public:
GlowExportJBean( GlowCtx *glow_ctx, GlowNodeClass *nodeclass = 0) :
ctx(glow_ctx), nc(nodeclass), page(1), func_cnt(0)
ctx(glow_ctx), nc(nodeclass), page(1), func_cnt(0), frc_created(0)
{
is_nodeclass = (nc != NULL);
};
......@@ -191,6 +191,7 @@ class GlowExportJBean {
int is_nodeclass;
int page;
int func_cnt;
int frc_created;
};
#endif
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