public class MapView
extends javax.swing.JPanel
implements java.awt.print.Printable, java.awt.dnd.Autoscroll
Modifier and Type | Class and Description |
---|---|
static class |
MapView.ScrollPane |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
standardNodeTextColor |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MapView(MindMap model,
Controller controller) |
Modifier and Type | Method and Description |
---|---|
void |
autoscroll(java.awt.Point cursorLocn) |
void |
centerNode(NodeView node)
Problem: Before scrollRectToVisible is called, the node has the location
(0,0), ie. the location first gets calculated after the scrollpane is
actually scrolled.
|
protected void |
collectLabels(NodeView source,
java.util.HashMap labels)
collect all existing labels in the current map.
|
void |
deselect(NodeView newSelected) |
MindMapArrowLink |
detectCollision(java.awt.Point p) |
void |
endPrinting()
Call preparePrinting() before printing and endPrinting() after printing
to minimize calculation efforts
|
java.awt.Insets |
getAutoscrollInsets() |
Controller |
getController() |
java.awt.Rectangle |
getInnerBounds()
Return the bounding box of all the descendants of the source view, that
without BORDER.
|
int |
getMaxNodeWidth() |
MindMap |
getModel() |
java.awt.Point |
getNodeContentLocation(NodeView nodeView) |
NodeView |
getNodeView(MindMapNode node) |
java.awt.Dimension |
getPreferredSize() |
NodeView |
getRoot() |
NodeView |
getSelected() |
java.util.ArrayList |
getSelectedNodesSortedByY() |
java.util.LinkedList |
getSelecteds() |
int |
getSiblingMaxLevel() |
java.util.ArrayList |
getSingleSelectedNodes() |
java.awt.Dimension |
getViewportSize()
Returns the size of the visible part of the view in view coordinates.
|
java.awt.Point |
getViewPosition() |
float |
getZoom() |
int |
getZoomed(int number) |
void |
initRoot() |
boolean |
isCurrentlyPrinting()
For nodes, they can ask, whether or not the width must be bigger to
prevent the "..." at the output.
|
boolean |
isSelected(NodeView n) |
void |
makeTheSelected(NodeView newSelected)
Add the node to the selection if it is not yet there, making it the
focused selected node.
|
void |
move(java.awt.event.KeyEvent e) |
void |
moveToRoot() |
void |
paint(java.awt.Graphics g)
P A I N T I N G **
|
void |
paintChildren(java.awt.Graphics graphics) |
protected void |
paintLinks(NodeView source,
java.awt.Graphics2D graphics,
java.util.HashMap labels,
java.util.HashSet LinkAlreadyVisited) |
void |
preparePrinting()
Call preparePrinting() before printing and endPrinting() after printing
to minimize calculation efforts
|
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex) |
void |
resetShiftSelectionOrigin() |
void |
scrollBy(int x,
int y)
Scroll the viewport of the map to the south-west, i.e. scroll the map
itself to the north-east.
|
void |
scrollNodeToVisible(NodeView node) |
void |
scrollNodeToVisible(NodeView node,
int extraWidth) |
void |
selectAsTheOnlyOneSelected(NodeView newSelected)
Select the node, resulting in only that one being selected.
|
void |
selectBranch(NodeView newlySelectedNodeView,
boolean extend)
Select the node and his descendants.
|
boolean |
selectContinuous(NodeView newSelected) |
void |
setMoveCursor(boolean isHand) |
void |
setSiblingMaxLevel(int level) |
void |
setViewLocation(int x,
int y) |
protected void |
setViewPosition(java.awt.Point currentPoint) |
void |
setZoom(float zoom) |
void |
toggleSelected(NodeView newSelected)
Add the node to the selection if it is not yet there, remove it
otherwise.
|
protected void |
validateTree() |
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, 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, 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
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, 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
public MapView(MindMap model, Controller controller)
public void initRoot()
public int getMaxNodeWidth()
public void centerNode(NodeView node)
public void scrollNodeToVisible(NodeView node)
public void scrollNodeToVisible(NodeView node, int extraWidth)
public void scrollBy(int x, int y)
public void setViewLocation(int x, int y)
protected void setViewPosition(java.awt.Point currentPoint)
public void move(java.awt.event.KeyEvent e)
public void resetShiftSelectionOrigin()
public void moveToRoot()
public void selectAsTheOnlyOneSelected(NodeView newSelected)
public void toggleSelected(NodeView newSelected)
public void makeTheSelected(NodeView newSelected)
public void deselect(NodeView newSelected)
public void selectBranch(NodeView newlySelectedNodeView, boolean extend)
public boolean selectContinuous(NodeView newSelected)
public MindMap getModel()
public void setMoveCursor(boolean isHand)
public NodeView getSelected()
public java.util.LinkedList getSelecteds()
public java.util.ArrayList getSelectedNodesSortedByY()
public java.util.ArrayList getSingleSelectedNodes()
public boolean isSelected(NodeView n)
public float getZoom()
public int getZoomed(int number)
public void setZoom(float zoom)
protected void validateTree()
validateTree
in class java.awt.Container
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
public void paintChildren(java.awt.Graphics graphics)
paintChildren
in class javax.swing.JComponent
protected void collectLabels(NodeView source, java.util.HashMap labels)
protected void paintLinks(NodeView source, java.awt.Graphics2D graphics, java.util.HashMap labels, java.util.HashSet LinkAlreadyVisited)
public MindMapArrowLink detectCollision(java.awt.Point p)
public void preparePrinting()
public void endPrinting()
public int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
print
in interface java.awt.print.Printable
public boolean isCurrentlyPrinting()
public java.awt.Rectangle getInnerBounds()
public NodeView getRoot()
public Controller getController()
public int getSiblingMaxLevel()
public void setSiblingMaxLevel(int level)
public java.awt.Insets getAutoscrollInsets()
getAutoscrollInsets
in interface java.awt.dnd.Autoscroll
public void autoscroll(java.awt.Point cursorLocn)
autoscroll
in interface java.awt.dnd.Autoscroll
public NodeView getNodeView(MindMapNode node)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Point getNodeContentLocation(NodeView nodeView)
public java.awt.Dimension getViewportSize()
public java.awt.Point getViewPosition()