Commit a81bea9d authored by claes's avatar claes

Java classgraphs implemented

parent 67f74b70
......@@ -1334,14 +1334,12 @@ static void ge_activate_export_javabean( Widget w, ge_tCtx gectx, XmAnyCallbackS
gectx->graph->get_name( name);
if ( strcmp( name, "") != 0)
{
if ( strncmp( name, "pwr_", 4) == 0)
{
if ( strncmp( name, "pwr_", 4) == 0) {
strcpy( default_name, "Jop");
strcat( default_name, &name[4]);
default_name[3] = _toupper( default_name[3]);
}
else
{
else {
strcpy( default_name, name);
default_name[0] = _toupper( default_name[0]);
}
......@@ -1370,14 +1368,12 @@ static void ge_activate_export_javabean_as( Widget w, ge_tCtx gectx, XmAnyCallba
gectx->graph->get_name( name);
if ( strcmp( name, "") != 0)
{
if ( strncmp( name, "pwr_", 4) == 0)
{
if ( strncmp( name, "pwr_", 4) == 0) {
strcpy( default_name, "Jop");
strcat( default_name, &name[4]);
default_name[3] = _toupper( default_name[3]);
}
else
{
else {
strcpy( default_name, name);
default_name[0] = _toupper( default_name[0]);
}
......@@ -1406,7 +1402,12 @@ static void ge_activate_export_gejava( Widget w, ge_tCtx gectx, XmAnyCallbackStr
gectx->graph->get_name( name);
if ( strcmp( name, "") != 0)
{
if ( strncmp( name, "pwr_", 4) == 0)
if ( strncmp( name, "pwr_c_", 6) == 0) {
strcpy( default_name, "Jopc");
strcat( default_name, &name[6]);
default_name[4] = _toupper( default_name[4]);
}
else if ( strncmp( name, "pwr_", 4) == 0)
{
strcpy( default_name, "Jop");
strcat( default_name, &name[4]);
......@@ -1437,7 +1438,12 @@ static void ge_activate_export_gejava_as( Widget w, ge_tCtx gectx, XmAnyCallback
gectx->graph->get_name( name);
if ( strcmp( name, "") != 0)
{
if ( strncmp( name, "pwr_", 4) == 0)
if ( strncmp( name, "pwr_c_", 6) == 0) {
strcpy( default_name, "Jopc");
strcat( default_name, &name[6]);
default_name[4] = _toupper( default_name[4]);
}
else if ( strncmp( name, "pwr_", 4) == 0)
{
strcpy( default_name, "Jop");
strcat( default_name, &name[4]);
......
......@@ -1380,7 +1380,7 @@ int Graph::export_gejava_nodeclass( ofstream& fp, grow_tNodeClass nodeclass)
if ( dyn_action_type & ge_mActionType_ValueInput) {
fp <<
"private class " << bean_name << " extends GeTextField {" << endl <<
"protected class " << bean_name << " extends GeTextField {" << endl <<
" public " << bean_name << "( JopSession session)" << endl <<
" {" << endl <<
" super( session);" << endl <<
......@@ -1413,7 +1413,7 @@ int Graph::export_gejava_nodeclass( ofstream& fp, grow_tNodeClass nodeclass)
{
// Use prefabricated class GeFrameThin
fp <<
"private class " << bean_name << " extends GeFrameThin {" << endl <<
"protected class " << bean_name << " extends GeFrameThin {" << endl <<
" public " << bean_name << "( JopSession session)" << endl <<
" {" << endl <<
" super(session);" << endl <<
......@@ -1425,10 +1425,10 @@ int Graph::export_gejava_nodeclass( ofstream& fp, grow_tNodeClass nodeclass)
{
// if ( grow_IsSliderClass( nodeclass))
// fp <<
//"private class " << bean_name << " extends GeSlider {" << endl;
//"protected class " << bean_name << " extends GeSlider {" << endl;
// else
fp <<
"private class " << bean_name << " extends GeComponent {" << endl;
"protected class " << bean_name << " extends GeComponent {" << endl;
fp <<
" Dimension size;" << endl;
......@@ -1668,13 +1668,13 @@ int Graph::export_javaframe( char *filename, char *bean_name, int applet,
" codebase=\"" << codebase << "\">" << endl <<
" <PARAM NAME = CODE VALUE = " << bean_name << "_A.class >" << endl <<
" <PARAM NAME =\"archive\" VALUE =\"pwrp_" << systemname << "_web.jar," <<
"pwr_rt_client.jar,pwr_jop.jar\">" << endl <<
"pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar\">" << endl <<
" <PARAM NAME=\"type\" VALUE=\"application/x-java-applet;version=1.3\">" << endl <<
" <PARAM NAME=\"scriptable\" VALUE=\"false\">" << endl <<
" <PARAM NAME=\"instance\" VALUE=\"\">" << endl <<
" <embed type=\"application/x-java-applet;version=1.3\"" << endl <<
" code = " << bean_name << "_A.class" << endl <<
" archive =\"pwrp_" << systemname << "_web.jar," <<"pwr_rt_client.jar,pwr_jop.jar\"" << endl <<
" archive =\"pwrp_" << systemname << "_web.jar," <<"pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar\"" << endl <<
" width=" << int(x1-x0) + 2*glow_cJBean_Offset << endl <<
" height=" << int(y1-y0) + 2*glow_cJBean_Offset << ">" << endl <<
" height=" << int(y1-y0) + 2*glow_cJBean_Offset << endl <<
......@@ -1705,6 +1705,9 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
int bg_image_width;
int bg_image_height;
int sts;
int baseclass;
baseclass = (strncmp( filename, "Jopc", 4) == 0);
grow_GetBackgroundImage( grow->ctx, background_image, &background_tiled);
if ( strcmp( background_image, "") != 0)
......@@ -1714,7 +1717,11 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
strcpy( background_image, "");
}
if ( !strchr( filename, ':') && !strchr( filename, '/'))
if ( baseclass) {
strcpy( fname, "$pwre_sroot/jpwr/jopc/src/");
strcat( fname, filename);
}
else if ( !strchr( filename, ':') && !strchr( filename, '/'))
{
strcpy( fname, default_path);
strcat( fname, filename);
......@@ -1736,6 +1743,9 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
fp.open( fname);
if ( baseclass)
fp << "package jpwr.jopc;" << endl;
fp <<
"import jpwr.rt.*;" << endl <<
"import jpwr.jop.*;" << endl <<
......@@ -1755,6 +1765,7 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
" JPanel contentPane;" << endl <<
" BorderLayout borderLayout1 = new BorderLayout();" << endl <<
" LocalPanel localPanel = new LocalPanel();" << endl <<
" boolean scrollbar = false;" << endl <<
" Dimension size;" << endl;
// Declarations of components
......@@ -1765,20 +1776,34 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
fp <<
" public " << bean_name << "() {}" << endl <<
" public void init() {" << endl <<
" super.init();" << endl;
" super.init();" << endl <<
" geInit();" << endl <<
" }" << endl;
}
else
{
fp <<
" public " << bean_name << "( JopSession session, String instance, boolean scrollbar) {" << endl <<
" super( session, instance);" << endl;
" super( session, instance);" << endl <<
" this.scrollbar = scrollbar;" << endl <<
" geInit();" << endl <<
" }" << endl <<
" public " << bean_name << "( JopSession session, String instance, boolean scrollbar, boolean noinit) {" << endl <<
" super( session, instance);" << endl <<
" this.scrollbar = scrollbar;" << endl <<
" if ( !noinit)" << endl <<
" geInit();" << endl <<
" }" << endl;
}
fp <<
" public void geInit() {" << endl <<
" JopSpider.setSystemName( \"" << systemname << "\");" << endl <<
" engine.setAnimationScanTime( " << int(animation_scan_time * 1000) << ");" << endl <<
" engine.setScanTime( " << int(scan_time * 1000) << ");" << endl <<
" size = new Dimension( " << int(x1-x0) + 2*glow_cJBean_Offset + cFrameBorderX << ", " << int(y1-y0) + 2*glow_cJBean_Offset + cFrameBorderY << ");" << endl <<
" Dimension dsize = new Dimension(localPanel.original_width,localPanel.original_height);" << endl <<
" this.addComponentListener(new AspectRatioListener(this,size));" << endl <<
" contentPane = (JPanel) this.getContentPane();" << endl <<
" contentPane.setLayout(borderLayout1);" << endl;
if ( applet) {
......@@ -1794,7 +1819,7 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
}
fp <<
" contentPane.setOpaque(true);" << endl <<
" localPanel.setLayout(null /* xxx new RatioLayout()*/);" << endl <<
" localPanel.setLayout( new RatioLayout()); // scaletest" << endl <<
" localPanel.setOpaque(true);" << endl;
if ( background_color != glow_eDrawType_LineErase)
fp <<
......@@ -1803,6 +1828,9 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
if ( !applet)
fp <<
" this.setSize(size);" << endl <<
" if ( engine.isInstance())" << endl <<
" setTitle( engine.getInstance());" << endl <<
" else" << endl <<
" this.setTitle(\"" << bean_name << "\");" << endl;
// Set drawing attributes of components
......@@ -1916,13 +1944,13 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
" codebase=\"" << codebase << "\">" << endl <<
" <PARAM NAME = CODE VALUE = " << bean_name << "_A.class >" << endl <<
" <PARAM NAME =\"archive\" VALUE =\"pwrp_" << systemname << "_web.jar," <<
"pwr_rt_client.jar,pwr_jop.jar\">" << endl <<
"pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar\">" << endl <<
" <PARAM NAME=\"type\" VALUE=\"application/x-java-applet;version=1.3\">" << endl <<
" <PARAM NAME=\"scriptable\" VALUE=\"false\">" << endl <<
" <PARAM NAME=\"instance\" VALUE=\"\">" << endl <<
" <embed type=\"application/x-java-applet;version=1.3\"" << endl <<
" code = " << bean_name << "_A.class" << endl <<
" archive =\"pwrp_" << systemname << "_web.jar," <<"pwr_rt_client.jar,pwr_jop.jar\"" << endl <<
" archive =\"pwrp_" << systemname << "_web.jar," <<"pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar\"" << endl <<
" width=" << int(x1-x0) + 2*glow_cJBean_Offset << endl <<
" height=" << int(y1-y0) + 2*glow_cJBean_Offset << endl <<
" instance=\"\">" << endl <<
......
......@@ -253,7 +253,7 @@ int Graph::generate_web( ldh_tSesContext ldhses)
" <object classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" << endl <<
" width=300 height=120 codebase=\"" << codebase << "\">" << endl <<
" <param name = code value=jpwr.jop.JopLoginApplet.class >" << endl <<
" <param name =\"archive\" value=\"pwr_rt_client.jar,pwr_jop.jar\">" << endl <<
" <param name =\"archive\" value=\"pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar\">" << endl <<
" <param name=\"type\" value=\"application/x-java-applet;version=1.3\">" << endl <<
" <param name=\"scriptable\" value=\"false\">" << endl <<
" </body>" << endl <<
......@@ -478,12 +478,12 @@ graph_text << "'," << resize << "," << width+20 << "," << height+20
" <object classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" << endl <<
" width=100% height=100% codebase=\"" << codebase << "\">" << endl <<
" <param name = code value=jpwr.jop.JopOpWindowApplet.class >" << endl <<
" <param name =\"archive\" value=\"pwr_rt_client.jar,pwr_jop.jar,pwrp_" << sname << "_web.jar\">" << endl <<
" <param name =\"archive\" value=\"pwr_rt_client.jar,pwr_jop.jar,pwr_jopc.jar,pwrp_" << sname << "_web.jar\">" << endl <<
" <param name=\"type\" value=\"application/x-java-applet;version=1.3\">" << endl <<
" <param name=\"scriptable\" value=\"false\">" << endl <<
" <embed type=\"application/x-java-applet;version=1.4\" " << endl <<
" code = jpwr.jop.JopOpWindowApplet.class " << endl <<
" archive=\"pwr_jop.jar,pwr_rt_client.jar,pwrp_" << sname << "_web.jar\" " << endl <<
" archive=\"pwr_jop.jar,pwr_jopc.jar,pwr_rt_client.jar,pwrp_" << sname << "_web.jar\" " << endl <<
" width = 100% height = 100% scriptable=false " << endl <<
" pluginspage=\"http://java.sun.com/products/plugin/index.html#download\">" << endl <<
" </body>" << endl <<
......
......@@ -749,6 +749,9 @@ void GlowCtx::nav_draw( int ll_x, int ll_y, int ur_x, int ur_y)
{
int i;
if ( no_nav)
return;
if ( ll_x == ur_x)
return;
......
......@@ -88,8 +88,8 @@ void GlowExportJBean::growctx( glow_eExportPass pass, ofstream& fp)
" public int getBorderColor() {" << endl <<
" return borderColor;" << endl <<
" }" << endl <<
" int original_width = " << int( dim_x1 - dim_x0) + 2 * glow_cJBean_Offset << ";" << endl <<
" int original_height = " << int( dim_y1 - dim_y0) + 2 * glow_cJBean_Offset<< ";" << endl <<
" public int original_width = " << int( dim_x1 - dim_x0) + 2 * glow_cJBean_Offset << ";" << endl <<
" public int original_height = " << int( dim_y1 - dim_y0) + 2 * glow_cJBean_Offset<< ";" << endl <<
" double rotate;" << endl <<
" public void setRotate( double rotate) {" << endl <<
" if ( rotate < 0)" << endl <<
......@@ -169,7 +169,7 @@ void GlowExportJBean::growctx( glow_eExportPass pass, ofstream& fp)
" AffineTransform save = g.getTransform();" << endl <<
" g.setColor(getBackground());" << endl <<
" g.fill(new Rectangle(0,0,getWidth(),getHeight()));" << endl <<
" // xxx g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight));" << endl <<
" g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight)); // scaletest" << endl <<
" AffineTransform save_tmp;" << endl;
if ( strcmp( ((GrowCtx *)ctx)->background_image, "") != 0)
{
......@@ -214,8 +214,8 @@ void GlowExportJBean::nodeclass( GlowNodeClass *nc, glow_eExportPass pass,
{
fp <<
" int original_width = " << int( dim_x1 - dim_x0) + 2 * glow_cJBean_Offset << ";" << endl <<
" int original_height = " << int( dim_y1 - dim_y0) + 2 * glow_cJBean_Offset << ";" << endl <<
" public int original_width = " << int( dim_x1 - dim_x0) + 2 * glow_cJBean_Offset << ";" << endl <<
" public int original_height = " << int( dim_y1 - dim_y0) + 2 * glow_cJBean_Offset << ";" << endl <<
" Shape[] shapes = new Shape[] { " << endl;
}
else
......@@ -1483,7 +1483,7 @@ void GlowExportJBean::node( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl;
else
fp <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
......@@ -1580,7 +1580,7 @@ void GlowExportJBean::image( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl;
else
fp <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
......@@ -1678,7 +1678,7 @@ void GlowExportJBean::bar( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl;
else
fp <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
case glow_eExportPass_Draw:
......@@ -1782,7 +1782,7 @@ void GlowExportJBean::trend( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl;
else
fp <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
case glow_eExportPass_Draw:
......@@ -1891,7 +1891,7 @@ void GlowExportJBean::axis( double x1, double y1, double x2, double y2,
" add(" << var_name << ");" << endl;
else
fp <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
case glow_eExportPass_Draw:
......@@ -1946,7 +1946,7 @@ void GlowExportJBean::window( double x1, double y1, double x2, double y2,
(int)(y1 - dim_y0 /* - glow_cJBean_Offset) */) << "," <<
(int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," <<
(int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
case glow_eExportPass_Draw:
......@@ -2017,7 +2017,7 @@ void GlowExportJBean::folder( double x1, double y1, double x2, double y2,
(int)(y1 - dim_y0 /* - glow_cJBean_Offset) */) << "," <<
(int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," <<
(int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
case glow_eExportPass_Draw:
......@@ -2030,7 +2030,7 @@ void GlowExportJBean::folder( double x1, double y1, double x2, double y2,
void GlowExportJBean::table( double x1, double y1, double x2, double y2,
glow_eDrawType fill_drawtype, int fill,
int rows, int columns, int header_row, int header_column,
int text_idx, glow_eDrawType text_drawtype,
int text_idx, glow_eDrawType text_drawtype, double header_row_height,
double row_height, double *column_width, char *header_text,
glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp)
{
......@@ -2079,6 +2079,7 @@ void GlowExportJBean::table( double x1, double y1, double x2, double y2,
fp <<
" " << var_name << " = new " << class_name << "(session, " <<
rows << "," << columns << "," << header_row << "," << header_column << ");" << endl <<
" " << var_name << ".setHeaderRowHeight(" << int(header_row_height) << ");" << endl <<
" " << var_name << ".setRowHeight(" << int(row_height) << ");" << endl;
char *text_p = header_text;
for ( int i = 0; i < columns; i++) {
......@@ -2101,7 +2102,7 @@ void GlowExportJBean::table( double x1, double y1, double x2, double y2,
(int)(x2 - x1 + 2 * glow_cJBean_Offset) << "," <<
(int)(y2 - y1 + 2 * glow_cJBean_Offset) << "));" << endl;
fp <<
" localPanel.add(" << var_name << ", ScaleTools.getAddString(" << var_name << ".getBounds(),size));" << endl;
" localPanel.add(" << var_name << ", new Proportion(" << var_name << ".getBounds(), dsize));" << endl;
break;
}
case glow_eExportPass_Draw:
......
......@@ -134,7 +134,7 @@ class GlowExportJBean {
void table( double x1, double y1, double x2, double y2,
glow_eDrawType fill_drawtype, int fill,
int rows, int columns, int header_row, int header_column,
int text_idx, glow_eDrawType text_drawtype,
int text_idx, glow_eDrawType text_drawtype, double header_row_height,
double row_height, double *column_width, char *header_text,
glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
void slider( double x1, double y1, double x2, double y2,
......
......@@ -2089,6 +2089,9 @@ void GrowCtx::draw( int ll_x, int ll_y, int ur_x, int ur_y)
void GrowCtx::nav_draw( int ll_x, int ll_y, int ur_x, int ur_y)
{
if ( no_nav)
return;
int i;
int loc_ll_x = ll_x;
int loc_ll_y = ll_y;
......
......@@ -809,6 +809,7 @@ void GrowTable::export_javabean( GlowTransform *t, void *node,
((GrowCtx *)ctx)->export_jbean->table( ll_x, ll_y, ur_x, ur_y,
fill_drawtype, fill, rows, columns, header_row,
header_column, text_size, text_drawtype,
header_row_height * ctx->zoom_factor_y,
row_height * ctx->zoom_factor_y, (double *)cwidth,
(char *)header_text,
pass, shape_cnt, node_cnt, fp);
......
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