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
75901483
Commit
75901483
authored
Jun 24, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Label with username added and login frame improved
parent
3912277b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
98 additions
and
30 deletions
+98
-30
java/jpwr/jop/src/JopLoginApplet.java
java/jpwr/jop/src/JopLoginApplet.java
+2
-1
java/jpwr/jop/src/JopLoginFrame.java
java/jpwr/jop/src/JopLoginFrame.java
+14
-4
java/jpwr/jop/src/JopOpWindow.java
java/jpwr/jop/src/JopOpWindow.java
+43
-12
java/jpwr/jop/src/JopOpWindowApplet.java
java/jpwr/jop/src/JopOpWindowApplet.java
+7
-1
java/jpwr/jop/src/JopOpWindowFrame.java
java/jpwr/jop/src/JopOpWindowFrame.java
+5
-1
java/jpwr/jop/src/JopSession.java
java/jpwr/jop/src/JopSession.java
+8
-4
java/jpwr/jop/src/JopSessionIfc.java
java/jpwr/jop/src/JopSessionIfc.java
+2
-1
java/jpwr/jop/src/JopSessionRep.java
java/jpwr/jop/src/JopSessionRep.java
+17
-6
No files found.
java/jpwr/jop/src/JopLoginApplet.java
View file @
75901483
/*
* Proview $Id: JopLoginApplet.java,v 1.
2 2005-09-01 14:57:50
claes Exp $
* Proview $Id: JopLoginApplet.java,v 1.
3 2008-06-24 13:33:26
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -142,6 +142,7 @@ public class JopLoginApplet extends JApplet {
private
void
checkUser
()
{
String
user
=
textUser
.
getText
();
String
passwd
=
new
String
(
textPassword
.
getPassword
());
passwd
=
JopCrypt
.
crypt
(
"aa"
,
passwd
);
int
sts
=
gdh
.
login
(
user
,
passwd
);
if
(
sts
%
2
==
0
)
{
JOptionPane
.
showMessageDialog
(
this
,
"User not authorized"
,
...
...
java/jpwr/jop/src/JopLoginFrame.java
View file @
75901483
/*
* Proview $Id: JopLoginFrame.java,v 1.
2 2005-09-01 14:57:50
claes Exp $
* Proview $Id: JopLoginFrame.java,v 1.
3 2008-06-24 13:34:14
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -91,9 +91,7 @@ public class JopLoginFrame extends JFrame {
});
buttonClear
.
addActionListener
(
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
e
)
{
textUser
.
setText
(
""
);
textPassword
.
setText
(
""
);
labelMessage
.
setText
(
" "
);
clear
();
}
});
textUser
.
addActionListener
(
new
ActionListener
()
{
...
...
@@ -109,9 +107,17 @@ public class JopLoginFrame extends JFrame {
});
}
public
void
clear
()
{
textUser
.
setText
(
""
);
textPassword
.
setText
(
""
);
labelMessage
.
setText
(
" "
);
javax
.
swing
.
FocusManager
.
getCurrentManager
().
focusNextComponent
(
textUser
);
}
private
void
checkUser
()
{
String
user
=
textUser
.
getText
();
String
passwd
=
new
String
(
textPassword
.
getPassword
());
passwd
=
JopCrypt
.
crypt
(
"aa"
,
passwd
);
int
sts
=
session
.
getEngine
().
gdh
.
login
(
user
,
passwd
);
if
(
sts
%
2
==
0
)
{
JOptionPane
.
showMessageDialog
(
this
,
"User not authorized"
,
...
...
@@ -119,7 +125,11 @@ public class JopLoginFrame extends JFrame {
labelMessage
.
setText
(
" "
);
}
else
{
textUser
.
setText
(
""
);
textPassword
.
setText
(
""
);
labelMessage
.
setText
(
"User "
+
user
+
" logged in"
);
session
.
setOpWindowLabelText
(
user
+
" logged in"
);
hide
();
}
}
}
java/jpwr/jop/src/JopOpWindow.java
View file @
75901483
/*
* Proview $Id: JopOpWindow.java,v 1.
7 2007-01-30 06:52:55
claes Exp $
* Proview $Id: JopOpWindow.java,v 1.
8 2008-06-24 13:35:11
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -28,6 +28,7 @@ public class JopOpWindow extends JPanel {
JopSession
session
;
JopEngine
en
;
Object
root
;
JLabel
label
=
null
;
public
JopOpWindow
(
JopSession
session
,
Object
root
)
{
// super( BoxLayout.Y_AXIS);
...
...
@@ -46,19 +47,19 @@ public class JopOpWindow extends JPanel {
CdhrString
srettxt
=
en
.
gdh
.
getObjectInfoString
(
s
);
if
(
srettxt
.
evenSts
())
return
;
JLabel
label
=
new
JLabel
(
srettxt
.
str
);
JLabel
l
l
abel
=
new
JLabel
(
srettxt
.
str
);
Font
f
=
new
Font
(
"Helvetica"
,
Font
.
BOLD
,
24
);
label
.
setFont
(
f
);
this
.
add
(
label
);
l
l
abel
.
setFont
(
f
);
this
.
add
(
l
l
abel
);
s
=
sret
.
str
+
".Text"
;
srettxt
=
en
.
gdh
.
getObjectInfoString
(
s
);
if
(
srettxt
.
evenSts
())
return
;
label
=
new
JLabel
(
srettxt
.
str
);
l
l
abel
=
new
JLabel
(
srettxt
.
str
);
f
=
new
Font
(
"Helvetica"
,
Font
.
BOLD
,
16
);
label
.
setFont
(
f
);
this
.
add
(
label
);
l
l
abel
.
setFont
(
f
);
this
.
add
(
l
l
abel
);
this
.
add
(
new
JSeparator
());
...
...
@@ -66,11 +67,19 @@ public class JopOpWindow extends JPanel {
CdhrInt
iret
=
en
.
gdh
.
getObjectInfoInt
(
s
);
if
(
iret
.
evenSts
())
return
;
label
=
new
JLabel
();
this
.
add
(
label
);
OpWindButton
button
;
if
(
iret
.
value
!=
0
)
{
button
=
new
OpWindButton
(
session
,
""
,
"Login"
,
OpWindButton
.
LOGIN
);
this
.
add
(
button
);
button
=
new
OpWindButton
(
session
,
""
,
"Logout"
,
OpWindButton
.
LOGOUT
);
this
.
add
(
button
);
}
s
=
sret
.
str
+
".EnableAlarmList"
;
...
...
@@ -172,11 +181,12 @@ public class JopOpWindow extends JPanel {
public
static
final
int
WEBGRAPH
=
1
;
public
static
final
int
WEBLINK
=
2
;
public
static
final
int
LOGIN
=
3
;
public
static
final
int
NAVIGATOR
=
4
;
public
static
final
int
ALARMLIST
=
5
;
public
static
final
int
EVENTLOG
=
6
;
public
static
final
int
HELP
=
7
;
public
static
final
int
PROVIEW
=
8
;
public
static
final
int
LOGOUT
=
4
;
public
static
final
int
NAVIGATOR
=
5
;
public
static
final
int
ALARMLIST
=
6
;
public
static
final
int
EVENTLOG
=
7
;
public
static
final
int
HELP
=
8
;
public
static
final
int
PROVIEW
=
9
;
JopSession
session
;
String
action
;
int
type
;
...
...
@@ -199,27 +209,45 @@ public class JopOpWindow extends JPanel {
public
void
mouseReleased
(
MouseEvent
e
)
{
switch
(
type
)
{
case
NAVIGATOR:
if
(
!
en
.
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllPwr
))
break
;
session
.
openNavigator
(
null
);
break
;
case
LOGIN:
session
.
openLogin
();
break
;
case
LOGOUT:
en
.
gdh
.
logout
();
setLabelText
(
" "
);
break
;
case
ALARMLIST:
if
(
!
en
.
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllPwr
))
break
;
session
.
openAlarmList
();
break
;
case
EVENTLOG:
if
(
!
en
.
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllPwr
))
break
;
session
.
openEventLog
();
break
;
case
HELP:
if
(
!
en
.
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllPwr
))
break
;
session
.
executeCommand
(
"help index"
);
break
;
case
PROVIEW:
if
(
!
en
.
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllPwr
))
break
;
session
.
executeCommand
(
"open url \"$pwr_doc/sv_se/index.html\""
);
break
;
case
WEBGRAPH:
if
(
!
en
.
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllPwr
))
break
;
session
.
openGraphFrame
(
action
,
instance
,
scrollbar
,
false
);
break
;
case
WEBLINK:
if
(
!
en
.
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllPwr
))
break
;
String
cmd
=
"open url \""
+
action
+
"\""
;
session
.
executeCommand
(
cmd
);
break
;
...
...
@@ -235,7 +263,10 @@ public class JopOpWindow extends JPanel {
public
void
setInstance
(
String
instance
)
{
this
.
instance
=
instance
;
}
}
public
void
setLabelText
(
String
text
)
{
label
.
setText
(
text
);
}
}
...
...
java/jpwr/jop/src/JopOpWindowApplet.java
View file @
75901483
/*
* Proview $Id: JopOpWindowApplet.java,v 1.
2 2005-09-01 14:57:50
claes Exp $
* Proview $Id: JopOpWindowApplet.java,v 1.
3 2008-06-24 13:35:11
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -62,6 +62,10 @@ public class JopOpWindowApplet extends JopApplet
super
.
destroy
();
}
public
void
setLabelText
(
String
text
)
{
localPanel
.
setLabelText
(
text
);
}
public
void
init
()
{
super
.
init
();
...
...
@@ -88,5 +92,7 @@ public class JopOpWindowApplet extends JopApplet
public
void
stop
()
{
}
}
java/jpwr/jop/src/JopOpWindowFrame.java
View file @
75901483
/*
* Proview $Id: JopOpWindowFrame.java,v 1.
3 2005-09-01 14:57:50
claes Exp $
* Proview $Id: JopOpWindowFrame.java,v 1.
4 2008-06-24 13:35:11
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -51,6 +51,10 @@ public class JopOpWindowFrame extends JFrame {
pack
();
}
public
void
setLabelText
(
String
text
)
{
localPanel
.
setLabelText
(
text
);
}
private
void
init
()
{
contentPane
=
(
JPanel
)
this
.
getContentPane
();
contentPane
.
setLayout
(
borderLayout1
);
...
...
java/jpwr/jop/src/JopSession.java
View file @
75901483
/*
* Proview $Id: JopSession.java,v 1.
5 2007-01-30 06:52:55
claes Exp $
* Proview $Id: JopSession.java,v 1.
6 2008-06-24 13:35:11
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -120,9 +120,13 @@ public class JopSession {
return
((
JopSessionIfc
)
sessionRep
).
isOpWindowApplet
();
}
public
void
openSearch
(
String
object
){
public
void
openSearch
(
String
object
){
((
JopSessionIfc
)
sessionRep
).
openSearch
(
object
);
}
public
void
setOpWindowLabelText
(
String
text
){
((
JopSessionIfc
)
sessionRep
).
setOpWindowLabelText
(
text
);
}
}
...
...
java/jpwr/jop/src/JopSessionIfc.java
View file @
75901483
/*
* Proview $Id: JopSessionIfc.java,v 1.
5 2007-01-30 06:52:55
claes Exp $
* Proview $Id: JopSessionIfc.java,v 1.
6 2008-06-24 13:35:11
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -42,4 +42,5 @@ public interface JopSessionIfc {
public
boolean
isApplication
();
public
boolean
isOpWindowApplet
();
public
void
openSearch
(
String
object
);
public
void
setOpWindowLabelText
(
String
text
);
}
java/jpwr/jop/src/JopSessionRep.java
View file @
75901483
/*
* Proview $Id: JopSessionRep.java,v 1.1
1 2007-01-30 13:02:27
claes Exp $
* Proview $Id: JopSessionRep.java,v 1.1
2 2008-06-24 13:35:11
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -102,6 +102,7 @@ public class JopSessionRep implements JopSessionIfc {
login
.
setVisible
(
true
);
}
else
{
login
.
clear
();
login
.
setVisible
(
true
);
login
.
setState
(
Frame
.
NORMAL
);
login
.
toFront
();
...
...
@@ -300,12 +301,22 @@ public class JopSessionRep implements JopSessionIfc {
public
boolean
isOpWindowApplet
()
{
return
(
root
instanceof
JopOpWindowApplet
);
}
public
boolean
isOpWindowFrame
()
{
return
(
root
instanceof
JopOpWindowFrame
);
}
public
void
openSearch
(
String
object
){
HistSearch
HSWindow
=
new
HistSearch
(
object
,
session
);
HSWindow
.
pack
();
HSWindow
.
setVisible
(
true
);
}
public
void
setOpWindowLabelText
(
String
text
)
{
if
(
isOpWindowApplet
())
((
JopOpWindowApplet
)
root
).
setLabelText
(
text
);
else
if
(
isOpWindowFrame
())
((
JopOpWindowFrame
)
root
).
setLabelText
(
text
);
}
}
...
...
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