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 @@ ...@@ -145,3 +145,4 @@
090916 cs xtt Alarm time viewed in operator window. 090916 cs xtt Alarm time viewed in operator window.
090916 cs xtt New xtt command 'show objectlist /class='. 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.. 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,7 +228,8 @@ void GlowExportJBean::nodeclass( GlowNodeClass *nc, glow_eExportPass pass, ...@@ -228,7 +228,8 @@ void GlowExportJBean::nodeclass( GlowNodeClass *nc, glow_eExportPass pass,
break; break;
case glow_eExportPass_Init: case glow_eExportPass_Init:
{ {
nc->measure_javabean( &dim_x1, &dim_x0, &dim_y1, &dim_y0); frc_created = 0;
nc->measure_javabean( &dim_x1, &dim_x0, &dim_y1, &dim_y0);
if ( page <= 1) if ( page <= 1)
{ {
...@@ -1370,13 +1371,19 @@ void GlowExportJBean::annot( int x0, int y0, int number, ...@@ -1370,13 +1371,19 @@ void GlowExportJBean::annot( int x0, int y0, int number,
char adjustmentstr[200]; char adjustmentstr[200];
switch ( adjustment) { switch ( adjustment) {
case glow_eAdjustment_Right: case glow_eAdjustment_Right:
fp << if ( !frc_created) {
frc_created = 1;
fp <<
" FontRenderContext frc = g.getFontRenderContext();" << endl; " FontRenderContext frc = g.getFontRenderContext();" << endl;
}
sprintf( adjustmentstr, "- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()", number); sprintf( adjustmentstr, "- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()", number);
break; break;
case glow_eAdjustment_Center: case glow_eAdjustment_Center:
if ( !frc_created) {
frc_created = 1;
fp << fp <<
" FontRenderContext frc = g.getFontRenderContext();" << endl; " FontRenderContext frc = g.getFontRenderContext();" << endl;
}
sprintf( adjustmentstr, "- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()/2", number); sprintf( adjustmentstr, "- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()/2", number);
break; break;
default: default:
......
...@@ -33,7 +33,7 @@ class GlowNodeClass; ...@@ -33,7 +33,7 @@ class GlowNodeClass;
class GlowExportJBean { class GlowExportJBean {
public: public:
GlowExportJBean( GlowCtx *glow_ctx, GlowNodeClass *nodeclass = 0) : 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); is_nodeclass = (nc != NULL);
}; };
...@@ -191,6 +191,7 @@ class GlowExportJBean { ...@@ -191,6 +191,7 @@ class GlowExportJBean {
int is_nodeclass; int is_nodeclass;
int page; int page;
int func_cnt; int func_cnt;
int frc_created;
}; };
#endif #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