|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
ComplDemo
public class ComplDemo
Demonstration of complex arithmetics.
The operations +, -, *, /, exp(), log() on complex numbers as well as many
other operations can be comprehended graphically.
ComplDemo can be embedded as Applet into a HTML page as well as used as
a stand-alone application.
As application:
java ComplDemo resp. java -jar ComplDemo.jar or javaw ComplDemo resp. javaw -jar ComplDemo.jarThe last possibility, the start by jawaw.exe from an archive you get on most Windows JDK/JRE installations by double clicking on the .jar file.
<applet code="ComplDemo.class" archive="compldemo.jar"
alt="Complex Applet" name="Comp1" width="500" height="328"
hspace="8" align="right">
ComplDemo and requesting the framework Frame4J in its manifest.
It will run on all up-to-date browsers if the framework is installed.
The best of them will offer the web-start download of Frame4J if that
framework should still be absent.
Complex,
CFun,
Beans,
Serialized Form| Nested Class Summary | |
|---|---|
class |
ComplDemo.ComplexWrapper
Wrapper for Complex with pixel coordinates and comparison. |
| Nested classes/interfaces inherited from class java.applet.Applet |
|---|
Applet.AccessibleApplet |
| Nested classes/interfaces inherited from class java.awt.Panel |
|---|
Panel.AccessibleAWTPanel |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
AUTHOR
Information: author. |
static String |
CLASS_F
Information: class file name. |
static String |
COPYRIGHT
Information: copyright hint. |
static int |
LAST_OP
Last operator respectively function index. |
static String[][] |
PAR_INFO
Infos on Applet parameters. |
boolean |
showPi
A circle of radius pi will be shown. |
boolean |
showUnit
A circle of radius 1 will be shown. |
static String |
TITLE
Title for use as graphical application. |
static String |
VERSION
Informations: version and date. |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ComplDemo()
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
|
void |
componentHidden(ComponentEvent e)
|
void |
componentMoved(ComponentEvent e)
|
void |
componentResized(ComponentEvent e)
Resize the frame if run as application. |
void |
componentShown(ComponentEvent e)
|
void |
destroy()
Final death as Applet. |
String |
getAppletInfo()
Common informations on the Applet. |
Dimension |
getMinimumSize()
Minimal size. |
String[][] |
getParameterInfo()
Infos on Applet parameters. |
Dimension |
getPreferredSize()
Size preferred. |
void |
imgInit()
Initialising the background picture. |
void |
init()
One time initialisations. |
void |
initOps()
Set the operands to visible default values. |
void |
itemStateChanged(ItemEvent e)
Item event. |
static void |
main(String[] args)
Start the graphical Demo as Java application. |
void |
makeArith()
Do the arithmetic operation. |
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
Dragging the mouse. |
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
Pressing the mouse button. |
void |
mouseReleased(MouseEvent e)
|
void |
paint(Graphics g)
Pint the picture. |
void |
run()
Working method of the background thread. |
void |
selectOp(int ts)
Choosing another arithmetic operation. |
void |
showArith()
Display "op1 op op2 = erg". |
void |
update(Graphics g)
Paints itself (avoiding flicker). |
void |
updateOps()
Make the operands and result consistent (pixel to Complex). |
| Methods inherited from class java.applet.Applet |
|---|
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TITLE
public static final String AUTHOR
public static final String CLASS_F
public static final String VERSION
public static final String COPYRIGHT
public static final String[][] PAR_INFO
public static final int LAST_OP
selectOp(int),
Constant Field Valuespublic boolean showPi
public boolean showUnit
| Constructor Detail |
|---|
public ComplDemo()
| Method Detail |
|---|
public String[][] getParameterInfo()
getParameterInfo in class Appletpublic String getAppletInfo()
getAppletInfo in class Appletpublic void init()
init in class Appletmain(String[])public void destroy()
destroy in class Appletpublic void run()
run in interface Runnablepublic void imgInit()
public void initOps()
public void updateOps()
public void update(Graphics g)
update in class Containerpublic void paint(Graphics g)
paint in class Containerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenermouseDragged(java.awt.event.MouseEvent)public void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void componentShown(ComponentEvent e)
componentShown in interface ComponentListenerpublic void itemStateChanged(ItemEvent e)
selectOp(int).
itemStateChanged in interface ItemListenerpublic void selectOp(int ts)
LAST_OP the operands will be
initialised to default values by initOps().
public void makeArith()
public void showArith()
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic Dimension getPreferredSize()
getPreferredSize in class Containerpublic Dimension getMinimumSize()
getMinimumSize in class Containerpublic static void main(String[] args)
ComplDemo will be embedded into a window of initial
size 520 * 338.
args - not relevant
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||