|
|
|||||||||
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
jpicedt.graphic.PECanvas
public class PECanvas
This is a JComponent on which graphic elements are drawn. It's has an underlying model (a Drawing) to represent the content, an EditorKit to manipulate the content, and a View responsible for rendering the content. EditorKit, Drawing, and View's are pluggable : the EditorKit is responsible for creating 1) a default Drawing and 2) a ViewFactory that will populate the View tree associated with the Drawing, by attaching a View to each element in the model.
Depending on the content type this Component is loaded with, it may plug a new EditorKit on-the-fly that's suited for the given content type (e.g. LaTeX, Postscript, SVG-XML, etc...).
Graphic objects are stored (e.g. in a Drawing) in natural coordinates, ie LaTeX/Postscript/... coordinates, using e.g. a "1 mm" unitlength : that's what we call "model coordinate". Obviously, we've to translate these coordinates to screen coordinates (e.g. JViewport-coordinate or JPanel-coordinate) before rendering, and this is done very simply by using an AffineTransform and adding it to the current Graphic2D context in the body of the "paintComponent" method. The following picture sums up the translation process that takes place b/w model- and view-coordinate.
The benefits of such an approach is to make it easy for someone willing to develop a parser/formater to handle objects coordinates with the fewest possible overhead, since objects coordinates are "natively" available in natural (ie from left to right and from bottom to top) coordinates, and this is perfectly suited for formatting language like LaTeX, Postscript or SVG-XML. Besides, this makes sense with the grid ticks marks.
Margins are encapsulated in a PageFormat (an inner class) object. Contrary to previous jpicedt releases, it's no longer necessary, as of jpicedt 1.3.2, to provide formater methods with the ptOrg parameter.
In addition to the standard behaviour inherited from JPanel, PropertyChangeEvent's are triggered when :
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
CONTENT_TYPE_CHANGE
property name for content-type's change events |
protected ContentType |
contentType
the current content-type for this PECanvas (determines the EditorKit behaviour) |
protected Drawing |
drawing
the model for this canvas |
static java.lang.String |
DRAWING_CHANGE
property name for drawing-change events |
static java.lang.String |
EDITOR_KIT_CHANGE
property name for editorkit-change events |
protected Grid |
grid
the grid attached to this canvas |
static java.lang.String |
KEY_CONTENT_TYPE
key for Properties's content-type value |
static java.lang.String |
KEY_UNDOABLE_STEPS
key for Properties's nb of undoable steps value |
static java.lang.String |
KEY_ZOOM
key for Properties's zoom value |
protected EditorKit |
kit
the current editor kit for this component |
static int |
MAX_UNDOABLE_STEPS_DEFAULT
default undoable events to remember |
protected java.awt.geom.AffineTransform |
model2ViewTransform
the AffineTransform used to translate from model-coordinates to view-coordinates ; gets updated each time either the zoom factor or the page format changes |
protected PageFormat |
pageFormat
pageFormat encapsulates board size and margin data |
static java.lang.String[] |
PREDEFINED_ZOOM_STRINGS
|
static double[] |
PREDEFINED_ZOOMS
|
protected java.awt.RenderingHints |
renderingHints
a Map storing RenderingHints to be applied to the graphic context when rendering the drawing |
protected javax.swing.undo.StateEdit |
stateEdit
the UndoableEdit in progress |
protected javax.swing.undo.UndoableEditSupport |
undoableEditSupport
the UndoableEditSupport delegate for UndoableEditEvent firing |
protected javax.swing.undo.UndoManager |
undoManager
the UndoManager delegate for undo/redo operation |
protected java.awt.geom.AffineTransform |
view2ModelTransform
the AffineTransform used to translate from mouse-coordinates to model-coordinates ; gets updated each time model2ViewTransform changes |
static double |
ZOOM_DEFAULT
|
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 |
Constructor Summary | |
---|---|
PECanvas()
Construct a new PECanvas initialized with default values. |
|
PECanvas(double zoom,
PageFormat pageFormat,
Grid grid,
ContentType contentType)
Construct a new PECanvas with the default editor-kit and drawing as content storage. |
Method Summary | |
---|---|
void |
addPEMouseInputListener(PEMouseInputListener l)
Adds the specified mouse listener to receive mouse events from this component. |
void |
addSelectionListener(SelectionListener l)
adds a SelectionListener to the Canvas |
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Register an UndoableEditListener for the Drawing hosted by this canvas. |
void |
addZoomListener(ZoomListener l)
adds a ZoomListener to the Canvas |
void |
beginUndoableUpdate(java.lang.String presentationName)
Create a new UndoableEdit that holds the current state of the Drawing. |
boolean |
canRedo()
|
boolean |
canUndo()
|
void |
copy()
Copy the content of the current selection to the System's clipboard (after a formatting to text) |
void |
copy(java.awt.datatransfer.Clipboard clipbrd)
Copy the content of the current selection (through a GraphicTransferable) to the System's clipboard (after a formatting to text), AND to the given clipboard if non-null (the latter can be a local clipboard supporting more data-flavors than the system clipboard) |
protected EditorKit |
createDefaultEditorKit(ContentType contentType)
Creates a default editor kit ( EditorKit ) whose factory delegates are initialized
from the given content-type. |
void |
cut()
Cut the content of the current selection to the System clipboard, after formatting to text. |
void |
cut(java.awt.datatransfer.Clipboard clipbrd)
Cut the content of the current selection (through a GraphicTransferable) to the System clipboard, AND to the given ClipBoard if non-null. |
void |
deleteSelection()
remove all selected objects from the drawing |
void |
endUndoableUpdate()
Ends the current UndoableEdit and fire an event to registered listeners. |
protected void |
fireSelectionUpdate(Element[] elements,
SelectionEvent.EventType type)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireSelectionUpdate(Element element,
SelectionEvent.EventType type)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireZoomUpdate(double oldZoom,
double newZoom,
PicPoint ptClick)
Notify all listeners that have registered interest for notification on this event type. |
ContentType |
getContentType()
|
Drawing |
getDrawing()
|
EditorKit |
getEditorKit()
Fetches the currently installed kit for handling content. |
Grid |
getGrid()
|
java.awt.geom.AffineTransform |
getModelToViewTransform()
|
PageFormat |
getPageFormat()
|
java.awt.Dimension |
getPreferredScrollableViewportSize()
|
java.lang.String |
getRedoPresentationName()
|
java.awt.RenderingHints |
getRenderingHints()
Return the RenderingHints applied to the graphic context when rendering this component |
double |
getScaleFactor()
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
getScrollableTracksViewportHeight()
|
boolean |
getScrollableTracksViewportWidth()
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
|
int |
getSelectionSize()
|
PicPoint |
getSheetOrigin()
|
java.lang.String |
getUndoPresentationName()
|
java.awt.geom.AffineTransform |
getViewToModelTransform()
|
double |
getZoomFactor()
|
static int |
getZoomIndex(double zoom)
utilities to retrieve the index of the given zoom in PREDEFINED_ZOOMS ; this may be used by GUI widgets, e.g. |
void |
groupSelection()
group all selected objects into a new PicGroup and add it to the drawing. |
void |
insert(java.io.Reader reader,
Parser parser)
insert content from a reader into the current drawing |
boolean |
isRequestFocusEnabled()
Overriden from JComponent Signals that this component can receive focus (useful for handling keyevents) |
boolean |
isSelected(Element e)
|
void |
joinSelection()
join all selected objects of type PicMultiCurveConvertable into a new PicMulticurve and add it to the drawing. |
PicPoint |
modelToView(PicPoint src,
PicPoint dst)
Converts a point from the model-coordinate system to the pixel-coordinate system. |
java.awt.Shape |
modelToView(java.awt.Shape src)
Converts a Shape from the model-coordinate system to the pixel-coordinate system. |
void |
paintComponent(java.awt.Graphics g)
paintComponent(Graphics g) is called by AWTEventDispatchThread via "paint(g)" it's absolutely necessary to call super.paintComponent(g) so that the background gets properly painted (PECanvas is opaque) |
void |
paste(boolean translate)
Add the content of the System's ClipBoard to the current drawing, then select it. |
void |
paste(java.awt.datatransfer.Clipboard clipbrd,
boolean translate)
Add the content of the given ClipBoard to the current drawing, then select it. |
protected void |
processMouseEvent(java.awt.event.MouseEvent e)
Processes mouse events occurring on this component by dispatching them to any registered PEMouseListener objects. |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent e)
Processes mouse motion events occurring on this component by dispatching them to any registered PEMouseInputListener objects. |
void |
read(java.io.Reader reader,
Parser parser)
read drawing content from a reader and erase old one. |
void |
redo()
Redo last change |
void |
removePEMouseInputListener(PEMouseInputListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component. |
void |
removeSelectionListener(SelectionListener l)
removes a SelectionListener from the Canvas |
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Unregister an UndoableEditListener for the Drawing hosted by this canvas. |
void |
removeZoomListener(ZoomListener l)
removes a ZoomListener from the Canvas |
void |
repaintFromModelRect(java.awt.geom.Rectangle2D rect)
add the given rectangle, given in model-coordinates, to the list of dirty regions. |
void |
select(java.util.Collection c,
boolean incremental)
select the elements in the given collection (if they belong to the drawing) |
void |
select(Element obj,
boolean incremental)
select the given element |
void |
selectAll(boolean state)
select or unselect every object in this drawing |
java.util.Iterator |
selection()
|
void |
setContentType(ContentType newContentType)
change the current content-type: this implies plugging a new ViewFactory and a new FormatterFactory to the currently installed EditorKit, as obtained from the given newContentType argument. |
void |
setDrawing(Drawing dr)
set the Drawing model for this component. |
void |
setEditorKit(EditorKit kit)
Sets the currently installed kit for handling content. |
void |
setPageFormat(PageFormat pageFormat)
Set the size of the drawing board. |
void |
setUndoLimit(int limit)
set the number of undoable events to remember |
void |
setZoomFactor(double zoom)
Convenience call to setZoomFactor(zoom,null) |
void |
setZoomFactor(double zoom,
PicPoint ptClick)
sets the current zoom factor to the given double, then updates various properties (model <-> view transforms, dimension, preferredSize...), finally, sources a ZoomEvent to give a chance to receiver to update their state accordingly (this may be used e.g. |
void |
undo()
Undo last change |
void |
unGroup(PicGroup g)
fetch all Element's belonging to the given PicGroup and add them to its parent, removing the given PicGroup from its parent afterward. |
void |
unSelect(Element obj)
unselect the given object |
PicPoint |
view2Model(PicPoint src,
PicPoint dst)
Converts a point from the pixel-coordinate system to the model-coordinate system. |
java.awt.Shape |
viewToModel(java.awt.Shape src)
Converts a Shape from the pixel-coordinate system to the model-coordinate system. |
void |
write(java.io.Writer writer,
boolean writeSelectionOnly)
Write drawing content to the given stream |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, 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 |
Methods inherited from class java.awt.Container |
---|
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 |
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, 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, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, 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 |
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[] PREDEFINED_ZOOM_STRINGS
public static final double[] PREDEFINED_ZOOMS
public static final double ZOOM_DEFAULT
public static final java.lang.String KEY_ZOOM
public static final java.lang.String KEY_CONTENT_TYPE
public static final java.lang.String KEY_UNDOABLE_STEPS
public static final int MAX_UNDOABLE_STEPS_DEFAULT
public static final java.lang.String DRAWING_CHANGE
public static final java.lang.String EDITOR_KIT_CHANGE
public static final java.lang.String CONTENT_TYPE_CHANGE
protected Drawing drawing
protected PageFormat pageFormat
protected ContentType contentType
protected java.awt.geom.AffineTransform model2ViewTransform
protected java.awt.geom.AffineTransform view2ModelTransform
protected Grid grid
protected EditorKit kit
protected javax.swing.undo.UndoableEditSupport undoableEditSupport
protected javax.swing.undo.UndoManager undoManager
protected javax.swing.undo.StateEdit stateEdit
protected java.awt.RenderingHints renderingHints
Constructor Detail |
---|
public PECanvas()
public PECanvas(double zoom, PageFormat pageFormat, Grid grid, ContentType contentType)
zoom
- initial zoom factorinitial
- page format (page size + page margins)content-type
- (e.g. LaTeX, PsTricks,...) ; this will determine the EditorKit for
editing the Drawing, and indirectly the ViewFactory that produces View's for the drawing,
(since the ViewFactory is obtained through the currently installed EditorKit) and the
FormatterFactory used to write the drawing to a writer.
If null, the default editor-kit/content-type is used.Method Detail |
---|
public void paintComponent(java.awt.Graphics g)
This implementation first applies an AffineTransform to the graphic context : this transform maps in effect model-coordinates to screen-coordinates. Then invokes the paint() method in that order :
paintComponent
in class javax.swing.JComponent
public void repaintFromModelRect(java.awt.geom.Rectangle2D rect)
public java.awt.RenderingHints getRenderingHints()
public Drawing getDrawing()
public void setDrawing(Drawing dr)
public EditorKit getEditorKit()
protected EditorKit createDefaultEditorKit(ContentType contentType)
EditorKit
) whose factory delegates are initialized
from the given content-type. If an EditorKit was already installed in this PECanvas,
we try to reuse its properties in the new EditorKit, if applicable.
contentType
- null if a default content-type should be used
public void setEditorKit(EditorKit kit)
null
, the new kit is installed.
A default drawing is created from it if there was no drawing set in this canvas before,
otherwise the old drawing is reused : in both cases, setDrawing
is called, but
this allows the caller to change the ContentType w/o changing the Drawing if it deems it unnecessary
(otherwise, it may call setDrawing() afterwards).
A PropertyChange
event (EDITOR_KIT_CHANGE) is always fired when
setEditorKit
is called.
kit
- the desired editor behaviorgetEditorKit()
public ContentType getContentType()
public void setContentType(ContentType newContentType)
newContentType
- if null, the DefaultContentType is installed.public void setPageFormat(PageFormat pageFormat)
public PageFormat getPageFormat()
public PicPoint getSheetOrigin()
public Grid getGrid()
public java.awt.geom.AffineTransform getModelToViewTransform()
public java.awt.geom.AffineTransform getViewToModelTransform()
public PicPoint modelToView(PicPoint src, PicPoint dst)
src
- the source point in model-coordinatedst
- the destination point ; if null, a new point is allocated, and returned for convenience.
public PicPoint view2Model(PicPoint src, PicPoint dst)
src
- the source point in pixel-coordinatedst
- the destination point ; if null, a new point is allocated, and returned for convenience.
public java.awt.Shape modelToView(java.awt.Shape src)
src
- a Shape in the model-coordinate system
public java.awt.Shape viewToModel(java.awt.Shape src)
src
- a Shape in the pixel-coordinate system
public void read(java.io.Reader reader, Parser parser) throws ParserException
reader
- the reader to read content from
ParserException
public void insert(java.io.Reader reader, Parser parser) throws ParserException
reader
- the reader to insert content from
ParserException
public void write(java.io.Writer writer, boolean writeSelectionOnly) throws java.io.IOException
writer
- The writer to write towriteSelectionOnly
- if true, only write selection content
java.io.IOException
- on any I/O errorpublic void setZoomFactor(double zoom)
public void setZoomFactor(double zoom, PicPoint ptClick)
zoom
- the new zoom factorptClick
- this only makes sense if the parent of this component is aka ScrollPane ;
public double getZoomFactor()
public double getScaleFactor()
protected void fireZoomUpdate(double oldZoom, double newZoom, PicPoint ptClick)
oldZoom
- previous zoom valuenewZoom
- new zoom valueptClick
- the point (in model-coordinates) that is expected to be at the center of the view-port ;
can be nullpublic void addZoomListener(ZoomListener l)
public void removeZoomListener(ZoomListener l)
public static int getZoomIndex(double zoom)
public void setUndoLimit(int limit)
public void undo() throws javax.swing.undo.CannotUndoException
javax.swing.undo.CannotUndoException
public void redo() throws javax.swing.undo.CannotRedoException
javax.swing.undo.CannotRedoException
public void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
public void beginUndoableUpdate(java.lang.String presentationName)
public void endUndoableUpdate()
public boolean canRedo()
public boolean canUndo()
public java.lang.String getRedoPresentationName()
public java.lang.String getUndoPresentationName()
public java.util.Iterator selection()
public int getSelectionSize()
public boolean isSelected(Element e)
public void selectAll(boolean state)
state
- if true, selectAll, otherwise unselect all.public void select(java.util.Collection c, boolean incremental)
incremental
- if true, add to the existing selection ; replace otherwise.public void select(Element obj, boolean incremental)
incremental
- if true, add to the existing selection ; replace otherwise.public void unSelect(Element obj)
public void deleteSelection()
public void paste(java.awt.datatransfer.Clipboard clipbrd, boolean translate) throws ParserException, java.io.IOException, java.awt.datatransfer.UnsupportedFlavorException
translate
- if true, translate the pasted content by a grid step so that it doesn't hide old one
ParserException
java.io.IOException
java.awt.datatransfer.UnsupportedFlavorException
public void paste(boolean translate) throws ParserException, java.io.IOException, java.awt.datatransfer.UnsupportedFlavorException
translate
- if true, translate the pasted content by a grid step so that it doesn't hide old one
ParserException
java.io.IOException
java.awt.datatransfer.UnsupportedFlavorException
public void copy(java.awt.datatransfer.Clipboard clipbrd)
clipbrd
- the target clipboard ; can be null, in which case only the System clipboard
is modified.public void copy()
public void cut(java.awt.datatransfer.Clipboard clipbrd)
clipbrd
- the target clipboard ; can be null, in which case only the System clipboard
is modified.public void cut()
public void groupSelection()
public void unGroup(PicGroup g)
public void joinSelection()
protected void fireSelectionUpdate(Element element, SelectionEvent.EventType type)
element
- the Element that was (un)selectedtype
- the event typeprotected void fireSelectionUpdate(Element[] elements, SelectionEvent.EventType type)
elements
- the Element's that were (un)selectedtype
- the event typepublic void addSelectionListener(SelectionListener l)
public void removeSelectionListener(SelectionListener l)
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
public boolean isRequestFocusEnabled()
isRequestFocusEnabled
in class javax.swing.JComponent
public void addPEMouseInputListener(PEMouseInputListener l)
l
- the mouse listener.public void removePEMouseInputListener(PEMouseInputListener l)
l
- the mouse listener.protected void processMouseEvent(java.awt.event.MouseEvent e)
PEMouseListener
objects.
processMouseEvent
in class javax.swing.JComponent
e
- the mouse event.protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
PEMouseInputListener
objects.
processMouseMotionEvent
in class javax.swing.JComponent
e
- the mouse motion event.
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |