java.lang.Object
com.marginallyclever.ro3.apps.donatello.DonatelloNode

public class DonatelloNode extends Object
Donatello uses DonatelloNode to associate a Node with its Swing JPanel and remember the 2D position for graphing.
  • Constructor Details

    • DonatelloNode

      public DonatelloNode(Node node)
  • Method Details

    • getJComponent

      public JComponent getJComponent()
    • getPosition

      public Point getPosition()
    • setPosition

      public void setPosition(Point p)
    • toJSON

      public org.json.JSONObject toJSON()
    • fromJSON

      public void fromJSON(org.json.JSONObject json)
    • getRectangle

      public Rectangle getRectangle()
    • setLocation

      public void setLocation(int x, int y)
    • paint

      public void paint(GraphViewPanel dn, Graphics2D g, Rectangle clippingRegion)
    • drawJComponentToBufferedImageUnlessClipped

      public BufferedImage drawJComponentToBufferedImageUnlessClipped(JComponent panel, Rectangle clippingRegion, int x, int y)
      Draw a JPanel to a BufferedImage unless the panel is clipped by the .
      Parameters:
      panel - the JPanel to draw
      clippingRegion - the bounds of the panel in world coordinates.
      x - the x position to draw the panel
      y - the y position to draw the panel
      Returns:
      a BufferedImage containing the panel or null.
    • drawJComponentToBufferedImage

      public BufferedImage drawJComponentToBufferedImage(JComponent panel)
    • doLayout

      public void doLayout()