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

63
LINES

< > BotCompany Repo | #1034718 // G22ProjectOverviewPanel (shows story, auto start status, variables)

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

Transpiled version (61364L) is out of date.

srecord noeq G22ProjectOverviewPanel(G22Utils g22utils) {
  JSyntaxTextFileEditor storyView;
  JLabel lblStats;
  transient G22ShowCasePanel showCasePanel;

  void updateStats {
    setText(lblStats, "Database core size: " + str_toKB(fileSize(g22utils.concepts().conceptsFile())));
  }
  
  cachedVisualize {
    var conceptsFile = g22utils.concepts().conceptsFile();
    lblStats = rightAlignedLabel();
    
    IVF1<File> fileListener = file -> {
      if (sameFile(file, conceptsFile))
        updateStats();
    };
    
    bindToComponent(lblStats, -> {
      g22utils.onProjectFileChanged(fileListener);
      updateStats();
    }, -> g22utils.removeProjectFileChangedListener(fileListener));
    
    storyView = new JSyntaxTextFileEditor(g22utils.projectStoryTextFile())
      .uneditable(true);
    storyView.adaptSyntaxTextArea = textArea ->
      g22_adaptSyntaxTextAreaForHashRefs(textArea, g22utils);
      
    addInFront(storyView.buttons(),
      jImageButtonScaledToWidth(16, #1103068, "Edit", rThread {
        //g22utils.projectActions.editProjectStory();
        storyView.uneditable(false);
      }));
      
    showCasePanel = new G22ShowCasePanel(g22utils);

    // LAYOUT
    
    S title = "Project " + quote(g22utils.projectName()) + " Overview";
    
    G22VariablesPanel variablesPanel = g22utils.makeVariablesPanel();
    variablesPanel.crud().tableSearcher().scpRightOfSearchPanel.set(withLeftMargin(
      toolTip("Maximize variables panel", jimageButtonScaledToWidth(16, #1103161, rThread {
        g22utils.showUIURL("Variables")
      }))));
    
    ret withTopAndBottomMargin(jRaisedCenteredSection(title,
      jvsplit_minZero(
        jhsplit(0.75,
          jCenteredSection("Project Story",
            centerAndSouthWithMargin(
              storyView,
              centerAndEastWithMargin(lblStats, jFilePathButton(conceptsFile))
            )),
          northAndCenterWithMargin(
            new G22AutoStartPanel(g22utils),
            variablesPanel.compactView(false)
          )),
        jCenteredSection("Showcase", showCasePanel.visualize())
      ) // end of jvsplit
    ));
  }
}

Author comment

Began life as a copy of #1034688

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1034718
Snippet name: G22ProjectOverviewPanel (shows story, auto start status, variables)
Eternal ID of this version: #1034718/52
Text MD5: 9099fc2376ae389686c6e94a6e214c4e
Author: stefan
Category: javax / gazelle 22
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-21 16:06:55
Source code size: 2197 bytes / 63 lines
Pitched / IR pitched: No / No
Views / Downloads: 114 / 382
Version history: 51 change(s)
Referenced in: [show references]