Documentation of 'kcl.waterloo.deploy.pde.PDEGraphics2D' Java class
PDEGraphics2D
kcl.waterloo.deploy.pde

Class PDEGraphics2D

  • All Implemented Interfaces:
    java.lang.Cloneable


    public class PDEGraphics2D
    extends AbstractDeployableGraphics2D
    implements java.lang.Cloneable

    PDEGraphics2D - a Graphics2D subclass that generates a script using the Processing graphics language.

    The generated script may be displayed using the open-source, multi-platform Processing application and displayed in web pages using the processing.js javascript when graphics will be rendered to an HTML5 canvas element.

    Usage:

    PDEGraphics2D instances are used in AWT/Swing component paint methods in the same way as any other Graphics2D class object. When painting is complete, a Processing script can be accessed by calling the getCode() method on the instance which returns the script as a String. Alternatively, call one of the write(...) methods to save the code to file. These methods optionally support the creation of HTML files, together with CSS style sheets, to display the generated script in an HTML5 browser canvas.

    The methods are not thread-safe. All painting should be done on the EDT.

    To create a PDEGraphics2D instance, pass the constructor an instance of a standard Graphics2D object, together with the size of the canvas to paint:

    PDEGraphics2D g= new PDEGraphics2D(Graphics2D g, int w, int h)
    or
    PDEGraphics2D g= new PDEGraphics2D(Graphics2D g, Dimension d)

    Alternatively, pass the component to paint as the input to one of the static paint methods:

    PDEGraphics2D g=PDEGraphics2D.paint(Component c);
    PDEGraphics2D g=PDEGraphics2D.paint(JComponent c);
    PDEGraphics2D g=PDEGraphics2D.paint(Window c);
    PDEGraphics2D g=PDEGraphics2D.paint(JApplet c);

    Creating animations:

    The PDEGraphics2D append() methods can be used to append paints to PDEGraphics2D instance to create animations using Processing. The append() method should be called after the first use of the instance to paint a component.

    Write methods:

    The write methods create files following a convention that is intended to facilitate the use of the generated scripts with both the Processing application and processing.js javascript

    The convention is as follows

    If you write a file named e.g. "script_name.pde", the file will be created in a folder named "script_name". This folder will be created if it does not exist. Thus a file specified as "/Users/ML/Documents/script_name", would create "/Users/ML/Documents/script_name/script_name.pde" - the .pde extension will be added if not specified.

    If the the paint methods called with the PDEGraphics2D instance include calls to the drawImage methods, the required images will be added to a "/script_name/data/" folder as PNG images. Gradient paints, including MultipleGradientPaints, are also supported through drawing images and require a /data folder.

    The write methods also support the creation of HTML files. If the htmlFlag on input is true, the following files can be created:

    script_name.html - a simple file that shows only the graphics

    index.html - a styled file that includes titles etc

    PDEGraphics2D.css - styling sheet for index.html

    index.xml - an xml file describing the contents of the /data folder

    htppd.py - a Python 2.7 script that displays index.html in the system default brpwser using a local server. Use this if the default browser's security settings prevent JavaScript accessing the local file system directly.

    See the write{)} methods for full details of the options available.

    PDEGraphics2D has been tested with the following browsers

    Adding code and comments to the scripts:

    Several methods allow the generated script to be modified on-the-fly when users have access to the paint methods of the components being painted. These methods are defined in AbstractDeployableGraphics2D, the PDEGraphics superclass.

    • public void setPaintObject(Object referenceObject)
    • Places a comment in file. Custom-subclasses could override this to do something more complex.
    • public void addComment(String comment)
    • Adds a comment to the script at the current writing location. Format markers will be added automatically.
    • public void addCode(String comment)
    • Inserts the specified code at the current write location
    • public void prependCode(String code)
    • Prepends the specified code to the Processing script before {@code void setup() {...}}
    • public void appendCode(String code)
    • Adds the code to the end of the generated script.

    Titles etc

    • public void setTitle(String title)
    • Gives the script a title. This will added as the name of the displayed Window or displayed in HTML files. It will also be used to set the title tag in HTML.
    • public void setDescription(String description)
    • The description will be displayed with index.html
    • public void setKeyWords(ArrayList keyWords)
    • Adds the specified strings as keywords to HTML documents.
    • public void addKeyWord(String word)
    • Adds the keyword to the current list for HTML files.

    PDEGraphics can only render graphics normally rendered through Java2D graphics calls. When painting using a proprietary, platform-specific, Java look-and-feel, some features may be painted using native graphics calls and will not appear in the generated scripts. For example, JFrames will not be decorated with close/maximize buttons etc.

    In addition, some components may not render fully perhaps because the componentUIs are cloning the wrapped Graphics2D instance instead of the PDEGraphics2D instance or maybe generating a new instance with a call to Component.getGraphics(). This seems to affect mainly the Mac Aqua L&F. Some fixes/workarounds are included for specific L&Fs and AWT/Swing components where the cause of the problem has been identified.

    Revisions: 14.05.2013 corrected drawString(AttributedCharacterIterator iterator, float x, float y). 14.05.2013 corrected handling of special cases from processShape(...). 15.05.2013 improved support for quadTo: now built from flattened pathiterator: heavy-handed perhaps but works with any control points and produces relatively compact output (2-3 lines of processing code per SEG_QUADTO). 15.05.2013 Add support for rotated text. 18.05.2013 Improved write options, CSS options etc. 27.05.2013 Minor improvements: colors, sizing of images.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int aquaFixes 
      static int aquaJButton
      MacOS Aqua L&F
    • Constructor Summary

      Constructors 
      Constructor and Description
      PDEGraphics2D(java.awt.Graphics2D g, java.awt.Dimension d)
      Constructs an initialised PDEGraphics2D object of specified width and height.
      PDEGraphics2D(java.awt.Graphics2D g, int w, int h)
      Constructs an initialised PDEGraphics2D object of specified width and height.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addCode(java.lang.String code)
      Inserts user-specified code into the coded output at the current location.
      void addComment(java.lang.String comment)
      Sets a string that will be added to the code output as a comment.
      void addKeyWord(java.lang.String word) 
      void append(java.awt.Component c)
      Appends a paint of the specified component to this instance.
      void append(java.awt.Component c, int elapsedTime)
      Appends a paint of the specified component to this instance.
      void appendCode(java.lang.String code)
      Adds user-specified code to the end of the generated code.
      void clearRect(int x, int y, int width, int height) 
      void copyArea(int x, int y, int width, int height, int dx, int dy) 
      boolean copyImage(java.awt.Image img, int dx, int dy, int sx, int sy, int width, int height, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
      Implemented in some Graphics2D subclasses e.g.
      java.awt.Graphics create() 
      java.awt.Graphics create(int x, int y, int width, int height) 
      void draw(java.awt.Shape s) 
      void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) 
      void drawBytes(byte[] data, int offset, int length, int x, int y) 
      void drawGlyphVector(java.awt.font.GlyphVector vec, float x, float y) 
      void drawImage(java.awt.image.BufferedImage img, java.awt.image.BufferedImageOp op, int x, int y) 
      boolean drawImage(java.awt.Image img, java.awt.geom.AffineTransform xform, java.awt.image.ImageObserver observer) 
      boolean drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver observer) 
      boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer) 
      boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.Color bgcolor, java.awt.image.ImageObserver observer) 
      boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer) 
      boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.Color bgcolor, java.awt.image.ImageObserver observer) 
      boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.image.ImageObserver observer) 
      void drawLine(int x1, int y1, int x2, int y2) 
      void drawOval(int x, int y, int width, int height) 
      void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) 
      void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) 
      void drawRect(int x, int y, int w, int h) 
      void drawRenderableImage(java.awt.image.renderable.RenderableImage img, java.awt.geom.AffineTransform xform) 
      void drawRenderedImage(java.awt.image.RenderedImage img, java.awt.geom.AffineTransform xform) 
      void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) 
      void drawString(java.text.AttributedCharacterIterator iterator, float x, float y) 
      void drawString(java.text.AttributedCharacterIterator iterator, int x, int y) 
      void drawString(java.lang.String str, float x, float y) 
      void drawString(java.lang.String str, int x, int y) 
      void fill(java.awt.Shape s) 
      void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) 
      void fillOval(int x, int y, int width, int height) 
      void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) 
      void fillRect(int x, int y, int w, int h) 
      void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) 
      java.lang.String getCode() 
      java.lang.String getDescription()
      Returns the description.
      java.util.ArrayList<java.lang.String> getKeyWords()
      Returns a shallow copy the the keywords.
      int getLFFixes()
      Returns an integer value, the bits of which indicate the use of fixes/workarounds for the look and feel in use.
      java.lang.String getTitle()
      Returns the title.
      static java.lang.String getUserHTML() 
      boolean isTextAsShapes()
      Return the textAsShapes setting.
      boolean isVerbose() 
      static PDEGraphics2D paint(java.awt.Component c)
      Convenience static method for painting an AWT Component and its contents.
      static PDEGraphics2D paint(javax.swing.JApplet c)
      Convenience static method for painting an Swing JApplet and its contents.
      static PDEGraphics2D paint(javax.swing.JComponent c)
      Convenience static method for painting an Swing JComponent and its contents.
      static PDEGraphics2D paint(java.awt.Window c)
      Convenience static method for painting an AWT Window and its contents.
      void prependCode(java.lang.String code)
      Inserts user-specified code at the start of the generated code, but after any automatically generated declarations (which are therefore potentially available for use in that code).
      void setColor(java.awt.Color c) 
      void setDescription(java.lang.String description)
      Creates a description.
      void setKeyWords(java.util.ArrayList<java.lang.String> keyWords)
      Sets the keyWords list.
      void setPaint(java.awt.Paint p) 
      void setPaintObject(java.lang.Object referenceObject)
      Call this routine in the painting mechanism of an AWT/Swing hierarchy.
      void setStroke(java.awt.Stroke s2) 
      void setTextAsShapes(boolean textAsShapes)
      Sets the textAsShapes setting.
      void setTitle(java.lang.String title)
      Creates a title.
      static void setUserHTML(java.lang.String aUserHTML) 
      void setVerbose(boolean verbose) 
      void write(java.io.File f, boolean htmlFlag, java.lang.String jsLoc, java.lang.String cssLoc, boolean httpdFlag)
      Writes the generated code to file.
      void write(java.lang.String fileName)
      Writes the generated code to file.
      void write(java.lang.String fileName, boolean htmlFlag)
      Writes the generated code to file.
      void write(java.lang.String fileName, boolean htmlFlag, java.lang.String jsLoc)
      Writes the generated code to file.
      void write(java.lang.String fileName, boolean htmlFlag, java.lang.String jsLoc, java.lang.String cssLoc, boolean httpdFlag)
      Writes the generated code to file.
      • Methods inherited from class java.awt.Graphics

        drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PDEGraphics2D

        public PDEGraphics2D(java.awt.Graphics2D g,
                             int w,
                             int h)
        Constructs an initialised PDEGraphics2D object of specified width and height.
        Parameters:
        g - Graphics2D object for the java component to be drawn.
        w - the width of the component
        h - the height of the component
      • PDEGraphics2D

        public PDEGraphics2D(java.awt.Graphics2D g,
                             java.awt.Dimension d)
        Constructs an initialised PDEGraphics2D object of specified width and height.
        Parameters:
        g - Graphics2D object for the java component to be drawn.
        d - Dimension of the component
    • Method Detail

      • paint

        public static PDEGraphics2D paint(java.awt.Component c)
        Convenience static method for painting an AWT Component and its contents. Returns a PDEGraphics instance that is ready to write to file.
        Parameters:
        c - the component to paint
        Returns:
        a ready-to-write PDEGraphics instance.
      • paint

        public static PDEGraphics2D paint(javax.swing.JComponent c)
        Convenience static method for painting an Swing JComponent and its contents. Returns a PDEGraphics instance that is ready to write to file.
        Parameters:
        c - the component to paint
        Returns:
        a ready-to-write PDEGraphics instance.
      • paint

        public static PDEGraphics2D paint(java.awt.Window c)
        Convenience static method for painting an AWT Window and its contents. Returns a PDEGraphics instance that is ready to write to file.
        Parameters:
        c - the component to paint
        Returns:
        a ready-to-write PDEGraphics instance.
      • paint

        public static PDEGraphics2D paint(javax.swing.JApplet c)
        Convenience static method for painting an Swing JApplet and its contents. Returns a PDEGraphics instance that is ready to write to file.
        Parameters:
        c - the component to paint
        Returns:
        a ready-to-write PDEGraphics instance.
      • getLFFixes

        public int getLFFixes()
        Returns an integer value, the bits of which indicate the use of fixes/workarounds for the look and feel in use.
        Returns:
        the lfFixes
      • getKeyWords

        public java.util.ArrayList<java.lang.String> getKeyWords()
        Returns a shallow copy the the keywords.
        Returns:
        an ArrayList
      • setKeyWords

        public void setKeyWords(java.util.ArrayList<java.lang.String> keyWords)
        Sets the keyWords list.
        Parameters:
        keyWords - the keyWords to set
      • addKeyWord

        public void addKeyWord(java.lang.String word)
      • getTitle

        public java.lang.String getTitle()
        Returns the title.
        Returns:
        the title
      • setTitle

        public void setTitle(java.lang.String title)
        Creates a title. This will be display in index.html and used as the frame title by Processing.app.
        Parameters:
        title - the title to set
      • getDescription

        public java.lang.String getDescription()
        Returns the description.
        Returns:
        the description
      • setDescription

        public void setDescription(java.lang.String description)
        Creates a description. This will be display in index.html.
        Parameters:
        description - the description to set
      • isTextAsShapes

        public boolean isTextAsShapes()
        Return the textAsShapes setting. If true, text will be rendered as glyphs. If false, the default Processing font will be used.
        Returns:
        the textAsShapes
      • setTextAsShapes

        public void setTextAsShapes(boolean textAsShapes)
        Sets the textAsShapes setting. If true, text will be rendered as glyphs. If false, the default Processing font will be used.
        Parameters:
        textAsShapes - the textAsShapes to set
      • create

        public java.awt.Graphics create()
        Specified by:
        create in class java.awt.Graphics
      • create

        public java.awt.Graphics create(int x,
                                        int y,
                                        int width,
                                        int height)
        Overrides:
        create in class java.awt.Graphics
      • append

        public void append(java.awt.Component c,
                           int elapsedTime)
        Appends a paint of the specified component to this instance. The component should have the same dimensions as the graphics for this instance. The appended graphics will be painted, when deployed to the target, at the time specified (+ the actionDelay constant value).
        Specified by:
        append in class AbstractDeployableGraphics2D
        Parameters:
        c - the component to paint
        elapsedTime - the time to paint this component in the deployed code.
      • append

        public void append(java.awt.Component c)
        Appends a paint of the specified component to this instance. The component should have the same dimensions as the graphics for this instance. This is equivalent to append(c, elapsedTime) where elapsedTime is the interval in milliseconds between the instantiation of this instance and this call to append.
        Specified by:
        append in class AbstractDeployableGraphics2D
        Parameters:
        c - the component to paint
      • write

        public void write(java.lang.String fileName)
                   throws java.io.IOException
        Writes the generated code to file. Equivalent to: write(fileName, true, "./processing.js", "./PDEGraphics2D.css", true);
        Overrides:
        write in class AbstractDeployableGraphics2D
        Parameters:
        fileName - - String describing the file to write to

        The remaining arguments are relevant only when htmlFlag==true and will be ignored otherwise.

        Notes:
        A file named "FILENAME.pde" will always be added to a folder name "FILENAME": the folder will be created if required following the usual Processing.app convention. If that folder already exists, any existing files will be overwritten
        Additional data such as images will be written to a "/data" sub-folder.

        Throws:
        java.io.IOException
      • write

        public void write(java.lang.String fileName,
                          boolean htmlFlag)
                   throws java.io.IOException
        Writes the generated code to file. Equivalent to: write(fileName, htmlFlag, "./processing.js", "./PDEGraphics2D.css", true);
        Parameters:
        fileName - - String describing the file to write to
        htmlFlag - - if true, html files to view the script will also be created.

        The remaining arguments are relevant only when htmlFlag==true and will be ignored otherwise.

        Notes:
        A file named "FILENAME.pde" will always be added to a folder name "FILENAME": the folder will be created if required following the usual Processing.app convention. If that folder already exists, any existing files will be overwritten
        Additional data such as images will be written to a "/data" sub-folder.

        Throws:
        java.io.IOException
      • write

        public void write(java.lang.String fileName,
                          boolean htmlFlag,
                          java.lang.String jsLoc)
                   throws java.io.IOException
        Writes the generated code to file. Equivalent to: write(fileName,htmlFlag, jsLoc, "./PDEGraphics2D.css", true);
        Parameters:
        fileName - - String describing the file to write to
        htmlFlag - - if true, html files to view the script will also be created.

        The remaining arguments are relevant only when htmlFlag==true and will be ignored otherwise.

        jsLoc - - String specifying the location of the processing.js file. If this is "processing.js" or "./processing.js", a copy of the JavaScript file will be created in the folder alongside the html files. Otherwise, the string should point to the location of a processing JavaScript file relative to the HTML file folder OR describe a URL. Notes:

        Notes:
        A file named "FILENAME.pde" will always be added to a folder name "FILENAME": the folder will be created if required following the usual Processing.app convention. If that folder already exists, any existing files will be overwritten
        Additional data such as images will be written to a "/data" sub-folder.

        Throws:
        java.io.IOException
      • write

        public void write(java.lang.String fileName,
                          boolean htmlFlag,
                          java.lang.String jsLoc,
                          java.lang.String cssLoc,
                          boolean httpdFlag)
                   throws java.io.IOException
        Writes the generated code to file.
        Parameters:
        fileName - - String describing the file to write to
        htmlFlag - - if true, html files to view the script will also be created.

        The remaining arguments are relevant only when htmlFlag==true and will be ignored otherwise.

        jsLoc - - String specifying the location of the processing.js file. If this is "processing.js" or "./processing.js", a copy of the JavaScript file will be created in the folder alongside the html files. Otherwise, the string should point to the location of a processing JavaScript file relative to the HTML file folder OR describe a URL.
        cssLoc - - String specifying the location of the CSS styling. If this is "PDEGraphics2D.css" or "./PDEGraphics2D.css", a copy of the default CSS settings will be created in the folder alongside the html files. The the string may also point to the location of a suitable CSS file relative to the HTML file folder OR describe a URL. Alternatively, if cssLoc is "index.html" or "./index.html" the default CSS settings will be embedded in the heml file.
        httpdFlag - If true, a Python 2.7 script ("httpd.py") will be created alongside the html files which will set up a local server and display index.html in the system browser. This can be useful if system or security settings prevent access to the local file system. The port to use will be obtained by the script from the OS.

        Notes:
        A file named "FILENAME.pde" will always be added to a folder name "FILENAME": the folder will be created if required following the usual Processing.app convention. If that folder already exists, any existing files will be overwritten
        Additional data such as images will be written to a "/data" sub-folder.

        Throws:
        java.io.IOException
      • write

        public void write(java.io.File f,
                          boolean htmlFlag,
                          java.lang.String jsLoc,
                          java.lang.String cssLoc,
                          boolean httpdFlag)
                   throws java.io.IOException
        Writes the generated code to file.
        Parameters:
        f - - the File to write to
        htmlFlag - - if true, html files to view the script will also be created.

        The remaining arguments are relevant only when htmlFlag==true and will be ignored otherwise.

        jsLoc - - String specifying the location of the processing.js file. If this is "processing.js" or "./processing.js", a copy of the JavaScript file will be created in the folder alongside the html files. Otherwise, the string should point to the location of a processing JavaScript file relative to the HTML file folder OR describe a URL.
        cssLoc - - String specifying the location of the CSS styling. If this is "PDEGraphics2D.css" or "./PDEGraphics2D.css", a copy of the default CSS settings will be created in the folder alongside the html files. The the string may also point to the location of a suitable CSS file relative to the HTML file folder OR describe a URL. Alternatively, if cssLoc is "index.html" or "./index.html" the default CSS settings will be embedded in the heml file.
        httpdFlag - If true, a Python 2.7 script ("httpd.py") will be created alongside the html files which will set up a local server and display index.html in the system browser. This can be useful if system or security settings prevent access to the local file system. The port to use will be obtained by the script from the OS.

        Notes:
        A file named "FILENAME.pde" will always be added to a folder name "FILENAME": the folder will be created if required following the usual Processing.app convention. If that folder already exists, any existing files will be overwritten
        Additional data such as images will be written to a "/data" sub-folder.

        Throws:
        java.io.IOException
      • copyImage

        public boolean copyImage(java.awt.Image img,
                                 int dx,
                                 int dy,
                                 int sx,
                                 int sy,
                                 int width,
                                 int height,
                                 java.awt.Color bgcolor,
                                 java.awt.image.ImageObserver observer)
        Description copied from class: AbstractDeployableGraphics2D
        Implemented in some Graphics2D subclasses e.g. com.sun.java.Graphics2D. This is not part of the java.awt.Graphics2D API.
        Specified by:
        copyImage in class AbstractDeployableGraphics2D
        Returns:
        true or false
      • drawImage

        public boolean drawImage(java.awt.Image img,
                                 int dx1,
                                 int dy1,
                                 int dx2,
                                 int dy2,
                                 int sx1,
                                 int sy1,
                                 int sx2,
                                 int sy2,
                                 java.awt.image.ImageObserver observer)
        Overrides:
        drawImage in class AbstractDeployableGraphics2D
      • drawImage

        public boolean drawImage(java.awt.Image img,
                                 int dx1,
                                 int dy1,
                                 int dx2,
                                 int dy2,
                                 int sx1,
                                 int sy1,
                                 int sx2,
                                 int sy2,
                                 java.awt.Color bgcolor,
                                 java.awt.image.ImageObserver observer)
        Overrides:
        drawImage in class AbstractDeployableGraphics2D
      • drawImage

        public boolean drawImage(java.awt.Image img,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 java.awt.image.ImageObserver observer)
        Overrides:
        drawImage in class AbstractDeployableGraphics2D
      • drawImage

        public boolean drawImage(java.awt.Image img,
                                 int x,
                                 int y,
                                 java.awt.Color bgcolor,
                                 java.awt.image.ImageObserver observer)
        Overrides:
        drawImage in class AbstractDeployableGraphics2D
      • drawImage

        public boolean drawImage(java.awt.Image img,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 java.awt.Color bgcolor,
                                 java.awt.image.ImageObserver observer)
        Overrides:
        drawImage in class AbstractDeployableGraphics2D
      • drawImage

        public boolean drawImage(java.awt.Image img,
                                 java.awt.geom.AffineTransform xform,
                                 java.awt.image.ImageObserver observer)
        Overrides:
        drawImage in class AbstractDeployableGraphics2D
      • setPaintObject

        public void setPaintObject(java.lang.Object referenceObject)
        Description copied from class: AbstractDeployableGraphics2D
        Call this routine in the painting mechanism of an AWT/Swing hierarchy. How a concrete class responds is an implementation detail for the subclass. Typically, this will simply be used to add a comment to the generated code in a custom component e.g.

        public void paintComponent(Graphics g){
        if (g instanceof AbstractDeployableGraphics2D) {
        ((AbstractDeployableGraphics2D)g).setPaintObject(this);
        }
        }

        Specified by:
        setPaintObject in class AbstractDeployableGraphics2D
        Parameters:
        referenceObject - the paintObject to set
      • addComment

        public void addComment(java.lang.String comment)
        Description copied from class: AbstractDeployableGraphics2D
        Sets a string that will be added to the code output as a comment. Do not added comment markers - these should be added by any concrete implementations automatically and will be specific to the code language being used.
        Specified by:
        addComment in class AbstractDeployableGraphics2D
        Parameters:
        comment - the comment to set as a String
      • prependCode

        public void prependCode(java.lang.String code)
        Description copied from class: AbstractDeployableGraphics2D
        Inserts user-specified code at the start of the generated code, but after any automatically generated declarations (which are therefore potentially available for use in that code).
        Specified by:
        prependCode in class AbstractDeployableGraphics2D
        Parameters:
        code - fully formatted code string
      • isVerbose

        public boolean isVerbose()
        Returns:
        the verbose
      • setVerbose

        public void setVerbose(boolean verbose)
        Parameters:
        verbose - the verbose to set
      • getUserHTML

        public static java.lang.String getUserHTML()
        Returns:
        the userHTML
      • setUserHTML

        public static void setUserHTML(java.lang.String aUserHTML)
        Parameters:
        aUserHTML - the userHTML to set

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.