Revision: 4727
http://sourceforge.net/p/jump-pilot/code/4727
Author: edso
Date: 2015-12-30 17:45:41 +0000 (Wed, 30 Dec 2015)
Log Message:
-----------
keep scrollbar pos intact when wms infoframe is updated
Modified Paths:
--------------
core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoFrame.java
Modified: core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoFrame.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoFrame.java
2015-12-29 21:49:39 UTC (rev 4726)
+++ core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoFrame.java
2015-12-30 17:45:41 UTC (rev 4727)
@@ -35,13 +35,17 @@
import java.awt.event.ComponentEvent;
import javax.swing.ImageIcon;
+import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
-import javax.swing.JRootPane;
+import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
+import javax.swing.table.DefaultTableModel;
import org.openjump.core.ui.swing.DetachableInternalFrame;
@@ -61,11 +65,6 @@
import com.vividsolutions.jump.workbench.ui.images.IconLoader;
import com.vividsolutions.jump.workbench.ui.plugin.PersistentBlackboardPlugIn;
import com.vividsolutions.jump.workbench.ui.plugin.ViewAttributesPlugIn;
-import java.io.IOException;
-import javax.swing.JEditorPane;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.table.DefaultTableModel;
/**
* Provides proxied (non-spatial) views of a Layer.
@@ -374,6 +373,7 @@
protected class WMSInfoTab extends JPanel {
private final JEditorPane jEditorPane;
+ private final JScrollPane jScrollPane;
public WMSInfoTab() {
@@ -381,7 +381,7 @@
jEditorPane = new JEditorPane();
jEditorPane.setEditable(false);
- JScrollPane jScrollPane = new JScrollPane(
+ jScrollPane = new JScrollPane(
jEditorPane,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
@@ -391,9 +391,14 @@
}
public void setWmsInfoText(String wmsInfo) {
-
jEditorPane.setText(wmsInfo);
-
+ // scroll back to top
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ jScrollPane.getHorizontalScrollBar().setValue(0);
+ jScrollPane.getVerticalScrollBar().setValue(0);
+ }
+ });
}
}
------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel