Class PsMainFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- jv.object.PsMainFrame
-
- All Implemented Interfaces:
- java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
public class PsMainFrame extends java.awt.Frame implements java.awt.event.WindowListenerMainframe window to hold an applet (of applications) or a display canvas.This class is a simple extension to java.awt.Frame and closes itself if the user presses the close button in the upper right corner of the window.
The class acts as a top-level window which is usually used to contain applet when JavaView runs as a standalone application.
It common practice that another class registers itself as window listener.
When JavaView runs from command-line, command-line arguments may be passed to constructor, and are added to System properties. Properties are, e.g., evaluated in PvViewer. Class handles window events. If viewer is used in JavaView applet then viewer registers itself as window listener of each frame.
- See Also:
- Serialized Form
- Version:
- 28.09.10, 5.80 revised (fk) Removed interfaces that are inherited from superclass.
06.01.07, 1.80 revised (kp) Methods parseArgs and getParameter moved to jv.object.PsConfig.
11.06.06, 1.70 revised (kp) Short title introduced.
25.11.02, 1.60 revised (kp) New constructor added.
17.11.02, 1.50 revised (kp) Overloading of setBounds() replaced with setInner... methods.
11.11.02, 1.30 revised (kp) Some WindowListener handling removed.
07.08.99, 1.20 revised (kp) Conversion to AWT 1.1.
04.08.99, 1.10 revised (kp) Deprecated constructors removed.
-
-
Field Summary
-
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
-
-
Constructor Summary
Constructors Constructor and Description PsMainFrame(java.awt.Component comp, java.lang.String[] args)Constructor with default title.PsMainFrame(java.awt.Component comp, java.lang.String title, java.lang.String[] args)Create a main frame window to hold the applet or a display canvas.PsMainFrame(java.lang.String title)Constructor, callsPsMainFrame(null, title, null).PsMainFrame(java.lang.String title, java.lang.String[] args)Constructor, callsPsMainFrame(null, title, args).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description static java.lang.StringgetParameter(java.lang.String name)Deprecated.since 3.97.044, use PsConfig#getParameter() instead.java.lang.StringgetShortTitle()Get the short title of this frame.static intgetTotalHeightOther(java.awt.Container frame, java.awt.Component comp)Calculate the total height of all components in this container other than comp.static voidparseArgs(java.lang.String[] args, java.util.Properties props)Deprecated.since 3.97.044, use PsConfig#parseArgs() instead.voidsetInnerBounds(int x, int y, int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets).voidsetInnerBounds(java.awt.Rectangle rect)Set the size of the drawing canvas (instead of the size of the frame including insets).voidsetInnerSize(java.awt.Dimension dim)Set the size of the drawing canvas (instead of the size of the frame including insets).voidsetInnerSize(int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets).voidsetLocation(int x, int y)Set location of dialog but correct upper left corner if outside screen.voidsetOuterBounds(int x, int y, int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets).voidsetOuterBounds(java.awt.Rectangle rect)Set the size of the drawing canvas (instead of the size of the frame including insets).voidsetOuterSize(int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets).voidsetShortTitle(java.lang.String name)Set the short title of this frame.voidsetTitle(java.lang.String name)Set the short title of this frame.voidwindowActivated(java.awt.event.WindowEvent event)Currently not used.voidwindowClosed(java.awt.event.WindowEvent event)Currently not used.voidwindowClosing(java.awt.event.WindowEvent event)Dispose frame.voidwindowDeactivated(java.awt.event.WindowEvent event)Currently not used.voidwindowDeiconified(java.awt.event.WindowEvent event)Currently not used.voidwindowIconified(java.awt.event.WindowEvent event)Currently not used.voidwindowOpened(java.awt.event.WindowEvent event)Currently not used.-
Methods inherited from class java.awt.Frame
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setUndecorated
-
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, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, getPeer, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
PsMainFrame
public PsMainFrame(java.awt.Component comp, java.lang.String title, java.lang.String[] args)Create a main frame window to hold the applet or a display canvas. Any of the arguments may benull.This frame class acts as a top-level window in which the applet appears when it is run as a standalone application.
- See Also:
PvViewer.getParameter(String)- Version:
- 26.10.99 revised (kp) New constructor with three arguments added.
-
PsMainFrame
public PsMainFrame(java.lang.String title)
Constructor, callsPsMainFrame(null, title, null).- Since:
- JavaView 2.47
- Version:
- 25.11.02, 1.00 created (kp)
-
PsMainFrame
public PsMainFrame(java.lang.String title, java.lang.String[] args)Constructor, callsPsMainFrame(null, title, args).
-
PsMainFrame
public PsMainFrame(java.awt.Component comp, java.lang.String[] args)Constructor with default title.
-
-
Method Detail
-
parseArgs
public static void parseArgs(java.lang.String[] args, java.util.Properties props)Deprecated. since 3.97.044, use PsConfig#parseArgs() instead.Turn command-line arguments into system parameters by adding to the system properties list. In general, an argument must have the formproperty=value
and does not contains any blanks. Blanks are used to separate arguments.One exception is the 'model' parameter which consists only of the file name. The property 'model' is assumed implicitly although it may be specified. This shortcut is a convenience for simplifying the loading of geometry models from file. Therefore, the following two shell commands are equivalent:
javaview knots.mgs
andjavaview model=knots.mgs
.- Author:
- Konrad Polthier
- Version:
- 06.01.07, 2.00 revised (kp) Method moved to PsConfig from jv.object.PsMainframe.
17.03.03, 1.05 revised (kp) Removal of enclosing "" corrected.
23.09.99, 1.01 revised (kp) Bug removed which converted argument to lower case.
-
getParameter
public static java.lang.String getParameter(java.lang.String name)
Deprecated. since 3.97.044, use PsConfig#getParameter() instead.Return a parameter from the system properties list. Each JavaView parameter has been added to the system property hashtable. Name of parameter is not case-sensitive.- Parameters:
name- Name of parameter whose value is requested, not case-sensitive.- Returns:
- value Value of parameter
- Author:
- Konrad Polthier
- Version:
- 06.01.07, 2.00 revised (kp) Method moved to PsConfig from jv.object.PsMainframe.
-
getShortTitle
public java.lang.String getShortTitle()
Get the short title of this frame.- Returns:
- short title
- Since:
- JavaView 3.96.016
- Version:
- 11.06.06, 1.00 created (kp)
-
setShortTitle
public void setShortTitle(java.lang.String name)
Set the short title of this frame.- Parameters:
name- short title.- Since:
- JavaView 3.96.016
- Version:
- 11.06.06, 1.00 created (kp)
-
setTitle
public void setTitle(java.lang.String name)
Set the short title of this frame.- Overrides:
setTitlein classjava.awt.Frame- Parameters:
name- short title.- Since:
- JavaView 3.96.016
- Version:
- 11.06.06, 1.00 created (kp)
-
setOuterBounds
public void setOuterBounds(java.awt.Rectangle rect)
Set the size of the drawing canvas (instead of the size of the frame including insets). This method calls the method java.awt.frame#setBounds which sets the size of the frame including boundary and title bar.- Since:
- JavaView 4.xx
- Version:
- 29.09.16, 1.00 created (kp).
-
setOuterBounds
public void setOuterBounds(int x, int y, int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets). This method calls the method java.awt.frame#setBounds which sets the size of the frame including boundary and title bar.- Since:
- JavaView 4.xx
- Version:
- 29.09.16, 1.00 created (kp).
-
setOuterSize
public void setOuterSize(int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets). This method calls the method java.awt.frame#setBounds which sets the size of the frame including boundary and title bar.- Since:
- JavaView 4.xx
- Version:
- 29.09.16, 1.00 created (kp).
-
setInnerBounds
public void setInnerBounds(java.awt.Rectangle rect)
Set the size of the drawing canvas (instead of the size of the frame including insets). This method calls the method java.awt.frame#setBounds which sets the size of the frame including boundary and title bar.- Since:
- JavaView 2.46
- Version:
- 17.11.02, 1.00 created (kp) From previous method setBounds().
-
setInnerBounds
public void setInnerBounds(int x, int y, int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets). This method calls the method java.awt.frame#setBounds which sets the size of the frame including boundary and title bar.- Since:
- JavaView 2.46
- Version:
- 17.11.02, 1.00 created (kp) From previous method setBounds().
-
setInnerSize
public void setInnerSize(int width, int height)Set the size of the drawing canvas (instead of the size of the frame including insets). This method calls the method java.awt.frame#setSize which sets the size of the frame including boundary and title bar.- Since:
- JavaView 2.46
- Version:
- 17.11.02, 1.00 created (kp)
-
setInnerSize
public void setInnerSize(java.awt.Dimension dim)
Set the size of the drawing canvas (instead of the size of the frame including insets). This method calls the method java.awt.frame#setSize which sets the size of the frame including boundary and title bar.- Since:
- JavaView 2.46
- Version:
- 17.11.02, 1.00 created (kp)
-
setLocation
public void setLocation(int x, int y)Set location of dialog but correct upper left corner if outside screen.- Overrides:
setLocationin classjava.awt.Window
-
getTotalHeightOther
public static int getTotalHeightOther(java.awt.Container frame, java.awt.Component comp)Calculate the total height of all components in this container other than comp. Method supports computing the correct display size in a frame when tool bar and status bar were added.- Since:
- JavaView 5.01
- Version:
- 31.03.2020, 1.00 created (kp)
-
windowOpened
public void windowOpened(java.awt.event.WindowEvent event)
Currently not used.- Specified by:
windowOpenedin interfacejava.awt.event.WindowListener
-
windowClosed
public void windowClosed(java.awt.event.WindowEvent event)
Currently not used.- Specified by:
windowClosedin interfacejava.awt.event.WindowListener
-
windowDeiconified
public void windowDeiconified(java.awt.event.WindowEvent event)
Currently not used.- Specified by:
windowDeiconifiedin interfacejava.awt.event.WindowListener
-
windowIconified
public void windowIconified(java.awt.event.WindowEvent event)
Currently not used.- Specified by:
windowIconifiedin interfacejava.awt.event.WindowListener
-
windowDeactivated
public void windowDeactivated(java.awt.event.WindowEvent event)
Currently not used.- Specified by:
windowDeactivatedin interfacejava.awt.event.WindowListener
-
windowActivated
public void windowActivated(java.awt.event.WindowEvent event)
Currently not used.- Specified by:
windowActivatedin interfacejava.awt.event.WindowListener
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent event)
Dispose frame.- Specified by:
windowClosingin interfacejava.awt.event.WindowListener
-
-
"