public class DisplayCanvas
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
canvasBg
_more_
|
static java.lang.String |
CMD_CHANGE
_more_
|
static java.lang.String |
CMD_CREATE
_more_
|
static java.lang.String |
CMD_MOVE
_more_
|
static java.lang.String |
CMD_REMOVE
_more_
|
static java.lang.String |
CMD_TOBACK
_more_
|
static java.lang.String |
CMD_TOFRONT
_more_
|
static java.awt.Cursor |
DEFAULT_CURSOR
_more_
|
protected java.util.List |
glyphs
_more_
|
int |
gridSpacing |
static java.awt.Cursor |
HAND_CURSOR
_more_
|
protected Glyph |
highlightedGlyph
_more_
|
static java.awt.Cursor |
MOVE_CURSOR
_more_
|
static java.awt.Cursor |
NW_CURSOR
_more_
|
protected double |
scaleFactor
The scaling
|
boolean |
showGrid |
static java.awt.Cursor |
TEXT_CURSOR
_more_
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DisplayCanvas()
_more_
|
Modifier and Type | Method and Description |
---|---|
void |
addGlyph(Glyph g)
_more_
|
void |
addSelection(Glyph g)
_more_
|
void |
clearAll()
_more_
|
void |
clearSelection()
_more_
|
Glyph |
createGlyph(java.lang.String glyphClass,
int x,
int y)
_more_
|
void |
decreaseGridSpacing() |
protected java.awt.Component |
doMakeContents()
_more_
|
void |
doRemove(Glyph g)
_more_
|
Glyph |
findGlyph(int x,
int y)
_more_
|
static Glyph |
findGlyph(java.util.List glyphs,
int x,
int y,
double threshold)
_more_
|
Glyph |
findGlyph(java.lang.String id)
_more_
|
java.awt.Component |
getContents()
_more_
|
protected java.util.List |
getGlyphs()
_more_
|
java.awt.Image |
getImage(java.lang.String path)
_more_
|
java.util.List |
getSelection()
_more_
|
boolean |
getShowGrid()
Get the ShowGrid property.
|
void |
glyphChanged(Glyph g)
_more_
|
boolean |
hasSelection()
_more_
|
void |
increaseGridSpacing() |
boolean |
isFocusTraversable()
_more_
|
boolean |
isSelected(Glyph g)
_more_
|
void |
justRemoveGlyph(Glyph g)
_more_
|
void |
moveToBack(Glyph theGlyph)
_more_
|
void |
moveToFront(Glyph theGlyph)
_more_
|
void |
notifyGlyphCreateComplete(Glyph g)
_more_
|
void |
notifyGlyphCreateComplete(Glyph g,
boolean diddleSelection,
boolean fromPaste)
_more_
|
void |
notifyGlyphMoveComplete(Glyph theGlyph)
_more_
|
void |
notifyGlyphMoved(Glyph theGlyph)
_more_
|
void |
paint(java.awt.Graphics g)
_more_
|
void |
paintGrid(java.awt.Graphics g) |
void |
removeGlyph(Glyph g)
_more_
|
void |
removeSelection(Glyph g)
_more_
|
void |
repaint(Glyph g)
_more_
|
void |
select(java.awt.Rectangle r)
_more_
|
void |
selectionChanged()
_more_
|
void |
setCanvasBackground(java.awt.Color c)
_more_
|
protected void |
setGlyphs(java.util.List newGlyphs)
_more_
|
void |
setHighlight(Glyph g)
_more_
|
void |
setShowGrid(boolean value)
Set the ShowGrid property.
|
int |
snap(int p) |
java.awt.Point |
transformInput(java.awt.Point r)
_more_
|
java.awt.Rectangle |
transformInput(java.awt.Rectangle r)
_more_
|
int |
transformInputX(int x)
_more_
|
int |
transformInputY(int x)
_more_
|
java.awt.Point |
transformOutput(java.awt.Point r)
_more_
|
java.awt.Rectangle |
transformOutput(java.awt.Rectangle r)
_more_
|
int |
transformOutputX(int x)
_more_
|
int |
transformOutputY(int x)
_more_
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, update
add, 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, validateTree
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, 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, transferFocusUpCycle
public static final java.lang.String CMD_CREATE
public static final java.lang.String CMD_TOFRONT
public static final java.lang.String CMD_TOBACK
public static final java.lang.String CMD_CHANGE
public static final java.lang.String CMD_REMOVE
public static final java.lang.String CMD_MOVE
public static final java.awt.Cursor DEFAULT_CURSOR
public static final java.awt.Cursor HAND_CURSOR
public static final java.awt.Cursor MOVE_CURSOR
public static final java.awt.Cursor TEXT_CURSOR
public static final java.awt.Cursor NW_CURSOR
public int gridSpacing
public boolean showGrid
protected double scaleFactor
protected java.awt.Color canvasBg
protected java.util.List glyphs
protected Glyph highlightedGlyph
public void setCanvasBackground(java.awt.Color c)
c
- _more_protected java.util.List getGlyphs()
protected void setGlyphs(java.util.List newGlyphs)
newGlyphs
- public boolean isFocusTraversable()
isFocusTraversable
in class java.awt.Component
public java.awt.Component getContents()
public int snap(int p)
public void setShowGrid(boolean value)
value
- The new value for ShowGridpublic boolean getShowGrid()
public void increaseGridSpacing()
public void decreaseGridSpacing()
protected java.awt.Component doMakeContents()
public void paintGrid(java.awt.Graphics g)
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- public Glyph createGlyph(java.lang.String glyphClass, int x, int y)
glyphClass
- x
- y
- public void repaint(Glyph g)
g
- public void addGlyph(Glyph g)
g
- public void select(java.awt.Rectangle r)
r
- public void selectionChanged()
public boolean hasSelection()
public void addSelection(Glyph g)
g
- public boolean isSelected(Glyph g)
g
- public java.util.List getSelection()
public void clearSelection()
public void clearAll()
public void notifyGlyphMoved(Glyph theGlyph)
theGlyph
- public void notifyGlyphMoveComplete(Glyph theGlyph)
theGlyph
- public void notifyGlyphCreateComplete(Glyph g, boolean diddleSelection, boolean fromPaste)
g
- diddleSelection
- fromPaste
- public void notifyGlyphCreateComplete(Glyph g)
g
- public void removeSelection(Glyph g)
g
- public void justRemoveGlyph(Glyph g)
g
- public void removeGlyph(Glyph g)
g
- public void doRemove(Glyph g)
g
- public void setHighlight(Glyph g)
g
- public void glyphChanged(Glyph g)
g
- public java.awt.Image getImage(java.lang.String path)
path
- public Glyph findGlyph(java.lang.String id)
id
- public Glyph findGlyph(int x, int y)
x
- y
- public static Glyph findGlyph(java.util.List glyphs, int x, int y, double threshold)
glyphs
- x
- y
- threshold
- public void moveToFront(Glyph theGlyph)
theGlyph
- public void moveToBack(Glyph theGlyph)
theGlyph
- public int transformInputX(int x)
x
- public int transformInputY(int x)
x
- public int transformOutputX(int x)
x
- public int transformOutputY(int x)
x
- public java.awt.Rectangle transformOutput(java.awt.Rectangle r)
r
- public java.awt.Rectangle transformInput(java.awt.Rectangle r)
r
- public java.awt.Point transformOutput(java.awt.Point r)
r
- public java.awt.Point transformInput(java.awt.Point r)
r
-