|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.lbl.genome.gui.Picture
public class Picture
Title: Picture
Description: Some panel require intermediate class for drawing. This class provides basic methods for drawing pictures
Copyright: Copyright (c) 2002 Ernest Orlando Lawrence Berkeley National Laboratory
Company: LBNL
Field Summary | |
---|---|
protected javax.swing.JComponent |
component
|
protected boolean |
debug
|
protected java.text.DecimalFormat |
df
|
protected java.awt.Graphics |
g
|
protected java.awt.Graphics2D |
g2d
|
protected boolean |
G2D
|
protected int |
height
|
protected java.awt.image.BufferedImage |
image
|
protected int |
imageableHeight
|
protected int |
imageableWidth
|
protected int |
marginBottom
|
protected int |
marginLeft
|
protected int |
marginRight
|
protected int |
marginTop
|
protected int |
maxHeight
|
protected int |
maxWidth
|
protected long |
maxX
|
protected long |
minX
|
protected java.lang.String |
name
|
protected double |
pixelWidth
|
protected boolean |
tooSmall
|
protected VistaApp |
va
|
protected int |
width
|
protected int |
z
|
Constructor Summary | |
---|---|
Picture(VistaApp vapp,
java.lang.String name)
Picture |
Method Summary | |
---|---|
protected int |
convertX(double x)
convert cromosome coordinate to the picture coordinate |
protected int |
convertX(long x)
convert cromosome coordinate to the picture coordinate |
void |
debug(java.lang.String s)
pring debuging output |
void |
drawPicture(java.awt.Graphics gr)
draw Picture |
void |
drawPicture(java.awt.Graphics gr,
int width,
int height)
draw Picture |
void |
drawPicture(java.awt.Graphics gr,
javax.swing.JComponent comp)
draw Picture |
void |
drawPicture(java.awt.Graphics gr,
javax.swing.JComponent comp,
int i)
draw Picture |
void |
drawPicture(java.awt.Graphics gr,
java.awt.print.PageFormat pf)
draw Picture |
void |
drawPicture(java.awt.Graphics gr,
java.awt.print.PageFormat pf,
int line)
draw Picture |
long |
getDX()
return maxX-minX |
java.lang.String |
getFormattedNumberString(double x,
int maxFracDigits)
return Formatted Number String |
java.lang.String |
getFormattedNumberString(int x,
int maxFracDigits)
return Formatted Number String |
java.lang.String |
getFormattedXDisplayString(int currXPos)
return Formatted String converted to the chromosome coordinates |
int |
getHeight()
return picture Height |
java.awt.image.BufferedImage |
getImage()
return new Image with default size |
java.awt.image.BufferedImage |
getImage(int width,
int height)
return new Image with the size specified by parameters |
java.awt.image.BufferedImage |
getImage(javax.swing.JComponent comp)
return new Image with the size equals to the componet size |
java.awt.image.BufferedImage |
getImage(javax.swing.JComponent comp,
int i)
return new Image with the size equals to the componet size |
java.awt.image.BufferedImage |
getImage(java.awt.print.PageFormat pf)
return new Image with the size equals to the page size |
int |
getImageableHeight()
return height of the Imageable rectangle |
int |
getImageableWidth()
return width of the Imageable rectangle |
int |
getMarginBottom()
return bottom Margin |
int |
getMarginLeft()
return left Margin |
int |
getMarginRight()
return right Margin |
int |
getMarginTop()
return top Margin |
int |
getMaxHeight()
return Max drawable Height |
int |
getMaxWidth()
return tMax drawable Width |
double |
getRelX(double x)
eturn relative position from the begining |
double |
getRelX(long x)
return relative position from the begining |
int |
getStringWidth(java.lang.String s,
java.awt.Font f)
return Width (in pixels) of the string |
int |
getWidth()
return picture Width |
long |
getXDisplay(int currXPos)
convert the parameter into chromosome coordinates |
void |
setComponent(javax.swing.JComponent comp)
set Component |
void |
setDebug(boolean d)
set Debuging mode |
void |
setImageableArea(int left,
int top,
int width,
int height)
set Imageable Area from the parameters |
void |
setImageableArea(java.awt.print.PageFormat pf)
setI mageable Area from the pages Imageable area |
void |
setMarginRight(int x)
set right Margin |
void |
setMargins(int left,
int top,
int right,
int bottom)
set Margins from the parameters |
void |
setMargins(java.awt.print.PageFormat pf)
set Margins from the page margins |
void |
setMaxX(int i)
set Max X |
void |
setMaxX(long maxx)
set Max X |
void |
setMinMaxX(int i)
set Min and Max X |
void |
setMinMaxX(long minx,
long maxx)
set Min and Max X |
void |
setMinX(int i)
set Min X |
void |
setMinX(long minx)
set Min X |
void |
setPage(java.awt.print.PageFormat pf)
set Page |
void |
setSize()
set size from the default component |
void |
setSize(int width,
int height)
set Size from the parameters |
void |
setSize(javax.swing.JComponent comp)
set size from the component |
void |
setSize(java.awt.print.PageFormat pf)
set Size from the page |
void |
setZ(int Z)
this parameter can be 0 or 1. |
java.lang.String |
shortenString(java.lang.String s,
java.awt.Font f,
int width)
remove last characters from the string until its width is less or equal the maximum parameter |
java.lang.String |
toString()
return summary string |
void |
translate(int x,
int y)
translate imageable area |
void |
translate(int x,
int y,
int x1,
int y1)
change size and position of the imageable area |
int |
X(int x)
correct x coordinates |
int |
Y(int y)
correct y coordinates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected VistaApp va
protected int width
protected int height
protected int imageableWidth
protected int imageableHeight
protected int marginLeft
protected int marginRight
protected int marginTop
protected int marginBottom
protected int maxWidth
protected int maxHeight
protected double pixelWidth
protected java.awt.Graphics g
protected java.awt.Graphics2D g2d
protected java.text.DecimalFormat df
protected java.lang.String name
protected boolean debug
protected boolean G2D
protected javax.swing.JComponent component
protected java.awt.image.BufferedImage image
protected long minX
protected long maxX
protected boolean tooSmall
protected int z
Constructor Detail |
---|
public Picture(VistaApp vapp, java.lang.String name)
vapp
- VistaAppname
- StringMethod Detail |
---|
public java.awt.image.BufferedImage getImage()
public java.awt.image.BufferedImage getImage(javax.swing.JComponent comp, int i)
public java.awt.image.BufferedImage getImage(javax.swing.JComponent comp)
public java.awt.image.BufferedImage getImage(java.awt.print.PageFormat pf)
public java.awt.image.BufferedImage getImage(int width, int height)
public void drawPicture(java.awt.Graphics gr, javax.swing.JComponent comp, int i)
gr
- Graphicscomp
- JComponenti
- intpublic void drawPicture(java.awt.Graphics gr, javax.swing.JComponent comp)
gr
- Graphicscomp
- JComponentpublic void drawPicture(java.awt.Graphics gr, java.awt.print.PageFormat pf)
gr
- Graphicspf
- PageFormatpublic void drawPicture(java.awt.Graphics gr, java.awt.print.PageFormat pf, int line)
gr
- Graphicspf
- PageFormatline
- intpublic void drawPicture(java.awt.Graphics gr, int width, int height)
gr
- Graphicswidth
- intheight
- intpublic void drawPicture(java.awt.Graphics gr)
gr
- Graphicspublic void debug(java.lang.String s)
s
- Stringpublic void setDebug(boolean d)
d
- booleanpublic int getWidth()
public int getHeight()
public int getMaxWidth()
public int getMaxHeight()
public int getImageableWidth()
public int getImageableHeight()
public int getMarginLeft()
public int getMarginRight()
public int getMarginTop()
public int getMarginBottom()
public void setSize()
public void setSize(javax.swing.JComponent comp)
comp
- JComponentpublic void setSize(java.awt.print.PageFormat pf)
pf
- PageFormatpublic void setSize(int width, int height)
width
- intheight
- intpublic void setMargins(java.awt.print.PageFormat pf)
pf
- PageFormatpublic void setMargins(int left, int top, int right, int bottom)
left
- inttop
- intright
- intbottom
- intpublic void setImageableArea(java.awt.print.PageFormat pf)
pf
- PageFormatpublic void setImageableArea(int left, int top, int width, int height)
left
- inttop
- intwidth
- intheight
- intpublic java.lang.String toString()
toString
in class java.lang.Object
public void translate(int x, int y)
x
- inty
- intpublic void translate(int x, int y, int x1, int y1)
x
- inty
- intx1
- inty1
- intpublic void setMarginRight(int x)
x
- intpublic int getStringWidth(java.lang.String s, java.awt.Font f)
s
- Stringf
- Font
public java.lang.String shortenString(java.lang.String s, java.awt.Font f, int width)
s
- Stringf
- Fontwidth
- int
public int X(int x)
x
- int
public int Y(int y)
y
- int
protected int convertX(double x)
x
- double
protected int convertX(long x)
x
- long
public java.lang.String getFormattedNumberString(double x, int maxFracDigits)
x
- doublemaxFracDigits
- int
public java.lang.String getFormattedNumberString(int x, int maxFracDigits)
x
- intmaxFracDigits
- int
public java.lang.String getFormattedXDisplayString(int currXPos)
currXPos
- int
public long getXDisplay(int currXPos)
currXPos
- int
public void setMinX(long minx)
minx
- longpublic void setMaxX(long maxx)
maxx
- longpublic void setMinMaxX(long minx, long maxx)
minx
- longmaxx
- longpublic void setMinX(int i)
i
- intVistaApp.getMinX(int)
public void setMaxX(int i)
i
- intVistaApp.getMaxX(int)
public void setMinMaxX(int i)
i
- intVistaApp.getMinX(int)
,
VistaApp.getMaxX(int)
public void setComponent(javax.swing.JComponent comp)
comp
- JComponentpublic void setPage(java.awt.print.PageFormat pf)
pf
- PageFormatpublic long getDX()
public double getRelX(long x)
x
- long
public double getRelX(double x)
x
- double
public void setZ(int Z)
Z
- int
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |