|
|||||||||
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.Window
java.awt.Frame
javax.swing.JFrame
optics.graphics.Diagram2DFrame
public class Diagram2DFrame
Main Frame for display of Diagram2DPanel
in frame
being a default JFrame
with curstom basic menu
to control pen width, font size, and save options. The frame
will be set to have BoarderLayout and the Diagram2DPanel
will be set in the centre panel.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
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 | |
---|---|
protected Container |
frame
|
ActionListener |
handler
Public access to local handler |
protected Color |
menuColour
|
protected JMenu |
optionsMenu
Options menu with public access to make it easy to add to. |
protected Diagram2DPanel |
panel
The panel containing the Diagram2D that is being displayed |
protected JLabel |
statusBar
Lower status bar, by default switched off. |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
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 class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Diagram2DFrame(String title)
Form Diagram2DFrame with specifed title and no internal displayable panel. |
|
Diagram2DFrame(String title,
Diagram2D diagram)
Form a Diagram2DFrame with specified title and displayable Diagram2D , the
Diagram2DPanel will be automatically created |
|
Diagram2DFrame(String title,
Diagram2DPanel panel)
Form a Diagram2DFrame with specified title and displayable Diagram2DPanel displayable panel. |
Method Summary | |
---|---|
void |
addPanel(Diagram2DPanel p)
Method to add a Diagram2DPanel to the frame. |
void |
addStatusBar(String s)
Method to add a status bar in a SOUTH
Jpanel with a preset text. |
void |
centre()
Centre the frame on the current display (should work for all display sizes) |
void |
extraButtons(ActionEvent e)
Method to implement extra buttons, can be overloaded in extending classes. |
ActionListener |
getActionListener()
Method to get the ActionListener |
JMenu |
getMainMenu()
Method to get the main menu so that additiona items can be adde |
JMenu |
getOptionsMenu()
Method to geet the options menus so additional items can be added. |
Diagram2DPanel |
getPanel()
Method to get the Diagram2DPanel display in the frame |
static void |
main(String[] args)
Test method to read in an OpticalGroup and display in the Frame |
void |
setStatusBarText(String s)
Method stub to set a status bar text. |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
protected Container frame
protected Color menuColour
protected JLabel statusBar
protected JMenu optionsMenu
public ActionListener handler
protected Diagram2DPanel panel
Constructor Detail |
---|
public Diagram2DFrame(String title, Diagram2D diagram)
Diagram2D
, the
Diagram2DPanel
will be automatically created
title
- the frame titlediagram
- the Diagram2D display in the framepublic Diagram2DFrame(String title, Diagram2DPanel panel)
Diagram2DPanel
displayable panel.
Initial frame will be size 0,0 and not visible, usr the
standard JFrame
.setSize(x,y) and .setVisible(true)
to display the frame.
title
- the frame titlepanel
- the displayable panel.public Diagram2DFrame(String title)
BorderLayout
with the diagram panel in the
centre.
Initial frame will be size 0,0 and not visible, usr the
standard JFrame
.setSize(x,y) and .setVisible(true)
yo display the frame.
A displayable panel must be added before this class is
rendered visible or null
Exceptions may occur.
title
- the frame titleMethod Detail |
---|
public void addPanel(Diagram2DPanel p)
JFrame.add
to the
BorderLayout.CENTER
of the frame.
p
- the panelpublic Diagram2DPanel getPanel()
Diagram2DPanel
the displayed panel.public ActionListener getActionListener()
public void addStatusBar(String s)
SOUTH
Jpanel with a preset text.
s
- the status bar string.public void setStatusBarText(String s)
s
- the status bar sStringpublic JMenu getMainMenu()
public JMenu getOptionsMenu()
public void centre()
public void extraButtons(ActionEvent e)
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |