|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--edu.mit.ai.psg.ui.patches.FrameableApplet
FramableApplet extends Applet with the following:
init()() initializes applet in one of 3 configurations
depending on size:getMinSizeInPlace()(),
displays applet in place normally.
Applet includes a title bar with a button that can be used to
create a separate window frame containing the applet.
init() calls initPanelInPlaceApplet()().
getMinSizeAsButton()(),
displays applet as a button.
If button is pressed, initFrameApplet() is called.
init()() calls initFrameApplet()().
Frame title may
be specified by getAppletTitle()(), so derived classes can
add a prefix or suffix to a string specified by the "title"
applet parameter if desired. initAppletColors(java.awt.Component)() initializes a container to the colors
specified in the applet parameters "textColor" and "bgcolor"
so that an applet's colors can be matched to that of the page
it is on.
| Field Summary | |
protected static String |
pkBgColor
applet parameter keyword: background color |
protected static String |
pkTextColor
applet parameter keyword |
protected static String |
pkTitle
applet parameter keyword |
static Font |
titleFont
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
FrameableApplet()
|
|
| Method Summary | |
List |
getAppletList()
utility: like AppletContext.getApplets(),
but returns a List. |
String |
getAppletTitle()
default applet title: getParameter(pkTitle) or "" |
protected String |
getButtonStartedText()
default: "Started Frame" |
protected String |
getButtonStartingText()
default: "Staring Frame" |
protected String |
getButtonStartText()
default: "Start Frame" |
protected abstract Dimension |
getMinSizeAsButton()
|
protected abstract Dimension |
getMinSizeInPlace()
|
String |
getParameter(String name)
extends super.getParameter() to catch NullPointerException and return null in case this is not being used as an applet |
String[][] |
getParameterInfo()
Applet parameters: title textColor: HTML color for text bgColor: HTML color for background |
Icon |
getTitleIcon()
|
void |
init()
Default applet startup based on applet size: |
protected void |
initAppletColors(Component component)
This method can be used to initialize applet foreground and background colors from applet parameters "textColor" and "bgColor". |
void |
initButtonForFrameApplet()
Display a button on page for starting a separate frame. |
Frame |
initFrameApplet()
Default behavior to be overridden or extended: |
void |
initPanelInPlaceApplet()
Initialization for displaying applet in place on page. |
Button |
makeButtonForFrame()
Creates new button initialized with getButtonStartText()
Starts up window frame when applet button is pushed: |
| Methods inherited from class java.applet.Applet |
destroy,
getAppletContext,
getAppletInfo,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
isActive,
newAudioClip,
play,
play,
resize,
resize,
setStub,
showStatus,
start,
stop |
| Methods inherited from class java.awt.Panel |
addNotify |
| Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
paramString,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setCursor,
setFont,
setLayout,
update,
validate,
validateTree |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static Font titleFont
protected static final String pkTitle
protected static final String pkTextColor
protected static final String pkBgColor
| Constructor Detail |
public FrameableApplet()
| Method Detail |
protected abstract Dimension getMinSizeInPlace()
init()protected abstract Dimension getMinSizeAsButton()
init()public void init()
initAppletColors(java.awt.Component)(this); if (getSize() >=getMinSizeInPlace()) .initPanelInPlaceApplet()else if (getSize() >=getMinSizeAsButton()) .initButtonForFrameApplet()else .initFrameApplet()
public String getAppletTitle()
public Icon getTitleIcon()
public void initPanelInPlaceApplet()
getParameterInfo()public void initButtonForFrameApplet()
getParameterInfo()protected String getButtonStartText()
protected String getButtonStartingText()
protected String getButtonStartedText()
public Button makeButtonForFrame()
getButtonStartText()
Starts up window frame when applet button is pushed: button.setLabel(applet.getButtonStartingText()); applet.initFrameApplet(); button.setLabel(applet.getButtonStartedText());
public Frame initFrameApplet()
Frame window = new(Need to do window.show() once it is initialized with applet's components.)CloseableFrame(getAppletTitle());initAppletColors(java.awt.Component)(window); return window;
getParameterInfo()protected void initAppletColors(Component component)
HTMLColor.decode(java.lang.String)public String[][] getParameterInfo()
public String getParameter(String name)
public List getAppletList()
AppletContext.getApplets(),
but returns a List. (Note that this may force some applets to be
created that are not yet showing.)
|
Copyright (c) 1996-1999 Massachusetts Institute of Technology Feedback: jeva-feedback@ai.mit.edu |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||