380 likes | 644 Views
Java , ActiveX , and Anfy. Java. Java Developed by Sun Object Oriented Language Compiling the source program into a special type of object code, known as Byte Code Byte Code can run on any computer with a Java Virtual Machine (JVM). JVM (Intel). Intel/ Windows PC. JVM (Sun). SPARC/
E N D
Java • Java • Developed by Sun • Object Oriented Language • Compiling the source program into a special type of object code, known as Byte Code • Byte Code can run on any computer with a Java Virtual Machine (JVM)
JVM (Intel) Intel/ Windows PC JVM (Sun) SPARC/ Solaris Workstation Java • Flow Java Source Code Java Compiler Other Architectures Supporting JVM Byte Code
Java • A Simple Java Program //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } }
Java Create Source Code Source code (developed by the programmer) public class Welcome { Saved on the disk public static void main(String[] args) { System.out.println("Welcome to Java!"); } Source Code } Byte code (generated by the compiler for JVM to read and interpret, not for you to understand) Compile Source Code … i.e., javac Welcome.java Method W elcome() 0 aload_0 … Method void main(java.lang.String[]) Bytecode (*.class) 0 getstatic #2 … 3 ldc #3 <String Welcome to " Java! > " 5 invokevirtual #4 … 8 return
Java • How to execute
Java Applet • Java applets are small Java programs that get downloaded to your computer and then run from a web browser when a web page that uses Java is loaded. • *.class
Java Applet • Example (WA.java) import javax.swing.JApplet; import java.awt.Graphics; public class WA extends JApplet { public void paint(Graphics g) { g.drawString("Welcome to Java!",25,25); } }
Java Applet • Embed Java Applet in HTML (WA.html) <html> <applet code=“WA.class”> </applet> </html>
Java Applet • Execution
JAR • JAR (Java Archive) • A platform-independent Data Format • Aggregating many files into one • Multiple Javaapplets and their requisite components (class files, images, and sounds) can be bundled in a JAR file • Subsequently downloaded to a Browser in a single HTTP transaction, improving the download speed
ActiveX • A set of technologies from Microsoft • Providing tools for linking desktop applications to the World Wide Web • Using a variety of programming tools--including Java, Visual Basic, and C++--developers can create interactive Web content • Allowinh users to view Word and Excel documents directly in a browser
Anfy • Tool for Building Java Applet
FrontPageand Anfy • Anfycan output Java Applet • We can paste the Applet to a HTML file by FrontPage
Anfy • Includes 52 applets • top effects and menu for • web sites • Blogs • Screensaver • URL • http://www.anfyteam.com/anj/index.html
Banner/Slideshow • 旗幟/幻燈片類型 • 三個Java Applets • 可以提供各種圖片間的切換效果。 • BOOK FLIP 書本翻頁特效 • Cross FADE Banner 交叉變換特效 • Mosaic Banner 馬賽克特效
Fractals & ALife • 分形/生命類型 • 四個Java Applets • 數學演算法建立的特殊圖形效果 • FLOZOIDS 飄浮物特效 • IFS FRACTALS 分形樹特效 • LIFE2D 二維生命特效 • MANDELBROT FRACTAL 幾何樹特效
Image Effects • 圖像效果類型 • 包含十四個Java Applets可以套用精彩和驚人的特殊效果。 • Stretch 拉扯 • Weather 天氣 • Zoom and Pan • BUMP光照投影特效
Image Effects • 圖像效果類型 • 包含十四個Java Applets • DEFORM 變形 • FIREWORKS 煙火 • HUE ROTATOR 循環色調 • LAKE湖面倒影特效 • ZOOM ROTATOR
Image Effects • 圖像效果類型 • 包含十四個Java Applets • LENS 透鏡特效 • ROT縮放旋轉特效 • SNOW 雪片特效 • WARP 彎曲變形特效 • WATER 水面漣漪特效 • WOBBLER 搖晃特效
3D Applets特效 • 3D Applets • 八種Java Applets • 3D效果的圖形特效 • Panarama 360度全景 • ANFY3D LIGHT 立體光影FLUID 液體流動 • GALAXY 銀河 • TMAP CUBE 3D 紋理映射立方體
3D Applets特效 • 3D效果的圖形特效 • TUNNEL 隧道 • TUNNEL 3D多層次隧道 • VOXEL LANDSCAPE 地表圖 • WORMHOLE蟲孔特效
Navigation Menu • 瀏覽選單 • 五個Java Applets 動態選單的超連結功能 • ANFY BUTTON • CUBE MENU立體選單特效 • MORP HMENU變形選單特效 • TREE MENU目錄樹選單特效 • WHEEL MENU旋轉選單特效
Other • 其它類型的十七個Java Applets不只提供多樣化的動畫效果,還擁有一些小而美的網頁工具程式。 • ANFYCAM 網路攝影機 • ANFYPAINT 繪畫工具 • BLOBS光點 • BLUR 模糊 • FIRE 火焰 • FLAG 旗幟飄揚 • FLAGLOAD 物件飄揚 • PLASMA 等離子 • SOLIDSCROLLER 簡單的文字捲動 • TEXTSCROLLER 固定文字捲動
Other • 其它類型的十七個Java Applets不只提供多樣化的動畫效果,還擁有一些小而美的網頁工具程式。 • Anfy Clock • Anfy Puzzle • Mad Text • Spiral Star • Star Text • Zoom and Blur • Anfy Chat
使用FrontPage插入Java Applet • 在FrontPage的Java Applet屬於進階控制項,只需擁有Java Applets或從Internet下載現成的Java Applet,就可以使用FrontPage在網頁插入Java Applet控制項。
Anfy Lab • Help • C:\Program Files\AnfyTeam\Tutorial\ helproot.html
Anfy Lab • Step 1 Press
Anfy Lab • Step 2 • The applet "Width" and "Height" are automatically entered when you specify the screen image and a "Resolution" value. Give A Figure
Anfy Lab • Step 2 • Next three parameters below "Intensity" decide how changeable the wind is. • With "Var. speed", you can set how fluently the wind changes its direction and speed. A higher value gives a faster change. The wind's behaviour itself is dynamically calculated and it does not show static behaviour. • You can limit the maximum and minimum wind speed at "Var. max" and "Var. min".
Anfy Lab • Step 2 • "Wave speed" literally controls the speed of the wave. Lower values produce very slow and calm wavings; whereas higher values result in very busy motion. • "Perspective" decides how the waves have to be stretched for perspective simulation. In other words, with this parameter, you can control visual distance between waves. Lower values mean narrow space in between waves and it looks very busy. • "Farwaving" parameter (values from 1 to 10000) allows you to determine how strong the far waves (top of lake) must be.
Anfy Lab • Step 2 • This "Half reflect" option allows you to shrink the reflection into the half size
Anfy Lab • Step 3
Anfy Lab • Step 4
Anfy Lab • Step 5 • If you would like the applet to be linked to a certain url, select "Enable link" and enter the link url below space. http://www.google.com
Anfy Lab • Step 6 • Click "Copy all files to..." button and specify a destination file name, say, home.html to which the HTML code will be output and the necessary .class files will be copied to the same folder.
Anfy Lab • Files
Anfy Lab • lake_lab.html <html> <head> : </head> <body bgcolor="#000000" text="#FFFF22" link="#5FFF5F" vlink="#553AEB" alink="#FF8000"> <table width=100% height=90%> <tr> <td align=center valign=center> <applet archive="AnLake.jar" code="AnLake.class" width="300" height="256"> <param name="credits" value="Applet by Fabio Ciucci (www.anfyteam.com)"> : </applet> : </body> </html>