freemind.view.mindmapview

Class NodeView

public abstract class NodeView extends JLabel

This class represents a single Node of a MindMap (in analogy to TreeCellRenderer).
Field Summary
protected static ColordragColor
static intDRAGGED_OVER_NO
static intDRAGGED_OVER_SIBLING
static intDRAGGED_OVER_SON
static intDRAGGED_OVER_SON_LEFT
For RootNodeView.
protected EdgeViewedge
protected intisDraggedOver
intLEFT_HEIGHT_OVERHEAD
intLEFT_WIDTH_OVERHEAD
protected MapViewmap
protected MindMapNodemodel
protected static ColorselectedColor
protected inttreeHeight
Constructor Summary
protected NodeView(MindMapNode model, MapView map)
Method Summary
booleandropAsSibling(double xCoord)
booleandropPosition(double xCoord)
booleanfollowLink(double xCoord)
LinkedListgetChildrenViews()
This method returns the NodeViews that are children of this node.
voidgetCoordinates(LinkedList inList, int additionalDistanceForConvexHull)
Returns the coordinates occupied by the node and its children as a vector of four point per node.
intgetDraggedOver()
booleangetIsLong()
intgetLeftWidthOverhead()
MindMapNodegetModel()
protected NodeViewgetNextPage()
protected NodeViewgetNextSibling()
protected NodeViewgetNextSiblingSingle()
protected NodeViewgetParentView()
DimensiongetPreferredSize()
Changed to remove the printing bug of java.
protected NodeViewgetPreviousPage()
protected NodeViewgetPreviousSibling()
protected NodeViewgetPreviousSiblingSingle()
protected LinkedListgetSiblingViews()
booleanisChildOf(NodeView myNodeView)
booleanisLeft()
Is the node left of root?
booleanisParentOf(NodeView myNodeView)
booleanisRoot()
protected booleanisSelected()
booleanisSiblingOf(NodeView myNodeView)
protected static NodeViewnewNodeView(MindMapNode model, MapView map)
Factory method which creates the right NodeView for the model.
voidpaint(Graphics graphics)
voidpaintDragOver(Graphics2D graphics, Dimension size)
voidpaintSelected(Graphics2D graphics, Dimension size)
voidrequestFocus()
voidsetDraggedOver(int draggedOver)
voidsetDraggedOver(Point p)
protected voidsetLeft(boolean left)
protected voidsetMap(MapView map)
protected voidsetModel(MindMapNode model)
protected voidsetRendering(Graphics2D g)
voidupdateCursor(double xCoord)

Field Detail

dragColor

protected static final Color dragColor

DRAGGED_OVER_NO

public static final int DRAGGED_OVER_NO

DRAGGED_OVER_SIBLING

public static final int DRAGGED_OVER_SIBLING

DRAGGED_OVER_SON

public static final int DRAGGED_OVER_SON

DRAGGED_OVER_SON_LEFT

public static final int DRAGGED_OVER_SON_LEFT
For RootNodeView.

edge

protected EdgeView edge

isDraggedOver

protected int isDraggedOver

LEFT_HEIGHT_OVERHEAD

public final int LEFT_HEIGHT_OVERHEAD

LEFT_WIDTH_OVERHEAD

public final int LEFT_WIDTH_OVERHEAD

map

protected MapView map

model

protected MindMapNode model

selectedColor

protected static final Color selectedColor

treeHeight

protected int treeHeight

Constructor Detail

NodeView

protected NodeView(MindMapNode model, MapView map)

Method Detail

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(int draggedOver)

setDraggedOver

public void setDraggedOver(Point p)

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)