geofasc.swing.tool
public class Frame extends JFrame
Frame
(synonym is a window) is intended to be used as a
top-level container with a Canvas
as its content pane.Component.BaselineResizeBehavior
EXIT_ON_CLOSE
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Frame()
Creates a new
Frame with width 640 and height 480 in pixels. |
Frame(int width,
int height)
Creates a new
Frame with the given size and with the
top-left corner of the display as location. |
Frame(int x,
int y,
int width,
int height,
String title)
Creates a new
Frame with the given size and at the given
location. |
Frame(int width,
int height,
String title)
Creates a new
Frame with the given size and with the
top-left corner of the display as location. |
Frame(String title)
Creates a new
Frame with width 640 and height 480 in pixels
and with the top-left corner of the display as location. |
Modifier and Type | Method and Description |
---|---|
void |
addToCanvas(Component... comps)
Convenience method for
Canvas.add(Component[]) . |
void |
addToCanvas(Component comp)
Convenience method for
Canvas.add(Component) . |
void |
close()
Sets this frame invisible and disposes it.
|
Canvas |
getCanvas()
Gets the canvas of this frame used as the actual content pane.
|
int |
getHeight() |
String |
getTitle() |
int |
getWidth() |
void |
setCanvas(Canvas canvas)
Sets the canvas of this frame used as the actual content pane.
|
void |
setCenterLocation()
Sets the position of this frame to the center location of its display.
|
void |
setContentPane(Container contentPane)
Overridden to permit only panes of type
Canvas as content panes. |
void |
setHeight(int height)
Sets the height of this frame.
|
void |
setLocation(int x,
int y) |
void |
setLocation(Point p) |
void |
setSize(Dimension d) |
void |
setSize(int width,
int height) |
void |
setTitle(String title) |
void |
setVisible(boolean b) |
void |
setWidth(int width)
Sets the width of this frame.
|
void |
toBack() |
void |
toFront() |
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, show
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, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, 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, requestFocus, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
public Frame() throws HeadlessException
Frame
with width 640 and height 480 in pixels.HeadlessException
public Frame(int width, int height) throws HeadlessException
Frame
with the given size and with the
top-left corner of the display as location.width
- the initial width of this frameheight
- the initial height of this frameHeadlessException
public Frame(int x, int y, int width, int height, String title) throws HeadlessException
Frame
with the given size and at the given
location.x
- the initial x-coordinate of this framey
- the initial x-coordinate of this framewidth
- the initial width of this frameheight
- the initial height of this frametitle
- the initial title of this frameHeadlessException
public Frame(int width, int height, String title) throws HeadlessException
Frame
with the given size and with the
top-left corner of the display as location.width
- the initial width of this frameheight
- the initial height of this frametitle
- the initial title of this frameHeadlessException
public Frame(String title) throws HeadlessException
Frame
with width 640 and height 480 in pixels
and with the top-left corner of the display as location.title
- the initial title of this frameHeadlessException
public void addToCanvas(Component comp)
Canvas.add(Component)
.comp
- the component to addpublic void addToCanvas(Component... comps)
Canvas.add(Component[])
.comps
- the components to addpublic void close()
public Canvas getCanvas()
public void setCanvas(Canvas canvas)
canvas
- the new canvaspublic void setCenterLocation()
public final void setContentPane(Container contentPane)
Canvas
as content panes.setContentPane
in interface RootPaneContainer
setContentPane
in class JFrame
public void setHeight(int height)
height
- the new heightpublic void setLocation(int x, int y)
setLocation
in class Component
public void setLocation(Point p)
setLocation
in class Component
public void setVisible(boolean b)
setVisible
in class Window
public void setWidth(int width)
width
- new width