Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
YoshikoWrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philipp Spohr
YoshikoWrapper
Commits
aca4c2a4
Commit
aca4c2a4
authored
7 years ago
by
Philipp Spohr
Browse files
Options
Downloads
Patches
Plain Diff
Added scroll bar to option panels to guarantee that run button is always visible
parent
e5764cff
Branches
Branches containing commit
Tags
1.1.4
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/MainPanel.java
+42
-13
42 additions, 13 deletions
.../de/hhu/ba/yoshikoWrapper/swing/components/MainPanel.java
with
42 additions
and
13 deletions
src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/MainPanel.java
+
42
−
13
View file @
aca4c2a4
...
@@ -33,6 +33,7 @@ import java.awt.event.ActionListener;
...
@@ -33,6 +33,7 @@ import java.awt.event.ActionListener;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
javax.swing.BorderFactory
;
import
javax.swing.GroupLayout
;
import
javax.swing.GroupLayout
;
import
javax.swing.GroupLayout.Alignment
;
import
javax.swing.GroupLayout.Alignment
;
import
javax.swing.Icon
;
import
javax.swing.Icon
;
...
@@ -42,7 +43,9 @@ import javax.swing.JComponent;
...
@@ -42,7 +43,9 @@ import javax.swing.JComponent;
import
javax.swing.JDialog
;
import
javax.swing.JDialog
;
import
javax.swing.JOptionPane
;
import
javax.swing.JOptionPane
;
import
javax.swing.JPanel
;
import
javax.swing.JPanel
;
import
javax.swing.JScrollPane
;
import
javax.swing.LayoutStyle
;
import
javax.swing.LayoutStyle
;
import
javax.swing.ScrollPaneConstants
;
import
org.cytoscape.application.swing.CytoPanelComponent
;
import
org.cytoscape.application.swing.CytoPanelComponent
;
import
org.cytoscape.application.swing.CytoPanelName
;
import
org.cytoscape.application.swing.CytoPanelName
;
...
@@ -69,6 +72,7 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -69,6 +72,7 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
//SWING COMPONENTS
//SWING COMPONENTS
private
final
YoshikoHeader
header
;
private
final
YoshikoHeader
header
;
private
final
JButton
about
;
private
final
JButton
about
;
...
@@ -76,6 +80,8 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -76,6 +80,8 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
private
final
JCheckBox
showAdvancedOptions
;
private
final
JCheckBox
showAdvancedOptions
;
private
final
ArrayList
<
JComponent
>
advancedOptions
;
private
final
ArrayList
<
JComponent
>
advancedOptions
;
private
final
JScrollPane
scrollPane
;
private
final
JPanel
scrollableContent
;
//Those two work with factories whysoever
//Those two work with factories whysoever
private
final
BasicCollapsiblePanel
langPanel
;
private
final
BasicCollapsiblePanel
langPanel
;
private
final
BasicCollapsiblePanel
libraryPanel
;
private
final
BasicCollapsiblePanel
libraryPanel
;
...
@@ -91,6 +97,8 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -91,6 +97,8 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
private
final
BasicCollapsiblePanel
opWrapper
;
private
final
BasicCollapsiblePanel
opWrapper
;
private
final
OperationModePanel
opModePanel
;
private
final
OperationModePanel
opModePanel
;
private
final
JButton
runButton
;
/**
/**
* Main constructor, creates a new Panel and initializes subcomponents
* Main constructor, creates a new Panel and initializes subcomponents
*/
*/
...
@@ -112,6 +120,11 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -112,6 +120,11 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
showAdvancedOptions
=
new
JCheckBox
(
LocalizationManager
.
get
(
"showAdvanced"
));
showAdvancedOptions
=
new
JCheckBox
(
LocalizationManager
.
get
(
"showAdvanced"
));
showAdvancedOptions
.
addActionListener
(
toggleAdvancedOptionsListener
);
showAdvancedOptions
.
addActionListener
(
toggleAdvancedOptionsListener
);
scrollableContent
=
new
JPanel
();
scrollPane
=
new
JScrollPane
(
scrollableContent
);
scrollPane
.
setHorizontalScrollBarPolicy
(
ScrollPaneConstants
.
HORIZONTAL_SCROLLBAR_NEVER
);
scrollPane
.
setBorder
(
BorderFactory
.
createEmptyBorder
());
langPanel
=
LanguageSwitcherPanelFactory
.
createLanguageSwitcherPanel
();
langPanel
=
LanguageSwitcherPanelFactory
.
createLanguageSwitcherPanel
();
libraryPanel
=
LibraryPanelFactory
.
createLibraryPanel
();
libraryPanel
=
LibraryPanelFactory
.
createLibraryPanel
();
...
@@ -133,19 +146,23 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -133,19 +146,23 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
reductionRulesChooser
=
new
ReductionRulesChooser
();
reductionRulesChooser
=
new
ReductionRulesChooser
();
reductionWrapper
.
add
(
reductionRulesChooser
);
reductionWrapper
.
add
(
reductionRulesChooser
);
JButton
runButton
=
new
JButton
(
LocalizationManager
.
get
(
"run"
));
runButton
=
new
JButton
(
LocalizationManager
.
get
(
"run"
));
runButton
.
addActionListener
(
buttonListener
);
runButton
.
addActionListener
(
buttonListener
);
//Add components to main panel
//Add components to main panel
SwingUtil
.
addAll
(
this
,
SwingUtil
.
addAll
(
scrollableContent
,
header
,
about
,
showAdvancedOptions
,
langPanel
,
langPanel
,
libraryPanel
,
libraryPanel
,
ecPanelWrapper
,
ecPanelWrapper
,
reductionWrapper
,
reductionWrapper
,
opWrapper
,
opWrapper
);
SwingUtil
.
addAll
(
this
,
header
,
about
,
showAdvancedOptions
,
scrollPane
,
runButton
runButton
);
);
...
@@ -160,12 +177,20 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -160,12 +177,20 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
showAdvancedOptions
(
false
);
showAdvancedOptions
(
false
);
applyLayout
();
}
private
void
applyLayout
()
{
//Layout
//Layout
GroupLayout
layout
=
new
GroupLayout
(
this
);
GroupLayout
layout
=
new
GroupLayout
(
this
);
GroupLayout
scrollLayout
=
new
GroupLayout
(
scrollableContent
);
layout
.
setAutoCreateGaps
(
true
);
layout
.
setAutoCreateGaps
(
true
);
layout
.
setAutoCreateContainerGaps
(
true
);
layout
.
setAutoCreateContainerGaps
(
true
);
scrollLayout
.
setAutoCreateGaps
(
true
);
scrollLayout
.
setAutoCreateContainerGaps
(
true
);
layout
.
setHorizontalGroup
(
layout
.
createParallelGroup
(
Alignment
.
LEADING
,
true
)
layout
.
setHorizontalGroup
(
layout
.
createParallelGroup
(
Alignment
.
LEADING
,
true
)
.
addGroup
(
layout
.
createSequentialGroup
()
.
addGroup
(
layout
.
createSequentialGroup
()
.
addComponent
(
header
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
header
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
...
@@ -175,12 +200,16 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -175,12 +200,16 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
)
)
.
addGap
(
4
)
.
addGap
(
4
)
.
addComponent
(
showAdvancedOptions
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
showAdvancedOptions
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
scrollPane
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
runButton
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
);
scrollLayout
.
setHorizontalGroup
(
scrollLayout
.
createParallelGroup
(
Alignment
.
LEADING
,
true
)
.
addComponent
(
langPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
langPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
libraryPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
libraryPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
ecPanelWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
ecPanelWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
reductionWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
reductionWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
opWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
opWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
runButton
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
);
);
layout
.
setVerticalGroup
(
layout
.
createSequentialGroup
()
layout
.
setVerticalGroup
(
layout
.
createSequentialGroup
()
...
@@ -190,16 +219,20 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -190,16 +219,20 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
)
)
.
addGap
(
4
)
.
addGap
(
4
)
.
addComponent
(
showAdvancedOptions
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
showAdvancedOptions
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
scrollPane
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
DEFAULT_SIZE
)
.
addComponent
(
runButton
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
);
scrollLayout
.
setVerticalGroup
(
scrollLayout
.
createSequentialGroup
()
.
addComponent
(
langPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
langPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
libraryPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
libraryPanel
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
ecPanelWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
ecPanelWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
reductionWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
reductionWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
opWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
opWrapper
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
.
addComponent
(
runButton
,
DEFAULT_SIZE
,
DEFAULT_SIZE
,
PREFERRED_SIZE
)
);
);
this
.
setLayout
(
layout
);
this
.
setLayout
(
layout
);
scrollableContent
.
setLayout
(
scrollLayout
);
}
}
private
ActionListener
toggleAdvancedOptionsListener
=
new
ActionListener
()
{
private
ActionListener
toggleAdvancedOptionsListener
=
new
ActionListener
()
{
...
@@ -293,10 +326,6 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
...
@@ -293,10 +326,6 @@ public class MainPanel extends JPanel implements CytoPanelComponent {
//GETTER / SETTER
//GETTER / SETTER
public
ColumnMapper
getColumnMapper
()
{
return
ecPanel
.
getColumnMapper
();
}
public
Component
getComponent
()
{
public
Component
getComponent
()
{
return
this
;
return
this
;
}
}
...
...
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