|
|||||||||
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
ubc.cs.JLog.Applet.gJLogApplicationBase
public abstract class gJLogApplicationBase
This is the abstract Application class for the Prolog in Java environment.
It includes jPrologServices
, but does not specify the user
interface. It is designed as a super class for any applications which needs
the jPrologServices
. Derivative authors should inherit from
this class to preserve the getApplicationInfo()
credits.
This class also supports the use of a single menu bar for all windows of
the application. This is not straightforward because Java uses a per
window menu bar by default. This class supports the construction of duplicate
menu bars, so that each window can have the same menu bar (by appearance,
but it is a copy), and also supports updating some common menu items so that
they appear the same (e.g., same hilight, same check state) for all menu bar
copies.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static gJLogBase |
base
|
protected java.lang.String |
current_directory
|
protected static java.util.Vector |
kb_windows
|
static java.lang.String |
MENU_BREAK
|
static java.lang.String |
MENU_CLOSE
|
static java.lang.String |
MENU_CONSULTALLKB
|
static java.lang.String |
MENU_CONSULTKB
|
static java.lang.String |
MENU_COPY
|
static java.lang.String |
MENU_CUT
|
static java.lang.String |
MENU_DEBUG
|
static java.lang.String |
MENU_FIND
|
static java.lang.String |
MENU_FINDNEXT
|
static java.lang.String |
MENU_GOTOLINE
|
static java.lang.String |
MENU_LABEL_PAUSEQ_CONT
|
static java.lang.String |
MENU_LABEL_PAUSEQ_PAUSE
|
static java.lang.String |
MENU_PASTE
|
static java.lang.String |
MENU_PAUSEQ
|
static java.lang.String |
MENU_RESETKB
|
static java.lang.String |
MENU_SAVE
|
static java.lang.String |
MENU_SAVEAS
|
static java.lang.String |
MENU_SELECTALL
|
static java.lang.String |
MENU_STOPQ
|
static java.lang.String |
MENU_TRACE
|
static java.lang.String |
MENU_UNKNOWNPRED
|
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
gJLogApplicationBase()
|
Method Summary | |
---|---|
void |
addKBWindow(gConsultWindow w)
|
java.lang.String |
convertStringLinebreaks(java.lang.String param)
|
java.awt.MenuBar |
createMenuBar(iMenuServiceRequester s)
This function returns a new menu bar, customized for the given iMenuServiceRequester . |
java.lang.String |
getApplicationInfo()
This function returns the credit assignment and copyright informaiton string. |
java.lang.String |
getCurrentDirectory()
|
java.awt.Image |
getImage(java.lang.String name)
|
java.io.InputStream |
getInputStreamFromFilename(java.lang.String name)
|
int |
getKBWindowCount()
|
java.lang.String |
getParameter(java.lang.String name)
|
jPrologServices |
getPrologServices()
|
java.lang.String |
getRequiredCreditInfo()
|
java.io.InputStream |
getResourceInputStreamFromFilename(java.lang.String name)
|
java.net.URL |
getResourceURLFromFilename(java.lang.String name)
|
java.lang.String |
getSource()
|
java.lang.String |
getTextFromInputStream(java.io.InputStream in_strm)
|
protected int |
getToolMenuID()
Returns the index of the tool menu in the menu bar. |
java.net.URL |
getURLFromFilename(java.lang.String name)
|
protected int |
getWindowMenuDynamicStart()
Returns the index where the dynamic elements of the window menu start. |
protected int |
getWindowMenuID()
Returns the index of the window menu in the menu bar. |
void |
removeKBWindow(gConsultWindow w)
|
void |
setCurrentDirectory(java.lang.String d)
|
void |
updateToolMenuConsultAll(boolean state)
|
void |
updateToolMenuConsultAll(java.awt.MenuBar menubar,
boolean state)
|
void |
updateToolMenuDebug(boolean dbg,
boolean unkpred,
boolean trce,
boolean brk,
boolean in_query)
This function updates the debug portion of the tool menu for all registered windows. |
protected void |
updateToolMenuDebug(java.awt.MenuBar menubar,
boolean dbg,
boolean unkpred,
boolean trce,
boolean brk,
boolean in_query)
This function updates the debug portion of the tool menu for all registered windows. |
void |
updateToolMenuQuery(boolean in_query,
boolean paused)
|
protected void |
updateToolMenuQuery(java.awt.MenuBar menubar,
boolean in_query,
boolean paused)
|
void |
updateToolMenuReset(java.awt.MenuBar menubar,
boolean state)
|
void |
updateWindowMenu()
Recreates the dynamic window menu for all registered windows. |
protected void |
updateWindowMenu(java.awt.MenuBar menubar)
Recreates the dynamic portion of the window menu for the given menu bar. |
Methods inherited from class java.awt.Frame |
---|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
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, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, 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, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ubc.cs.JLog.Applet.iMenuServiceRequester |
---|
useMenuItem |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public static final java.lang.String MENU_CLOSE
public static final java.lang.String MENU_SAVE
public static final java.lang.String MENU_SAVEAS
public static final java.lang.String MENU_CUT
public static final java.lang.String MENU_COPY
public static final java.lang.String MENU_PASTE
public static final java.lang.String MENU_SELECTALL
public static final java.lang.String MENU_FIND
public static final java.lang.String MENU_FINDNEXT
public static final java.lang.String MENU_GOTOLINE
public static final java.lang.String MENU_CONSULTKB
public static final java.lang.String MENU_CONSULTALLKB
public static final java.lang.String MENU_RESETKB
public static final java.lang.String MENU_PAUSEQ
public static final java.lang.String MENU_STOPQ
public static final java.lang.String MENU_DEBUG
public static final java.lang.String MENU_UNKNOWNPRED
public static final java.lang.String MENU_TRACE
public static final java.lang.String MENU_BREAK
public static final java.lang.String MENU_LABEL_PAUSEQ_PAUSE
public static final java.lang.String MENU_LABEL_PAUSEQ_CONT
protected static gJLogBase base
protected static java.util.Vector kb_windows
protected java.lang.String current_directory
Constructor Detail |
---|
public gJLogApplicationBase()
Method Detail |
---|
public java.lang.String getApplicationInfo()
gJLogApplicationBase
class, and if they
provide their own getApplicationInfo()
function it should
invoke this version first.
For example: return super.getApplicationInfo() + "derivative information";
public java.lang.String getRequiredCreditInfo()
getRequiredCreditInfo
in interface iJLogApplBaseServices
public java.lang.String getSource() throws java.io.IOException
getSource
in interface iJLogApplBaseServices
java.io.IOException
public java.net.URL getURLFromFilename(java.lang.String name) throws java.net.MalformedURLException, java.io.IOException
getURLFromFilename
in interface iJLogApplBaseServices
getURLFromFilename
in interface iPrologFileServices
java.net.MalformedURLException
java.io.IOException
public java.io.InputStream getInputStreamFromFilename(java.lang.String name) throws java.net.MalformedURLException, java.io.IOException
getInputStreamFromFilename
in interface iJLogApplBaseServices
getInputStreamFromFilename
in interface iPrologFileServices
java.net.MalformedURLException
java.io.IOException
public java.net.URL getResourceURLFromFilename(java.lang.String name) throws java.net.MalformedURLException, java.io.IOException
getResourceURLFromFilename
in interface iPrologFileServices
java.net.MalformedURLException
java.io.IOException
public java.io.InputStream getResourceInputStreamFromFilename(java.lang.String name) throws java.net.MalformedURLException, java.io.IOException
getResourceInputStreamFromFilename
in interface iPrologFileServices
java.net.MalformedURLException
java.io.IOException
public java.lang.String getTextFromInputStream(java.io.InputStream in_strm) throws java.io.IOException
getTextFromInputStream
in interface iJLogApplBaseServices
getTextFromInputStream
in interface iPrologFileServices
java.io.IOException
public java.lang.String getParameter(java.lang.String name)
getParameter
in interface iJLogApplBaseServices
public java.lang.String convertStringLinebreaks(java.lang.String param)
convertStringLinebreaks
in interface iJLogApplBaseServices
public java.awt.Image getImage(java.lang.String name)
getImage
in interface iJLogApplBaseServices
public java.awt.MenuBar createMenuBar(iMenuServiceRequester s)
iMenuServiceRequester
. The menu bar will have the same layout
and items, so that all windows have the same menus, but those menus items
not handled by the application will be passed to the iMenuServiceRequester
so that it can register a listener and the appropriate action.
s
- The iMenuServiceRequester
that this menu bar is for.
public void updateWindowMenu()
protected void updateWindowMenu(java.awt.MenuBar menubar)
menubar
- The MenuBar
to update.public void updateToolMenuDebug(boolean dbg, boolean unkpred, boolean trce, boolean brk, boolean in_query)
dbg
- true is the debugging is on.unkpred
- true if prolog throws an error on unknown predicates. false if
if unknown predicates are false.trce
- true is trace all goals.brk
- true if break after each step.in_query
- true if a query is presently underway.protected void updateToolMenuDebug(java.awt.MenuBar menubar, boolean dbg, boolean unkpred, boolean trce, boolean brk, boolean in_query)
menubar
- The iMenuServiceRequester
that this menu bar is for.dbg
- true is the debugging is on.unkpred
- true if prolog throws an error on unknown predicates. false if
if unknown predicates are false.trce
- true is trace all goals.brk
- true if break after each step.in_query
- true if a query is presently underway.public void updateToolMenuQuery(boolean in_query, boolean paused)
protected void updateToolMenuQuery(java.awt.MenuBar menubar, boolean in_query, boolean paused)
public void updateToolMenuReset(java.awt.MenuBar menubar, boolean state)
public void updateToolMenuConsultAll(boolean state)
public void updateToolMenuConsultAll(java.awt.MenuBar menubar, boolean state)
public void addKBWindow(gConsultWindow w)
public void removeKBWindow(gConsultWindow w)
public int getKBWindowCount()
protected int getToolMenuID()
protected int getWindowMenuID()
protected int getWindowMenuDynamicStart()
public java.lang.String getCurrentDirectory()
public void setCurrentDirectory(java.lang.String d)
public jPrologServices getPrologServices()
getPrologServices
in interface iJLogApplBaseServices
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |