Author: jflesch
Date: 2007-07-25 18:59:31 +0000 (Wed, 25 Jul 2007)
New Revision: 14346

Modified:
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/Frost.txt
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
Log:
Fix scrollbar behavior in the message view

Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/Frost.txt
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/Frost.txt        2007-07-25 
18:50:03 UTC (rev 14345)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/Frost.txt        2007-07-25 
18:59:31 UTC (rev 14346)
@@ -59,10 +59,9 @@
 
<InReplyTo><![CDATA[3677AC9EB291D5BDB9076FF27A66A9AD9ADE2A5C249C9A75781592310C1FA3F2,C6F339A701245E514379E9598927777BB300D2A8EF392C085964D693E1A5D108]]></InReplyTo>

 <!--
-        No fucking idea of what it can be
-        => Useless as hell => Ignore.
-        Thaw will put 0 in these two fields
-        (I don't care about the side effects for Frost)
+       Only used by Frost for a display purpose.
+       No logical client would use that.
+       Put 0.
 -->
 <IdLinePos>404</IdLinePos>
 <IdLineLen>76</IdLineLen>

Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java        
2007-07-25 18:50:03 UTC (rev 14345)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java        
2007-07-25 18:59:31 UTC (rev 14346)
@@ -83,7 +83,6 @@
                msgsPanel.add(new JLabel(""), BorderLayout.CENTER);

                scrollPane = new JScrollPane(msgsPanel);
-
                panel.add(scrollPane, BorderLayout.CENTER);


@@ -195,6 +194,10 @@
                }


+               public void forceDot() {
+                       area.getCaret().setDot(msg.getMessage().length());
+               }
+
                public void setRetracted(boolean retracted) {
                        if (!retracted) {
                                area = getTextArea(msg.getMessage());
@@ -356,7 +359,6 @@

                insidePanel = iPanel;

-               msgsPanel.revalidate();
                panel.revalidate();

                panel.repaint();
@@ -366,9 +368,30 @@


        private void putScrollBarAtBottom() {
-               scrollPane.revalidate();
-               //int max = scrollPane.getVerticalScrollBar().getMaximum();
-               scrollPane.getVerticalScrollBar().setValue(Integer.MAX_VALUE);
+               int max = scrollPane.getVerticalScrollBar().getMaximum();
+               scrollPane.getVerticalScrollBar().setValue(max);
+
+               Runnable doScroll = new Runnable() {
+                               public void run() {
+                                       int max = 
scrollPane.getVerticalScrollBar().getMaximum();
+                                       int extent = 
scrollPane.getVerticalScrollBar().getVisibleAmount();
+                                       int min = 
scrollPane.getVerticalScrollBar().getMinimum();
+                                       int value = 
scrollPane.getVerticalScrollBar().getValue();
+
+                                       Logger.info(this, "ScrollBar: "
+                                                   +"min : 
"+Integer.toString(min)
+                                                   +" ; max : 
"+Integer.toString(max)
+                                                   +" ; extent : 
"+Integer.toString(extent)
+                                                   +" ; value : 
"+Integer.toString(value));
+
+                                       
///scrollPane.getVerticalScrollBar().setValues(max-extent,
+                                       //                                      
    extent,
+                                       //                                      
    min, max);
+                                       
scrollPane.getVerticalScrollBar().setValue(max);
+                               }
+                       };
+
+               javax.swing.SwingUtilities.invokeLater(doScroll);
        }


@@ -389,6 +412,8 @@
                        newMsg.setRead(true);
                        mainPanel.getMessageTreeTable().refresh();
                        mainPanel.getBoardTree().refresh(newMsg.getBoard());
+                       //putScrollBarAtBottom();
+                       setMessage(newMsg);
                        return true;
                }



Reply via email to