public class ComplDemo extends Panel implements MouseMotionListener, MouseListener, ActionListener, ItemListener, ComponentListener, Runnable
java de.frame4j.demos.ComplDemo or javaw de.frame4j.demos.ComplDemo
Complex
,
CFun
,
Beans
,
Serialized FormModifier and Type | Class and Description |
---|---|
class |
ComplDemo.ComplexWrapper
Wrapper for Complex with pixel coordinates and comparison.
|
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
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.
|
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.
|
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ComplDemo(boolean showPi,
boolean showUnit)
Constructor as Panel respectively Application.
|
Modifier and Type | Method and Description |
---|---|
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) |
Dimension |
getMinimumSize()
Minimal size.
|
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).
|
addNotify, getAccessibleContext
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
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 int LAST_OP
selectOp(int)
,
Constant Field Valuespublic boolean showPi
public boolean showUnit
public ComplDemo(boolean showPi, boolean showUnit)
public void init()
main(String[])
public void run()
public void imgInit()
public void initOps()
public void updateOps()
public void update(Graphics g)
public void paint(Graphics g)
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
e
- the mouse event (ignored)public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
e
- the mouse event (forwarded to mouseDragged(MouseEvent)
)mouseDragged(java.awt.event.MouseEvent)
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void componentResized(ComponentEvent e)
componentResized
in interface ComponentListener
e
- the component event (ignored)public void componentHidden(ComponentEvent e)
componentHidden
in interface ComponentListener
public void componentMoved(ComponentEvent e)
componentMoved
in interface ComponentListener
public void componentShown(ComponentEvent e)
componentShown
in interface ComponentListener
public void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
public void selectOp(int ts)
LAST_OP
the operands will be
initialised to default values by initOps()
.ts
- the complex operator to be demonstrated next (see list above)public void makeArith()
public void showArith()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public Dimension getPreferredSize()
getPreferredSize
in class Container
public Dimension getMinimumSize()
getMinimumSize
in class Container