Skip to content

Commit

Permalink
SwingNodePropertyEditor: Use correct sizing for transfer function/his…
Browse files Browse the repository at this point in the history
…togram chart
  • Loading branch information
skalarproduktraum committed Apr 11, 2024
1 parent 3aa0229 commit dfae453
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/kotlin/sc/iview/ui/SwingNodePropertyEditor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import graphics.scenery.Settings
import graphics.scenery.volumes.TransferFunctionEditor
import graphics.scenery.volumes.Volume
import net.miginfocom.swing.MigLayout
import org.jfree.chart.ChartPanel
import org.joml.Quaternionf
import org.joml.Vector3f
import org.scijava.Context
Expand Down Expand Up @@ -66,7 +67,6 @@ import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import java.util.concurrent.TimeUnit
import java.util.concurrent.locks.ReentrantLock
import javax.swing.JCheckBox
import javax.swing.JFrame
import javax.swing.JLabel
import javax.swing.JMenuItem
Expand Down Expand Up @@ -366,10 +366,7 @@ class SwingNodePropertyEditor(private val sciView: SciView) : UIComponent<JPanel
val parent = inputPanel.component.components.find { it.name == "group:Volume" } as? JPanel
val tfe = TransferFunctionEditor(sceneNode)
tfe.preferredSize = Dimension(300, 300)

// the next line is a workaround for a ChangeListener being attached to the Show Histogram checkbox,
// which will continously show/hide the histogram on mouse over. We disable rollover to prevent this.
(tfe.components.find { it is JCheckBox && it.text == "Show Histogram" } as? JCheckBox)?.isRolloverEnabled = false
tfe.components.find { it is ChartPanel }?.minimumSize = Dimension(100, 200)

tfe.layout = MigLayout("fillx,flowy,insets 0 0 0 0".maybeActivateDebug(uiDebug), "[right,fill,grow]")
parent?.add(tfe, "span 2, growx")
Expand Down

0 comments on commit dfae453

Please sign in to comment.