Comments on: Advanced JIDE Property Grids https://undocumentedmatlab.com/blog_old/advanced-jide-property-grids Charting Matlab's unsupported hidden underbelly Sun, 03 Jul 2022 14:46:57 +0000 hourly 1 https://wordpress.org/?v=4.4.1 By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-504659 Mon, 21 Oct 2019 17:21:18 +0000 https://undocumentedmatlab.com/?p=1316#comment-504659 Philip – you cannot directly use a Java control inside Java tables, such as a Property Grid. Inside a table you should use a Cell-Editor and Cell-Renderer. Showing how to integrate them inside a JIDE Property Grid is well outside the scope of this blog. You can search in Java forums, or the code within my propertiesGUI utility.

A description of how to integrate color cell renderers and editors in Java-based Matlab uitables can be found in my uitable customization report (note: this is related, but not directly applicable, to property-grids).

]]>
By: Philiphttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-504592 Mon, 21 Oct 2019 06:09:43 +0000 https://undocumentedmatlab.com/?p=1316#comment-504592 Yair,

Could you please shed some more insight on how to use color choosers (specifically the ColorComboBox / JideColorSplitButton / or com.mathworks.mlwidgets.graphics.ColorPicker) in JIDE Property Grids? I’ve been referencing the notes you outlined in this post as well as the following two posts on your undocumented site ( https://undocumentedmatlab.com/blog/color-selection-components and https://undocumentedmatlab.com/using-jide-combo-boxes ), however my efforts to insert the component into the grid were unsuccessful.

]]>
By: Philiphttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-490182 Thu, 08 Aug 2019 03:36:47 +0000 https://undocumentedmatlab.com/?p=1316#comment-490182 Yair,

This is with reference to your response to my post on August 5, 2019. Thank you for the response. The problem I was facing was directly related to the link in your comment. The problem was fixed by simply programmatically setting the property’s default value (of class java.util.ArrayList) in the class constructor for an instance of custom class project, as opposed to setting the default value in the properties declaration.

Philip

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-489635 Mon, 05 Aug 2019 08:15:02 +0000 https://undocumentedmatlab.com/?p=1316#comment-489635 @Philip – you probably have a bug in your code, for example reusing the same ArrayList object for all projects, rather than using a new ArrayList instance for each project instance. For example: https://undocumentedmatlab.com/blog/handle-object-as-default-class-property-value

]]>
By: Philiphttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-489626 Mon, 05 Aug 2019 07:31:33 +0000 https://undocumentedmatlab.com/?p=1316#comment-489626 Yair,

Using the example above, I created a ML custom class called a ‘project’ which has certain public properties of class com.jidesoft.grid.DefaultProperty so that the properties of the project can be edited from the PropertyTable. The default properties are added to a list of class java.util.ArrayList, which is also a property of the custom project class. I then created a tree that lists all the projects. I adapted the mousePressedCallback you wrote in Customizing uitree nodes – part 2, so that when each project node is double clicked its properties are displayed in the PropertyTable using:

obj.ProjModel.setOriginalProperties( project.list );
obj.ProjModel.refresh();

I thought that each instance of project would control its list and the UI would simply load the list when I double click on the project node, but it appears as though my current implementation of Arraylist is not localized to the instance of project that called it. It seems that the same list continues to be updated with every new call to project and when I double click on each project node, I get a concatenated grid of the project properties from all projects.

Any help you can give with this would be greatly appreciated.

]]>
By: amirhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-397027 Tue, 20 Dec 2016 21:14:59 +0000 https://undocumentedmatlab.com/?p=1316#comment-397027 hi

how can make live searchable in jtable ?

]]>
By: Sarahhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-362435 Tue, 24 Nov 2015 15:24:47 +0000 https://undocumentedmatlab.com/?p=1316#comment-362435 Hi, I tried your code but I get the following error:

??? Undefined variable "com" or class "com.jidesoft.grid.DefaultProperty".

I’m a newbiew and would appreciate ideas.

Thanks!

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-360014 Wed, 28 Oct 2015 10:20:56 +0000 https://undocumentedmatlab.com/?p=1316#comment-360014 @Cho – my article on color-selection components might help you: https://undocumentedmatlab.com/blog/color-selection-components

]]>
By: Chohttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-360010 Wed, 28 Oct 2015 09:21:36 +0000 https://undocumentedmatlab.com/?p=1316#comment-360010 Hello ~

is there editor style like inspector background / foreground ?
there are color in value section and have colour picker front.
i want make inspector in color picker & background

thanks.

]]>
By: Sukhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-358787 Mon, 12 Oct 2015 09:03:29 +0000 https://undocumentedmatlab.com/?p=1316#comment-358787 Dear Yair~

I solved problem that java error. Matlab & Java version is not same on my laptop…

i have more question!

your example is greatly work..
is there methods to align property value , and change heights of description zone?

Thanks..

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-356530 Sun, 06 Sep 2015 15:47:44 +0000 https://undocumentedmatlab.com/?p=1316#comment-356530 @Suk – you are probably configuring your cell-array of options incorrectly. Read my blog examples carefully and/or read my book on Matlab-Java programming to see how to configure Java components in Matlab.

]]>
By: Sukhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-356528 Sun, 06 Sep 2015 14:57:44 +0000 https://undocumentedmatlab.com/?p=1316#comment-356528 Dear Yair

I’m trying to make own property inspector. i try step by step on your code. but there are some errors. it’s in combo-box and logical value. making combo-box, logic works well but when i choose other options (ex. your script combo-box spring, summer, fall, winter) i can’t see other options (summer, fall, winter). the error in java , grid . how can i solve the problem..

------error
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at java.lang.reflect.Array.newArray(Native Method)
	at java.lang.reflect.Array.newInstance(Array.java:75)
	at com.jidesoft.combobox.MultiSelectListExComboBox.convertArrayType(Unknown Source)
	at com.jidesoft.combobox.MultiSelectListExComboBox.getSelectedItem(Unknown Source)
	at com.jidesoft.combobox.ExComboBox.setConverterContext(Unknown Source)
	at com.jidesoft.grid.ExComboBoxCellEditor.getTableCellEditorComponent(Unknown Source)
	at javax.swing.JTable.prepareEditor(JTable.java:5778)
	at com.jidesoft.grid.JideTable.prepareEditor(Unknown Source)
	at com.jidesoft.grid.ContextSensitiveTable.prepareEditor(Unknown Source)
	at com.jidesoft.grid.CellStyleTable.prepareEditor(Unknown Source)
	at com.jidesoft.grid.CellSpanTable.prepareEditor(Unknown Source)
	at com.jidesoft.grid.PropertyTable.prepareEditor(Unknown Source)
	at com.jidesoft.grid.JideTable.editCellAt(Unknown Source)
	at com.jidesoft.grid.CellSpanTable.editCellAt(Unknown Source)
	at javax.swing.plaf.basic.BasicTableUI$Handler.adjustSelection(BasicTableUI.java:1108)
	at javax.swing.plaf.basic.BasicTableUI$Handler.mousePressed(BasicTableUI.java:1038)
	at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mousePressed(BasicTableUI.java:798)
	at com.jidesoft.swing.DelegateMouseInputListener.mousePressed(Unknown Source)
	at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:280)
	at java.awt.Component.processMouseEvent(Component.java:6522)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
...

Thanks

]]>
By: 4000erhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-345930 Tue, 24 Feb 2015 08:15:25 +0000 https://undocumentedmatlab.com/?p=1316#comment-345930 Hello

Does anybody know how to add another column to the property grid?
I’m displaying some physical values in a property grid.
Now I would be happy to have a third column to display the units of values.

Thank you in advance

]]>
By: GimmeFivehttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-334089 Tue, 14 Oct 2014 10:33:58 +0000 https://undocumentedmatlab.com/?p=1316#comment-334089 I get the same issue as above using jide grids on r2014b. The com.jidesoft.grid.ListComboBoxCellEditor editor seems to trigger the exception. Anybody has a hint?

]]>
By: Cruxhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-321223 Tue, 01 Apr 2014 20:02:59 +0000 https://undocumentedmatlab.com/?p=1316#comment-321223 Dear Yair,

I’ve been using your inspiring hints smoothly up to R2012b. Since R2013a – and including R2014a – I receive a Java NullPointerException when I click with the mouse pointer on a CheckBoxListCombo in a grid table. Any suggestions on a fix?

For example:

data = {'1A','2B','3C','4D'};
selected = [2 4];
com.mathworks.mwswing.MJUtilities.initJIDE;
list = java.util.ArrayList();
 
