gnu.jemacs.swing
Class SwingWindow

java.lang.Object
  extended by gnu.jemacs.buffer.EWindow
      extended by gnu.jemacs.swing.SwingWindow
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.KeyListener, java.util.EventListener, javax.swing.event.ChangeListener

public class SwingWindow
extends EWindow
implements java.awt.event.FocusListener, java.awt.event.KeyListener, javax.swing.event.ChangeListener

An Emacs window (EWindow) implemented using the Swing toolkits.


Field Summary
 Modeline modeline
           
 
Fields inherited from class gnu.jemacs.buffer.EWindow
buffer, charHeight, charWidth, frame, nextWindow, pendingKeys, pendingLength, prevWindow
 
Constructor Summary
SwingWindow(Buffer buffer)
           
SwingWindow(Buffer buffer, boolean wantModeline)
          Create new Window.
 
Method Summary
 void activateRegion()
           
protected  void deleteNoValidate()
           
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
protected  void getCharSize()
           
static javax.swing.JTextPane getContainedWindow(java.awt.Container cont, boolean last)
           
 int getHeight()
          Get the current height (in pixels) of this window.
 javax.swing.JPanel getPanel()
          Get the JPanel containing this Window.
 int getPoint()
          Returns the "Emacs value" (1-origin) of point.
 java.awt.Dimension getPreferredScrollableViewportSize()
           
 int getWidth()
          Get the current width (in pixels) of this window.
static SwingWindow getWindow(java.awt.event.ActionEvent event)
           
protected  void handle(java.awt.event.KeyEvent e, int code)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void requestFocus()
           
 void setBuffer(Buffer buffer)
           
 void setDot(int offset)
           
 void setSelected()
           
 EWindow split(Buffer buffer, int lines, boolean horizontal)
          Split this window into two.
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 java.lang.Object tooLong(int pendingLength)
           
 void unselect()
           
 javax.swing.JPanel wrap()
          Warp this (and optional modeline) inside a ScrollPane in a new JPanel.
 
Methods inherited from class gnu.jemacs.buffer.EWindow
delete, deleteOtherWindows, getBuffer, getFrame, getHeightInLines, getNextWindow, getNextWindowInFrame, getOtherWindow, getSelected, getWidthInColumns, handleCommand, handleKey, linkSibling, lookupKey, pushPrefix, setFrame, setPoint, setSelected, split, toString, unlink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modeline

public Modeline modeline
Constructor Detail

SwingWindow

public SwingWindow(Buffer buffer)

SwingWindow

public SwingWindow(Buffer buffer,
                   boolean wantModeline)
Create new Window.

Parameters:
buffer - the Buffer containing the data.
wantModeline - true if we should create a mode line
Method Detail

wrap

public javax.swing.JPanel wrap()
Warp this (and optional modeline) inside a ScrollPane in a new JPanel.


getPanel

public javax.swing.JPanel getPanel()
Get the JPanel containing this Window.


focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

requestFocus

public void requestFocus()
Overrides:
requestFocus in class EWindow

setBuffer

public void setBuffer(Buffer buffer)
Overrides:
setBuffer in class EWindow

unselect

public void unselect()
Specified by:
unselect in class EWindow

setSelected

public void setSelected()
Overrides:
setSelected in class EWindow

getPoint

public int getPoint()
Description copied from class: EWindow
Returns the "Emacs value" (1-origin) of point.

Specified by:
getPoint in class EWindow

setDot

public void setDot(int offset)
Specified by:
setDot in class EWindow

split

public EWindow split(Buffer buffer,
                     int lines,
                     boolean horizontal)
Description copied from class: EWindow
Split this window into two. Display Var>buffer in the new window.

Specified by:
split in class EWindow
Returns:
the new window.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

getContainedWindow

public static javax.swing.JTextPane getContainedWindow(java.awt.Container cont,
                                                       boolean last)

getWindow

public static SwingWindow getWindow(java.awt.event.ActionEvent event)

deleteNoValidate

protected void deleteNoValidate()
Overrides:
deleteNoValidate in class EWindow

activateRegion

public void activateRegion()

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()

getCharSize

protected void getCharSize()
Specified by:
getCharSize in class EWindow

getWidth

public int getWidth()
Description copied from class: EWindow
Get the current width (in pixels) of this window.

Specified by:
getWidth in class EWindow

getHeight

public int getHeight()
Description copied from class: EWindow
Get the current height (in pixels) of this window.

Specified by:
getHeight in class EWindow

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

handle

protected void handle(java.awt.event.KeyEvent e,
                      int code)

tooLong

public java.lang.Object tooLong(int pendingLength)
Specified by:
tooLong in class EWindow
See Also:
EWindow.tooLong(int)