Class DonatelloNode
java.lang.Object
com.marginallyclever.ro3.apps.donatello.DonatelloNode
Donatello
uses DonatelloNode
to associate a Node
with its
Swing JPanel
and remember the 2D position for graphing.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doLayout()
drawJComponentToBufferedImageUnlessClipped
(JComponent panel, Rectangle clippingRegion, int x, int y) Draw aJPanel
to aBufferedImage
unless the panel is clipped by the .void
fromJSON
(org.json.JSONObject json) void
paint
(GraphViewPanel dn, Graphics2D g, Rectangle clippingRegion) void
setLocation
(int x, int y) void
setPosition
(Point p) org.json.JSONObject
toJSON()
-
Constructor Details
-
DonatelloNode
-
-
Method Details
-
getJComponent
-
getPosition
-
setPosition
-
toJSON
public org.json.JSONObject toJSON() -
fromJSON
public void fromJSON(org.json.JSONObject json) -
getRectangle
-
setLocation
public void setLocation(int x, int y) -
paint
-
drawJComponentToBufferedImageUnlessClipped
public BufferedImage drawJComponentToBufferedImageUnlessClipped(JComponent panel, Rectangle clippingRegion, int x, int y) Draw aJPanel
to aBufferedImage
unless the panel is clipped by the .- Parameters:
panel
- theJPanel
to drawclippingRegion
- the bounds of the panel in world coordinates.x
- the x position to draw the panely
- the y position to draw the panel- Returns:
- a
BufferedImage
containing the panel or null.
-
drawJComponentToBufferedImage
-
doLayout
public void doLayout()
-