Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

40
LINES

< > BotCompany Repo | #1030774 // DynBEAReactor_textInOut

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (27631L/191K).

beaConcept BInput {
  S text;
  
  toString { ret "[\*id*/] Input " + quote(text); }
}

beaConcept BOutput {
  S text;
  
  toString { ret "[\*id*/] Output " + quote(text); }
}

asclass DynBEAReactor_textInOut > DynBEAReactor {
  S input, output;
  
  transient JPanel inputButtons;

  visual
    jvsplit(0.2, jhsplit(jCenteredSection("Input",
      centerAndSouth(dm_wordWrapTextArea input(), withMargin(inputButtons = jRightAlignedButtons(
        "Load input", rThreadEnter loadInput,
        "Load & process", rThreadEnter loadAndProcess)))),
      dm_wordWrapTextAreaAsSection output()),
      super);


  @Override bool hasOutput() { ret hasConcept(BOutput); }
  
  void loadInput {
    setField(output := "");
    deleteReactors();
    deleteConcepts(BInput);
    uniq BInput(text := input);
  }
  
  void loadAndProcess {
    loadInput();
    reactUntilOutput();
  }
}

Author comment

Began life as a copy of #1030762

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030774
Snippet name: DynBEAReactor_textInOut
Eternal ID of this version: #1030774/12
Text MD5: 9e73f9acbe6ced92414d90a1c04b9693
Transpilation MD5: c3db599974077be63ea155e59ddb9c90
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-31 15:42:08
Source code size: 915 bytes / 40 lines
Pitched / IR pitched: No / No
Views / Downloads: 197 / 392
Version history: 11 change(s)
Referenced in: [show references]