Short patches: Difference between revisions

From FreeMind
Jump to navigationJump to search
(added note that the patches tracker is preferable to this wiki page)
No edit summary
Line 1: Line 1:
===Patch resizing images upon zoom===
>===Patch resizing images upon zoom===


Our user ''Mario Claerhout'' has written to us: Since I like FreeMind so much I decided to add a little contribution. Attached you find an altered NodeView.java which contains following modification :
Our user ''Mario Claerhout'' has written to us: Since I like FreeMind so much I decided to add a little contribution. Attached you find an altered NodeView.java which contains following modification :
Line 11: Line 11:
     int width=(int)(prefSize.width * map.getZoom());
     int width=(int)(prefSize.width * map.getZoom());
     int height=(int)(prefSize.height * map.getZoom());               
     int height=(int)(prefSize.height * map.getZoom());               
     String result=text.replaceAll("(<html>.*?<img src=\".*?\")",
     String result=text.replaceAll(&quot;(&lt;html&gt;.*?&lt;img src=\&quot;.*?\&quot;)&quot;,
                                   "$1 width=\""+width+"\" height=\""+height+"\"");
                                   &quot;$1 width=\&quot;&quot;+width+&quot;\&quot; height=\&quot;&quot;+height+&quot;\&quot;&quot;);
     System.out.println(result);
     System.out.println(result);
     return result;
     return result;
Line 18: Line 18:
   }
   }


</table>
&lt;/table&gt;
 
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://inaroregi.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
----
=[http://inaroregi.co.cc CLICK HERE]=
----
</div>

Revision as of 23:05, 17 November 2010

>===Patch resizing images upon zoom===

Our user Mario Claerhout has written to us: Since I like FreeMind so much I decided to add a little contribution. Attached you find an altered NodeView.java which contains following modification : Nodes containing images are now also resized when zooming. I did this by adding the method:

 private String resizeImage(String text) {

   JLabel imageLabel=new JLabel(text);
   Dimension prefSize=imageLabel.getPreferredSize();
   int width=(int)(prefSize.width * map.getZoom());
   int height=(int)(prefSize.height * map.getZoom());              
   String result=text.replaceAll("(<html>.*?<img src=\".*?\")",
                                 "$1 width=\""+width+"\" height=\""+height+"\"");
   System.out.println(result);
   return result;

 }

</table>