This class represents the view of a whole MindMap
(in analogy to class JTree).
centerNode
public 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. Thus, as a workaround, I simply call scrollRectToVisible
twice, the first time the location of the node is calculated, the second time the scrollPane is actually
scrolled.
collectLabels
protected void collectLabels(NodeView source,
HashMap labels)
collect all existing labels in the current map.
deselect
public void deselect(NodeView newSelected)
getMaxNodeWidth
public int getMaxNodeWidth()
getPreferredSize
public Dimension getPreferredSize()
getSelected
public NodeView getSelected()
getSelectedNodesSortedByY
public ArrayList getSelectedNodesSortedByY()
getSelecteds
public LinkedList getSelecteds()
getSelectedsByDepth
public LinkedList getSelectedsByDepth()
- a LinkedList of NodeViews ordered by depth. nodes with greater depth occur first.
getSelectedsSortedByY
public ArrayList getSelectedsSortedByY()
getSiblingMaxLevel
public int getSiblingMaxLevel()
getZoom
public float getZoom()
getZoomed
public int getZoomed(int number)
initRoot
public void initRoot()
isPrinting
public boolean isPrinting()
For nodes, they can ask, whether or not the width must be bigger to prevent the "..." at the output. (Bug of java).
isSelected
public boolean isSelected(NodeView n)
makeTheSelected
public void makeTheSelected(NodeView newSelected)
Add the node to the selection if it is not yet there, making it the focused selected node.
move
public void move(KeyEvent e)
moveToRoot
public void moveToRoot()
paintChildren
public void paintChildren(Graphics graphics)
P A I N T I N G **
paintClouds
protected void paintClouds(NodeView source,
Graphics graphics,
int iterativeLevel)
iterativeLevel
- describes the n-th nested cloud that is to be painted.
paintLinks
protected void paintLinks(NodeView source,
Graphics2D graphics,
HashMap labels,
HashSet LinkAlreadyVisited)
print
public int print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
scrollBy
public 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.
scrollNodeToVisible
public void scrollNodeToVisible(NodeView node)
scrollNodeToVisible
public void scrollNodeToVisible(NodeView node,
int extraWidth)
selectAsTheOnlyOneSelected
public void selectAsTheOnlyOneSelected(NodeView newSelected)
Select the node, resulting in only that one being selected.
selectBranch
public void selectBranch(NodeView newlySelectedNodeView,
boolean extend)
Select the node and his descendants. On extend = false clear up the previous selection.
if extend is false, the past selection will be empty.
if yes, the selection will extended with this node and its children
selectContinuous
public boolean selectContinuous(NodeView newSelected)
setMoveCursor
public void setMoveCursor(boolean isHand)
setSiblingMaxLevel
public void setSiblingMaxLevel(int level)
setZoom
public void setZoom(float zoom)
toggleSelected
public void toggleSelected(NodeView newSelected)
Add the node to the selection if it is not yet there, remove it otherwise.