Class KmgFormelPlotFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- KmgFormelPlotFrame
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
- Direct Known Subclasses:
JxnComplexPlotFrame
,JxnPerspectivePlotFrame
,JxnRealArrayPlotFrame
public class KmgFormelPlotFrame extends Frame
Base class of allPlotFrame
s (graphic display windows). Theplot
methods of the classesJxnRealArrayAlgebra
,JxnComplexAlgebra
andJxnUtilities
create a new display window as an instance of the appropriate subclass ofKmgFormelPlotFrame
.
The context menu (right mouse-click) of the graphic display allows to call the following methods of this class:rescale()
,writePNG(filename)
,setAutoScale(int)
andsetCursorTextEnabled(boolean)
.
Zooming of the graphic display is possible by left mouse drag. After zooming the scrollbars of the graphic display can be used to shift the display area.- See Also:
- JXN Tutorial, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
-
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected int
iFrame
Sequential number of the current PlotFrame.protected static boolean
isRepeating
Currently processing the slider repeat list.protected static int
nFrames
Number of created PlotFrames.-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KmgFormelPlotFrame(String title)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description KmgFormelPlotFrame
add(KmgXYPainter painter)
Shows an additional graphical (painter) object in thisPlotFrame
.KmgFormelPlotFrame
add(KmgXYPainter[] painter)
Shows additional graphical (painter) objects in thisPlotFrame
.int
getPlotFrameNumber()
Returns the sequential number of thisPlotFrame
.static boolean
getRepeating()
Called internally...Canvas
getXYCanvas()
Returns the Canvas (without the scrollbars) of thisPlotFrame
.Panel
getXYPanel()
Returns the ZoomPanel (containing the scrollbars) of thisPlotFrame
.void
moveCanvasTo(Container cont)
void
moveCanvasTo(Container cont, Object constraints)
KmgFormelPlotFrame
nop(double sliderDependentVariable)
Deprecated.No more needed here.KmgFormelPlotFrame
nop(Object sliderDependentObject)
Deprecated.Not needed.static void
repaintAll()
Called internally...void
repaintCanvas()
Repaints the graphic display (called internally).KmgFormelPlotFrame
rescale()
(Re)scales the display to the optimal bounds.KmgFormelPlotFrame
setAuto(boolean auto)
Deprecated.UsesetAutoScale(int)
.KmgFormelPlotFrame
setAuto(boolean auto, boolean rescale)
Deprecated.UsesetAutoScale(int)
.KmgFormelPlotFrame
setAutoScale(int auto)
Controls automatic scaling.KmgFormelPlotFrame
setCursorTextEnabled(boolean cursorTextEnabled)
Controls the cursor display.KmgFormelPlotFrame
setHeadline(String headline)
Adds a headline to the graphic display.KmgFormelPlotFrame
setPlotFrameTitle(String title)
Sets the title for thisPlotFrame
.KmgFormelPlotFrame
setXBounds(double left, double right)
Manually set the horizontal bounds to the given values (the vertical bounds are not changed).KmgFormelPlotFrame
setXYBounds(double left, double bottom, double right, double top)
Manually set the bounds to the given values.KmgFormelPlotFrame
setXYLabels(String strX, String strY)
Sets labels for x- and y-axis.KmgFormelPlotFrame
setYBounds(double bottom, double top)
Manually set the vertical bounds to the given values (the horizontal bounds are not changed).String
toString()
Returns a string representation of thisPlotFrame
.void
writePNG(String filename)
Writes the graphic display to a png-file.-
Methods inherited from class java.awt.Component
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
-
Methods inherited from class java.awt.Frame
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setBackground, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
-
-
-
Constructor Detail
-
KmgFormelPlotFrame
protected KmgFormelPlotFrame(String title)
-
-
Method Detail
-
toString
public String toString()
Returns a string representation of thisPlotFrame
.
-
getPlotFrameNumber
public int getPlotFrameNumber()
Returns the sequential number of thisPlotFrame
.
-
getRepeating
public static boolean getRepeating()
Called internally...
-
repaintAll
public static void repaintAll()
Called internally...
-
add
public KmgFormelPlotFrame add(KmgXYPainter painter)
Shows an additional graphical (painter) object in thisPlotFrame
.- Returns:
- this
-
add
public KmgFormelPlotFrame add(KmgXYPainter[] painter)
Shows additional graphical (painter) objects in thisPlotFrame
.- Returns:
- this
-
nop
public KmgFormelPlotFrame nop(double sliderDependentVariable)
Deprecated.No more needed here.Forces the repetition of the statement by inserting an artificial dependency onsliderDependentVariable
.
A slider animatedPlotFrame
requires the repetition of all statements which depend on the slider variables. All statements which contain a slider variable or a variable which is dependent on a slider variable are repeated automatically on the change of any of the slider dependent variables. Therefore in most cases it is not necessary to explicitly control the repetition. Only if a statement does not contain any slider dependent variable but must be repeated, thenop
methods can be used to artificially create a dependency and thus force the repetition.- Parameters:
sliderDependentVariable
- any of the slider variablesvar
from:var
=
slider
.
add
(...)
- Returns:
- this
- See Also:
JxnUtilities.nop(double)
-
nop
public KmgFormelPlotFrame nop(Object sliderDependentObject)
Deprecated.Not needed.
-
setPlotFrameTitle
public KmgFormelPlotFrame setPlotFrameTitle(String title)
Sets the title for thisPlotFrame
. CallsFrame.setTitle(java.lang.String)
.- Returns:
- this
-
setHeadline
public KmgFormelPlotFrame setHeadline(String headline)
Adds a headline to the graphic display.- Returns:
- this
-
setXYLabels
public KmgFormelPlotFrame setXYLabels(String strX, String strY)
Sets labels for x- and y-axis.- Parameters:
strX
- label of horizontal axis.strY
- label of vertical axis.- Returns:
- this
-
setCursorTextEnabled
public KmgFormelPlotFrame setCursorTextEnabled(boolean cursorTextEnabled)
Controls the cursor display.
The cursor can also be changed in the context menu (right mouse-click) of the graphic display.- Parameters:
cursorTextEnabled
- iftrue
displays a crosshair cursor with cursor coordiantes
else displays the default cursor (arrow only)- Returns:
- this
- See Also:
java.awt.Cursor
-
setAuto
public KmgFormelPlotFrame setAuto(boolean auto)
Deprecated.UsesetAutoScale(int)
.
-
setAuto
public KmgFormelPlotFrame setAuto(boolean auto, boolean rescale)
Deprecated.UsesetAutoScale(int)
.
-
setAutoScale
public KmgFormelPlotFrame setAutoScale(int auto)
Controls automatic scaling. Also available in the context menu (right mouse-click) of the graphic display.- Parameters:
auto
- ...
2: expands and shrinks on slider change andadd
(painter)
1: expands on slider change andadd(painter)
0: expands onadd(painter)
(zooming impliessetAutoScale(0)
)
-1: no automatic rescale (set bysetXYBounds(double, double, double, double)
)
⇒ freezes to current bounds, subsequentadd(painter)
do not change the scaling, objects added may not be visible- Returns:
- this
-
rescale
public KmgFormelPlotFrame rescale()
(Re)scales the display to the optimal bounds. Also available in the context menu (right mouse-click) of the graphic display.- Returns:
- this
-
setXYBounds
public KmgFormelPlotFrame setXYBounds(double left, double bottom, double right, double top)
Manually set the bounds to the given values. ImpliessetAutoScale
(-1)
.- Returns:
- this
-
setXBounds
public KmgFormelPlotFrame setXBounds(double left, double right)
Manually set the horizontal bounds to the given values (the vertical bounds are not changed).- Returns:
- this
- See Also:
setXYBounds(double, double, double, double)
-
setYBounds
public KmgFormelPlotFrame setYBounds(double bottom, double top)
Manually set the vertical bounds to the given values (the horizontal bounds are not changed).- Returns:
- this
- See Also:
setXYBounds(double, double, double, double)
-
writePNG
public void writePNG(String filename)
Writes the graphic display to a png-file. Also available in the context menu (right mouse-click) of the graphic display.
Note: Supported only if JXN runs as Java application (see JxnPortable)- Parameters:
filename
- the name of the png-file. Prompts for filename ifnull
or""
.
-
getXYPanel
public Panel getXYPanel()
Returns the ZoomPanel (containing the scrollbars) of thisPlotFrame
.
-
getXYCanvas
public Canvas getXYCanvas()
Returns the Canvas (without the scrollbars) of thisPlotFrame
.
-
moveCanvasTo
public void moveCanvasTo(Container cont)
Moves the Canvas from thePlotFrame
to anotherjava.awt.
Container
and hides thePlotFrame
.
Calls:cont.
add
( getXYCanvas() )
.
If you are familiar with Java LayoutManagement see the examples in the gallery and the include files on folder JxnPortable/include how to use themoveCanvasTo
(...)
methods to arrange multiple graphic displays in a common display panel.
-
moveCanvasTo
public void moveCanvasTo(Container cont, Object constraints)
Moves the Canvas from thePlotFrame
to anotherjava.awt.
Container
and hides thePlotFrame
.
Calls:cont.
add
( getXYCanvas(), constraints )
- Parameters:
constraints
- e.g.java.awt.
BorderLayout.CENTER
-
repaintCanvas
public void repaintCanvas()
Repaints the graphic display (called internally).
-
-