Sky View Café - Java

org.shetline.gui
Class KApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by org.shetline.gui.KApplet
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, ResourceProvider

public class KApplet
extends JApplet
implements ResourceProvider

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JApplet
JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class java.applet.Applet
Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
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  String altWebHost
           
protected  boolean appletMode
           
protected static Vector<KApplet> applets
           
protected  Object browserWindow
           
protected  String cookieDomain
           
protected  String cookieFrame
           
protected  String cookieWriter
           
protected  boolean isResourceReference
           
protected  boolean liveConnectWorks
           
protected  ResourceProvider resourceProvider
           
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
KApplet()
           
 
Method Summary
 void addChoicesFromResource(JComboBox comboBox, String key)
          Fill in selections choices for a JComboBox using a delimited (as per ResourceProvider.getStrings(String) resource string.
protected  void beep()
           
 boolean canDoLiveConnect()
           
 void destroy()
           
 String fillInURL(String url)
           
 String format(String patternKey, Object... args)
          Return a formatted string, filled in using a specified list of arguments, as per ExtendedMessageFormat.format(String, Object...), where the pattern argument is a resource string matching the specified patternKey.
static KApplet getApplet()
           
 boolean getAppletMode()
           
 String getCookie()
           
 String getCookie(String name)
           
 String getCookie(String name, boolean raw)
           
 String getFilledInURL(String key)
           
 int getInt(String key)
          Return an integer value for the given key.
 int getInt(String key, int errorValue)
          Return an integer value for the given key.
 String getParameter(String name)
           
protected  Dimension getScreenSize()
           
 String getString(String key)
          Return a resource string for the given key.
 String getString(String key, String defaultValue)
          Return a resource string for the given key.
 String getString(String key, String defaultValue, boolean failQuietly)
          Return a resource string for the given key.
 String[] getStrings(String key)
          Return an array of strings parsed from the resource string for the given key.
 String[] getStrings(String key, char delimiter)
          Return an array of strings parsed from the resource string for the given key.
 String[] getStrings(String key, char delimiter, char escapeChar)
          Return an array of strings parsed from the resource string for the given key.
 String getWebHost()
           
 void init()
           
 boolean isDestroyed()
           
 boolean setCookie(String name, String value)
           
 boolean setCookie(String name, String value, Date expiration)
           
 boolean setCookie(String name, String value, String path)
           
 boolean setCookie(String name, String value, String path, Date expiration)
           
protected  boolean setCookieViaFrameHack(String name, String value, String path, Date expiration)
           
static boolean showDocument(Applet applet, String url)
           
static boolean showDocument(Applet applet, String url, String target)
           
 boolean showDocument(String url)
           
 boolean showDocument(String url, String target)
           
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.applet.Applet
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameterInfo, 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, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

altWebHost

protected String altWebHost

appletMode

protected boolean appletMode

browserWindow

protected Object browserWindow

cookieDomain

protected String cookieDomain

cookieFrame

protected String cookieFrame

cookieWriter

protected String cookieWriter

isResourceReference

protected boolean isResourceReference

liveConnectWorks

protected boolean liveConnectWorks

resourceProvider

protected ResourceProvider resourceProvider

applets

protected static final Vector<KApplet> applets
Constructor Detail

KApplet

public KApplet()
Method Detail

init

public void init()
Overrides:
init in class Applet

getApplet

public static KApplet getApplet()

getAppletMode

public boolean getAppletMode()

getParameter

public String getParameter(String name)
Overrides:
getParameter in class Applet

destroy

public void destroy()
Overrides:
destroy in class Applet

isDestroyed

public boolean isDestroyed()

getString

public String getString(String key)
Description copied from interface: ResourceProvider
Return a resource string for the given key.

Specified by:
getString in interface ResourceProvider
Parameters:
key - Resource key.
Returns:
Matching string resource, or "<<key>>" if no match is found.

getString

public String getString(String key,
                        String defaultValue)
Description copied from interface: ResourceProvider
Return a resource string for the given key.

Specified by:
getString in interface ResourceProvider
Parameters:
key - Resource key.
defaultValue - Default return value if resource not found.
Returns:
Matching string resource, or defaultValue if no match is found.

getString

public String getString(String key,
                        String defaultValue,
                        boolean failQuietly)
Description copied from interface: ResourceProvider
Return a resource string for the given key.

Specified by:
getString in interface ResourceProvider
Parameters:
key - Resource key.
defaultValue - Default return value if resource not found.
failQuietly - If true, log no error for unmatched resource key.
Returns:
Matching string resource, or defaultValue if no match is found.

getStrings

public String[] getStrings(String key)
Description copied from interface: ResourceProvider

Return an array of strings parsed from the resource string for the given key.

The delimiters used to separate multiple string items will be automatically determined as follows, in this order of evaluation:

  1. If the resource contains any new line characters (\n), use new line as the item separator.
  2. If the resource contains any tab characters (\t), use tab as the item separator.
  3. If the resource contains any semicolons (;), use semicolon as the item separator, use backslash (\) as an escape character for literally-intended semicolons, and double backslash for single literally-intended backslashes
  4. If the resource contains any commas (,), use comma as the item separator, use backslash (\) as an escape character for literally-intended commas, and double backslash for single literally-intended backslashes

If none of the above delimiters are found, the resource will be treated as a single string.

Specified by:
getStrings in interface ResourceProvider
Parameters:
key - Resource key.
Returns:
Matching string resource parsed into an array of strings, or a single-item array containing "<<key>>" if no matching resource is found.

getStrings

public String[] getStrings(String key,
                           char delimiter)
Description copied from interface: ResourceProvider
Return an array of strings parsed from the resource string for the given key.

Specified by:
getStrings in interface ResourceProvider
Parameters:
key - Resource key.
delimiter - The delimiter character used to separate individual string items. If the delimiter is either semicolon (;) or comma (,) backslash (\) is used as an escape character.
Returns:
Matching string resource parsed into an array of strings, or a single-item array containing "<<key>>" if no matching resource is found.

getStrings

public String[] getStrings(String key,
                           char delimiter,
                           char escapeChar)
Description copied from interface: ResourceProvider
Return an array of strings parsed from the resource string for the given key.

Specified by:
getStrings in interface ResourceProvider
Parameters:
key - Resource key.
delimiter - The delimiter character used to separate individual string items.
escapeChar - An escape character. If the null character (\0) is specified, no escaping is performed.
Returns:
Matching string resource parsed into an array of strings, or a single-item array containing "<<key>>" if no matching resource is found.

getInt

public int getInt(String key)
Description copied from interface: ResourceProvider
Return an integer value for the given key.

Specified by:
getInt in interface ResourceProvider
Parameters:
key - Resource key.
Returns:
Integer value of matching string resource, 0 if no match is found or if the matching resource does not parse as a proper integer.

getInt

public int getInt(String key,
                  int errorValue)
Description copied from interface: ResourceProvider
Return an integer value for the given key.

Specified by:
getInt in interface ResourceProvider
Parameters:
key - Resource key.
errorValue - Value to return for missing or invalid resources.
Returns:
Integer value of matching string resource, errorValue if no match is found or if the matching resource does not parse as a proper integer.

format

public String format(String patternKey,
                     Object... args)
Description copied from interface: ResourceProvider

Return a formatted string, filled in using a specified list of arguments, as per ExtendedMessageFormat.format(String, Object...), where the pattern argument is a resource string matching the specified patternKey.

Specified by:
format in interface ResourceProvider
Parameters:
patternKey - Resource key for a formatting pattern.
args - Values to be applied to the formatting pattern.
Returns:
A formatted string based on the supplied pattern and values.
See Also:
MessageFormat.format(String, Object...)

addChoicesFromResource

public void addChoicesFromResource(JComboBox comboBox,
                                   String key)
Description copied from interface: ResourceProvider
Fill in selections choices for a JComboBox using a delimited (as per ResourceProvider.getStrings(String) resource string.

Specified by:
addChoicesFromResource in interface ResourceProvider
Parameters:
comboBox - Target JComboBox.
key - Resource key of delimited list of choices.

getWebHost

public String getWebHost()

fillInURL

public String fillInURL(String url)

getFilledInURL

public String getFilledInURL(String key)

beep

protected void beep()

getScreenSize

protected Dimension getScreenSize()

canDoLiveConnect

public boolean canDoLiveConnect()

getCookie

public String getCookie()

getCookie

public String getCookie(String name)

getCookie

public String getCookie(String name,
                        boolean raw)

setCookie

public boolean setCookie(String name,
                         String value)

setCookie

public boolean setCookie(String name,
                         String value,
                         String path)

setCookie

public boolean setCookie(String name,
                         String value,
                         Date expiration)

setCookie

public boolean setCookie(String name,
                         String value,
                         String path,
                         Date expiration)

setCookieViaFrameHack

protected boolean setCookieViaFrameHack(String name,
                                        String value,
                                        String path,
                                        Date expiration)

showDocument

public boolean showDocument(String url)

showDocument

public boolean showDocument(String url,
                            String target)

showDocument

public static boolean showDocument(Applet applet,
                                   String url)

showDocument

public static boolean showDocument(Applet applet,
                                   String url,
                                   String target)

Sky View Café - Java