|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--com.jfimagine.jfdraw.gui.DrawCanvas
Drawing canvas class. A main drawing canvas used to draw or show graphs.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
| 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 | |
DrawCanvas(DrawAdapter drawAdapter,
double maxUnitIncrement)
Constructor |
|
| Method Summary | |
void |
adjustQuadrantsSize()
Adjust all quadrants' size of this page |
protected void |
clearCanvas(java.awt.Graphics g)
|
void |
drawGraph(java.awt.Graphics g,
boolean isXorMode)
Draw all graphs |
protected void |
finishPainting(java.awt.Graphics g)
A finish painting method is used to draw the selection and currently drawing shapes after a normal graph drawing operation. |
void |
fireMouseEvent(java.awt.event.MouseEvent e)
|
java.awt.Color |
getBackgroundColor()
get the background color for drawing canvas |
CanvasFormat |
getCanvasFormat()
Get canvas format. |
JFPage |
getDrawPage()
get current drawing page |
DrawState |
getDrawState()
get current draw state |
java.lang.String |
getFileName()
get graph file name |
GridFormat |
getGridFormat()
get current grid format |
JFPoint |
getLastMousePos()
get last mouse position on this canvas. |
JFOperationManager |
getOperationManager()
get current operation manager |
java.awt.Dimension |
getOriginalSize()
get original size |
JFPageFormat |
getPageFormat()
Get page format. |
DrawPane |
getParentDrawPane()
get parent draw pane |
java.awt.Dimension |
getPreferredScrollableViewportSize()
implements parent method in Interface Scrollable |
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
implements parent method in Interface Scrollable |
boolean |
getScrollableTracksViewportHeight()
implements parent method in Interface Scrollable |
boolean |
getScrollableTracksViewportWidth()
implements parent method in Interface Scrollable |
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
implements parent method in Interface Scrollable |
Selection |
getSelection()
get selection object list. |
JFPoint |
getViewCenter()
get view center of this canvas |
double |
getZoomScale()
get zoom scale |
protected void |
initCanvas(java.awt.Graphics g)
init canvas and clear all graph on it |
boolean |
isHideGrids()
if hide grids now |
boolean |
isHidePopupMenus()
if hide popupmenus now |
boolean |
isMetric()
|
boolean |
isReverse()
get if current current drawing canvas is under a reverse color. |
boolean |
isUsePageBounds()
if use page bounds(or the bounds of a canvas format) to restrict drawing |
void |
keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed |
void |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released |
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Mouse click method required by the MouseListener interface. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Mouse dragging method required by the MouseMotionListener interface. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Mouse enter method required by the MouseListener interface. |
void |
mouseExited(java.awt.event.MouseEvent e)
Mouse exit method required by the MouseListener interface. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Mouse move method required by the MouseMotionListener interface. |
void |
mousePressed(java.awt.event.MouseEvent e)
Mouse press method required by the MouseListener interface. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Mouse release method required by the MouseListener interface. |
void |
paint(java.awt.Graphics g)
repaint all graphs |
void |
setBackgroundColor(java.awt.Color color)
set the background color for drawing canvas |
void |
setCanvasFormat(CanvasFormat canvasFormat)
Set canvas format. |
void |
setDrawPage(JFPage page)
set current drawing page as a new page |
void |
setDrawState(DrawState drawState)
set current draw state |
void |
setFileName(java.lang.String fileName)
set graph file name |
void |
setHideGrids(boolean hideGrids)
set if hide grids |
void |
setHidePopupMenus(boolean hidePopupMenus)
set if hide popupmenus |
void |
setIsMetric(boolean isMetric)
|
void |
setLastMousePos(double x,
double y)
set last mouse position on this canvas. |
void |
setMaxUnitIncrement(int pixels)
set current max unit increment while scrolling |
void |
setOriginalSize(java.awt.Dimension originalSize)
set original size |
void |
setPageFormat(java.awt.print.PageFormat pageFormat)
Set page format. |
void |
setParentDrawPane(DrawPane drawPane)
set parent draw pane |
void |
setReverse(boolean reverse)
set if current current drawing canvas is under a reverse color. |
void |
setUsePageBounds(boolean usePageBounds)
set if use page bounds(or the bounds of a canvas format) to restrict drawing |
void |
setZoomScale(double zoomScale)
set zoom scale |
protected void |
superPaint(java.awt.Graphics g)
call super paint method of JPanel |
void |
update(java.awt.Graphics g)
|
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DrawCanvas(DrawAdapter drawAdapter,
double maxUnitIncrement)
| Method Detail |
public boolean isMetric()
public void setIsMetric(boolean isMetric)
public boolean isHideGrids()
public void setHideGrids(boolean hideGrids)
public boolean isHidePopupMenus()
public void setHidePopupMenus(boolean hidePopupMenus)
public boolean isUsePageBounds()
public void setUsePageBounds(boolean usePageBounds)
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color color)
public boolean isReverse()
public void setReverse(boolean reverse)
reverse - True if is reversed, false otherwise.public java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
public GridFormat getGridFormat()
public double getZoomScale()
public void setZoomScale(double zoomScale)
zoomScale - A new zoom scale.public JFPoint getViewCenter()
public java.awt.Dimension getOriginalSize()
public void setOriginalSize(java.awt.Dimension originalSize)
originalSize - A new original size.public DrawState getDrawState()
public void setDrawState(DrawState drawState)
drawState - A new draw state.public void setParentDrawPane(DrawPane drawPane)
drawPane - a new parent drawPanepublic DrawPane getParentDrawPane()
public JFPoint getLastMousePos()
public void setLastMousePos(double x,
double y)
public JFPage getDrawPage()
public void setDrawPage(JFPage page)
public JFOperationManager getOperationManager()
public Selection getSelection()
public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentprotected void superPaint(java.awt.Graphics g)
g - Graphics contextprotected void finishPainting(java.awt.Graphics g)
g - A graphics contextpublic void update(java.awt.Graphics g)
update in class javax.swing.JComponentprotected void clearCanvas(java.awt.Graphics g)
protected void initCanvas(java.awt.Graphics g)
public void drawGraph(java.awt.Graphics g,
boolean isXorMode)
g - A graphics contextisXorMode - If is in xor mode now.public void fireMouseEvent(java.awt.event.MouseEvent e)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - A mouse press event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - A mouse release event.public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - A mouse enter event.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - A mouse exit event.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - A mouse click event.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - A mouse move event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - A mouse drag event.public void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenere - A key event object.public void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenere - A key event object.public void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenere - A key event object.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.Scrollablepublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface javax.swing.Scrollablepublic void setMaxUnitIncrement(int pixels)
pixels - Pixels as unit for scrolling.public JFPageFormat getPageFormat()
public void setPageFormat(java.awt.print.PageFormat pageFormat)
pageFormat - A new page format.public CanvasFormat getCanvasFormat()
public void setCanvasFormat(CanvasFormat canvasFormat)
public void adjustQuadrantsSize()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||