|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
multivalent.Browser
This class implements a browser window.
It interfaces with the operating systems GUI,
holds a document tree with both user interface and content,
manages flow of control through associated behaviors according to the protocols,
and holds resources shared among all documents in a window.
Don't instantiate directly -- use Multivalent.getBrowser(String)
.
State:
browser name
getCurScrn()
)
getCurNode()
and getCurOffset()
)
grab
cursor
and selection span
(at most one of which is valid at a time)
offscreen image
getRoot()
of GUI and content
document
, the one with the focus
Functionality:
eventq(AWTEvent)
add event to event queue, either low level or semantic
Browsers do not contain:
Root
)
Nested Class Summary |
---|
Nested classes inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
MSG_CLOSE
Close browser window, safely saving component documents as needed and releasing resources. |
static java.lang.String |
MSG_CREATE_TOOLBAR
Construct toolbar by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_TOOLBAR2
Like MSG_CREATE_TOOLBAR , but for a second toolbar, under the first. |
static java.lang.String |
MSG_NEW
Create new browser window. |
static java.lang.String |
MSG_STATUS
Another semantic command, which should be given more descriptive name. |
static java.lang.String |
PROTOCOL_BUILD
|
static java.lang.String |
PROTOCOL_EVENT
|
static java.lang.String |
PROTOCOL_FORMAT
|
static java.lang.String |
PROTOCOL_PAINT
|
static java.lang.String |
PROTOCOL_REFORMAT
|
static java.lang.String |
PROTOCOL_RESTORE
|
static java.lang.String |
PROTOCOL_SEMANTICEVENT
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 |
Method Summary | |
---|---|
java.lang.Object |
callSemanticEvent(java.lang.String msg,
java.lang.Object arg)
Treat mutation (filtering, augmenting, replacing) during semantic event pass as a method. |
boolean |
checkRep()
|
java.lang.String |
clipboard()
|
java.lang.String |
clipboard(Span span)
|
void |
createBufferStrategy(int numBuffers,
java.awt.BufferCapabilities caps)
|
boolean |
event(java.awt.AWTEvent e)
Process event. |
void |
eventq(java.awt.AWTEvent e)
There are two types of events: low-level events and semantic events. |
void |
eventq(java.lang.String message,
java.lang.Object arg)
A convenience function for behaviors to create a semantic event and put on event queue. |
void |
format()
Deprecated. |
Document |
getCurDocument()
Current Document on which to attach annotations. |
Node |
getCurNode()
Returns node under the cursor. |
int |
getCurOffset()
Returns offset within node under the cursor. |
java.awt.Point |
getCurScrn()
Returns coordinates of mouse cursor, relative to top-level Frame. |
CursorMark |
getCursorMark()
Returns handle to cursor . |
INode |
getDocRoot()
|
EventListener |
getGrab()
Returns owner of grab; null if none. |
java.lang.String |
getName()
Return logical internal name of browser window instance. |
java.awt.Image |
getOffImage()
Returns handle to offscreen Image that holds the image of the Browser content. |
java.awt.Dimension |
getPreferredSize()
|
Root |
getRoot()
Returns master Root , which contains both GUI and perhaps multiple content subdocument. |
INode |
getScope()
Interactive editing should be done only within subtree rooted here. |
Span |
getSelectionSpan()
Returns handle to the selection span . |
void |
paintComponent(java.awt.Graphics g_old_api)
|
protected void |
processEvent(java.awt.AWTEvent e)
Hook into Java's event system |
void |
releaseGrab(EventListener owner)
Release grab, assuming owner currently has grab. |
void |
repaint(long ms,
int x,
int y,
int w,
int h)
|
void |
resetProfile()
|
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setCurDocument(Document doc)
Switching from one completely formed independent document tree (Document) to another. |
void |
setCurNode(Mark m)
|
void |
setCurNode(Node newnode,
int newoffset)
The current node under the cursor, either a Leaf or its corresponding IScrollPane. |
void |
setGrab(EventListener owner)
Delivers subsequent events directly to |
void |
setGrab(EventListener owner,
Node relativeTo)
Delivers subsequent events directly to owner, in coordinates relative to relativeTo. |
void |
setScope(INode scope)
|
void |
showProfile(java.lang.StringBuffer sb)
|
void |
showStatusX(java.lang.String label)
Deprecated. in favor of MSG_STATUS . |
boolean |
tickleActives(java.awt.AWTEvent e,
java.awt.Point rel,
Node obsn)
Used by Leaf (which knows rel) and IHBox and IParaBox. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, 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 |
---|
public static final java.lang.String MSG_NEW
"newBrowserInstance": arg= HashMap
attributes, in= INode
root of tree, out=unused.
public static final java.lang.String MSG_CLOSE
"closeBrowserInstance": arg= Browser
browser to close
public static final java.lang.String MSG_STATUS
"showStatus": arg= String
message-to-show.
public static final java.lang.String MSG_CREATE_TOOLBAR
"createWidget/Toolbar": out= INode
instance-under-construction.
public static final java.lang.String MSG_CREATE_TOOLBAR2
MSG_CREATE_TOOLBAR
, but for a second toolbar, under the first.
public static final java.lang.String PROTOCOL_RESTORE
public static final java.lang.String PROTOCOL_BUILD
public static final java.lang.String PROTOCOL_FORMAT
public static final java.lang.String PROTOCOL_REFORMAT
public static final java.lang.String PROTOCOL_PAINT
public static final java.lang.String PROTOCOL_EVENT
public static final java.lang.String PROTOCOL_SEMANTICEVENT
Method Detail |
---|
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void setBounds(int x, int y, int width, int height)
setBounds
in class java.awt.Component
public void createBufferStrategy(int numBuffers, java.awt.BufferCapabilities caps) throws java.awt.AWTException
java.awt.AWTException
public java.lang.String getName()
getName
in class java.awt.Component
public java.awt.Image getOffImage()
Image
that holds the image of the Browser content.
This can be used for special effects:
BitMagnify redraws the portion of the page at a different scale.
Interactive drawing tools could quickly re-establish the background as the user moves some object or adjusts a line
(draw on Image.getGraphics()
).
public Root getRoot()
Root
, which contains both GUI and perhaps multiple content subdocument.
public INode getDocRoot()
public Span getSelectionSpan()
selection span
. Check Span.isSet()
to see if presently set or not.
public CursorMark getCursorMark()
cursor
.
public INode getScope()
public void setScope(INode scope)
public Node getCurNode()
public int getCurOffset()
public void setCurNode(Mark m)
public void setCurNode(Node newnode, int newoffset)
public java.awt.Point getCurScrn()
public Document getCurDocument()
public void setCurDocument(Document doc)
public final void showStatusX(java.lang.String label)
MSG_STATUS
.
public void format()
public void repaint(long ms, int x, int y, int w, int h)
repaint
in class javax.swing.JComponent
public void paintComponent(java.awt.Graphics g_old_api)
paintComponent
in class javax.swing.JComponent
public boolean tickleActives(java.awt.AWTEvent e, java.awt.Point rel, Node obsn)
public java.lang.Object callSemanticEvent(java.lang.String msg, java.lang.Object arg)
protected void processEvent(java.awt.AWTEvent e)
processEvent
in class java.awt.Container
public void eventq(java.awt.AWTEvent e)
SemanticEvent
public void eventq(java.lang.String message, java.lang.Object arg)
event(AWTEvent)
whenever possible!
public boolean event(java.awt.AWTEvent e)
eventq()
, instead on demanding instant attention.
public EventListener getGrab()
null
if none.
public void setGrab(EventListener owner)
public void setGrab(EventListener owner, Node relativeTo)
public void releaseGrab(EventListener owner)
getGrab()
.
public java.lang.String clipboard()
public java.lang.String clipboard(Span span)
public boolean checkRep()
public void resetProfile()
public void showProfile(java.lang.StringBuffer sb)
|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |