home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09961.iso / java / mojo1-2e.exe / MOJODISK / DATA.4 / lib / packages / network.def < prev    next >
Encoding:
Text File  |  1996-07-02  |  8.9 KB  |  509 lines

  1. DEF_COMPONENTNAME
  2. URLTextComponent_Button1
  3. DEF_SUPERCLASS
  4. Button
  5. DEF_SUPERCOMPONENT
  6. URLTextComponent
  7. DEF_PACKAGE
  8. mojo
  9. networking
  10. subcomponents
  11. urltextcomponent
  12. DEF_ENDLIST
  13. DEF_SUBCOMPONENTLIST
  14. DEF_ENDLIST
  15. DEF_SUBCOMPONENTCLASSLIST
  16. DEF_ENDLIST
  17. DEF_CATEGORY
  18.  
  19. DEF_BITMAP
  20.  
  21. DEF_THUMBNAIL_UP
  22.  
  23. DEF_THUMBNAIL_DOWN
  24.  
  25. DEF_VISUAL
  26. DEF_IMPORTS
  27. DEF_ENDLIST
  28. DEF_REQUIRES
  29. DEF_ENDLIST
  30. DEF_IMPLEMENTS
  31. DEF_ENDLIST
  32. DEF_DECLARATION
  33. // A class that produces a labeled button component.
  34. DEF_ENDLIST
  35. DEF_EVENT
  36. public boolean action(Event evt, Object what)
  37. {
  38.    // local variables
  39.  
  40.   URL tempURL = null;
  41.   URL hostURL = null;
  42.   String aLine = "";
  43.  
  44.    // event body
  45.   try {
  46.     if (parent.getUseDocumentBase() == true)
  47.       hostURL = new URL(applet.getDocumentBase(), parent.getFilename());
  48.     else  // using current applet's CodeBase
  49.       hostURL = new URL(applet.getCodeBase(), parent.getFilename());
  50.   }
  51.   catch (MalformedURLException e) {
  52.     System.out.println("MalforedURLExeption using File: " + parent.getFilename());
  53.   }
  54.   try {
  55.     InputStream hostInputStream = hostURL.openStream();
  56.     // Creating DataInputStream wrapped around BufferedInputStream for better performance.
  57.     DataInputStream dataStream = new DataInputStream(new BufferedInputStream(hostInputStream));
  58.     while ((aLine = dataStream.readLine()) != null) { ;
  59.       parent.TextArea1.appendText(aLine + "\n");
  60.     }
  61.   }
  62.   catch (IOException e)   {
  63.     System.out.println("IOExeption while reading: " + hostURL.toString());
  64.   }
  65.    return(true);
  66. }
  67. DEF_ENDLIST
  68. DEF_PROPERTY
  69. Label
  70. String
  71. setLabel(AVALUE);
  72. AVALUE = getLabel();
  73. Read
  74. DEF_ENDLIST
  75. DEF_PROPERTY
  76. Top
  77. int
  78. move(bounds().x, AVALUE);
  79. AVALUE = bounds().y;
  80. 230
  81. DEF_ENDLIST
  82. DEF_PROPERTY
  83. Left
  84. int
  85. move(AVALUE, bounds().y);
  86. AVALUE = bounds().x;
  87. 110
  88. DEF_ENDLIST
  89. DEF_PROPERTY
  90. Height
  91. int
  92. resize(bounds().width, AVALUE);
  93. AVALUE = bounds().height;
  94. 25
  95. DEF_ENDLIST
  96. DEF_PROPERTY
  97. Width
  98. int
  99. resize(AVALUE, bounds().height);
  100. AVALUE = bounds().width;
  101. 75
  102. DEF_ENDLIST
  103. DEF_PROPERTY
  104. ForegroundColor
  105. Color
  106. setForeground(AVALUE);
  107. AVALUE = getForeground();
  108. Color.black
  109. DEF_ENDLIST
  110. DEF_PROPERTY
  111. BackgroundColor
  112. Color
  113. setBackground(AVALUE);
  114. AVALUE = getBackground();
  115. Color.lightGray
  116. DEF_ENDLIST
  117. DEF_PROPERTY
  118. FontName
  119. String
  120. setFont(new Font(AVALUE, getFont().getStyle(), getFont().getSize()));
  121. AVALUE = getFont().getName();
  122. Courier
  123. DEF_ENDLIST
  124. DEF_PROPERTY
  125. FontStyle
  126. int
  127. setFont(new Font(getFont().getName(), AVALUE, getFont().getSize()));
  128. AVALUE = getFont().getStyle();
  129. Font.PLAIN
  130. DEF_ENDLIST
  131. DEF_PROPERTY
  132. FontSize
  133. int
  134. setFont(new Font(getFont().getName(), getFont().getStyle(), AVALUE));
  135. AVALUE = getFont().getSize();
  136. 10
  137. DEF_ENDLIST
  138. DEF_ENDCOMPONENT
  139. DEF_COMPONENTNAME
  140. URLTextComponent_Button2
  141. DEF_SUPERCLASS
  142. Button
  143. DEF_SUPERCOMPONENT
  144. URLTextComponent
  145. DEF_PACKAGE
  146. mojo
  147. networking
  148. subcomponents
  149. urltextcomponent
  150. DEF_ENDLIST
  151. DEF_SUBCOMPONENTLIST
  152. DEF_ENDLIST
  153. DEF_SUBCOMPONENTCLASSLIST
  154. DEF_ENDLIST
  155. DEF_CATEGORY
  156.  
  157. DEF_BITMAP
  158.  
  159. DEF_THUMBNAIL_UP
  160. nbutn2.bmp
  161. DEF_THUMBNAIL_DOWN
  162.  
  163. DEF_VISUAL
  164. DEF_IMPORTS
  165. DEF_ENDLIST
  166. DEF_REQUIRES
  167. DEF_ENDLIST
  168. DEF_IMPLEMENTS
  169. DEF_ENDLIST
  170. DEF_DECLARATION
  171. // A class that produces a labeled button component.
  172. DEF_ENDLIST
  173. DEF_EVENT
  174. public boolean action(Event evt, Object what)
  175. {
  176.    // local variables
  177.  
  178.    // event body
  179.  
  180.    parent.TextArea1.setText("");
  181.  
  182.    return(true);
  183. }
  184. DEF_ENDLIST
  185. DEF_PROPERTY
  186. Label
  187. String
  188. setLabel(AVALUE);
  189. AVALUE = getLabel();
  190. Clear
  191. DEF_ENDLIST
  192. DEF_PROPERTY
  193. Top
  194. int
  195. move(bounds().x, AVALUE);
  196. AVALUE = bounds().y;
  197. 230
  198. DEF_ENDLIST
  199. DEF_PROPERTY
  200. Left
  201. int
  202. move(AVALUE, bounds().y);
  203. AVALUE = bounds().x;
  204. 240
  205. DEF_ENDLIST
  206. DEF_PROPERTY
  207. Height
  208. int
  209. resize(bounds().width, AVALUE);
  210. AVALUE = bounds().height;
  211. 25
  212. DEF_ENDLIST
  213. DEF_PROPERTY
  214. Width
  215. int
  216. resize(AVALUE, bounds().height);
  217. AVALUE = bounds().width;
  218. 75
  219. DEF_ENDLIST
  220. DEF_PROPERTY
  221. ForegroundColor
  222. Color
  223. setForeground(AVALUE);
  224. AVALUE = getForeground();
  225. Color.black
  226. DEF_ENDLIST
  227. DEF_PROPERTY
  228. BackgroundColor
  229. Color
  230. setBackground(AVALUE);
  231. AVALUE = getBackground();
  232. Color.lightGray
  233. DEF_ENDLIST
  234. DEF_PROPERTY
  235. FontName
  236. String
  237. setFont(new Font(AVALUE, getFont().getStyle(), getFont().getSize()));
  238. AVALUE = getFont().getName();
  239. Courier
  240. DEF_ENDLIST
  241. DEF_PROPERTY
  242. FontStyle
  243. int
  244. setFont(new Font(getFont().getName(), AVALUE, getFont().getSize()));
  245. AVALUE = getFont().getStyle();
  246. Font.PLAIN
  247. DEF_ENDLIST
  248. DEF_PROPERTY
  249. FontSize
  250. int
  251. setFont(new Font(getFont().getName(), getFont().getStyle(), AVALUE));
  252. AVALUE = getFont().getSize();
  253. 10
  254. DEF_ENDLIST
  255. DEF_ENDCOMPONENT
  256. DEF_COMPONENTNAME
  257. URLTextComponent_TextArea1
  258. DEF_SUPERCLASS
  259. TextArea
  260. DEF_SUPERCOMPONENT
  261. URLTextComponent
  262. DEF_PACKAGE
  263. mojo
  264. networking
  265. subcomponents
  266. urltextcomponent
  267. DEF_ENDLIST
  268. DEF_SUBCOMPONENTLIST
  269. DEF_ENDLIST
  270. DEF_SUBCOMPONENTCLASSLIST
  271. DEF_ENDLIST
  272. DEF_CATEGORY
  273.  
  274. DEF_BITMAP
  275.  
  276. DEF_THUMBNAIL_UP
  277. nmemo.bmp
  278. DEF_THUMBNAIL_DOWN
  279.  
  280. DEF_VISUAL
  281. DEF_IMPORTS
  282. DEF_ENDLIST
  283. DEF_REQUIRES
  284. DEF_ENDLIST
  285. DEF_IMPLEMENTS
  286. DEF_ENDLIST
  287. DEF_DECLARATION
  288. // A TextArea object is a multi-line area that displays text. It can
  289. // be set to allow editing or read-only modes.
  290.  
  291. DEF_ENDLIST
  292. DEF_PROPERTY
  293. Top
  294. int
  295. move(bounds().x, AVALUE);
  296. AVALUE = bounds().y;
  297. 20
  298. DEF_ENDLIST
  299. DEF_PROPERTY
  300. Left
  301. int
  302. move(AVALUE, bounds().y);
  303. AVALUE = bounds().x;
  304. 30
  305. DEF_ENDLIST
  306. DEF_PROPERTY
  307. Height
  308. int
  309. resize(bounds().width, AVALUE);
  310. AVALUE = bounds().height;
  311. 186
  312. DEF_ENDLIST
  313. DEF_PROPERTY
  314. Width
  315. int
  316. resize(AVALUE, bounds().height);
  317. AVALUE = bounds().width;
  318. 365
  319. DEF_ENDLIST
  320. DEF_PROPERTY
  321. ForegroundColor
  322. Color
  323. setForeground(AVALUE);
  324. AVALUE = getForeground();
  325. Color.black
  326. DEF_ENDLIST
  327. DEF_PROPERTY
  328. BackgroundColor
  329. Color
  330. setBackground(AVALUE);
  331. AVALUE = getBackground();
  332. Color.white
  333. DEF_ENDLIST
  334. DEF_PROPERTY
  335. FontName
  336. String
  337. setFont(new Font(AVALUE, getFont().getStyle(), getFont().getSize()));
  338. AVALUE = getFont().getName();
  339. Courier
  340. DEF_ENDLIST
  341. DEF_PROPERTY
  342. FontStyle
  343. int
  344. setFont(new Font(getFont().getName(), AVALUE, getFont().getSize()));
  345. AVALUE = getFont().getStyle();
  346. Font.PLAIN
  347. DEF_ENDLIST
  348. DEF_PROPERTY
  349. FontSize
  350. int
  351. setFont(new Font(getFont().getName(), getFont().getStyle(), AVALUE));
  352. AVALUE = getFont().getSize();
  353. 10
  354. DEF_ENDLIST
  355. DEF_ENDCOMPONENT
  356. DEF_COMPONENTNAME
  357. URLTextComponent
  358. DEF_SUPERCLASS
  359. Panel
  360. DEF_SUPERCOMPONENT
  361. Object
  362. DEF_PACKAGE
  363. mojo
  364. networking
  365. DEF_ENDLIST
  366. DEF_SUBCOMPONENTLIST
  367. TextArea1
  368. Button1
  369. Button2
  370. DEF_ENDLIST
  371. DEF_SUBCOMPONENTCLASSLIST
  372. URLTextComponent_TextArea1
  373. URLTextComponent_Button1
  374. URLTextComponent_Button2
  375. DEF_ENDLIST
  376. DEF_CATEGORY
  377. Networking
  378. DEF_BITMAP
  379.  
  380. DEF_THUMBNAIL_UP
  381. url.bmp
  382. DEF_THUMBNAIL_DOWN
  383. 2-url.bmp
  384. DEF_VISUAL
  385. DEF_TOOL
  386. DEF_PANEL
  387. DEF_IMPORTS
  388. java.net.URL
  389. java.net.MalformedURLException
  390. java.io.*
  391. DEF_ENDLIST
  392. DEF_REQUIRES
  393. DEF_ENDLIST
  394. DEF_IMPLEMENTS
  395. DEF_ENDLIST
  396. DEF_DECLARATION
  397. // A Panel Container class. This produces a generic container.
  398.  
  399.   // private variables used for properties
  400.  
  401.   String filename;            // Filename to load
  402.  
  403.   boolean useDocumentBase;    // when true the DocumentBase is used; when false the CodeBase is used.
  404.                               // DocumentBase is the URL of the HTML file contain the current Applet.
  405.                               // CodeBase is the URL of the current Applet.
  406. DEF_ENDLIST
  407. DEF_METHOD
  408. public void setFilename(String aFilename) {
  409.  
  410.   filename = aFilename;
  411. }
  412. DEF_ENDLIST
  413. DEF_METHOD
  414. public String getFilename() {
  415.  
  416.   return(filename);
  417. }
  418. DEF_ENDLIST
  419. DEF_METHOD
  420. public boolean getUseDocumentBase() {
  421.  
  422.   return(useDocumentBase);
  423. }
  424. DEF_ENDLIST
  425. DEF_METHOD
  426. public void setUseDocumentBase(boolean aBoolean) {
  427.  
  428.   useDocumentBase = aBoolean;
  429. }
  430. DEF_ENDLIST
  431. DEF_PROPERTY
  432. Filename
  433. String
  434. setFilename(AVALUE);
  435. AVALUE = getFilename();
  436.  
  437. DEF_ENDLIST
  438. DEF_PROPERTY
  439. Use DocumentBase
  440. boolean
  441. setUseDocumentBase(AVALUE);
  442. AVALUE = getUseDocumentBase();
  443. false
  444. DEF_ENDLIST
  445. DEF_PROPERTY
  446. Top
  447. int
  448. move(bounds().x, AVALUE);
  449. AVALUE = bounds().y;
  450. 10
  451. DEF_ENDLIST
  452. DEF_PROPERTY
  453. Left
  454. int
  455. move(AVALUE, bounds().y);
  456. AVALUE = bounds().x;
  457. 40
  458. DEF_ENDLIST
  459. DEF_PROPERTY
  460. Height
  461. int
  462. resize(bounds().width, AVALUE);
  463. AVALUE = bounds().height;
  464. 284
  465. DEF_ENDLIST
  466. DEF_PROPERTY
  467. Width
  468. int
  469. resize(AVALUE, bounds().height);
  470. AVALUE = bounds().width;
  471. 430
  472. DEF_ENDLIST
  473. DEF_PROPERTY
  474. ForegroundColor
  475. Color
  476. setForeground(AVALUE);
  477. AVALUE = getForeground();
  478. Color.black
  479. DEF_ENDLIST
  480. DEF_PROPERTY
  481. BackgroundColor
  482. Color
  483. setBackground(AVALUE);
  484. AVALUE = getBackground();
  485. Color.lightGray
  486. DEF_ENDLIST
  487. DEF_PROPERTY
  488. FontName
  489. String
  490. setFont(new Font(AVALUE, getFont().getStyle(), getFont().getSize()));
  491. AVALUE = getFont().getName();
  492. Courier
  493. DEF_ENDLIST
  494. DEF_PROPERTY
  495. FontStyle
  496. int
  497. setFont(new Font(getFont().getName(), AVALUE, getFont().getSize()));
  498. AVALUE = getFont().getStyle();
  499. Font.PLAIN
  500. DEF_ENDLIST
  501. DEF_PROPERTY
  502. FontSize
  503. int
  504. setFont(new Font(getFont().getName(), getFont().getStyle(), AVALUE));
  505. AVALUE = getFont().getSize();
  506. 10
  507. DEF_ENDLIST
  508. DEF_ENDCOMPONENT
  509.