Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
ScheduLearn
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nils Vreman
ScheduLearn
Commits
c43ae92c
Commit
c43ae92c
authored
6 years ago
by
Nils Vreman
Browse files
Options
Downloads
Patches
Plain Diff
Fixed problem with text disappearing when list option pressed
parent
91a440f6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
gui/menu/help/HelpMenuPane.java
+1
-1
1 addition, 1 deletion
gui/menu/help/HelpMenuPane.java
gui/menu/help/ScheduleTab.java
+7
-6
7 additions, 6 deletions
gui/menu/help/ScheduleTab.java
gui/menu/help/TabPanel.java
+10
-3
10 additions, 3 deletions
gui/menu/help/TabPanel.java
with
18 additions
and
10 deletions
gui/menu/help/HelpMenuPane.java
+
1
−
1
View file @
c43ae92c
...
@@ -18,7 +18,7 @@ public class HelpMenuPane extends JFrame {
...
@@ -18,7 +18,7 @@ public class HelpMenuPane extends JFrame {
tabbedPane
.
addTab
(
"Schedule"
,
new
ScheduleTab
());
tabbedPane
.
addTab
(
"Schedule"
,
new
ScheduleTab
());
tabbedPane
.
setTabLayoutPolicy
(
JTabbedPane
.
SCROLL_TAB_LAYOUT
);
tabbedPane
.
setTabLayoutPolicy
(
JTabbedPane
.
SCROLL_TAB_LAYOUT
);
tabbedPane
.
setPreferredSize
(
new
Dimension
(
4
00
,
400
));
tabbedPane
.
setPreferredSize
(
new
Dimension
(
5
00
,
400
));
add
(
CENTER
,
tabbedPane
);
add
(
CENTER
,
tabbedPane
);
...
...
This diff is collapsed.
Click to expand it.
gui/menu/help/ScheduleTab.java
+
7
−
6
View file @
c43ae92c
...
@@ -5,16 +5,17 @@ public class ScheduleTab extends TabPanel {
...
@@ -5,16 +5,17 @@ public class ScheduleTab extends TabPanel {
private
static
final
String
[]
listOptions
=
new
String
[]
{
private
static
final
String
[]
listOptions
=
new
String
[]
{
"Schedule"
,
"Schedule"
,
"Solution"
,
"Solution"
,
"Checking Solution"
,
"Check Solution"
,
"Clearing Cells"
,
"Clear Cells"
,
"Clearing Strategy"
};
"Clear Strategy"
};
private
static
final
String
[]
helpTexts
=
new
String
[]
{
private
static
final
String
[]
helpTexts
=
new
String
[]
{
"Schedule"
,
"Schedule"
,
"Solution"
,
"Solution"
,
"Check
ing
Solution"
,
"Check Solution"
,
"Clear
ing
Cells"
,
"Clear Cells"
,
"Clear
ing
Strategy"
};
"Clear Strategy"
};
public
ScheduleTab
()
{
public
ScheduleTab
()
{
super
(
listOptions
,
helpTexts
);
super
(
listOptions
,
helpTexts
);
...
...
This diff is collapsed.
Click to expand it.
gui/menu/help/TabPanel.java
+
10
−
3
View file @
c43ae92c
...
@@ -3,20 +3,23 @@ package gui.menu.help;
...
@@ -3,20 +3,23 @@ package gui.menu.help;
import
javax.swing.JPanel
;
import
javax.swing.JPanel
;
import
javax.swing.JTextField
;
import
javax.swing.JTextField
;
import
java.awt.BorderLayout
;
import
java.awt.BorderLayout
;
import
java.awt.Dimension
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.HashMap
;
public
abstract
class
TabPanel
extends
JPanel
implements
EventListener
{
public
abstract
class
TabPanel
extends
JPanel
implements
EventListener
{
private
final
String
[]
listOptions
;
private
final
String
[]
listOptions
;
private
OptionList
list
;
private
Map
<
String
,
JTextField
>
helpTexts
=
new
HashMap
<>();
private
Map
<
String
,
JTextField
>
helpTexts
=
new
HashMap
<>();
public
TabPanel
(
String
[]
listOptions
,
String
[]
fieldTexts
)
{
public
TabPanel
(
String
[]
listOptions
,
String
[]
fieldTexts
)
{
super
(
new
BorderLayout
());
super
(
new
BorderLayout
());
this
.
listOptions
=
listOptions
;
this
.
listOptions
=
listOptions
;
OptionList
list
=
new
OptionList
(
listOptions
);
list
=
new
OptionList
(
listOptions
);
list
.
addListener
(
this
);
list
.
addListener
(
this
);
list
.
setPreferredSize
(
new
Dimension
(
120
,
400
));
for
(
int
i
=
0
;
i
<
listOptions
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
listOptions
.
length
;
i
++)
{
JTextField
htf
=
new
HelpTextField
(
fieldTexts
[
i
]);
JTextField
htf
=
new
HelpTextField
(
fieldTexts
[
i
]);
...
@@ -28,10 +31,14 @@ public abstract class TabPanel extends JPanel implements EventListener {
...
@@ -28,10 +31,14 @@ public abstract class TabPanel extends JPanel implements EventListener {
}
}
public
void
update
(
String
tab
)
{
public
void
update
(
String
tab
)
{
removeAll
();
add
(
BorderLayout
.
WEST
,
list
);
if
(
helpTexts
.
containsKey
(
tab
))
{
if
(
helpTexts
.
containsKey
(
tab
))
{
add
(
BorderLayout
.
CENTER
,
helpTexts
.
get
(
tab
));
add
(
BorderLayout
.
CENTER
,
helpTexts
.
get
(
tab
));
}
revalidate
();
revalidate
();
repaint
();
repaint
();
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment