Module org.autogui

Class GuiReprEmbeddedComponent

java.lang.Object
org.autogui.base.mapping.GuiReprValue
org.autogui.swing.mapping.GuiReprEmbeddedComponent
All Implemented Interfaces:
GuiRepresentation

public class GuiReprEmbeddedComponent extends GuiReprValue
a GUI component for a property holding a JComponent
     private JComponent comp;
     @GuiIncluded public JComponent getComp() {
         if (comp == null) {
             comp = new JLabel("hello");
         }
         return comp;
     }
 

the class executes obtaining and updating a target value under the event dispatching thread via SwingDeferredRunner.

For the case of updating from GUI, a UI event (in the event thread) -> executeContextTask and it observes that isTaskRunnerUsedFor(Supplier) returns false and directly invoke the given task -> updateFromGui -> update -> SwingDeferredRunner.run(SwingDeferredRunner.Task) with super.update (it directly invoke the task as in the event thread) -> the method of the target object is invoked under the event thread.