Commit df7760d9 authored by Claes Sjofors's avatar Claes Sjofors

Java GlowCon fix, and open function for image and window added

parent 30443e8e
......@@ -31,6 +31,8 @@ extern_java_sources := \
GlowConPoint.java,\
GrowNode.java,\
GlowLine.java,\
GlowRect.java,\
GlowText.java,\
GlowArc.java,\
GlowArrow.java,\
GlowCon.java,\
......@@ -50,6 +52,8 @@ extern_java_sources := \
GrowScrollBarIfc.java,\
GrowScrollBar.java,\
GrowTable.java,\
GrowImage.java,\
GrowWindow.java,\
GrowConGlue.java,\
GlowVector.java,\
GrowCtx.java,\
......
......@@ -246,15 +246,15 @@ public class GlowCon extends GlowArrayElem {
// ref_a.draw( w, &cc->zero, highlight, hot, NULL);
}
else {
for ( i = 0; i < line_a.size(); i++)
for ( i = 0; i < l_num; i++)
((GlowLine)line_a.get(i)).draw( highlight, hot);
for ( i = 0; i < arc_a.size(); i++)
for ( i = 0; i < a_num; i++)
((GlowArc)arc_a.get(i)).draw( highlight, hot);
// arrow_a.draw( highlight, hot);
if ( (shadow != 0 || border != 0) && cc.con_type == Glow.eConType_Routed && cc.corner == Glow.eCorner_Rounded) {
for ( i = 0; i < line_a.size(); i++)
for ( i = 0; i < l_num; i++)
((GlowLine)line_a.get(i)).draw_shadow( border, shadow, highlight, hot);
for ( i = 0; i < arc_a.size(); i++)
for ( i = 0; i < a_num; i++)
((GlowArc)arc_a.get(i)).draw_shadow( border, shadow, highlight, hot);
}
}
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2013 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.jopg;
import jpwr.rt.*;
import java.io.*;
import java.util.*;
public class GlowRect extends GlowArrayElem {
GrowCmn cmn;
GlowPoint ll;
GlowPoint ur;
int draw_type;
int line_width;
int display_level;
int fill;
public GlowRect(GrowCmn cmn) {
this.cmn = cmn;
ll = new GlowPoint();
ur = new GlowPoint();
}
public int type() {
return Glow.eObjectType_Rect;
}
public void open(BufferedReader reader) {
String line;
StringTokenizer token;
boolean end_found = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = Integer.valueOf(token.nextToken());
if ( cmn.debug) System.out.println( "GlowRect : " + line);
switch ( key) {
case Glow.eSave_Rect:
break;
case Glow.eSave_Rect_draw_type:
draw_type = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_Rect_line_width:
line_width = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_Rect_display_level:
display_level = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_Rect_fill:
fill = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_Rect_ll:
ll.open( reader);
break;
case Glow.eSave_Rect_ur:
ur.open( reader);
break;
case Glow.eSave_End:
end_found = true;
break;
default:
System.out.println( "Syntax error in GlowRect");
break;
}
if ( end_found)
break;
}
} catch ( Exception e) {
System.out.println( "IOException GlowRect");
}
}
public void draw(GlowTransform t, int highlight, int hot, Object node, Object colornode) {
}
public void draw( int hightlight, int hot) {
}
public void draw_shadow( int border, int shadow, int hightlight, int hot) {
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2013 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.jopg;
import jpwr.rt.*;
import java.io.*;
import java.util.*;
public class GlowText extends GlowArrayElem {
GrowCmn cmn;
GlowPoint p;
String text;
int draw_type;
int text_size;
int display_level;
int color_drawtype;
public GlowText(GrowCmn cmn) {
this.cmn = cmn;
p = new GlowPoint();
}
public int type() {
return Glow.eObjectType_Text;
}
public void open(BufferedReader reader) {
String line;
StringTokenizer token;
boolean end_found = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = Integer.valueOf(token.nextToken());
if ( cmn.debug) System.out.println( "GlowText : " + line);
switch ( key) {
case Glow.eSave_Text:
break;
case Glow.eSave_Text_draw_type:
draw_type = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_Text_text_size:
text_size = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_Text_color_drawtype:
color_drawtype = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_Text_text:
text = line.substring(4);
break;
case Glow.eSave_Text_p:
p.open( reader);
break;
case Glow.eSave_End:
end_found = true;
break;
default:
System.out.println( "Syntax error in GlowText");
break;
}
if ( end_found)
break;
}
} catch ( Exception e) {
System.out.println( "IOException GlowText");
}
}
public void draw(GlowTransform t, int highlight, int hot, Object node, Object colornode) {
}
public void draw( int hightlight, int hot) {
}
public void draw_shadow( int border, int shadow, int hightlight, int hot) {
}
}
......@@ -135,6 +135,18 @@ public class GlowVector {
a.add( c);
break;
}
case Glow.eSave_Rect: {
GlowRect c = new GlowRect( cmn);
c.open( reader);
a.add( c);
break;
}
case Glow.eSave_Text: {
GlowText c = new GlowText( cmn);
c.open( reader);
a.add( c);
break;
}
case Glow.eSave_Arrow: {
GlowArrow c = new GlowArrow( cmn);
c.open( reader);
......@@ -201,6 +213,18 @@ public class GlowVector {
a.add( c);
break;
}
case Glow.eSave_GrowImage: {
GrowImage c = new GrowImage( cmn);
c.open( reader);
a.add( c);
break;
}
case Glow.eSave_GrowWindow: {
GrowWindow c = new GrowWindow( cmn);
c.open( reader);
a.add( c);
break;
}
case Glow.eSave_Point: {
GlowPoint c = new GlowPoint();
c.open( reader);
......
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2013 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.jopg;
import jpwr.rt.*;
import java.io.*;
import java.util.*;
public class GrowWindow extends GrowRect {
String file_name;
double scrollbar_width;
int scrollbar_color;
int scrollbar_bg_color;
int vertical_scrollbar;
int horizontal_scrollbar;
double window_scale;
String owner;
Object userdata;
public GrowWindow(GrowCmn cmn) {
super(cmn);
}
public GrowWindow( GrowCmn cmn, String n_name, double x, double y,
double w, double h, int draw_type, int line_width,
int fill, int border, int shadow,
int fill_drawtype) {
super(cmn, n_name, x, y, w, h, draw_type, line_width, fill, border, shadow, fill_drawtype);
}
public int type() {
return Glow.eObjectType_GrowWindow;
}
public void open(BufferedReader reader) {
String line;
StringTokenizer token;
boolean end_found = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = Integer.valueOf(token.nextToken());
if ( cmn.debug) System.out.println( "GrowWindow : " + line);
switch ( key) {
case Glow.eSave_GrowWindow:
break;
case Glow.eSave_GrowWindow_file_name:
if ( token.hasMoreTokens())
file_name = token.nextToken();
break;
case Glow.eSave_GrowWindow_scrollbar_width:
scrollbar_width = new Double(token.nextToken()).doubleValue();
break;
case Glow.eSave_GrowWindow_scrollbar_color:
scrollbar_color = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_GrowWindow_scrollbar_bg_color:
scrollbar_bg_color = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_GrowWindow_vertical_scrollbar:
vertical_scrollbar = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_GrowWindow_horizontal_scrollbar:
horizontal_scrollbar = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_GrowWindow_window_scale:
window_scale = new Double(token.nextToken()).doubleValue();
break;
case Glow.eSave_GrowWindow_owner:
if ( token.hasMoreTokens())
owner = token.nextToken();
break;
case Glow.eSave_GrowWindow_rect_part:
super.open( reader);
break;
case Glow.eSave_GrowWindow_userdata_cb:
if ( cmn.appl != null)
userdata = cmn.appl.growUserdataOpen( reader, this, Glow.eUserdataCbType_Node);
break;
case Glow.eSave_End:
end_found = true;
break;
default:
System.out.println( "Syntax error in GrowWindow");
break;
}
if ( end_found)
break;
}
} catch ( Exception e) {
System.out.println( "IOException GrowWindow");
}
}
public void draw(GlowTransform t, int highlight, int hot, Object node, Object colornode) {
if ( cmn.nodraw != 0)
return;
}
}
......@@ -33,6 +33,8 @@ local_java_sources := \
GrowNode.java,\
GlowLine.java,\
GlowArc.java,\
GlowRect.java,\
GlowText.java,\
GlowArrow.java,\
GlowCon.java,\
GrowRect.java,\
......@@ -52,6 +54,8 @@ local_java_sources := \
GrowScrollBar.java,\
GrowTable.java,\
GrowConGlue.java,\
GrowImage.java,\
GrowWindow.java,\
GlowVector.java,\
GrowCtx.java,\
DynParsedAttrName.java,\
......
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