How to add a “tutorial message div” to figures?
up vote
9
down vote
favorite
After installing R2018b, the first figure I opened contained an interesting message (shown in blue):
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.
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
ordocroot
(or evendoc
) 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
(frommlservices.jar
), which opens the help browser.
matlab flexbox matlab-figure matlab-gui undocumented-behavior
add a comment |
up vote
9
down vote
favorite
After installing R2018b, the first figure I opened contained an interesting message (shown in blue):
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.
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
ordocroot
(or evendoc
) 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
(frommlservices.jar
), which opens the help browser.
matlab flexbox matlab-figure matlab-gui undocumented-behavior
It is likely pure Java.
– Cris Luengo
Nov 19 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 at 16:43
4
@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 at 16:55
add a comment |
up vote
9
down vote
favorite
up vote
9
down vote
favorite
After installing R2018b, the first figure I opened contained an interesting message (shown in blue):
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.
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
ordocroot
(or evendoc
) 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
(frommlservices.jar
), which opens the help browser.
matlab flexbox matlab-figure matlab-gui undocumented-behavior
After installing R2018b, the first figure I opened contained an interesting message (shown in blue):
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.
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
ordocroot
(or evendoc
) 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
(frommlservices.jar
), which opens the help browser.
matlab flexbox matlab-figure matlab-gui undocumented-behavior
matlab flexbox matlab-figure matlab-gui undocumented-behavior
asked Nov 19 at 15:59
Dev-iL
16.3k64074
16.3k64074
It is likely pure Java.
– Cris Luengo
Nov 19 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 at 16:43
4
@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 at 16:55
add a comment |
It is likely pure Java.
– Cris Luengo
Nov 19 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 at 16:43
4
@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 at 16:55
It is likely pure Java.
– Cris Luengo
Nov 19 at 16:33
It is likely pure Java.
– Cris Luengo
Nov 19 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 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 at 16:43
4
4
@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 at 16:55
@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 at 16:55
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
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:
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
To make it appear, we need to call the
static
methodaddBannerPanel
, 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 );
The MATLAB setting that controls whether this should appear is
showinteractioninfobar
inside the<prefdir>/matlab.settings
XML.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.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
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:
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
To make it appear, we need to call the
static
methodaddBannerPanel
, 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 );
The MATLAB setting that controls whether this should appear is
showinteractioninfobar
inside the<prefdir>/matlab.settings
XML.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.
add a comment |
up vote
6
down vote
accepted
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:
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
To make it appear, we need to call the
static
methodaddBannerPanel
, 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 );
The MATLAB setting that controls whether this should appear is
showinteractioninfobar
inside the<prefdir>/matlab.settings
XML.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.
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
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:
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
To make it appear, we need to call the
static
methodaddBannerPanel
, 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 );
The MATLAB setting that controls whether this should appear is
showinteractioninfobar
inside the<prefdir>/matlab.settings
XML.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.
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:
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
To make it appear, we need to call the
static
methodaddBannerPanel
, 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 );
The MATLAB setting that controls whether this should appear is
showinteractioninfobar
inside the<prefdir>/matlab.settings
XML.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.
answered Nov 19 at 20:30
Dev-iL
16.3k64074
16.3k64074
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
It is likely pure Java.
– Cris Luengo
Nov 19 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 at 16:43
4
@marsei: Take a look at the contributors page of the toolbox you linked. :)
– Cris Luengo
Nov 19 at 16:55