cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Thierry_S
Super User

JMP > JSL > Journal > How to Identify Collapsed versus Expanded Items?

Hi JMP Community,

I want to extract items from an existing Journal based on their Collapsed / Expanded status. I tried to use the "Root << is collapsed (Node)" method but it is returning an empty value independently of Collapsed/Expanded status (see JSL work in progress below).

(JMP 16.1, Windows 10 Pro)

Questions:

  1. Is the "<< is Collapsed" method applicable to journal structures?
  2. If it does, what is its correct usage, especially regarding "root" and "node" definitions?
  3. If it does not, what alternative could I use to return the collapsed status of a Journal item?
Names Default to Here (1);

winlist = Window () << Get Window Title ();

For( i = N Items( winlist ), i > 0, i--,
	If( (Window( winlist[i] ) << Window Class Name) != "Journal",
		Remove From( winlist, i )
	)
);

If (N items (winlist) == 0, New Window ("ERROR", Text Box ("!!!! NO JOURNAL CURRENTLY OPENED !!!!")); throw (1));

dw = New Window (" PICK A JOURNAL ",
	<< MODAL,
	V List Box (	
		Text Box (" SELECT A JOURNAL"),
		wl = List Box (	winlist,
						Width (500),
						Max Selected (1),
						nlines (10)
						),
		
		Text Box (" Enter number of plots per row"),
		nbe = Number Edit Box (5),	
		
		Text Box (" REMOVE LEGEND? "),
		rb = Radio Box( {"YES", "NO"}),	
		
		Text Box (" PLOT ONLY EXPANDED? "),
		rb2 = Radio Box( {"YES", "NO"}),			
		
		Button Box ("OK", jrn_l = (wl << get selected); npr = nbe << get (); lg_x = rb << get (); ex_x = rb2 << get (); switch = 1),
		
		Button Box ("CANCEL", switch = 0; Throw(1))			
		),
		

	
	);


show (jrn_l);
show (npr);
show (lg_x);
show (ex_x);

If (switch == 0, Throw (1));

jrn = Get Window (jrn_l [1]);

show (jrn);

nplot = N Items (jrn << Xpath ("//OutlineBox"));

dummy = Lineup Box(N Col (1));
win = New window ("PLOTS",
	mybox = Lineup Box (N Col (npr))
);

For (i = 1, i<= nplot, i++,
	collp = jrn << is collapsed (OutlineBox (i));
	show (collp);
	if (collp == 1, 
			dummy = Lineup Box(N Col (1));
			Plot = jrn [PictureBox (i)];
			dummy << Append (Plot);
			if(lg_x == 1, 
				zzz = Dummy << Xpath ("//LegendBox");
				zzz << delete
			   );	
			mybox << Append (Dummy)
		)	
	
);

Thank you.

 

Best,

 

TS

Thierry R. Sornasse
1 ACCEPTED SOLUTION

Accepted Solutions
Thierry_S
Super User

Re: JMP > JSL > Journal > How to Identify Collapsed versus Expanded Items?

Hi JMP Community and @txnelson ,

After reviewing all the methods applicable to OutlineBox objects, I finally found the solution to my own query: << GetOpen returns 1 for Expanded items and 0 for Collapsed items. 

Best,

TS

Thierry R. Sornasse

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: JMP > JSL > Journal > How to Identify Collapsed versus Expanded Items?

Is Collapsed()

is the proper way to work with Outline Boxes to determine if they are Open or Closed(Expanded or Collapsed);  On another dimension, an outline box has a Visibility dimension, which deals with the actual displaying of the object.  The Visibility() element is used to make an object, Visible, Hidden or Collapsed.  The Get Visibility() function determins the diplay objects visibility status.

Names Default To Here( 1 );
//This message applies to all display box objects
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d = dt << Distribution( Column( :height ) );
r = d << report;
tb = r[Table Box( 1 )];
Show( tb << Get Visibility );
Wait( 2 );
tb << Visibility( "Collapse" );
Show( tb << Get Visibility );

 

Jim
Thierry_S
Super User

Re: JMP > JSL > Journal > How to Identify Collapsed versus Expanded Items?

Hi @txnelson ,

I found that example in the Scripting Help, too, but it does not return the collapsed state of an item in a journal. Instead, it returns the Visible / Hidden state of an item which is not the same, unfortunately.

Also, I wonder if the << Get Visibility works differently in an active report versus a journal.

Thanks for your insights.

Best,

TS

Thierry R. Sornasse
Thierry_S
Super User

Re: JMP > JSL > Journal > How to Identify Collapsed versus Expanded Items?

Hi JMP Community and @txnelson ,

After reviewing all the methods applicable to OutlineBox objects, I finally found the solution to my own query: << GetOpen returns 1 for Expanded items and 0 for Collapsed items. 

Best,

TS

Thierry R. Sornasse