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

97
LINES

< > BotCompany Repo | #1034135 // Gazelle 22 Standalone [backup]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 6056K of libraries. Click here for Pure Java version (31168L/178K).

1  
// WELCOME!! This is THE PROGRAM YOU ARE LOOKING FOR.
2  
3  
!7
4  
5  
//set flag OtherLoadableUtils. lib 1033861
6  
7  
// INCLUDE THE MAIN MODULE
8  
!include #1033862 // Gazelle Screen Cam [dev version]
9  
replace MainModule with GazelleScreenCam.
10  
11  
!include early #1033891 // include GazelleHost early for flags like PingV3
12  
13  
//set flag InCore.
14  
set flag NoJavaXJar.
15  
set flag NoLocalSnippets.
16  
set flag OurSyncCollections.
17  
18  
sS windowTitle = "Gazelle 22";
19  
sS progIDForDBAndAutoUpdate = #1033860;
20  
sbool pingSourceStrictMode;
21  
22  
static GazelleHost host;
23  
static MainModule client;
24  
static ThreadPool threadPool;
25  
26  
p {
27  
  loadableUtils.utils.__setJavaX(main.class);
28  
  standaloneInit();
29  
  
30  
  ping_v3_setPingSourceMaker(-> {
31  
    //System.out.println("pingSourceMaker");
32  
    if (pingSourceStrictMode)
33  
      fail("Strict mode - make a ping source first!!");
34  
    ret new PingSource(threadPool, "legacy");
35  
  });
36  
  
37  
  threadPool = new ThreadPool(findIntArg cores(args, numberOfCores()));
38  
  print(threadPool);
39  
  //threadPool.verbose = true;
40  
  PingSource ps = new(threadPool, print("Starting Gazelle"));
41  
  ps.do(-> {
42  
    System.out.println("Pinging");
43  
    ping();
44  
    //if (true) fail("error test");
45  
  
46  
    print("Pinged");
47  
    
48  
    programID = progIDForDBAndAutoUpdate;
49  
    
50  
    // patch utils.preferredScreen
51  
    
52  
    preferredScreen = -> {
53  
      if (host == null) ret 0;
54  
      var stem = host.stem;
55  
      if (stem == null) ret 0;
56  
      int screen = max(0, screenNrOfWindow(mainWindow()));
57  
      print(preferredScreen := screen);
58  
      ret screen;
59  
    };
60  
    
61  
    // patch utils.showForm_makeFrame to use JDialog
62  
    // (to avoid dialogs being hidden behind always-on-top window)
63  
    
64  
    showForm_makeFrame = (title, panel) -> {
65  
      var dialog = new JDialog(mainWindow(), title);
66  
      setDialogContents(dialog, withMargin(panel));
67  
      packWindow(dialog);
68  
      minWindowWidth(dialog, 400);
69  
      centerDialogOverOwner(dialog);
70  
      dialog.setVisible(true);
71  
      //setBounds(dialog, defaultNewFrameBounds());
72  
    };
73  
    
74  
    if (cic(args, "delete-session")) {
75  
      print("Deleting session (" + programDir(programID) + ")");
76  
      clearConceptsOf(programID);
77  
    }
78  
    
79  
    host = new GazelleHost(threadPool, -> {
80  
      ret client = new MainModule;
81  
    });
82  
    if (sameSnippetID(programID, #1033860))
83  
      windowTitle += " dev";
84  
    host.windowTitle = windowTitle;
85  
    host.run(args);
86  
    
87  
    if (!cic(args, "console")) {
88  
      print("Stopping System.out");
89  
      printAlsoToSystemOut = false;
90  
    }
91  
  });
92  
  print("aha.");
93  
}
94  
95  
static Window mainWindow() { ret host.stem.window; }
96  
97  
static Map generalMap = syncMap();

Author comment

Began life as a copy of #1033860

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): bhatertpkbcr, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034135
Snippet name: Gazelle 22 Standalone [backup]
Eternal ID of this version: #1034135/1
Text MD5: 3d7b628b70627a9527455e46d79f81df
Transpilation MD5: 210de75c747b53da31ddc99a493dc5f2
Author: stefan
Category: javax / screen recognition
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-24 14:21:19
Source code size: 2677 bytes / 97 lines
Pitched / IR pitched: No / No
Views / Downloads: 204 / 643
Referenced in: [show references]