Maximize Workplace within its frame and add versioned Design Studio
This commit is contained in:
@@ -58,3 +58,10 @@ in HMI_APP_PREF/PAGE_ACCESS and enforced on operator navigation, effective pages
|
||||
Ancestor restrictions apply; existing designer/admin management privileges retained. JNLP starts in
|
||||
full browser viewport; browser fullscreen requires a click; diagnostics remain off.
|
||||
See HMI_PAGE_ROLES_FULLSCREEN.md for test evidence and live-test limits.
|
||||
|
||||
## 2026-11-24 follow-up – authoritative latest behavior
|
||||
|
||||
Workplace remains in its widget frame; Java wrapper maximizes only its main JFrame and adapts to
|
||||
virtual desktop dimensions. No automatic browser overlay. Diagnostics off. Design-Studio adds
|
||||
named base-layout/color profiles, validated JSON import/export, immutable revisions and publication
|
||||
rollback through the existing CUST preference store. See HMI_DESIGN_STUDIO.md.
|
||||
|
||||
38
hmi-docs/cheerpj/WorkplaceLauncher.java
Normal file
38
hmi-docs/cheerpj/WorkplaceLauncher.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.widgetworkbench.cheerpj;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import java.util.Arrays;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
/** Starts the unmodified vendor main and maximizes its JFrame INSIDE CheerpJ's desktop. */
|
||||
public final class WorkplaceLauncher {
|
||||
private WorkplaceLauncher() { }
|
||||
public static void main(String[] args)throws Exception {
|
||||
if(args.length<1)throw new IllegalArgumentException("Missing main class");
|
||||
Thread maximize=new Thread(()->{
|
||||
final java.util.Map<Frame,Dimension> sizes=new java.util.WeakHashMap<>();
|
||||
while(true){
|
||||
try{
|
||||
SwingUtilities.invokeAndWait(()->{
|
||||
Dimension viewport=Toolkit.getDefaultToolkit().getScreenSize();
|
||||
for(Frame frame:Frame.getFrames()){
|
||||
if(!"com.itac.mes.suite.presentation.MesSuiteFrame".equals(frame.getClass().getName())||!frame.isShowing())continue;
|
||||
if(viewport.equals(sizes.get(frame)))continue;
|
||||
frame.setMaximizedBounds(new Rectangle(0,0,viewport.width,viewport.height));
|
||||
frame.setExtendedState(frame.getExtendedState()|Frame.MAXIMIZED_BOTH);
|
||||
// Also size explicitly for virtual window managers without maximization support.
|
||||
frame.setBounds(0,0,viewport.width,viewport.height);
|
||||
frame.validate();sizes.put(frame,new Dimension(viewport));
|
||||
}
|
||||
});
|
||||
Thread.sleep(750);
|
||||
}catch(InterruptedException e){Thread.currentThread().interrupt();return;}
|
||||
catch(Exception e){return;} // Never block the vendor application on window-manager support.
|
||||
}
|
||||
},"Workplace-Frame-Maximize");
|
||||
maximize.setDaemon(true);maximize.start();
|
||||
try{Class.forName(args[0]).getMethod("main",String[].class).invoke(null,(Object)Arrays.copyOfRange(args,1,args.length));}
|
||||
catch(InvocationTargetException e){Throwable cause=e.getCause();if(cause instanceof Exception)throw (Exception)cause;if(cause instanceof Error)throw (Error)cause;throw e;}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user