public class EditCanvas extends DisplayCanvas implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.KeyListener
| Modifier and Type | Class and Description |
|---|---|
static class |
EditCanvas.ShapeDescriptor
Class ShapeDescriptor _more_
|
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CMD_ALIGN_BOTTOM
_more_
|
static java.lang.String |
CMD_ALIGN_CENTER
_more_
|
static java.lang.String |
CMD_ALIGN_LEFT
_more_
|
static java.lang.String |
CMD_ALIGN_MIDDLE
_more_
|
static java.lang.String |
CMD_ALIGN_PREFIX
_more_
|
static java.lang.String |
CMD_ALIGN_RIGHT
_more_
|
static java.lang.String |
CMD_ALIGN_TOP
_more_
|
static java.lang.String |
CMD_EDIT_COPY
_more_
|
static java.lang.String |
CMD_EDIT_CUT
_more_
|
static java.lang.String |
CMD_EDIT_GROUP
_more_
|
static java.lang.String |
CMD_EDIT_PASTE
_more_
|
static java.lang.String |
CMD_EDIT_SELECTALL
_more_
|
static java.lang.String |
CMD_EDIT_TOBACK
_more_
|
static java.lang.String |
CMD_EDIT_TOFRONT
_more_
|
static java.lang.String |
CMD_EDIT_UNGROUP
_more_
|
static java.lang.String |
CMD_SNAP |
static java.lang.String |
CMD_SPACE_H |
static java.lang.String |
CMD_SPACE_V |
static java.lang.String |
CMD_ZOOMIN
_more_
|
static java.lang.String |
CMD_ZOOMOUT
_more_
|
static java.lang.String |
CMD_ZOOMRESET
_more_
|
canvasBg, CMD_CHANGE, CMD_CREATE, CMD_MOVE, CMD_REMOVE, CMD_TOBACK, CMD_TOFRONT, DEFAULT_CURSOR, glyphs, gridSpacing, HAND_CURSOR, highlightedGlyph, MOVE_CURSOR, NW_CURSOR, scaleFactor, showGrid, TEXT_CURSORlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
EditCanvas()
_more_
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
_more_
|
java.util.List |
cloneGlyphs(java.util.List from)
_more_
|
void |
doAlign(java.lang.String cmd)
Align the set of selected glyphs with the given command
(e.g., align.top, align.bottom, etc.)
|
void |
doCopy()
_more_
|
void |
doCut()
_more_
|
protected void |
doDoubleClick(Glyph nearestGlyph)
_more_
|
boolean |
doGroup() |
protected java.awt.Component |
doMakeContents()
_more_
|
java.util.List |
doMakeMenuItems(Glyph g,
java.util.List l)
/**
_more_
|
java.awt.Component |
doMakePalette()
Create the Glyph creation palette
|
javax.swing.JToolBar |
doMakeToolbar(javax.swing.JToolBar toolbar)
_more_
|
void |
doPaste()
_more_
|
void |
doPaste(java.util.List l,
int x,
int y)
Paste the given vector of glyphs.
|
void |
doToBack()
_more_
|
void |
doToFront()
_more_
|
protected void |
doZoomIn()
zoom in
|
protected void |
doZoomOut()
zoom out
|
void |
focusGained(java.awt.event.FocusEvent e)
_more_
|
void |
focusLost(java.awt.event.FocusEvent e)
_more_
|
boolean |
getHaveChanged()
_more_
|
protected javax.swing.JComponent |
getLabelComponent()
_more_
|
javax.swing.JMenuBar |
getMenuBar()
_more_
|
java.util.List |
getShapeDescriptors()
_more_
|
void |
group()
_more_
|
boolean |
haveCommand()
_more_
|
void |
initMenuBar(javax.swing.JMenuBar menuBar)
_more_
|
void |
keyPressed(java.awt.event.KeyEvent evt)
_more_
|
void |
keyReleased(java.awt.event.KeyEvent e)
_more_
|
void |
keyTyped(java.awt.event.KeyEvent evt)
_more_
|
void |
loadXml(org.w3c.dom.Element root)
_more_
|
EditCanvas.ShapeDescriptor |
makeDescriptor(java.lang.String className,
java.lang.String name,
java.lang.String iconName,
java.lang.String attrs)
_more_
|
javax.swing.JMenu |
makeEditMenu()
_more_
|
javax.swing.JMenu |
makeEditMenu(javax.swing.JMenu editMenu)
_more_
|
protected javax.swing.JMenuItem |
makeMenuItem(java.lang.String label,
char mnem,
java.lang.String command)
_more_
|
protected javax.swing.JMenuItem |
makeMenuItem(java.lang.String label,
java.lang.String command)
_more_
|
protected javax.swing.JMenuItem |
makeSelectionMenuItem(java.lang.String label,
char mnem,
java.lang.String command,
boolean enabled)
_more_
|
javax.swing.JMenu |
makeViewMenu()
_more_
|
javax.swing.JMenu |
makeViewMenu(javax.swing.JMenu viewMenu)
_more_
|
void |
mouseClicked(java.awt.event.MouseEvent event)
Handle mouse click events.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
_more_
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Handle mouse entered events.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Handle mouse exited events.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Handle mouse moved events.
|
void |
mousePressed(java.awt.event.MouseEvent e)
_more_
|
boolean |
mousePressedInner(java.awt.event.MouseEvent e)
_more_
|
void |
mouseReleased(java.awt.event.MouseEvent e)
_more_
|
void |
notifyGlyphChanged(Glyph theGlyph,
java.lang.String attr)
_more_
|
void |
notifyGlyphChangeDone(Glyph theGlyph,
java.lang.String attr)
_more_
|
void |
notifyGlyphCreateComplete(Glyph g,
boolean diddleSelection,
boolean fromPaste)
_more_
|
void |
notifyGlyphMoveComplete(Glyph theGlyph)
_more_
|
void |
notifyGlyphMoved(Glyph theGlyph)
We have these hooks here so that derived classes can do things based
on glyph events (e.g., tell the whiteboard server that a Glyph moved
|
boolean |
okToPaintHighlight()
_more_
|
void |
paint(java.awt.Graphics g)
Called from the base class.
|
void |
selectAll()
_more_
|
void |
selectionChanged()
_more_
|
void |
setColor(Glyph g,
boolean foreground)
Set the color of the glyph from a color chooser dialog.
|
void |
setColor(Glyph g,
boolean foreground,
java.awt.Color newColor)
Set the color of the glyph from a color chooser dialog.
|
void |
setCommand(CanvasCommand newCommand)
_more_
|
void |
setDefaultCursor()
_more_
|
void |
setHaveChanged(boolean v)
_more_
|
boolean |
showTextInPalette()
_more_
|
void |
snapToGrid() |
void |
spaceH() |
void |
spaceV() |
void |
togglePressed(javax.swing.JToggleButton pressed)
_more_
|
void |
unGroup()
_more_
|
addGlyph, addSelection, clearAll, clearSelection, createGlyph, decreaseGridSpacing, doRemove, findGlyph, findGlyph, findGlyph, getContents, getGlyphs, getImage, getSelection, getShowGrid, glyphChanged, hasSelection, increaseGridSpacing, isFocusTraversable, isSelected, justRemoveGlyph, moveToBack, moveToFront, notifyGlyphCreateComplete, paintGrid, removeGlyph, removeSelection, repaint, select, setCanvasBackground, setGlyphs, setHighlight, setShowGrid, snap, transformInput, transformInput, transformInputX, transformInputY, transformOutput, transformOutput, transformOutputX, transformOutputYgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final java.lang.String CMD_ZOOMIN
public static final java.lang.String CMD_ZOOMOUT
public static final java.lang.String CMD_ZOOMRESET
public static final java.lang.String CMD_EDIT_CUT
public static final java.lang.String CMD_EDIT_COPY
public static final java.lang.String CMD_EDIT_PASTE
public static final java.lang.String CMD_EDIT_SELECTALL
public static final java.lang.String CMD_EDIT_GROUP
public static final java.lang.String CMD_EDIT_UNGROUP
public static final java.lang.String CMD_EDIT_TOFRONT
public static final java.lang.String CMD_EDIT_TOBACK
public static final java.lang.String CMD_ALIGN_PREFIX
public static final java.lang.String CMD_ALIGN_TOP
public static final java.lang.String CMD_ALIGN_CENTER
public static final java.lang.String CMD_ALIGN_BOTTOM
public static final java.lang.String CMD_ALIGN_LEFT
public static final java.lang.String CMD_ALIGN_MIDDLE
public static final java.lang.String CMD_ALIGN_RIGHT
public static final java.lang.String CMD_SPACE_H
public static final java.lang.String CMD_SPACE_V
public static final java.lang.String CMD_SNAP
public void setDefaultCursor()
public boolean okToPaintHighlight()
public void paint(java.awt.Graphics g)
paint in class DisplayCanvasg - public boolean haveCommand()
public boolean getHaveChanged()
public void setHaveChanged(boolean v)
v - public void setCommand(CanvasCommand newCommand)
newCommand - public void notifyGlyphMoved(Glyph theGlyph)
notifyGlyphMoved in class DisplayCanvastheGlyph - public void notifyGlyphMoveComplete(Glyph theGlyph)
notifyGlyphMoveComplete in class DisplayCanvastheGlyph - public void notifyGlyphChanged(Glyph theGlyph, java.lang.String attr)
theGlyph - attr - public void notifyGlyphChangeDone(Glyph theGlyph, java.lang.String attr)
theGlyph - attr - public void notifyGlyphCreateComplete(Glyph g, boolean diddleSelection, boolean fromPaste)
notifyGlyphCreateComplete in class DisplayCanvasg - diddleSelection - fromPaste - public void focusGained(java.awt.event.FocusEvent e)
focusGained in interface java.awt.event.FocusListenere - public void focusLost(java.awt.event.FocusEvent e)
focusLost in interface java.awt.event.FocusListenere - public void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenere - public void keyTyped(java.awt.event.KeyEvent evt)
keyTyped in interface java.awt.event.KeyListenerevt - public void keyPressed(java.awt.event.KeyEvent evt)
keyPressed in interface java.awt.event.KeyListenerevt - protected javax.swing.JMenuItem makeSelectionMenuItem(java.lang.String label,
char mnem,
java.lang.String command,
boolean enabled)
label - mnem - command - enabled - protected javax.swing.JMenuItem makeMenuItem(java.lang.String label,
char mnem,
java.lang.String command)
label - mnem - command - protected javax.swing.JMenuItem makeMenuItem(java.lang.String label,
java.lang.String command)
label - command - public javax.swing.JMenu makeEditMenu()
public javax.swing.JMenu makeViewMenu()
public void selectionChanged()
selectionChanged in class DisplayCanvaspublic javax.swing.JMenu makeEditMenu(javax.swing.JMenu editMenu)
editMenu - public javax.swing.JMenu makeViewMenu(javax.swing.JMenu viewMenu)
viewMenu - public boolean doGroup()
protected void doZoomIn()
protected void doZoomOut()
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerevent - public void group()
public void unGroup()
public void doPaste(java.util.List l,
int x,
int y)
l - x - y - public void doPaste()
public java.util.List cloneGlyphs(java.util.List from)
from - public void doToFront()
public void doToBack()
public void doCopy()
public void doCut()
public void selectAll()
public void spaceH()
public void spaceV()
public void doAlign(java.lang.String cmd)
cmd - public void snapToGrid()
public java.util.List doMakeMenuItems(Glyph g, java.util.List l)
g - l - public void setColor(Glyph g, boolean foreground)
g - Glyph to color.foreground - true if the color is for the foregroundpublic void setColor(Glyph g, boolean foreground, java.awt.Color newColor)
g - Glyph to color.foreground - true if the color is for the foregroundnewColor - new Color for this Glyphpublic void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked in interface java.awt.event.MouseListenerevent - MouseEventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - MouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - MouseEventpublic java.util.List getShapeDescriptors()
public javax.swing.JMenuBar getMenuBar()
protected java.awt.Component doMakeContents()
doMakeContents in class DisplayCanvasprotected javax.swing.JComponent getLabelComponent()
public void initMenuBar(javax.swing.JMenuBar menuBar)
menuBar - public void togglePressed(javax.swing.JToggleButton pressed)
pressed - public javax.swing.JToolBar doMakeToolbar(javax.swing.JToolBar toolbar)
toolbar - public java.awt.Component doMakePalette()
public boolean showTextInPalette()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - protected void doDoubleClick(Glyph nearestGlyph)
nearestGlyph - _more_public boolean mousePressedInner(java.awt.event.MouseEvent e)
e - public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - public void loadXml(org.w3c.dom.Element root)
root - public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - public EditCanvas.ShapeDescriptor makeDescriptor(java.lang.String className, java.lang.String name, java.lang.String iconName, java.lang.String attrs)
className - _more_name - _more_iconName - _more_attrs - _more_