Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Core_Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
BioinformaticDataCompression
BigDataViewer_Core_Extension
Commits
851f1dab
Commit
851f1dab
authored
Sep 7, 2020
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
Clean up
parent
5ec5380c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/bdv/ui/BdvDefaultCards.java
+16
-20
16 additions, 20 deletions
src/main/java/bdv/ui/BdvDefaultCards.java
src/main/java/bdv/viewer/ViewerPanel.java
+2
-2
2 additions, 2 deletions
src/main/java/bdv/viewer/ViewerPanel.java
with
18 additions
and
22 deletions
src/main/java/bdv/ui/BdvDefaultCards.java
+
16
−
20
View file @
851f1dab
...
@@ -86,7 +86,7 @@ public class BdvDefaultCards
...
@@ -86,7 +86,7 @@ public class BdvDefaultCards
tablePanel
.
setPreferredSize
(
new
Dimension
(
300
,
245
)
);
tablePanel
.
setPreferredSize
(
new
Dimension
(
300
,
245
)
);
// -- Groups tree --
// -- Groups tree --
SourceGroupTree
tree
=
new
SourceGroupTree
(
state
,
viewer
.
getOptionValues
().
getInputTriggerConfig
()
);
final
SourceGroupTree
tree
=
new
SourceGroupTree
(
state
,
viewer
.
getOptionValues
().
getInputTriggerConfig
()
);
// tree.setPreferredSize( new Dimension( 300, 200 ) );
// tree.setPreferredSize( new Dimension( 300, 200 ) );
tree
.
setVisibleRowCount
(
10
);
tree
.
setVisibleRowCount
(
10
);
tree
.
setEditable
(
true
);
tree
.
setEditable
(
true
);
...
@@ -104,7 +104,6 @@ public class BdvDefaultCards
...
@@ -104,7 +104,6 @@ public class BdvDefaultCards
treePanel
.
add
(
editPanelTree
,
BorderLayout
.
SOUTH
);
treePanel
.
add
(
editPanelTree
,
BorderLayout
.
SOUTH
);
treePanel
.
setPreferredSize
(
new
Dimension
(
300
,
225
)
);
treePanel
.
setPreferredSize
(
new
Dimension
(
300
,
225
)
);
// -- handle focus --
new
FocusListener
(
tablePanel
,
table
,
treePanel
,
tree
);
new
FocusListener
(
tablePanel
,
table
,
treePanel
,
tree
);
cards
.
addCard
(
DEFAULT_VIEWERMODES_CARD
,
"Display Modes"
,
new
DisplaySettingsPanel
(
viewer
.
state
()
),
true
,
new
Insets
(
0
,
4
,
4
,
0
)
);
cards
.
addCard
(
DEFAULT_VIEWERMODES_CARD
,
"Display Modes"
,
new
DisplaySettingsPanel
(
viewer
.
state
()
),
true
,
new
Insets
(
0
,
4
,
4
,
0
)
);
...
@@ -114,31 +113,26 @@ public class BdvDefaultCards
...
@@ -114,31 +113,26 @@ public class BdvDefaultCards
private
static
class
FocusListener
implements
PropertyChangeListener
private
static
class
FocusListener
implements
PropertyChangeListener
{
{
private
final
KeyboardFocusManager
keyboardFocusManager
;
private
final
KeyboardFocusManager
currentKeyboardFocusManager
;
private
final
WeakReference
<
JPanel
>
tablePanel
;
private
final
WeakReference
<
JPanel
>
tablePanel
;
private
final
WeakReference
<
SourceTable
>
table
;
private
final
WeakReference
<
SourceTable
>
table
;
private
final
WeakReference
<
JPanel
>
treePanel
;
private
final
WeakReference
<
JPanel
>
treePanel
;
private
final
WeakReference
<
SourceGroupTree
>
tree
;
private
final
WeakReference
<
SourceGroupTree
>
tree
;
static
final
int
MAX_DEPTH
=
8
;
static
final
int
MAX_DEPTH
=
8
;
boolean
tableFocused
;
boolean
tableFocused
;
boolean
treeFocused
;
boolean
treeFocused
;
FocusListener
(
JPanel
tablePanel
,
SourceTable
table
,
JPanel
treePanel
,
SourceGroupTree
tree
)
FocusListener
(
final
JPanel
tablePanel
,
final
SourceTable
table
,
final
JPanel
treePanel
,
final
SourceGroupTree
tree
)
{
{
this
.
tablePanel
=
new
WeakReference
<>(
tablePanel
);
this
.
tablePanel
=
new
WeakReference
<>(
tablePanel
);
this
.
table
=
new
WeakReference
<>(
table
);
this
.
table
=
new
WeakReference
<>(
table
);
this
.
treePanel
=
new
WeakReference
<>(
treePanel
);
this
.
treePanel
=
new
WeakReference
<>(
treePanel
);
this
.
tree
=
new
WeakReference
<>(
tree
);
this
.
tree
=
new
WeakReference
<>(
tree
);
currentKeyboardFocusManager
=
KeyboardFocusManager
.
getCurrentKeyboardFocusManager
();
currentKeyboardFocusManager
.
addPropertyChangeListener
(
"focusOwner"
,
this
);
keyboardFocusManager
=
KeyboardFocusManager
.
getCurrentKeyboardFocusManager
();
keyboardFocusManager
.
addPropertyChangeListener
(
"focusOwner"
,
this
);
}
}
void
focusTable
(
final
boolean
focus
)
void
focusTable
(
final
boolean
focus
)
...
@@ -146,7 +140,7 @@ public class BdvDefaultCards
...
@@ -146,7 +140,7 @@ public class BdvDefaultCards
if
(
focus
!=
tableFocused
)
if
(
focus
!=
tableFocused
)
{
{
tableFocused
=
focus
;
tableFocused
=
focus
;
SourceTable
table
=
this
.
table
.
get
();
final
SourceTable
table
=
this
.
table
.
get
();
if
(
table
!=
null
)
if
(
table
!=
null
)
table
.
setSelectionBackground
(
focus
);
table
.
setSelectionBackground
(
focus
);
}
}
...
@@ -157,7 +151,7 @@ public class BdvDefaultCards
...
@@ -157,7 +151,7 @@ public class BdvDefaultCards
if
(
focus
!=
treeFocused
)
if
(
focus
!=
treeFocused
)
{
{
treeFocused
=
focus
;
treeFocused
=
focus
;
SourceGroupTree
tree
=
this
.
tree
.
get
();
final
SourceGroupTree
tree
=
this
.
tree
.
get
();
if
(
tree
!=
null
)
if
(
tree
!=
null
)
tree
.
setSelectionBackground
(
focus
);
tree
.
setSelectionBackground
(
focus
);
}
}
...
@@ -166,28 +160,30 @@ public class BdvDefaultCards
...
@@ -166,28 +160,30 @@ public class BdvDefaultCards
@Override
@Override
public
void
propertyChange
(
final
PropertyChangeEvent
evt
)
public
void
propertyChange
(
final
PropertyChangeEvent
evt
)
{
{
if
(
tablePanel
.
get
()
==
null
&&
treePanel
.
get
()
==
null
)
final
JPanel
tablePanel
=
this
.
tablePanel
.
get
();
final
JPanel
treePanel
=
this
.
treePanel
.
get
();
if
(
tablePanel
==
null
&&
treePanel
==
null
)
{
{
currentK
eyboardFocusManager
.
removePropertyChangeListener
(
"focusOwner"
,
this
);
k
eyboardFocusManager
.
removePropertyChangeListener
(
"focusOwner"
,
this
);
return
;
return
;
}
}
if
(
evt
.
getNewValue
()
instanceof
JComponent
)
if
(
evt
.
getNewValue
()
instanceof
JComponent
)
{
{
JComponent
component
=
(
JComponent
)
evt
.
getNewValue
();
final
JComponent
component
=
(
JComponent
)
evt
.
getNewValue
();
for
(
int
i
=
0
;
i
<
MAX_DEPTH
;
++
i
)
for
(
int
i
=
0
;
i
<
MAX_DEPTH
;
++
i
)
{
{
Container
parent
=
component
.
getParent
();
final
Container
parent
=
component
.
getParent
();
if
(
!(
parent
instanceof
JComponent
)
)
if
(
!(
parent
instanceof
JComponent
)
)
break
;
break
;
if
(
component
==
treePanel
.
get
()
)
if
(
component
==
treePanel
)
{
{
focusTable
(
false
);
focusTable
(
false
);
focusTree
(
true
);
focusTree
(
true
);
return
;
return
;
}
}
else
if
(
component
==
tablePanel
.
get
()
)
else
if
(
component
==
tablePanel
)
{
{
focusTable
(
true
);
focusTable
(
true
);
focusTree
(
false
);
focusTree
(
false
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/bdv/viewer/ViewerPanel.java
+
2
−
2
View file @
851f1dab
...
@@ -1155,7 +1155,7 @@ public class ViewerPanel extends JPanel implements OverlayRenderer, PainterThrea
...
@@ -1155,7 +1155,7 @@ public class ViewerPanel extends JPanel implements OverlayRenderer, PainterThrea
protected
static
class
RenderThreadFactory
implements
ThreadFactory
protected
static
class
RenderThreadFactory
implements
ThreadFactory
{
{
private
ThreadGroup
threadGroup
;
private
final
ThreadGroup
threadGroup
;
private
final
String
threadNameFormat
=
String
.
format
(
private
final
String
threadNameFormat
=
String
.
format
(
"bdv-panel-%d-thread-%%d"
,
"bdv-panel-%d-thread-%%d"
,
...
...
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