Commit a92df731 authored by Claes Sjofors's avatar Claes Sjofors

Ge export java, gradients implemented

parent 4bb49624
......@@ -524,6 +524,10 @@ public class GeColor {
Rgb rgb;
Color color = null;
if ( idx == 300)
// TODO, should be background color
idx = 31;
if ( idx < 4)
color = new Color( (int)(colorValues[3*idx] * 255),
(int)(colorValues[3*idx + 1] * 255),
......@@ -614,7 +618,7 @@ public class GeColor {
if ( local_drawtype == 300) {
// This should be background color TODO...
return 33;
return 31;
}
if ( default_color == NO_COLOR && color_tone != NO_TONE) {
......
......@@ -182,6 +182,7 @@ public class GeComponent extends JComponent implements GeComponentIfc,
public int levelColorTone = 0;
public int levelFillColor = 0;
public int shadow = 0;
public int gradient = 0;
public boolean visible = true;
public boolean dimmed = false;
public void setColorTone( int colorTone) {
......@@ -236,6 +237,9 @@ public class GeComponent extends JComponent implements GeComponentIfc,
public void setShadow( int shadow) {
this.shadow = shadow;
}
public void setGradient( int gradient) {
this.gradient = gradient;
}
public int animationCount = 1;
public int page = 1;
public int pages = 1;
......
/*
* Proview $Id$
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.jop;
import jpwr.rt.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
public class GeGradient {
public static final int eGradient_No = 0;
public static final int eGradient_HorizontalUp = 1;
public static final int eGradient_HorizontalDown = 2;
public static final int eGradient_HorizontalTube1 = 3;
public static final int eGradient_HorizontalTube2 = 4;
public static final int eGradient_VerticalLeft = 5;
public static final int eGradient_VerticalRight = 6;
public static final int eGradient_VerticalTube1 = 7;
public static final int eGradient_VerticalTube2 = 8;
public static final int eGradient_DiagonalUpperLeft = 9;
public static final int eGradient_DiagonalLowerLeft = 10;
public static final int eGradient_DiagonalUpperRight = 11;
public static final int eGradient_DiagonalLowerRight = 12;
public static final int eGradient_DiagonalUpTube = 13;
public static final int eGradient_DiagonalDownTube = 14;
public static final int eGradient_Globe = 15;
public static final int eGradient_RadialCenter = 16;
public static final int eGradient_RadialUpperLeft = 17;
public static final int eGradient_RadialLowerLeft = 18;
public static final int eGradient_RadialUpperRight = 19;
public static final int eGradient_RadialLowerRight = 20;
static public void paint( Graphics2D g, int gradient, int gradientContrast1, int gradientContrast2,
float x, float y, float w, float h,
boolean fixcolor, int fillDrawtype, int colorTone, int colorShift,
int colorIntensity, int colorInverse, int fillColor,
boolean dimmed) {
float gx0 = 0;
float gy0 = 0;
float gx1 = 0;
float gy1 = 0;
float gr = 0;
switch ( gradient) {
case eGradient_HorizontalUp:
gx0 = x;
gy0 = y;
gx1 = x;
gy1 = y + h;
break;
case eGradient_HorizontalDown:
gx0 = x;
gy0 = y + h;
gx1 = x;
gy1 = y;
break;
case eGradient_HorizontalTube1:
gx0 = x;
gy0 = y + 0.5F * h;
gx1 = x;
gy1 = y;
break;
case eGradient_HorizontalTube2:
gx0 = x;
gy0 = y + 0.3F * h;
gx1 = x;
gy1 = y + h;
break;
case eGradient_VerticalLeft:
gx0 = x;
gy0 = y;
gx1 = x + w;
gy1 = y;
break;
case eGradient_VerticalRight:
gx0 = x + w;
gy0 = y;
gx1 = x;
gy1 = y;
break;
case eGradient_VerticalTube1:
gx0 = x + 0.5F * w;
gy0 = y;
gx1 = x;
gy1 = y;
break;
case eGradient_VerticalTube2:
gx0 = x + 0.3F * w;
gy0 = y;
gx1 = x + w;
gy1 = y;
break;
case eGradient_DiagonalUpperLeft:
gx0 = x;
gy0 = y;
gx1 = x + w;
gy1 = y + h;
break;
case eGradient_DiagonalLowerLeft:
gx0 = x;
gy0 = y + h;
gx1 = x + w;
gy1 = y;
break;
case eGradient_DiagonalUpperRight:
gx0 = x + w;
gy0 = y;
gx1 = x;
gy1 = y + h;
break;
case eGradient_DiagonalLowerRight:
gx0 = x + w;
gy0 = y + h;
gx1 = x;
gy1 = y;
break;
case eGradient_DiagonalUpTube:
gx0 = x + 0.5F * w;
gy0 = y + 0.5F * h;
gx1 = x + w;
gy1 = y + h;
break;
case eGradient_DiagonalDownTube:
gx0 = x + 0.5F * w;
gy0 = y + 0.5F * h;
gx1 = x;
gy1 = y + h;
break;
case eGradient_Globe:
gx0 = x + 0.3F * w;
gy0 = y + 0.3F * h;
gx1 = x + w;
gy1 = y + h;
gr = (float) Math.sqrt( w*w/4+h*h/4);
break;
case eGradient_RadialCenter:
gx0 = x + 0.5F * w;
gy0 = y + 0.5F * h;
gx1 = x + w;
gy1 = y + h;
gr = (float) Math.sqrt( w*w/4F+h*h/4F);
break;
case eGradient_RadialUpperLeft:
gx0 = x;
gy0 = y;
gx1 = x + w;
gy1 = y + h;
gr = (float) Math.sqrt( w*w+h*h);
break;
case eGradient_RadialLowerLeft:
gx0 = x;
gy0 = y + h;
gx1 = x + w;
gy1 = y;
gr = (float) Math.sqrt( w*w+h*h);
break;
case eGradient_RadialUpperRight:
gx0 = x + w;
gy0 = y;
gx1 = x;
gy1 = y + h;
gr = (float) Math.sqrt( w*w+h*h);
break;
case eGradient_RadialLowerRight:
gx0 = x + w;
gy0 = y + h;
gx1 = x;
gy1 = y;
gr = (float) Math.sqrt( w*w+h*h);
break;
default: ;
}
switch ( gradient) {
case eGradient_HorizontalUp:
case eGradient_HorizontalDown:
case eGradient_HorizontalTube1:
case eGradient_HorizontalTube2:
case eGradient_VerticalLeft:
case eGradient_VerticalRight:
case eGradient_VerticalTube1:
case eGradient_VerticalTube2:
case eGradient_DiagonalUpperLeft:
case eGradient_DiagonalLowerLeft:
case eGradient_DiagonalUpperRight:
case eGradient_DiagonalLowerRight:
case eGradient_DiagonalUpTube:
case eGradient_DiagonalDownTube:
if ( fixcolor) {
GradientPaint gp = new GradientPaint( gx0, gy0,
GeColor.getColor(fillDrawtype, GeColor.NO_TONE, 0, 0, gradientContrast2, colorInverse, GeColor.NO_COLOR, dimmed),
gx1, gy1 ,
GeColor.getColor(fillDrawtype, GeColor.NO_TONE,0,0,gradientContrast1, colorInverse, GeColor.NO_COLOR, dimmed),true);
g.setPaint(gp);
}
else {
GradientPaint gp = new GradientPaint( gx0, gy0,
GeColor.getColor(fillDrawtype ,colorTone,colorShift,colorIntensity, gradientContrast2, colorInverse, fillColor, dimmed),
gx1, gy1,
GeColor.getColor(fillDrawtype, colorTone,colorShift,colorIntensity, gradientContrast1, colorInverse, fillColor, dimmed),true);
g.setPaint(gp);
}
break;
case eGradient_Globe:
case eGradient_RadialCenter:
case eGradient_RadialUpperLeft:
case eGradient_RadialLowerLeft:
case eGradient_RadialUpperRight:
case eGradient_RadialLowerRight:
if ( fixcolor) {
RadialGradientPaint gp = new RadialGradientPaint( new Point2D.Float(gx0,gy0), gr, new float[] {0F,1F}, new Color[] { GeColor.getColor(fillDrawtype, GeColor.NO_TONE,0,0,gradientContrast2, colorInverse, GeColor.NO_COLOR, dimmed),GeColor.getColor(fillDrawtype,GeColor.NO_TONE,0,0,gradientContrast1, colorInverse, GeColor.NO_COLOR, dimmed)});
g.setPaint(gp);
}
else {
RadialGradientPaint gp = new RadialGradientPaint( new Point2D.Float(gx0,gy0),gr, new float[] {0F,1F}, new Color[] { GeColor.getColor(fillDrawtype,colorTone,colorShift,colorIntensity,gradientContrast2, colorInverse, fillColor, dimmed),GeColor.getColor(fillDrawtype,colorTone,colorShift,colorIntensity,gradientContrast1, colorInverse, fillColor, dimmed)});
g.setPaint(gp);
}
break;
default: ;
}
}
}
......@@ -178,6 +178,7 @@ Graph::Graph(
else
strcpy( object_name, "");
strcpy( filename, "");
strcpy( systemname, "");
// Create journal file
if ( mode == graph_eMode_Development) {
......
......@@ -1935,7 +1935,10 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
" return JopUtility.GRAPH;" << endl <<
" }" << endl <<
" public PwrtObjid getUtilityObjid() {" << endl <<
" if ( utilityAref != null)" << endl <<
" return utilityAref.getObjid();" << endl <<
" else" << endl <<
" return null;" << endl <<
" }" << endl <<
" public PwrtAttrRef getUtilityAttrRef() {" << endl <<
" return utilityAref;" << endl <<
......
......@@ -359,8 +359,8 @@ void GlowArc::export_javabean( GlowTransform *t, void *node,
ll.z_x - ctx->mw.offset_x,
ll.z_y - ctx->mw.offset_y,
ur.z_x - ll.z_x, ur.z_y - ll.z_y, angle1, angle2,
fill, !fill, draw_type, draw_type, idx, 0.0, 0, glow_eDrawType_No,
pass, shape_cnt, node_cnt, fp);
fill, !fill, draw_type, draw_type, idx, 0.0, 0, glow_eDrawType_No, 0,
glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
}
void GlowArc::export_javabean_shadow( GlowTransform *t, void *node,
......@@ -379,68 +379,81 @@ void GlowArc::export_javabean_shadow( GlowTransform *t, void *node,
ll.z_y - ctx->mw.offset_y + idx/2 - idx + offs,
ur.z_x - ll.z_x + idx - offs*2, ur.z_y - ll.z_y + idx - offs*2, angle1 + 45, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0),
ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
ish-1, 0.0, 0, glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - idx + offs,
ll.z_y - ctx->mw.offset_y + idx/2 - idx + offs,
ur.z_x - ll.z_x + idx - offs*2, ur.z_y - ll.z_y + idx - offs*2, angle1, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - offs,
ll.z_y - ctx->mw.offset_y + idx/2 - offs,
max( 0, ur.z_x - ll.z_x - idx + offs*2), max( 0, ur.z_y - ll.z_y - idx + offs*2), angle1 + 45, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - offs,
ll.z_y - ctx->mw.offset_y + idx/2 - offs,
max( 0, ur.z_x - ll.z_x - idx + offs*2), max( 0, ur.z_y - ll.z_y - idx + offs*2), angle1, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
}
else if ( angle1 == 90) {
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - idx + offs,
ll.z_y - ctx->mw.offset_y + idx/2 - idx + offs,
ur.z_x - ll.z_x + idx - offs*2, ur.z_y - ll.z_y + idx - offs*2, angle1, angle2,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - offs,
ll.z_y - ctx->mw.offset_y + idx/2 - offs,
max( 0, ur.z_x - ll.z_x - idx + offs*2), max( 0, ur.z_y - ll.z_y - idx + offs*2), angle1, angle2,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
}
else if ( angle1 == 180) {
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - idx + offs,
ll.z_y - ctx->mw.offset_y + idx/2 - idx + offs,
ur.z_x - ll.z_x + idx - offs*2, ur.z_y - ll.z_y + idx - offs*2, angle1 + 45, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - idx + offs,
ll.z_y - ctx->mw.offset_y + idx/2 - idx + offs,
ur.z_x - ll.z_x + idx - offs*2, ur.z_y - ll.z_y + idx - offs*2, angle1, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - offs,
ll.z_y - ctx->mw.offset_y + idx/2 - offs,
max( 0, ur.z_x - ll.z_x - idx + offs*2), max( 0, ur.z_y - ll.z_y - idx + offs*2), angle1 + 45, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - offs,
ll.z_y - ctx->mw.offset_y + idx/2 - offs,
max( 0, ur.z_x - ll.z_x - idx + offs*2), max( 0, ur.z_y - ll.z_y - idx + offs*2), angle1, angle2 - 45,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
}
else if ( angle1 == 270) {
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - idx + offs,
ll.z_y - ctx->mw.offset_y + idx/2 - idx + offs,
ur.z_x - ll.z_x + idx - offs*2, ur.z_y - ll.z_y + idx - offs*2, angle1, angle2,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, 2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - offs,
ll.z_y - ctx->mw.offset_y + idx/2 - offs,
max( 0, ur.z_x - ll.z_x - idx + offs*2), max( 0, ur.z_y - ll.z_y - idx + offs*2), angle1, angle2,
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, ((GrowCtx *)ctx)->shift_drawtype( draw_type, -2, 0), ish-1, 0.0, 0,
glow_eDrawType_No, 0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
}
}
if ( border) {
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2 - idx,
ll.z_y - ctx->mw.offset_y + idx/2 - idx,
ur.z_x - ll.z_x + idx, ur.z_y - ll.z_y + idx, angle1, angle2,
0, 1, glow_eDrawType_No, glow_eDrawType_Line, 0, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, glow_eDrawType_Line, 0, 0.0, 0, glow_eDrawType_No,
0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
((GrowCtx *)ctx)->export_jbean->arc( ll.z_x - ctx->mw.offset_x + idx/2,
ll.z_y - ctx->mw.offset_y + idx/2,
max( 0, ur.z_x - ll.z_x - idx), max( 0, ur.z_y - ll.z_y - idx), angle1, angle2,
0, 1, glow_eDrawType_No, glow_eDrawType_Line, 0, 0.0, 0, glow_eDrawType_No, pass, shape_cnt, node_cnt, fp);
0, 1, glow_eDrawType_No, glow_eDrawType_Line, 0, 0.0, 0, glow_eDrawType_No,
0, glow_eGradient_No, 0, 0, pass, shape_cnt, node_cnt, fp);
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -44,7 +44,8 @@ class GlowExportJBean {
glow_eDrawType fill_drawtype, glow_eDrawType border_drawtype,
int fill_eq_border, int fill_eq_light, int fill_eq_shadow, int line_width,
int print_shadow, int shadow, int drawtype_incr, glow_sShadowInfo *sp, int sp_num,
glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
int fixcolor, glow_eGradient gradient, int gc1, int gc2, glow_eExportPass pass,
int *shape_cnt, int node_cnt, ofstream& fp);
void line( double x1, double y1, double x2, double y2,
glow_eDrawType border_drawtype,
int line_width, glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
......@@ -52,18 +53,20 @@ class GlowExportJBean {
int fill, int border,
glow_eDrawType fill_drawtype, glow_eDrawType border_drawtype,
int line_width, double shadow_width, int shadow,
int drawtype_incr, glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
int drawtype_incr, int fixcolor, glow_eGradient gradient,
int gc1, int gc2, glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
void rectrounded( double x0, double y0, double width, double height,
int fill, int border,
glow_eDrawType fill_drawtype, glow_eDrawType border_drawtype,
int line_width, double roundamount, double shadow_width, int shadow,
int drawtype_incr, glow_eExportPass pass, int *shape_cnt,
int node_cnt, ofstream& fp);
int drawtype_incr, glow_eGradient gradient, int gc1, int gc2,
glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
void arc( double x0, double y0, double width, double height,
double angle1, double angle2, int fill, int border,
glow_eDrawType fill_drawtype, glow_eDrawType border_drawtype,
int line_width, double shadow_width, int shadow,
int drawtype_incr, glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
int drawtype_incr, int fixcolor, glow_eGradient gradient, int gc1, int gc2,
glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
void text( int x0, int y0, char *text,
glow_eDrawType drawtype, glow_eDrawType color_drawtype, int bold,
int idx, glow_eExportPass pass, int *shape_cnt, int node_cnt, ofstream& fp);
......@@ -86,6 +89,7 @@ class GlowExportJBean {
int line_width,
double rotate,
int shadow,
glow_eGradient gradient,
glow_eExportPass pass, int *shape_cnt, int node_cnt, int in_nc, ofstream& fp);
void image( double x1, double y1, double x2, double y2,
char *filename, int transparent,
......@@ -185,7 +189,11 @@ class GlowExportJBean {
int line_width,
double rotate,
int shadow,
glow_eGradient gradient,
glow_eExportPass pass, int *shape_cnt, int node_cnt, int in_nc, ofstream& fp);
void gradient_paint( glow_eGradient gradient, int gc1, int gc2,
double x0, double y0, double w, double h,
int fixcolor, glow_eDrawType fill_drawtype, ofstream& fp);
GlowCtx *ctx;
GlowNodeClass *nc;
int is_nodeclass;
......
......@@ -997,6 +997,8 @@ void GrowArc::export_javabean( GlowTransform *t, void *node,
glow_eExportPass pass, int *shape_cnt, int node_cnt, int in_nc, ofstream &fp)
{
int idx;
int gc1, gc2;
if ( node && ((GrowNode *)node)->line_width)
idx = int( ctx->mw.zoom_factor_y / ctx->mw.base_zoom_factor *
((GrowNode *)node)->line_width - 1);
......@@ -1039,9 +1041,19 @@ void GrowArc::export_javabean( GlowTransform *t, void *node,
if ( relief == glow_eRelief_Down)
drawtype_incr = -shadow_contrast;
if ( gradient_contrast >= 0) {
gc1 = gradient_contrast/2;
gc2 = -int(float(gradient_contrast)/2+0.6);
}
else {
gc1 = int(float(gradient_contrast)/2-0.6);
gc2 = -gradient_contrast/2;
}
ctx->export_jbean->arc( ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
angle1 - rot, angle2, fill, border || !fill, fill_drawtype, draw_type,
idx, ish, shadow, drawtype_incr, pass, shape_cnt, node_cnt, fp);
idx, ish, shadow, drawtype_incr, fixcolor, gradient, gc1, gc2,
pass, shape_cnt, node_cnt, fp);
}
void GrowArc::flip( double x0, double y0, glow_eFlipDirection dir)
......
This diff is collapsed.
......@@ -1518,7 +1518,7 @@ void GrowNode::export_javabean( GlowTransform *t, void *node,
nc->get_java_name( java_name);
ctx->export_jbean->node( x1, y1, x2, y2, java_name,
draw_type, fill_drawtype, text_drawtype, color_tone, color_lightness,
color_intensity, color_shift, line_width, rot, shadow,
color_intensity, color_shift, line_width, rot, shadow, gradient,
pass, shape_cnt, node_cnt, in_nc, fp);
}
......
......@@ -1447,6 +1447,8 @@ void GrowPolyLine::export_javabean( GlowTransform *t, void *node,
{
int i;
int idx;
int gc1, gc2;
if ( node && ((GrowNode *)node)->line_width)
idx = int( ctx->mw.zoom_factor_y / ctx->mw.base_zoom_factor *
((GrowNode *)node)->line_width - 1);
......@@ -1495,10 +1497,24 @@ void GrowPolyLine::export_javabean( GlowTransform *t, void *node,
}
int jborder = border || !(fill || (!disable_shadow && shadow_width != 0));
glow_eGradient grad = gradient;
if ( disable_gradient)
grad = glow_eGradient_No;
if ( gradient_contrast >= 0) {
gc1 = gradient_contrast/2;
gc2 = -int(float(gradient_contrast)/2+0.6);
}
else {
gc1 = int(float(gradient_contrast)/2-0.6);
gc2 = -gradient_contrast/2;
}
ctx->export_jbean->polyline( p, a_points.a_size, fill, jborder,
fill_drawtype, draw_type, fill_eq_border,
fill_eq_light, fill_eq_shadow,
idx, jshadow, shadow, shadow_contrast, sp, p_num, pass, shape_cnt, node_cnt, fp);
idx, jshadow, shadow, shadow_contrast, sp, p_num, fixcolor,
grad, gc1, gc2, pass, shape_cnt, node_cnt, fp);
free( (char *) p);
free( sp);
}
......
......@@ -1083,6 +1083,7 @@ void GrowRect::export_javabean( GlowTransform *t, void *node,
if ( !(display_level & ctx->display_level) || invisible)
return;
int idx;
int gc1, gc2;
if ( fix_line_width)
{
......@@ -1137,9 +1138,18 @@ void GrowRect::export_javabean( GlowTransform *t, void *node,
int jborder = border || !(fill || (!disable_shadow && shadow_width != 0));
if ( gradient_contrast >= 0) {
gc1 = gradient_contrast/2;
gc2 = -int(float(gradient_contrast)/2+0.6);
}
else {
gc1 = int(float(gradient_contrast)/2-0.6);
gc2 = -gradient_contrast/2;
}
ctx->export_jbean->rect( ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
fill, jborder, fill_drawtype, draw_type, idx, ish, shadow,
drawtype_incr, pass, shape_cnt, node_cnt, fp);
drawtype_incr, fixcolor, gradient, gc1, gc2, pass, shape_cnt, node_cnt, fp);
}
void GrowRect::flip( double x0, double y0, glow_eFlipDirection dir)
......
......@@ -1086,6 +1086,7 @@ void GrowRectRounded::export_javabean( GlowTransform *t, void *node,
if ( !(display_level & ctx->display_level))
return;
int idx;
int gc1, gc2;
if ( fix_line_width)
{
......@@ -1141,9 +1142,20 @@ void GrowRectRounded::export_javabean( GlowTransform *t, void *node,
if ( relief == glow_eRelief_Down)
drawtype_incr = -shadow_contrast;
if ( gradient_contrast >= 0) {
gc1 = gradient_contrast/2;
gc2 = -int(float(gradient_contrast)/2+0.6);
}
else {
gc1 = int(float(gradient_contrast)/2-0.6);
gc2 = -gradient_contrast/2;
}
ctx->export_jbean->rectrounded( ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
fill, border || !fill, fill_drawtype, draw_type, idx, amount, ish, shadow,
drawtype_incr, pass, shape_cnt, node_cnt, fp);
fill, border || !fill, fill_drawtype,
draw_type, idx, amount, ish, shadow,
drawtype_incr, gradient, gc1, gc2,
pass, shape_cnt, node_cnt, fp);
}
......
......@@ -249,7 +249,7 @@ void GrowSlider::export_javabean( GlowTransform *t, void *node,
nc->get_java_name( java_name);
ctx->export_jbean->slider( x1, y1, x2, y2, java_name,
draw_type, fill_drawtype, text_drawtype, color_tone, color_lightness,
color_intensity, color_shift, line_width, rot, shadow,
color_intensity, color_shift, line_width, rot, shadow, gradient,
pass, shape_cnt, node_cnt, in_nc, 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