About.Java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // About.java
  19. import com.ms.wfc.app.*;
  20. import com.ms.wfc.core.*;
  21. import com.ms.wfc.ui.*;
  22. /**
  23. * @author: Application Wizard
  24. * @version: 1.0
  25. * This class can take a variable number of parameters on the command
  26. * line. Program execution begins with the main() method. The class
  27. * constructor is not invoked unless an object of type '%FILENAME%'
  28. * created in the main() method.
  29. */
  30. public class About extends Form
  31. {
  32. private void okButton_click(Object sender, Event e)
  33. {
  34. this.setDialogResult(DialogResult.OK);
  35. }
  36. public About()
  37. {
  38. super();
  39. //Required for Visual J++ Form Designer support
  40. initForm();
  41. // Set Avail System Memory Information
  42. com.ms.win32.MEMORYSTATUS lpMemStat = new com.ms.win32.MEMORYSTATUS();
  43. GlobalMemoryStatus(lpMemStat);
  44. availableMemoryLabel.setText(Integer.toString(lpMemStat.dwTotalPhys/1024) + " KB");
  45. }
  46. /**
  47. * %FILENAME% overrides dispose so it can clean up the
  48. * component list.
  49. */
  50. public void dispose()
  51. {
  52. super.dispose();
  53. components.dispose();
  54. }
  55. /**
  56. * NOTE: The following code is required by the Visual J++ form
  57. * designer. It can be modified using the form editor. Do not
  58. * modify it using the code editor.
  59. */
  60. Container components = new Container();
  61. Button okButton = new Button();
  62. Label titleLabel = new Label();
  63. Label versionLabel = new Label();
  64. Label nameLabel = new Label();
  65. Label memoryLabel = new Label();
  66. Label availableMemoryLabel = new Label();
  67. private void initForm()
  68. {
  69. okButton.setLocation(new Point(208, 192));
  70. okButton.setSize(new Point(84, 23));
  71. okButton.setTabIndex(0);
  72. okButton.setText("OK");
  73. okButton.addOnClick(new EventHandler(this.okButton_click));
  74. this.setText("RenegadeSim");
  75. this.setAcceptButton(okButton);
  76. this.setAutoScaleBaseSize(new Point(5, 13));
  77. this.setBorderStyle(FormBorderStyle.FIXED_TOOLWINDOW);
  78. this.setCancelButton(okButton);
  79. this.setClientSize(new Point(298, 241));
  80. this.setMaximizeBox(false);
  81. this.setMinimizeBox(false);
  82. this.setStartPosition(FormStartPosition.CENTER_SCREEN);
  83. titleLabel.setFont(new Font("MS Sans Serif", 15.0f, FontSize.CHARACTERHEIGHT, FontWeight.BOLD, false, false, false));
  84. titleLabel.setLocation(new Point(10, 10));
  85. titleLabel.setSize(new Point(280, 40));
  86. titleLabel.setTabIndex(1);
  87. titleLabel.setTabStop(false);
  88. titleLabel.setText("Renegade Game Results Simulator");
  89. versionLabel.setLocation(new Point(10, 60));
  90. versionLabel.setSize(new Point(280, 20));
  91. versionLabel.setTabIndex(3);
  92. versionLabel.setTabStop(false);
  93. versionLabel.setText("Version 0.1a");
  94. nameLabel.setLocation(new Point(10, 90));
  95. nameLabel.setSize(new Point(280, 50));
  96. nameLabel.setTabIndex(4);
  97. nameLabel.setTabStop(false);
  98. nameLabel.setText("Randomly computes a set of scores given a bunch of Renegade players and calls a C++ DLL via JNI to deliver game results packets to the Renegade game results server.");
  99. memoryLabel.setLocation(new Point(8, 160));
  100. memoryLabel.setSize(new Point(200, 24));
  101. memoryLabel.setTabIndex(2);
  102. memoryLabel.setTabStop(false);
  103. memoryLabel.setText("Memory available to system: ");
  104. availableMemoryLabel.setLocation(new Point(212, 160));
  105. availableMemoryLabel.setSize(new Point(72, 24));
  106. availableMemoryLabel.setTabIndex(5);
  107. availableMemoryLabel.setTabStop(false);
  108. availableMemoryLabel.setText("");
  109. this.setNewControls(new Control[] {
  110. nameLabel,
  111. versionLabel,
  112. titleLabel,
  113. memoryLabel,
  114. availableMemoryLabel,
  115. okButton});
  116. }
  117. /**
  118. * The main entry point for the application.
  119. *
  120. * @param args Array of parameters passed to the application
  121. * via the command line.
  122. */
  123. public static void main(String args[])
  124. {
  125. Application.run(new About());
  126. }
  127. /**
  128. * @dll.import("KERNEL32",auto)
  129. */
  130. public static native void GlobalMemoryStatus(com.ms.win32.MEMORYSTATUS lpBuffer);
  131. }