freemind.view.mindmapview

Class NodeView

Known Direct Subclasses:
BubbleNodeView, ForkNodeView, RootNodeView

public abstract class NodeView
extends JLabel

This class represents a single Node of a MindMap (in analogy to TreeCellRenderer).

Field Summary

static int
DRAGGED_OVER_NO
static int
DRAGGED_OVER_SIBLING
static int
DRAGGED_OVER_SON
static int
DRAGGED_OVER_SON_LEFT
For RootNodeView.
int
LEFT_HEIGHT_OVERHEAD
int
LEFT_WIDTH_OVERHEAD
protected static Color
dragColor
protected EdgeView
edge
protected int
isDraggedOver
protected MapView
map
protected MindMapNode
model
protected static Color
selectedColor
protected int
treeHeight

Constructor Summary

NodeView(MindMapNode model, MapView map)

Method Summary

boolean
dropAsSibling(double xCoord)
boolean
dropPosition(double xCoord)
boolean
followLink(double xCoord)
LinkedList
getChildrenViews()
This method returns the NodeViews that are children of this node.
void
getCoordinates(LinkedList inList, int additionalDistanceForConvexHull)
Returns the coordinates occupied by the node and its children as a vector of four point per node.
int
getDraggedOver()
boolean
getIsLong()
int
getLeftWidthOverhead()
MindMapNode
getModel()
protected NodeView
getNextPage()
protected NodeView
getNextSibling()
protected NodeView
getNextSiblingSingle()
protected NodeView
getParentView()
Dimension
getPreferredSize()
Changed to remove the printing bug of java.
protected NodeView
getPreviousPage()
protected NodeView
getPreviousSibling()
protected NodeView
getPreviousSiblingSingle()
protected LinkedList
getSiblingViews()
boolean
isChildOf(NodeView myNodeView)
boolean
isLeft()
Is the node left of root?
boolean
isParentOf(NodeView myNodeView)
boolean
isRoot()
protected boolean
isSelected()
boolean
isSiblingOf(NodeView myNodeView)
protected static NodeView
newNodeView(MindMapNode model, MapView map)
Factory method which creates the right NodeView for the model.
void
paint(Graphics graphics)
void
paintDragOver(Graphics2D graphics, Dimension size)
void
paintSelected(Graphics2D graphics, Dimension size)
void
requestFocus()
void
setDraggedOver(Point p)
void
setDraggedOver(int draggedOver)
protected void
setLeft(boolean left)
protected void
setMap(MapView map)
protected void
setModel(MindMapNode model)
protected void
setRendering(Graphics2D g)
void
updateCursor(double xCoord)

Field Details

DRAGGED_OVER_NO

public static final int DRAGGED_OVER_NO
Field Value:
0

DRAGGED_OVER_SIBLING

public static final int DRAGGED_OVER_SIBLING
Field Value:
2

DRAGGED_OVER_SON

public static final int DRAGGED_OVER_SON
Field Value:
1

DRAGGED_OVER_SON_LEFT

public static final int DRAGGED_OVER_SON_LEFT
For RootNodeView.
Field Value:
3

LEFT_HEIGHT_OVERHEAD

public final int LEFT_HEIGHT_OVERHEAD

LEFT_WIDTH_OVERHEAD

public final int LEFT_WIDTH_OVERHEAD

dragColor

protected static final Color dragColor

edge

protected EdgeView edge

isDraggedOver

protected int isDraggedOver

map

protected MapView map

model

protected MindMapNode model

selectedColor

protected static final Color selectedColor

treeHeight

protected int treeHeight

Constructor Details

NodeView

protected NodeView(MindMapNode model,
                   MapView map)

Method Details

dropAsSibling

public boolean dropAsSibling(double xCoord)

dropPosition

public boolean dropPosition(double xCoord)
Returns:
true if should be on the left, false otherwise.

followLink

public boolean followLink(double xCoord)

getChildrenViews

public LinkedList getChildrenViews()
This method returns the NodeViews that are children of this node.

getCoordinates

public void getCoordinates(LinkedList inList,
                           int additionalDistanceForConvexHull)
Returns the coordinates occupied by the node and its children as a vector of four point per node.

getDraggedOver

public int getDraggedOver()

getIsLong

public boolean getIsLong()

getLeftWidthOverhead

public int getLeftWidthOverhead()

getModel

public MindMapNode getModel()

getNextPage

protected NodeView getNextPage()

getNextSibling

protected NodeView getNextSibling()

getNextSiblingSingle

protected NodeView getNextSiblingSingle()

getParentView

protected NodeView getParentView()

getPreferredSize

public Dimension getPreferredSize()
Changed to remove the printing bug of java.

getPreviousPage

protected NodeView getPreviousPage()

getPreviousSibling

protected NodeView getPreviousSibling()

getPreviousSiblingSingle

protected NodeView getPreviousSiblingSingle()

getSiblingViews

protected LinkedList getSiblingViews()

isChildOf

public boolean isChildOf(NodeView myNodeView)

isLeft

public boolean isLeft()
Is the node left of root?

isParentOf

public boolean isParentOf(NodeView myNodeView)

isRoot

public boolean isRoot()

isSelected

protected boolean isSelected()

isSiblingOf

public boolean isSiblingOf(NodeView myNodeView)

newNodeView

protected static NodeView newNodeView(MindMapNode model,
                                      MapView map)
Factory method which creates the right NodeView for the model.

paint

public void paint(Graphics graphics)

paintDragOver

public void paintDragOver(Graphics2D graphics,
                          Dimension size)

paintSelected

public void paintSelected(Graphics2D graphics,
                          Dimension size)

requestFocus

public void requestFocus()

setDraggedOver

public void setDraggedOver(Point p)

setDraggedOver

public void setDraggedOver(int draggedOver)

setLeft

protected void setLeft(boolean left)

setMap

protected void setMap(MapView map)

setModel

protected void setModel(MindMapNode model)

setRendering

protected void setRendering(Graphics2D g)

updateCursor

public void updateCursor(double xCoord)