-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:knime-mpicbg/knime-scripting int…
…o develop synchronizing...
- Loading branch information
Showing
10 changed files
with
52 additions
and
1,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
142 changes: 0 additions & 142 deletions
142
de.mpicbg.knime.scripting.core/src/de/mpicbg/knime/scripting/core/DomainSelector.jfd
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
de.mpicbg.knime.scripting.core/src/de/mpicbg/knime/scripting/core/ResizableCardLayout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* | ||
*/ | ||
package de.mpicbg.knime.scripting.core; | ||
|
||
import java.awt.CardLayout; | ||
import java.awt.Component; | ||
import java.awt.Container; | ||
import java.awt.Dimension; | ||
import java.awt.Insets; | ||
|
||
/** | ||
* @author niederle | ||
* | ||
*/ | ||
public class ResizableCardLayout extends CardLayout { | ||
|
||
/** | ||
* adapts preferred size to content of current visible component | ||
*/ | ||
@Override | ||
public Dimension preferredLayoutSize(Container parent) { | ||
Component current = findCurrentComponent(parent); | ||
if (current != null) { | ||
Insets insets = parent.getInsets(); | ||
Dimension pref = current.getPreferredSize(); | ||
pref.width += insets.left + insets.right; | ||
pref.height += insets.top + insets.bottom; | ||
return pref; | ||
} | ||
return super.preferredLayoutSize(parent); | ||
} | ||
|
||
/** | ||
* retrieves the currently visible component | ||
* @param parent | ||
* @return | ||
*/ | ||
private Component findCurrentComponent(Container parent) { | ||
for (Component comp : parent.getComponents()) { | ||
if (comp.isVisible()) { | ||
return comp; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
} |
Oops, something went wrong.