javatype = javaclass('char',1);
editor = com.jidesoft.grid.CheckBoxListComboBoxCellEditor(data);
renderer = com.jidesoft.grid.MultilineTableCellRenderer;
context = com.jidesoft.grid.EditorContext('con1');
com.jidesoft.grid.CellEditorManager.registerEditor(javatype, editor, context);
com.jidesoft.grid.CellRendererManager.registerRenderer(javatype, renderer, context);
prop = com.jidesoft.grid.DefaultProperty();
set(prop,'Value',data(selected),'Type',javatype,'EditorContext',context);
list.add(prop);
 
model = com.jidesoft.grid.PropertyTableModel(list);
model.expandAll();
grid = com.jidesoft.grid.PropertyTable(model);
pane = com.jidesoft.grid.PropertyPane(grid);
javacomponent(pane, [50 050 400 300], gcf);
pause(0.05);
hJavaModel = handle(model, 'CallbackProperties');
]]>
By: CitizenInsanehttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-319087 Mon, 17 Mar 2014 10:45:52 +0000 https://undocumentedmatlab.com/?p=1316#comment-319087 Hi,

Thanks for your reply. I gave up using a .NET grid to be able to reset edited field to default values (too complex). Anyway, as I dived much into your code, I updated it to accept a ‘callback’ as input argument so as to get more control on how fields are edited (editor type, field description, field name, category, etc…). See ‘uipropedit.m’ and ‘DemoCallback.m’ routines here:

https://gist.github.com/CitizenInsane/3ce1755bf0901f0bae38

Contribution is not perfect but it’s a first try to get more control on how values are edited. Additionally, the new routine manages for n-dimensional fields (or n-dimensional objects themselves!) using ‘ind2sub’ instead of ‘reshape’ to 3D at max; this is a litle more appealing when editing n-d data.

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-318155 Mon, 10 Mar 2014 17:12:09 +0000 https://undocumentedmatlab.com/?p=1316#comment-318155 I do not know of a way to integrate .NET controls in Matlab figures, but I’m guessing that this may be a solved problem in the Java world. So if you find a way to integrate a .NET control in a Java container, it should be pretty straight-forward to extend this to Matlab figures.

]]>
By: CitizenInsanehttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-317414 Thu, 06 Mar 2014 11:04:13 +0000 https://undocumentedmatlab.com/?p=1316#comment-317414 Hi! This is great and inspirative work.

Is it possible to perform a ‘reset property value to default’ with jide grid controls?. I was thinking of using .NET PropertyGrid instead which allows this behaviour. Following sample code works great:

NET.addAssembly('System.Windows.Forms');
import System.Windows.Forms.*;
f = Form();
g = PropertyGrid();
g.Dock = DockStyle.Fill;
g.SelectedObject = f;
f.Controls.Add(g);
f.Show();

But then i don’t know how to embed resulting “.NET form” inside a “matlab figure/panel” (+ Need a workaround to add/remove properties on the fly because .NET grids work from attributes ==> http://stackoverflow.com/q/313822/684399)

]]>
By: Janhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-314661 Tue, 18 Feb 2014 10:14:07 +0000 https://undocumentedmatlab.com/?p=1316#comment-314661 Oh, nevermind. it was not as difficult as I thought it would be:

grid = com.jidesoft.grid.PropertyTable(model);
hGrid = handle(grid.getSelectionModel, 'CallbackProperties');
set(hGrid, 'ValueChangedCallback', {@onValueChange, model});

… and

function onValueChange(jHandle, ~, model)
  mHandle = handle(jHandle, 'CallbackProperties');
  id = get(mHandle, 'MinSelectionIndex'); % 'MaxSelectionIndex' would do as well ...
 
  prop = model.getPropertyAt(id);
 
  disp(prop.getName());
end % fcn

… actually works fine.

Thanks, for everything! This blog is helping a lot …
Jan

]]>
By: Janhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-314533 Mon, 17 Feb 2014 17:25:07 +0000 https://undocumentedmatlab.com/?p=1316#comment-314533 Hi Yair,

thanks for your quick reply.

I managed to get the ‘ValueChangedCallback’ as you suggested. But unfortunately, I only get the actual java ID of the selected component. So, having 8 properties in 3 categories, the ID I get goes from 0 to 10. The components are all stored in a java.util.ArrayList (just like in your example above), which goes from 0 to 7 (for 8 components). Is there a way to get the ‘complete’ list of the property grid, where also the categories are stored in?

Unfortunately, I have no knowledge of java (yet), so I can’t figure it out myself …

Best wishes,
Jan

]]>