public class MDIApplet extends JApplet implements ActionListener
This applet has a main() method so it can be directly called/started as an application.
It contains all the basics of an Multiple Document Interface (MDI) windowing system with a Menubar at the top, a floatable toolbar, and a statusbar at the bottom. In the center of the applet is the main MDI Desktop.
New child windows all go into the main MDI Desktop panel and each contain
a generic Object.
Modifier and Type | Class and Description |
---|---|
(package private) class |
MDIApplet.DesktopController
This is the object that will act as the main child window manager.
|
JApplet.AccessibleJApplet
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static String |
actionSuffix
Suffix applied to the key used in resource file
lookups for an action.
|
private short |
appX
The initial X coordinate for this app/let.
|
private short |
appY
The initial Y coordinate for this app/let.
|
static short |
BOTTOM_SCREENJUSTIFY
The CONSTANT to represent BOTTOM screen justification.
|
static short |
CENTER_SCREENJUSTIFY
The CONSTANT to represent CENTER screen justification.
|
private URL |
codeBase
The Codes Base URL.
|
(package private) static Date |
currentDate
The Current Date and time.
|
private static int |
debug
A variable to indicate the level of debug output produced.
|
(package private) static boolean |
debugOutput
Flag to spew debug output to the screen.
|
private static int |
debugParam
A temp variable that holds the APPLET parameter that might or might not
have been specified at runtime.
|
static short |
DEFAULT_LOOKANDFEEL
the Default LookAndFeel CONSTANT.
|
private MDIApplet.DesktopController |
desktopController
The Applets main desktop object manager.
|
(package private) String |
fileSeperator
Holds the file separator for the system this applet is running on.
|
(package private) String |
iconNamePrefix
String added to the iconNames used to auatomatically
create the IconsBar
|
(package private) String[] |
iconNames
String Tokens used to auatomatically create the IconsBar
|
(package private) String[] |
iconToolTips
String Tokens used to auatomatically create the Icon bar tooltips
|
static String |
imageSuffix
Suffix applied to the key used in resource file
lookups for an image.
|
static boolean |
isRunningAsAnApplet
A flag that indicates if this applet is running as an application.
|
static short |
LEFT_SCREENJUSTIFY
The CONSTANT to represent LEFT screen justification.
|
(package private) String |
lineSeperator
Holds the line separator for the system this applet is running on.
|
static short |
MAC_LOOKANDFEEL
the Mac LookAndFeel CONSTANT.
|
private static String |
macClassName
the Mac LookAndFeel class name
|
private JPanel |
mdiPanel
The Applets main internal window desktop panel.
|
private static String |
mediaURL
Strings to hold the retrieved applet parameters.
|
private JMenuBar |
menuBar
The Applets MenuBar.
|
(package private) int[][] |
menuItemAccel
The Tokens used when automatically assigning the accel key for each menu
items.
|
(package private) int[][] |
menuItemAccel2
The Tokens used when automatically assigning the 2nd level of accel key for
each menu items.
|
(package private) static boolean[][] |
menuItemEnabled
boolean Tokens used to enable the menu items for each menu on the menubar.
|
(package private) char[][] |
menuItemMnemonic
The Tokens used to automatically assign the Mnemonic for each menu items.
|
(package private) String[][] |
menuItemName
String Tokens used to automatically create the menu items for each menu
on the menubar.
|
(package private) static boolean[][] |
menuItemShown
boolean Tokens used to enable automatic creation of the menu items for
each menu on the menubar.
|
(package private) String[] |
menuName
String Tokens used to auatomatically create the menu bar
|
(package private) String[][] |
menuToolTip
String Tokens used to automatically create the menu items tooltip for
each menu on the menubar.
|
static short |
METAL_LOOKANDFEEL
the Metal LookAndFeel CONSTANT.
|
private static String |
metalClassName
the Java LookAndFeel class name
|
static short |
MOTIF_LOOKANDFEEL
the Motif LookAndFeel CONSTANT.
|
private static String |
motifClassName
the motif LookAndFeel class name
|
private AutoButtonBar |
myButtonBar
The applets JToolbar.
|
private JLayeredPane |
myMDIDesktop
myMDIDesktop is the Multiple Document Desktop that gets placed directly
inside the MDIViewPanel JPanel.
|
static short |
RIGHT_SCREENJUSTIFY
The CONSTANT to represent RIGHT screen justification.
|
private static String |
splashGraphic
The filename for the graphic to splash up at start
|
private StatusBar |
statBar
A status bar object that lives at the bottom of the Internal Window
Desktop to provide useful information regarding the applet.
|
private String[] |
statusMsg
Status bar information variable used with the StatusBar object.
|
private double[] |
statusSizes
Status bar information variable used with the StatusBar object.
|
private static String |
tempPath
General variables that are used as counters or temps.
|
(package private) Toolkit |
toolkit
The Toolkit object that is used to get some basic system information (ie screen size).
|
static short |
TOP_SCREENJUSTIFY
The CONSTANT to represent TOP screen justification.
|
private static String |
userDir
A holder for a string representation of the users starting directory.
|
private static String |
windowsClassName
the Windoze LookAndFeel class name
|
static short |
WINDOZE_LOOKANDFEEL
the Windoze LookAndFeel CONSTANT.
|
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
MDIApplet() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Receives the button actions
|
private void |
addListener(JMenuItem menuItem)
Adds an ActionListener to the JMenuItem that is supplied in the
passed param.
|
private int |
buttonIndexOf(String[] list,
String s)
Aa simple indexOf helper function to look through the button items and
return an int to represent its HASH position
|
private JMenuItem |
createMenuItem(int menuRef,
int menuItemRef)
This is the hook through which all menu items are created.
|
private static void |
debugOutput(int l,
String output)
Handles debug messages by comparing the app debug level to the
message level.
|
private Frame |
getAncestorFrame(Component c)
This method seeks out and returns the Parent Frame for a given component.
|
private void |
getAppCodeBase()
Creates a URL for the location of the applications codebase.
|
String |
getAppletInfo()
the method that return the programmers customized information about
this applet.
|
String[][] |
getParameterInfo()
The method that returns the information about the possible applet
parameters.
|
private int |
indexOf(String s)
Aa simple indexOf helper function to look through the menu items and
return an int to represent its HASH position
|
void |
init()
Initializes the Applet.
|
private JMenuBar |
initMenuBar()
Creates the JMenuBar and populates the menuitms into it.
|
private StatusBar |
initStatusBar()
Initializes the statusbar with the pre- inititialized arrays of data.
|
boolean |
isApp()
Tells if this applet was started as an app via its main method
|
boolean |
isApplet()
Tells if this applet was started as an applet directly without
going through its main method.
|
static void |
main(String[] args)
The main entry for running the MDIApplet as an APP.
|
void |
repaintMenuBar()
Forces a repaint to this apps menubar.
|
private void |
setScreenLocation(int xPosition,
int yPosition,
int xOffset,
int yOffset)
This method sets the position of this app/applet on the users screen
based on the supplied location parameters
|
private void |
setTheLookAndFeel(short i)
Calls the User Interface Manager and sets the look and feel setting based
on the parameter it is passed.
|
void |
start()
Starts the operation of the applet.
|
void |
stop()
The stop method that gets called whne stoping the applet.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, 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
String lineSeperator
String fileSeperator
Toolkit toolkit
String iconNamePrefix
String[] iconToolTips
String[][] menuItemName
char[][] menuItemMnemonic
int[][] menuItemAccel
int[][] menuItemAccel2
String[][] menuToolTip
static boolean[][] menuItemShown
static boolean[][] menuItemEnabled
private AutoButtonBar myButtonBar
private JMenuBar menuBar
initMenuBar
.initMenuBar
private StatusBar statBar
private double[] statusSizes
StatusBar
private String[] statusMsg
StatusBar
private JPanel mdiPanel
private MDIApplet.DesktopController desktopController
private JLayeredPane myMDIDesktop
private short appX
private short appY
public static boolean isRunningAsAnApplet
public static final String imageSuffix
public static final String actionSuffix
private static final String splashGraphic
static Date currentDate
static boolean debugOutput
public static final short METAL_LOOKANDFEEL
public static final short WINDOZE_LOOKANDFEEL
public static final short MOTIF_LOOKANDFEEL
public static final short MAC_LOOKANDFEEL
public static final short DEFAULT_LOOKANDFEEL
public static final short LEFT_SCREENJUSTIFY
public static final short CENTER_SCREENJUSTIFY
public static final short RIGHT_SCREENJUSTIFY
public static final short TOP_SCREENJUSTIFY
public static final short BOTTOM_SCREENJUSTIFY
private static String macClassName
private static String metalClassName
private static String motifClassName
private static String windowsClassName
private static String userDir
private static String mediaURL
private static int debug
private static int debugParam
public MDIApplet()
public String getAppletInfo()
getAppletInfo
in class Applet
public String[][] getParameterInfo()
getParameterInfo
in class Applet
public boolean isApp()
public boolean isApplet()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void init()
public void start()
public void stop()
private StatusBar initStatusBar()
public void repaintMenuBar()
private void setTheLookAndFeel(short i)
i
- The new TheLookAndFeel valueprivate void setScreenLocation(int xPosition, int yPosition, int xOffset, int yOffset)
xPosition
- The new ScreenLocation valueyPosition
- The new ScreenLocation valuexOffset
- The new ScreenLocation valueyOffset
- The new ScreenLocation valueprivate void getAppCodeBase()
private Frame getAncestorFrame(Component c)
c
- The Component to be used as the basis of the frame searchprivate JMenuBar initMenuBar()
The fields it uses are:
MediaViewer#createMenuItem(int,int)
private JMenuItem createMenuItem(int menuRef, int menuItemRef)
menuRef
- Description of ParametermenuItemRef
- Description of ParameterMediaViewer#createMenu()
private int indexOf(String s)
s
- Description of Parameterprivate int buttonIndexOf(String[] list, String s)
list
- List of strings to look throughs
- Description of Parameterprivate void addListener(JMenuItem menuItem)
menuItem
- The feature to be added to the Listener attributepublic static void main(String[] args)
args
- The command line argumentsprivate static void debugOutput(int l, String output)
l
- Description of Parameteroutput
- Description of ParameterWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses