Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
df7760d9
Commit
df7760d9
authored
Jan 03, 2014
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java GlowCon fix, and open function for image and window added
parent
30443e8e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
776 additions
and
4 deletions
+776
-4
java/aapp/jopg/src/os_templ/hw_templ/makefile
java/aapp/jopg/src/os_templ/hw_templ/makefile
+4
-0
java/jpwr/jopg/src/GlowCon.java
java/jpwr/jopg/src/GlowCon.java
+4
-4
java/jpwr/jopg/src/GlowRect.java
java/jpwr/jopg/src/GlowRect.java
+120
-0
java/jpwr/jopg/src/GlowText.java
java/jpwr/jopg/src/GlowText.java
+116
-0
java/jpwr/jopg/src/GlowVector.java
java/jpwr/jopg/src/GlowVector.java
+24
-0
java/jpwr/jopg/src/GrowImage.java
java/jpwr/jopg/src/GrowImage.java
+365
-0
java/jpwr/jopg/src/GrowWindow.java
java/jpwr/jopg/src/GrowWindow.java
+139
-0
java/jpwr/jopg/src/os_templ/hw_templ/makefile
java/jpwr/jopg/src/os_templ/hw_templ/makefile
+4
-0
No files found.
java/aapp/jopg/src/os_templ/hw_templ/makefile
View file @
df7760d9
...
...
@@ -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,
\
...
...
java/jpwr/jopg/src/GlowCon.java
View file @
df7760d9
...
...
@@ -246,15 +246,15 @@ public class GlowCon extends GlowArrayElem {
// ref_a.draw( w, &cc->zero, highlight, hot, NULL);
}
else
{
for
(
i
=
0
;
i
<
l
ine_a
.
size
()
;
i
++)
for
(
i
=
0
;
i
<
l
_num
;
i
++)
((
GlowLine
)
line_a
.
get
(
i
)).
draw
(
highlight
,
hot
);
for
(
i
=
0
;
i
<
a
rc_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
<
l
ine_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
<
a
rc_a
.
size
()
;
i
++)
for
(
i
=
0
;
i
<
a
_num
;
i
++)
((
GlowArc
)
arc_a
.
get
(
i
)).
draw_shadow
(
border
,
shadow
,
highlight
,
hot
);
}
}
...
...
java/jpwr/jopg/src/GlowRect.java
0 → 100644
View file @
df7760d9
/*
* 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
)
{
}
}
java/jpwr/jopg/src/GlowText.java
0 → 100644
View file @
df7760d9
/*
* 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
)
{
}
}
java/jpwr/jopg/src/GlowVector.java
View file @
df7760d9
...
...
@@ -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
);
...
...
java/jpwr/jopg/src/GrowImage.java
0 → 100644
View file @
df7760d9
/*
* 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
GrowImage
extends
GlowArrayElem
{
GrowCmn
cmn
;
String
n_name
;
double
x_right
;
double
x_left
;
double
y_high
;
double
y_low
;
String
image_filename
;
int
dynamicsize
;
GlowTransform
trf
;
int
color_lightness
;
int
color_intensity
;
int
color_shift
;
int
color_tone
;
int
fixposition
;
GlowPoint
ll
;
GlowPoint
ur
;
int
display_level
;
public
GrowImage
(
GrowCmn
cmn
)
{
this
.
cmn
=
cmn
;
trf
=
new
GlowTransform
();
ll
=
new
GlowPoint
();
ur
=
new
GlowPoint
();
}
public
GrowImage
(
GrowCmn
cmn
,
String
n_name
,
double
x
,
double
y
,
String
imagefile
)
{
double
w
=
10
;
double
h
=
10
;
this
.
cmn
=
cmn
;
trf
=
new
GlowTransform
();
ll
=
new
GlowPoint
();
ll
.
x
=
x
;
ll
.
y
=
y
;
ur
=
new
GlowPoint
();
ur
.
x
=
x
+
w
;
ur
.
y
=
y
+
h
;
this
.
image_filename
=
imagefile
;
this
.
n_name
=
n_name
;
}
public
int
type
()
{
return
Glow
.
eObjectType_GrowImage
;
}
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
(
"GrowImage : "
+
line
);
switch
(
key
)
{
case
Glow
.
eSave_GrowImage
:
break
;
case
Glow
.
eSave_GrowImage_n_name
:
if
(
token
.
hasMoreTokens
())
n_name
=
token
.
nextToken
();
break
;
case
Glow
.
eSave_GrowImage_image_filename
:
if
(
token
.
hasMoreTokens
())
image_filename
=
token
.
nextToken
();
break
;
case
Glow
.
eSave_GrowImage_x_right
:
x_right
=
new
Double
(
token
.
nextToken
()).
doubleValue
();
break
;
case
Glow
.
eSave_GrowImage_x_left
:
x_left
=
new
Double
(
token
.
nextToken
()).
doubleValue
();
break
;
case
Glow
.
eSave_GrowImage_y_high
:
y_high
=
new
Double
(
token
.
nextToken
()).
doubleValue
();
break
;
case
Glow
.
eSave_GrowImage_y_low
:
y_low
=
new
Double
(
token
.
nextToken
()).
doubleValue
();
break
;
case
Glow
.
eSave_GrowImage_dynamicsize
:
dynamicsize
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_GrowImage_dynamic
:
if
(
cmn
.
dynamicsize
>
0
)
{
for
(
int
j
=
0
;
j
<
cmn
.
dynamicsize
;
j
++)
line
=
reader
.
readLine
();
// TODO handle backslash and citationmarks
}
break
;
case
Glow
.
eSave_GrowImage_trf
:
trf
.
open
(
reader
);
break
;
case
Glow
.
eSave_GrowImage_display_level
:
display_level
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_GrowImage_ll
:
ll
.
open
(
reader
);
break
;
case
Glow
.
eSave_GrowImage_ur
:
ur
.
open
(
reader
);
break
;
case
Glow
.
eSave_GrowImage_color_tone
:
color_tone
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_GrowImage_color_lightness
:
color_lightness
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_GrowImage_color_intensity
:
color_intensity
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_GrowImage_color_shift
:
color_shift
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_GrowImage_fixposition
:
fixposition
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_End
:
end_found
=
true
;
break
;
default
:
System
.
out
.
println
(
"Syntax error in GrowImage"
);
break
;
}
if
(
end_found
)
break
;
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"IOException GrowImage"
);
}
}
public
int
eventHandler
(
GlowEvent
event
,
double
fx
,
double
fy
)
{
GlowPointDX
rp
;
switch
(
event
.
event
)
{
case
Glow
.
eEvent_CursorMotion
:
return
0
;
default
:
;
}
rp
=
trf
.
reverse
(
fx
,
fy
);
//rp = new GlowPoint();
//rp.x = fx;
//rp.y = fy;
if
(
ll
.
x
<=
rp
.
x
&&
rp
.
x
<=
ur
.
x
&&
ll
.
y
<=
rp
.
y
&&
rp
.
y
<=
ur
.
y
)
{
System
.
out
.
println
(
"Event handler: Hit in image"
);
return
1
;
}
else
return
0
;
}
public
void
draw
()
{
draw
(
null
,
0
,
0
,
null
,
null
);
}
public
void
draw
(
GlowTransform
t
,
int
highlight
,
int
hot
,
Object
node
,
Object
colornode
)
{
if
(
cmn
.
nodraw
!=
0
)
return
;
int
chot
=
0
;
int
idx
;
int
drawtype
;
if
(
node
!=
null
&&
((
GrowNode
)
node
).
line_width
!=
0
)
idx
=
(
int
)(
cmn
.
mw
.
zoom_factor_y
/
cmn
.
mw
.
base_zoom_factor
*
((
GrowNode
)
node
).
line_width
-
1
);
else
idx
=
(
int
)(
cmn
.
mw
.
zoom_factor_y
/
cmn
.
mw
.
base_zoom_factor
-
1
);
idx
+=
hot
;
idx
=
Math
.
max
(
0
,
idx
);
idx
=
Math
.
min
(
idx
,
Glow
.
DRAW_TYPE_SIZE
-
1
);
int
x1
,
y1
,
x2
,
y2
,
ll_x
,
ll_y
,
ur_x
,
ur_y
;
if
(
t
==
null
)
{
x1
=
(
int
)(
trf
.
x
(
ll
.
x
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_x
+
0.5
)
-
cmn
.
mw
.
offset_x
;
y1
=
(
int
)(
trf
.
y
(
ll
.
x
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_y
+
0.5
)
-
cmn
.
mw
.
offset_y
;
x2
=
(
int
)(
trf
.
x
(
ur
.
x
,
ur
.
y
)
*
cmn
.
mw
.
zoom_factor_x
+
0.5
)
-
cmn
.
mw
.
offset_x
;
y2
=
(
int
)(
trf
.
y
(
ur
.
x
,
ur
.
y
)
*
cmn
.
mw
.
zoom_factor_y
+
0.5
)
-
cmn
.
mw
.
offset_y
;
}
else
{
x1
=
(
int
)(
trf
.
x
(
t
,
ll
.
x
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_x
+
0.5
)
-
cmn
.
mw
.
offset_x
;
y1
=
(
int
)(
trf
.
y
(
t
,
ll
.
x
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_y
+
0.5
)
-
cmn
.
mw
.
offset_y
;
x2
=
(
int
)(
trf
.
x
(
t
,
ur
.
x
,
ur
.
y
)
*
cmn
.
mw
.
zoom_factor_x
+
0.5
)
-
cmn
.
mw
.
offset_x
;
y2
=
(
int
)(
trf
.
y
(
t
,
ur
.
x
,
ur
.
y
)
*
cmn
.
mw
.
zoom_factor_y
+
0.5
)
-
cmn
.
mw
.
offset_y
;
}
ll_x
=
Math
.
min
(
x1
,
x2
);
ur_x
=
Math
.
max
(
x1
,
x2
);
ll_y
=
Math
.
min
(
y1
,
y2
);
ur_y
=
Math
.
max
(
y1
,
y2
);
cmn
.
gdraw
.
rect
(
ll_x
,
ll_y
,
ur_x
-
ll_x
,
ur_y
-
ll_y
,
Glow
.
eDrawType_Line
,
idx
,
0
);
}
public
void
get_borders
(
GlowTransform
t
,
GlowGeometry
g
)
{
double
ll_x
,
ur_x
,
ll_y
,
ur_y
,
x1
,
x2
,
y1
,
y2
;
if
(
t
!=
null
)
{
x1
=
trf
.
x
(
t
,
ll
.
x
,
ll
.
y
);
x2
=
trf
.
x
(
t
,
ur
.
x
,
ur
.
y
);
y1
=
trf
.
y
(
t
,
ll
.
x
,
ll
.
y
);
y2
=
trf
.
y
(
t
,
ur
.
x
,
ur
.
y
);
}
else
{
x1
=
trf
.
x
(
ll
.
x
,
ll
.
y
);
x2
=
trf
.
x
(
ur
.
x
,
ur
.
y
);
y1
=
trf
.
y
(
ll
.
x
,
ll
.
y
);
y2
=
trf
.
y
(
ur
.
x
,
ur
.
y
);
}
ll_x
=
Math
.
min
(
x1
,
x2
);
ur_x
=
Math
.
max
(
x1
,
x2
);
ll_y
=
Math
.
min
(
y1
,
y2
);
ur_y
=
Math
.
max
(
y1
,
y2
);
if
(
ll_x
<
g
.
ll_x
)
g
.
ll_x
=
ll_x
;
if
(
ur_x
>
g
.
ur_x
)
g
.
ur_x
=
ur_x
;
if
(
ll_y
<
g
.
ll_y
)
g
.
ll_y
=
ll_y
;
if
(
ur_y
>
g
.
ur_y
)
g
.
ur_y
=
ur_y
;
}
public
void
get_node_borders
()
{
GlowGeometry
g
=
new
GlowGeometry
();
g
.
ll_x
=
g
.
ll_y
=
1
e37
;
g
.
ur_x
=
g
.
ur_y
=
-
1
e37
;
get_borders
(
null
,
g
);
x_left
=
g
.
ll_x
;
x_right
=
g
.
ur_x
;
y_low
=
g
.
ll_y
;
y_high
=
g
.
ur_y
;
}
void
set_scale
(
double
scale_x
,
double
scale_y
,
double
x0
,
double
y0
,
int
type
)
{
double
old_x_left
,
old_x_right
,
old_y_low
,
old_y_high
;
if
(
trf
.
s_a11
!=
0
&&
trf
.
s_a22
!=
0
&&
Math
.
abs
(
scale_x
-
trf
.
a11
/
trf
.
s_a11
)
<
Float
.
MIN_VALUE
&&
Math
.
abs
(
scale_y
-
trf
.
a22
/
trf
.
s_a22
)
<
Float
.
MIN_VALUE
)
return
;
switch
(
type
)
{
case
Glow
.
eScaleType_LowerLeft
:
x0
=
x_left
;
y0
=
y_low
;
break
;
case
Glow
.
eScaleType_LowerRight
:
x0
=
x_right
;
y0
=
y_low
;
break
;
case
Glow
.
eScaleType_UpperRight
:
x0
=
x_right
;
y0
=
y_high
;
break
;
case
Glow
.
eScaleType_UpperLeft
:
x0
=
x_left
;
y0
=
y_high
;
break
;
case
Glow
.
eScaleType_FixPoint
:
break
;
case
Glow
.
eScaleType_Center
:
x0
=
(
x_left
+
x_right
)
/
2
;
y0
=
(
y_low
+
y_high
)
/
2
;
break
;
default
:
;
}
old_x_left
=
x_left
;
old_x_right
=
x_right
;
old_y_low
=
y_low
;
old_y_high
=
y_high
;
trf
.
scale_from_stored
(
scale_x
,
scale_y
,
x0
,
y0
);
get_node_borders
();
switch
(
type
)
{
case
Glow
.
eScaleType_LowerLeft
:
x_left
=
old_x_left
;
y_low
=
old_y_low
;
break
;
case
Glow
.
eScaleType_LowerRight
:
x_right
=
old_x_right
;
y_low
=
old_y_low
;
break
;
case
Glow
.
eScaleType_UpperRight
:
x_right
=
old_x_right
;
y_high
=
old_y_high
;
break
;
case
Glow
.
eScaleType_UpperLeft
:
x_left
=
old_x_left
;
y_high
=
old_y_high
;
break
;
case
Glow
.
eScaleType_FixPoint
:
break
;
case
Glow
.
eScaleType_Center
:
x0
=
(
x_left
+
x_right
)
/
2
;
y0
=
(
y_low
+
y_high
)
/
2
;
break
;
default
:
;
}
cmn
.
ctx
.
draw
(
old_x_left
*
cmn
.
mw
.
zoom_factor_x
-
cmn
.
mw
.
offset_x
-
Glow
.
DRAW_MP
,
old_y_low
*
cmn
.
mw
.
zoom_factor_y
-
cmn
.
mw
.
offset_y
-
Glow
.
DRAW_MP
,
old_x_right
*
cmn
.
mw
.
zoom_factor_x
-
cmn
.
mw
.
offset_x
+
Glow
.
DRAW_MP
,
old_y_high
*
cmn
.
mw
.
zoom_factor_y
-
cmn
.
mw
.
offset_y
+
Glow
.
DRAW_MP
);
cmn
.
ctx
.
draw
(
x_left
*
cmn
.
mw
.
zoom_factor_x
-
cmn
.
mw
.
offset_x
-
Glow
.
DRAW_MP
,
y_low
*
cmn
.
mw
.
zoom_factor_y
-
cmn
.
mw
.
offset_y
-
Glow
.
DRAW_MP
,
x_right
*
cmn
.
mw
.
zoom_factor_x
-
cmn
.
mw
.
offset_x
+
Glow
.
DRAW_MP
,
y_high
*
cmn
.
mw
.
zoom_factor_y
-
cmn
.
mw
.
offset_y
+
Glow
.
DRAW_MP
);
}
}
java/jpwr/jopg/src/GrowWindow.java
0 → 100644
View file @
df7760d9
/*
* 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
;
}
}
java/jpwr/jopg/src/os_templ/hw_templ/makefile
View file @
df7760d9
...
...
@@ -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,
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment