How to add a “tutorial message div” to figures?












12














After installing R2018b, the first figure I opened contained an interesting message (shown in blue):



Static image



The reason it's interesting is because it contains features like text wrapping, transparency, the fact that the image maintains a constant width even though the text resizes (this reminded me of CSS3 flexbox, hence the tag), etc.



Animation



The last part of the animation is in slow motion, to better show how the div's size follows that of the figure.



In case it matters, I'm using Win 10 v1803.



Question:



I'd like to know how we can draw similar, custom, divs (for a lack of a better word) in our figures. (It's important to stress that this is not a UIFigure!)





What I found so far:





  • The Learn More link opens the page:



    web(fullfile(docroot, 'matlab/creating_plots/interactively-explore-plotted-data.html'))


    yet breakpoints in the entry points of either web or docroot (or even doc) aren't hit.




  • Assuming that this element is a Child of the figure, I attempted to locate a handle to it:



    >> set(gcf,'MenuBar','none'); findall(gcf)

    ans =
    22×1 graphics array:

    Figure (1)
    ContextMenu
    AnnotationPane
    Axes
    AxesToolbar
    Text
    Text
    Text
    ToolbarStateButton (Brush/Select Data)
    ToolbarStateButton (Data Tips)
    ToolbarStateButton (Rotate 3-D)
    ToolbarStateButton (Pan)
    ToolbarStateButton (Zoom In)
    ToolbarStateButton (Zoom Out)
    ToolbarPushButton (Restore View)
    Button
    Button
    Button
    Button
    Button
    Button
    Button


    however, making these controls invisible using set(h(2:end), 'Visible', false) didn't make the div disappear.



  • Saving the figure as .fig or generating code for it, doesn't leave any trace of this div.


  • When uiinspect-ing the figure, this div doesn't show (or at least, I couldn't find it).


  • I don't know what exactly I did to make it reappear once more, but since it's set to appear on the very first time you boot R2018b, I suspect deleting prefdir (obviously, after backing it up) and restarting MATLAB could bring it back.


  • The only thing I didn't try yet, is to attach a java debugger to MATLAB and attempt to trace the caller to com.mathworks.mlservices.MLHelpServices.setCurrentLocation (from mlservices.jar), which opens the help browser.










share|improve this question






















  • It is likely pure Java.
    – Cris Luengo
    Nov 19 '18 at 16:33










  • To dive into modern figure styling, see the toolbox github.com/StackOverflowMATLABchat/mlapptools and its exemples. Another web-GUI example here (uipanel): undocumentedmatlab.com/blog/customizing-web-gui-uipanel. But it's kind of buggy on my system.
    – marsei
    Nov 19 '18 at 16:43






  • 5




    @marsei: Take a look at the contributors page of the toolbox you linked. :)
    – Cris Luengo
    Nov 19 '18 at 16:55


















12














After installing R2018b, the first figure I opened contained an interesting message (shown in blue):



Static image



The reason it's interesting is because it contains features like text wrapping, transparency, the fact that the image maintains a constant width even though the text resizes (this reminded me of CSS3 flexbox, hence the tag), etc.



Animation



The last part of the animation is in slow motion, to better show how the div's size follows that of the figure.



In case it matters, I'm using Win 10 v1803.



Question:



I'd like to know how we can draw similar, custom, divs (for a lack of a better word) in our figures. (It's important to stress that this is not a UIFigure!)





What I found so far:





  • The Learn More link opens the page:



    web(fullfile(docroot, 'matlab/creating_plots/interactively-explore-plotted-data.html'))


    yet breakpoints in the entry points of either web or docroot (or even doc) aren't hit.




  • Assuming that this element is a Child of the figure, I attempted to locate a handle to it:



    >> set(gcf,'MenuBar','none'); findall(gcf)

    ans =
    22×1 graphics array:

    Figure (1)
    ContextMenu
    AnnotationPane
    Axes
    AxesToolbar
    Text
    Text
    Text
    ToolbarStateButton (Brush/Select Data)
    ToolbarStateButton (Data Tips)
    ToolbarStateButton (Rotate 3-D)
    ToolbarStateButton (Pan)
    ToolbarStateButton (Zoom In)
    ToolbarStateButton (Zoom Out)
    ToolbarPushButton (Restore View)
    Button
    Button
    Button
    Button
    Button
    Button
    Button


    however, making these controls invisible using set(h(2:end), 'Visible', false) didn't make the div disappear.



  • Saving the figure as .fig or generating code for it, doesn't leave any trace of this div.


  • When uiinspect-ing the figure, this div doesn't show (or at least, I couldn't find it).


  • I don't know what exactly I did to make it reappear once more, but since it's set to appear on the very first time you boot R2018b, I suspect deleting prefdir (obviously, after backing it up) and restarting MATLAB could bring it back.


  • The only thing I didn't try yet, is to attach a java debugger to MATLAB and attempt to trace the caller to com.mathworks.mlservices.MLHelpServices.setCurrentLocation (from mlservices.jar), which opens the help browser.










share|improve this question






















  • It is likely pure Java.
    – Cris Luengo
    Nov 19 '18 at 16:33










  • To dive into modern figure styling, see the toolbox github.com/StackOverflowMATLABchat/mlapptools and its exemples. Another web-GUI example here (uipanel): undocumentedmatlab.com/blog/customizing-web-gui-uipanel. But it's kind of buggy on my system.
    – marsei
    Nov 19 '18 at 16:43






  • 5




    @marsei: Take a look at the contributors page of the toolbox you linked. :)
    – Cris Luengo
    Nov 19 '18 at 16:55
















12












12








12


2





After installing R2018b, the first figure I opened contained an interesting message (shown in blue):



Static image



The reason it's interesting is because it contains features like text wrapping, transparency, the fact that the image maintains a constant width even though the text resizes (this reminded me of CSS3 flexbox, hence the tag), etc.



Animation



The last part of the animation is in slow motion, to better show how the div's size follows that of the figure.



In case it matters, I'm using Win 10 v1803.



Question:



I'd like to know how we can draw similar, custom, divs (for a lack of a better word) in our figures. (It's important to stress that this is not a UIFigure!)





What I found so far:





  • The Learn More link opens the page:



    web(fullfile(docroot, 'matlab/creating_plots/interactively-explore-plotted-data.html'))


    yet breakpoints in the entry points of either web or docroot (or even doc) aren't hit.




  • Assuming that this element is a Child of the figure, I attempted to locate a handle to it:



    >> set(gcf,'MenuBar','none'); findall(gcf)

    ans =
    22×1 graphics array:

    Figure (1)
    ContextMenu
    AnnotationPane
    Axes
    AxesToolbar
    Text
    Text
    Text
    ToolbarStateButton (Brush/Select Data)
    ToolbarStateButton (Data Tips)
    ToolbarStateButton (Rotate 3-D)
    ToolbarStateButton (Pan)
    ToolbarStateButton (Zoom In)
    ToolbarStateButton (Zoom Out)
    ToolbarPushButton (Restore View)
    Button
    Button
    Button
    Button
    Button
    Button
    Button


    however, making these controls invisible using set(h(2:end), 'Visible', false) didn't make the div disappear.



  • Saving the figure as .fig or generating code for it, doesn't leave any trace of this div.


  • When uiinspect-ing the figure, this div doesn't show (or at least, I couldn't find it).


  • I don't know what exactly I did to make it reappear once more, but since it's set to appear on the very first time you boot R2018b, I suspect deleting prefdir (obviously, after backing it up) and restarting MATLAB could bring it back.


  • The only thing I didn't try yet, is to attach a java debugger to MATLAB and attempt to trace the caller to com.mathworks.mlservices.MLHelpServices.setCurrentLocation (from mlservices.jar), which opens the help browser.










share|improve this question













After installing R2018b, the first figure I opened contained an interesting message (shown in blue):



Static image



The reason it's interesting is because it contains features like text wrapping, transparency, the fact that the image maintains a constant width even though the text resizes (this reminded me of CSS3 flexbox, hence the tag), etc.



Animation



The last part of the animation is in slow motion, to better show how the div's size follows that of the figure.



In case it matters, I'm using Win 10 v1803.



Question:



I'd like to know how we can draw similar, custom, divs (for a lack of a better word) in our figures. (It's important to stress that this is not a UIFigure!)





What I found so far:





  • The Learn More link opens the page:



    web(fullfile(docroot, 'matlab/creating_plots/interactively-explore-plotted-data.html'))


    yet breakpoints in the entry points of either web or docroot (or even doc) aren't hit.




  • Assuming that this element is a Child of the figure, I attempted to locate a handle to it:



    >> set(gcf,'MenuBar','none'); findall(gcf)

    ans =
    22×1 graphics array:

    Figure (1)
    ContextMenu
    AnnotationPane
    Axes
    AxesToolbar
    Text
    Text
    Text
    ToolbarStateButton (Brush/Select Data)
    ToolbarStateButton (Data Tips)
    ToolbarStateButton (Rotate 3-D)
    ToolbarStateButton (Pan)
    ToolbarStateButton (Zoom In)
    ToolbarStateButton (Zoom Out)
    ToolbarPushButton (Restore View)
    Button
    Button
    Button
    Button
    Button
    Button
    Button


    however, making these controls invisible using set(h(2:end), 'Visible', false) didn't make the div disappear.



  • Saving the figure as .fig or generating code for it, doesn't leave any trace of this div.


  • When uiinspect-ing the figure, this div doesn't show (or at least, I couldn't find it).


  • I don't know what exactly I did to make it reappear once more, but since it's set to appear on the very first time you boot R2018b, I suspect deleting prefdir (obviously, after backing it up) and restarting MATLAB could bring it back.


  • The only thing I didn't try yet, is to attach a java debugger to MATLAB and attempt to trace the caller to com.mathworks.mlservices.MLHelpServices.setCurrentLocation (from mlservices.jar), which opens the help browser.







matlab flexbox matlab-figure matlab-gui undocumented-behavior






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 '18 at 15:59









Dev-iL

16.6k64075




16.6k64075












  • It is likely pure Java.
    – Cris Luengo
    Nov 19 '18 at 16:33










  • To dive into modern figure styling, see the toolbox github.com/StackOverflowMATLABchat/mlapptools and its exemples. Another web-GUI example here (uipanel): undocumentedmatlab.com/blog/customizing-web-gui-uipanel. But it's kind of buggy on my system.
    – marsei
    Nov 19 '18 at 16:43






  • 5




    @marsei: Take a look at the contributors page of the toolbox you linked. :)
    – Cris Luengo
    Nov 19 '18 at 16:55




















  • It is likely pure Java.
    – Cris Luengo
    Nov 19 '18 at 16:33










  • To dive into modern figure styling, see the toolbox github.com/StackOverflowMATLABchat/mlapptools and its exemples. Another web-GUI example here (uipanel): undocumentedmatlab.com/blog/customizing-web-gui-uipanel. But it's kind of buggy on my system.
    – marsei
    Nov 19 '18 at 16:43






  • 5




    @marsei: Take a look at the contributors page of the toolbox you linked. :)
    – Cris Luengo
    Nov 19 '18 at 16:55


















It is likely pure Java.
– Cris Luengo
Nov 19 '18 at 16:33




It is likely pure Java.
– Cris Luengo
Nov 19 '18 at 16:33












To dive into modern figure styling, see the toolbox github.com/StackOverflowMATLABchat/mlapptools and its exemples. Another web-GUI example here (uipanel): undocumentedmatlab.com/blog/customizing-web-gui-uipanel. But it's kind of buggy on my system.
– marsei
Nov 19 '18 at 16:43




To dive into modern figure styling, see the toolbox github.com/StackOverflowMATLABchat/mlapptools and its exemples. Another web-GUI example here (uipanel): undocumentedmatlab.com/blog/customizing-web-gui-uipanel. But it's kind of buggy on my system.
– marsei
Nov 19 '18 at 16:43




5




5




@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 '18 at 16:55






@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 '18 at 16:55














1 Answer
1






active

oldest

votes


















7














After some digging in the Java side of things (starting from findjobj, followed by a lot of .getComponent(0).getComponent(0)...), I've finally managed to locate the component in question. Here's what I learned:





  1. This component is called InfoPanel, and is part of MATLAB's Java API. The class definition itself is found in:



    MATLAB/R2018b/java/jar/hg.jar!/com/mathworks/hg/util/InfoPanel.class



  2. To make it appear, we need to call the static method addBannerPanel, passing in a figure handle:



    com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)) );


    Or another signature that also accepts a custom panel:



    jIP = com.mathworks.hg.util.InfoPanel;
    jIP.setBackground(java.awt.Color(0.8, 0.7, 0.1));
    com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)), jIP );


  3. The MATLAB setting that controls whether this should appear is showinteractioninfobar inside the <prefdir>/matlab.settings XML.


  4. It appears that the "interesting parts" of InfoPanel are private, which means it allows barely any customization (mostly some colors; not the string or the icon), but it should be fairly easy to make a copy of this class and expose all elements we need.







share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378410%2fhow-to-add-a-tutorial-message-div-to-figures%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    7














    After some digging in the Java side of things (starting from findjobj, followed by a lot of .getComponent(0).getComponent(0)...), I've finally managed to locate the component in question. Here's what I learned:





    1. This component is called InfoPanel, and is part of MATLAB's Java API. The class definition itself is found in:



      MATLAB/R2018b/java/jar/hg.jar!/com/mathworks/hg/util/InfoPanel.class



    2. To make it appear, we need to call the static method addBannerPanel, passing in a figure handle:



      com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)) );


      Or another signature that also accepts a custom panel:



      jIP = com.mathworks.hg.util.InfoPanel;
      jIP.setBackground(java.awt.Color(0.8, 0.7, 0.1));
      com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)), jIP );


    3. The MATLAB setting that controls whether this should appear is showinteractioninfobar inside the <prefdir>/matlab.settings XML.


    4. It appears that the "interesting parts" of InfoPanel are private, which means it allows barely any customization (mostly some colors; not the string or the icon), but it should be fairly easy to make a copy of this class and expose all elements we need.







    share|improve this answer


























      7














      After some digging in the Java side of things (starting from findjobj, followed by a lot of .getComponent(0).getComponent(0)...), I've finally managed to locate the component in question. Here's what I learned:





      1. This component is called InfoPanel, and is part of MATLAB's Java API. The class definition itself is found in:



        MATLAB/R2018b/java/jar/hg.jar!/com/mathworks/hg/util/InfoPanel.class



      2. To make it appear, we need to call the static method addBannerPanel, passing in a figure handle:



        com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)) );


        Or another signature that also accepts a custom panel:



        jIP = com.mathworks.hg.util.InfoPanel;
        jIP.setBackground(java.awt.Color(0.8, 0.7, 0.1));
        com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)), jIP );


      3. The MATLAB setting that controls whether this should appear is showinteractioninfobar inside the <prefdir>/matlab.settings XML.


      4. It appears that the "interesting parts" of InfoPanel are private, which means it allows barely any customization (mostly some colors; not the string or the icon), but it should be fairly easy to make a copy of this class and expose all elements we need.







      share|improve this answer
























        7












        7








        7






        After some digging in the Java side of things (starting from findjobj, followed by a lot of .getComponent(0).getComponent(0)...), I've finally managed to locate the component in question. Here's what I learned:





        1. This component is called InfoPanel, and is part of MATLAB's Java API. The class definition itself is found in:



          MATLAB/R2018b/java/jar/hg.jar!/com/mathworks/hg/util/InfoPanel.class



        2. To make it appear, we need to call the static method addBannerPanel, passing in a figure handle:



          com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)) );


          Or another signature that also accepts a custom panel:



          jIP = com.mathworks.hg.util.InfoPanel;
          jIP.setBackground(java.awt.Color(0.8, 0.7, 0.1));
          com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)), jIP );


        3. The MATLAB setting that controls whether this should appear is showinteractioninfobar inside the <prefdir>/matlab.settings XML.


        4. It appears that the "interesting parts" of InfoPanel are private, which means it allows barely any customization (mostly some colors; not the string or the icon), but it should be fairly easy to make a copy of this class and expose all elements we need.







        share|improve this answer












        After some digging in the Java side of things (starting from findjobj, followed by a lot of .getComponent(0).getComponent(0)...), I've finally managed to locate the component in question. Here's what I learned:





        1. This component is called InfoPanel, and is part of MATLAB's Java API. The class definition itself is found in:



          MATLAB/R2018b/java/jar/hg.jar!/com/mathworks/hg/util/InfoPanel.class



        2. To make it appear, we need to call the static method addBannerPanel, passing in a figure handle:



          com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)) );


          Or another signature that also accepts a custom panel:



          jIP = com.mathworks.hg.util.InfoPanel;
          jIP.setBackground(java.awt.Color(0.8, 0.7, 0.1));
          com.mathworks.hg.util.InfoPanel.addBannerPanel( figure(randi(1E4)), jIP );


        3. The MATLAB setting that controls whether this should appear is showinteractioninfobar inside the <prefdir>/matlab.settings XML.


        4. It appears that the "interesting parts" of InfoPanel are private, which means it allows barely any customization (mostly some colors; not the string or the icon), but it should be fairly easy to make a copy of this class and expose all elements we need.








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 '18 at 20:30









        Dev-iL

        16.6k64075




        16.6k64075






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378410%2fhow-to-add-a-tutorial-message-div-to-figures%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith