de.tubs.macs.applications.whiteboard
Class WbCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--de.tubs.macs.applications.whiteboard.WbCanvas

public class WbCanvas
extends javax.swing.JPanel
implements java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver

See Also:
Serialized Form

Inner Class Summary
(package private)  class WbCanvas.ClearAction
           
(package private)  class WbCanvas.ColorAction
           
(package private)  class WbCanvas.CutAction
           
(package private)  class WbCanvas.FillAction
           
(package private)  class WbCanvas.FloorAction
           
(package private)  class WbCanvas.LinesizeAction
           
(package private)  class WbCanvas.MarkerAction
           
(package private)  class WbCanvas.NewAction
           
(package private)  class WbCanvas.PagebackAction
           
(package private)  class WbCanvas.PageforwAction
           
(package private)  class WbCanvas.PagesetAction
           
(package private)  class WbCanvas.PaintToolsAction
           
(package private)  class WbCanvas.PrintAction
           
(package private)  class WbCanvas.TextsizeAction
           
 
Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardBinding, javax.swing.JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
static java.lang.String clearAction
           
(package private)  java.awt.Color col
           
static java.lang.String colorAction
           
(package private)  java.awt.font.TextLayout currentLayout
           
 int currentPage
           
(package private)  de.tubs.macs.applications.whiteboard.wbgraphics.WbText currentText
           
static java.lang.String cutAction
           
protected  javax.swing.Action[] defaultActions
          instantiate inner action-classes for canvas
static java.lang.String fillAction
           
(package private)  boolean fillMode
           
static java.lang.String floorAction
           
static java.lang.String linesizeAction
           
(package private)  int lineWidth
           
(package private)  java.util.Hashtable marker
           
static java.lang.String markerAction
           
(package private)  boolean markerLock
           
(package private)  boolean markerMode
           
 int maxPage
           
static java.lang.String newAction
           
static java.awt.geom.Point2D NULL_POS
           
 java.lang.String objMode
           
static java.lang.String pagebackAction
           
static java.lang.String pageforwAction
           
static java.lang.String pagesetAction
           
static java.lang.String painttoolsAction
          Strings for actions used in canvas
static java.lang.String printAction
           
(package private)  boolean shiftKey
           
(package private)  java.util.Hashtable telePtr
           
(package private)  java.awt.Point textPos
           
(package private)  int textSize
           
static java.lang.String textsizeAction
           
(package private)  Marker wbMarker
           
(package private)  WbRemoteOperation wbRemoteOps
           
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
component, containerListener, layoutMgr, ncomponents
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WbCanvas(Whiteboard wb, WbStorage store)
           
 
Method Summary
 void clearAllPages()
           
 void clearPage(java.lang.Integer p)
           
 void drawTelePtr(long id, TelePointer newtp, boolean xor)
           
 void drawTelePtr(java.lang.Long id, TelePointer newtp, boolean xor)
           
 javax.swing.Action[] getActions()
           
 int getLineWidth()
           
 int getMaxPage()
           
 int getPage()
           
 java.awt.Dimension getPreferredSize()
          default-size of the canvas
 java.lang.String getShape()
           
 int getTextSize()
           
 boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
           
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void keyReleased(java.awt.event.KeyEvent ke)
           
 void keyTyped(java.awt.event.KeyEvent ke)
           
 void mouseClicked(java.awt.event.MouseEvent me)
           
 void mouseDragged(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent me)
           
 void mouseExited(java.awt.event.MouseEvent me)
           
 void mouseMoved(java.awt.event.MouseEvent me)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 void paint(java.awt.Graphics g)
           
 void sendPageSet(int page, int maxPage)
           
 void setColor(java.awt.Color c)
           
 void setFillmode(boolean b)
           
 void setLineWidth(int w)
           
 void setMarkermode(boolean b)
           
 void setMaxPage(int p)
           
 void setPage(int p)
           
 void setRemoteOperation(WbRemoteOperation wbRemoteOps)
           
 void setShape(java.lang.String s)
           
 void setTextSize(int s)
           
 
Methods inherited from class javax.swing.JPanel
, getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, bindingForKeyStroke, checkIfChildObscuredBySibling, computeVisibleRect, computeVisibleRect, contains, createToolTip, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getLayout, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setCursor, setFocusOwner, setLayout, transferFocus, updateCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getIntrinsicCursor, getLocale, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, gotFocus, handleEvent, hide, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

painttoolsAction

public static final java.lang.String painttoolsAction
Strings for actions used in canvas

fillAction

public static final java.lang.String fillAction

colorAction

public static final java.lang.String colorAction

linesizeAction

public static final java.lang.String linesizeAction

textsizeAction

public static final java.lang.String textsizeAction

cutAction

public static final java.lang.String cutAction

clearAction

public static final java.lang.String clearAction

printAction

public static final java.lang.String printAction

pagebackAction

public static final java.lang.String pagebackAction

pageforwAction

public static final java.lang.String pageforwAction

pagesetAction

public static final java.lang.String pagesetAction

markerAction

public static final java.lang.String markerAction

newAction

public static final java.lang.String newAction

floorAction

public static final java.lang.String floorAction

defaultActions

protected javax.swing.Action[] defaultActions
instantiate inner action-classes for canvas

currentPage

public int currentPage

maxPage

public int maxPage

objMode

public java.lang.String objMode

fillMode

boolean fillMode

markerMode

boolean markerMode

shiftKey

boolean shiftKey

lineWidth

int lineWidth

textSize

int textSize

col

java.awt.Color col

wbRemoteOps

WbRemoteOperation wbRemoteOps

wbMarker

Marker wbMarker

markerLock

boolean markerLock

telePtr

java.util.Hashtable telePtr

marker

java.util.Hashtable marker

NULL_POS

public static java.awt.geom.Point2D NULL_POS

textPos

java.awt.Point textPos

currentText

de.tubs.macs.applications.whiteboard.wbgraphics.WbText currentText

currentLayout

java.awt.font.TextLayout currentLayout
Constructor Detail

WbCanvas

public WbCanvas(Whiteboard wb,
                WbStorage store)
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
default-size of the canvas
Overrides:
getPreferredSize in class javax.swing.JComponent

setRemoteOperation

public void setRemoteOperation(WbRemoteOperation wbRemoteOps)

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

setShape

public void setShape(java.lang.String s)

getShape

public java.lang.String getShape()

setColor

public void setColor(java.awt.Color c)

setFillmode

public void setFillmode(boolean b)

setMarkermode

public void setMarkermode(boolean b)

setLineWidth

public void setLineWidth(int w)

getLineWidth

public int getLineWidth()

setTextSize

public void setTextSize(int s)

getTextSize

public int getTextSize()

setPage

public void setPage(int p)

getPage

public int getPage()

setMaxPage

public void setMaxPage(int p)

getMaxPage

public int getMaxPage()

clearAllPages

public void clearAllPages()

clearPage

public void clearPage(java.lang.Integer p)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

keyTyped

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

keyPressed

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

keyReleased

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

drawTelePtr

public void drawTelePtr(long id,
                        TelePointer newtp,
                        boolean xor)

drawTelePtr

public void drawTelePtr(java.lang.Long id,
                        TelePointer newtp,
                        boolean xor)

sendPageSet

public void sendPageSet(int page,
                        int maxPage)

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
Specified by:
imageUpdate in interface java.awt.image.ImageObserver
Overrides:
imageUpdate in class java.awt.Component

getActions

public javax.swing.Action[] getActions()