Class TextPaneResizer
- java.lang.Object
-
- java.awt.event.ComponentAdapter
-
- idare.imagenode.GUI.Legend.Utilities.TextPaneResizer
-
- All Implemented Interfaces:
LegendSizeListener
,ComponentListener
,EventListener
public class TextPaneResizer extends ComponentAdapter implements LegendSizeListener
A Listener that adapts a JTextPane according to the Scrollpane enclosing the pane. Without this listener, the TextPane would always try to assume the maximal extension, which would make the Scrollpane have an extremely large viewport.- Author:
- Thomas Pfau
-
-
Constructor Summary
Constructors Constructor Description TextPaneResizer(JTextPane pane)
Default parameters will be used for the given pane (300 width, 2 offset)TextPaneResizer(JTextPane pane, int minsize, int offset)
Default constructor with a provided minimal width, an offset to adjust the width coming in and the Pane to resize.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
componentResized(ComponentEvent e)
-
Methods inherited from class java.awt.event.ComponentAdapter
componentHidden, componentMoved, componentShown
-
-
-
-
Constructor Detail
-
TextPaneResizer
public TextPaneResizer(JTextPane pane, int minsize, int offset)
Default constructor with a provided minimal width, an offset to adjust the width coming in and the Pane to resize.- Parameters:
pane
- The textpane this resizer will be added tominsize
- The minimal size to useoffset
- The remaining space between this component and the width
-
TextPaneResizer
public TextPaneResizer(JTextPane pane)
Default parameters will be used for the given pane (300 width, 2 offset)- Parameters:
pane
- The pane to use this Resizer for
-
-
Method Detail
-
componentResized
public void componentResized(ComponentEvent e)
- Specified by:
componentResized
in interfaceComponentListener
- Overrides:
componentResized
in classComponentAdapter
-
-