org.utgenome.graphics
Class GenomeCanvas

java.lang.Object
  extended by org.utgenome.graphics.GenomeCanvas

public class GenomeCanvas
extends Object

A canvas class for drawing genes. Modify this implementation so that it can handle Ribbon coordinate

Author:
leo

Constructor Summary
GenomeCanvas(int width, int height, GenomeWindow window)
           
 
Method Summary
 void drawBase(String text, long startIndexOnGenome, long endIndexOnGenome, int yOffset, float fontSize, Color color)
           
 void drawGeneRect(long startIndexOnGenome, long endIndexOnGenome, int yOffset, int height, Color color)
           
 void drawLine(long x1, long y1, long x2, long y2, Color lineColor)
           
 void drawLocusLabel(String text, long startIndexOnGenome, long endIndexOnGenome, int yOffset, float fontSize, Color color)
           
 void drawRect(int x, int y, int width, int height, Color color)
           
 void drawTag(long startIndexOnGenome, long endIndexOnGenome)
           
 void drawTag(long startIndexOnGenome, long endIndexOnGenome, Color color)
           
 void drawText(String text, long startIndexOnGenome, long endIndexOnGenome, int yOffset, float fontSize, Color color)
           
 void drawText(String text, long startIndexOnGenome, long endIndexOnGenome, int yOffset, int fontSize, Color color)
           
 BufferedImage getBufferedImage()
           
 int getEndIndex(String text, int fontSize, int start, int end, int gapWidth)
           
 int getFontWidth(String text)
           
 GenomeWindow getGenomeWindow()
           
 Graphics2D getGraphics()
           
 int getOffset(String text, int fontSize, long startIndexOnGenome, long endIndexOnGenome, int gapWidth)
           
 int getWidth()
           
 int getXPosOnWindow(long indexOnGenome)
           
 void outputImage(javax.servlet.http.HttpServletResponse response, String imageType)
           
 void setGeneHeight(int height)
           
 void setPixelHeight(int height)
           
 void setPixelSize(int width, int height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenomeCanvas

public GenomeCanvas(int width,
                    int height,
                    GenomeWindow window)
Method Detail

setGeneHeight

public void setGeneHeight(int height)

getGraphics

public Graphics2D getGraphics()

getGenomeWindow

public GenomeWindow getGenomeWindow()

getWidth

public int getWidth()

getBufferedImage

public BufferedImage getBufferedImage()

drawTag

public void drawTag(long startIndexOnGenome,
                    long endIndexOnGenome)

drawTag

public void drawTag(long startIndexOnGenome,
                    long endIndexOnGenome,
                    Color color)

drawGeneRect

public void drawGeneRect(long startIndexOnGenome,
                         long endIndexOnGenome,
                         int yOffset,
                         int height,
                         Color color)

drawRect

public void drawRect(int x,
                     int y,
                     int width,
                     int height,
                     Color color)

drawBase

public void drawBase(String text,
                     long startIndexOnGenome,
                     long endIndexOnGenome,
                     int yOffset,
                     float fontSize,
                     Color color)

drawText

public void drawText(String text,
                     long startIndexOnGenome,
                     long endIndexOnGenome,
                     int yOffset,
                     float fontSize,
                     Color color)
Parameters:
text -
startIndexOnGenome - font range start
endIndexOnGenome - font range end
yOffset - offset value of Y-axis
fontSize -
color -
Throws:
IOException

drawText

public void drawText(String text,
                     long startIndexOnGenome,
                     long endIndexOnGenome,
                     int yOffset,
                     int fontSize,
                     Color color)

drawLocusLabel

public void drawLocusLabel(String text,
                           long startIndexOnGenome,
                           long endIndexOnGenome,
                           int yOffset,
                           float fontSize,
                           Color color)

outputImage

public void outputImage(javax.servlet.http.HttpServletResponse response,
                        String imageType)
                 throws IOException
Throws:
IOException

setPixelSize

public void setPixelSize(int width,
                         int height)

drawLine

public void drawLine(long x1,
                     long y1,
                     long x2,
                     long y2,
                     Color lineColor)

setPixelHeight

public void setPixelHeight(int height)

getFontWidth

public int getFontWidth(String text)

getXPosOnWindow

public int getXPosOnWindow(long indexOnGenome)

getOffset

public int getOffset(String text,
                     int fontSize,
                     long startIndexOnGenome,
                     long endIndexOnGenome,
                     int gapWidth)

getEndIndex

public int getEndIndex(String text,
                       int fontSize,
                       int start,
                       int end,
                       int gapWidth)


Copyright © 2007-2012 utgenome.org. All Rights Reserved.