Package net.sourceforge.jeuclid.layout
Class JEuclidView
java.lang.Object
net.sourceforge.jeuclid.layout.JEuclidView
- All Implemented Interfaces:
LayoutView,EventListener,AbstractView
- Version:
- $Revision: 96bf1edada57 $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classData structure for storing aNodealong with its rendering boundary (Rectangle2D). -
Constructor Summary
ConstructorsConstructorDescriptionJEuclidView(Node node, LayoutContext layoutContext, Graphics2D layoutGraphics) Default Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D g, float x, float y) Draw this view onto a Graphics context.floatfloatgetInfo(LayoutableNode node) Retrieve the Info object for a given child.getNodesAt(float x, float y, float offsetX, float offsetY) Get the node and rendering information from a mouse position.getRect(float offsetX, float offsetY, LayoutableNode node) Gets the absolute Bounds for a given node and offset.floatgetWidth()voidhandleEvent(Event evt)
-
Constructor Details
-
JEuclidView
Default Constructor.- Parameters:
node- document to layout.layoutContext- layoutContext to use.layoutGraphics- Graphics context to use for layout calculations. This should be compatible to the context used for painting, but does not have to be the same.
-
-
Method Details
-
getDocument
- Specified by:
getDocumentin interfaceAbstractView
-
draw
Draw this view onto a Graphics context.- Parameters:
g- Graphics context for painting. Should be compatible to the context used during construction, but does not have to be the same.x- x-offset for left edgey- y-offset for baseline
-
getInfo
Retrieve the Info object for a given child.- Specified by:
getInfoin interfaceLayoutView- Parameters:
node- the node- Returns:
- an LayoutInfo object.
-
getWidth
public float getWidth()- Returns:
- width of this view.
-
getAscentHeight
public float getAscentHeight()- Returns:
- ascent height.
-
getDescentHeight
public float getDescentHeight()- Returns:
- descent height.
-
getGraphics
- Specified by:
getGraphicsin interfaceLayoutView- Returns:
- the Layout Graphics Context.
-
handleEvent
- Specified by:
handleEventin interfaceEventListener
-
getNodesAt
Get the node and rendering information from a mouse position.- Parameters:
x- x-coordy- y-coordoffsetX- starting x position offsetoffsetY- starting y position offset- Returns:
- list of nodes with rendering information
-
getRect
Gets the absolute Bounds for a given node and offset. May return null if the node could not be found.- Parameters:
offsetX- x position offset to nodeoffsetY- y position offset to nodenode- A layoutable node which was layouted in the current view.- Returns:
- the rectangle with the absolute bounds or null if the given node was not layouted in this view.
-