imagereportelement.java
来自「iReport-0.4.1-src是iReport的源代码,iReport是一个」· Java 代码 · 共 710 行 · 第 1/2 页
JAVA
710 行
}
public void drawGraphicsElement(Graphics2D g, String pen, double zoom_factor, int x_shift_origin, int y_shift_origin)
{
Stroke stroke = getPenStroke( pen,zoom_factor );
g.setColor( this.fgcolor );
this.zoom_factor = zoom_factor;
if (stroke==null || pen.equalsIgnoreCase("None")) return;
position.x -= 10;
position.y -= 10;
x_shift_origin -= 10;
y_shift_origin -= 10;
Stroke oldStroke = g.getStroke();
g.setStroke(stroke);
g.drawRect(
getZoomedDim(position.x)-x_shift_origin,
getZoomedDim(position.y)-y_shift_origin,
getZoomedDim(width),getZoomedDim(height));
position.x += 10;
position.y += 10;
g.setStroke(oldStroke);
}
/** Getter for property horizontalAlignment.
* @return Value of property horizontalAlignment.
*
*/
public java.lang.String getHorizontalAlignment() {
return horizontalAlignment;
}
/** Setter for property horizontalAlignment.
* @param horizontalAlignment New value of property horizontalAlignment.
*
*/
public void setHorizontalAlignment(java.lang.String horizontalAlignment) {
this.horizontalAlignment = horizontalAlignment;
}
/** Getter for property imageClass.
* @return Value of property imageClass.
*
*/
public java.lang.String getImageClass() {
return imageClass;
}
/** Setter for property imageClass.
* @param imageClass New value of property imageClass.
*
*/
public void setImageClass(java.lang.String imageClass) {
this.imageClass = imageClass;
}
/** Getter for property verticalAlignment.
* @return Value of property verticalAlignment.
*
*/
public java.lang.String getVerticalAlignment() {
return verticalAlignment;
}
/** Setter for property verticalAlignment.
* @param verticalAlignment New value of property verticalAlignment.
*
*/
public void setVerticalAlignment(java.lang.String verticalAlignment) {
this.verticalAlignment = verticalAlignment;
}
/** Getter for property evaluationGroup.
* @return Value of property evaluationGroup.
*
*/
public java.lang.String getEvaluationGroup() {
return evaluationGroup;
}
/** Setter for property evaluationGroup.
* @param evaluationGroup New value of property evaluationGroup.
*
*/
public void setEvaluationGroup(java.lang.String evaluationGroup) {
this.evaluationGroup = evaluationGroup;
}
/** Getter for property imageExpression.
* @return Value of property imageExpression.
*
*/
public java.lang.String getImageExpression() {
return imageExpression;
}
/** Setter for property imageExpression.
* @param imageExpression New value of property imageExpression.
*
*/
public void setImageExpression(java.lang.String imageExpression) {
this.imageExpression = imageExpression;
this.triedToLoadImg = false;
}
/** Getter for property evaluationTime.
* @return Value of property evaluationTime.
*
*/
public java.lang.String getEvaluationTime() {
return evaluationTime;
}
/** Setter for property evaluationTime.
* @param evaluationTime New value of property evaluationTime.
*
*/
public void setEvaluationTime(java.lang.String evaluationTime) {
this.evaluationTime = evaluationTime;
}
/** Getter for property img.
* @return Value of property img.
*
*/
public java.awt.Image getImg() {
return img;
}
public java.awt.Image getImgDef() {
return defimg;
}
/** Setter for property img.
* @param img New value of property img.
*
*/
public void setImg(java.awt.Image img) {
this.img = img;
}
/** Getter for property hyperlinkType.
* @return Value of property hyperlinkType.
*
*/
public java.lang.String getHyperlinkType() {
return hyperlinkType;
}
/** Setter for property hyperlinkType.
* @param hyperlinkType New value of property hyperlinkType.
*
*/
public void setHyperlinkType(java.lang.String hyperlinkType) {
this.hyperlinkType = hyperlinkType;
}
/** Getter for property anchorNameExpression.
* @return Value of property anchorNameExpression.
*
*/
public java.lang.String getAnchorNameExpression() {
return anchorNameExpression;
}
/** Setter for property anchorNameExpression.
* @param anchorNameExpression New value of property anchorNameExpression.
*
*/
public void setAnchorNameExpression(java.lang.String anchorNameExpression) {
this.anchorNameExpression = anchorNameExpression;
}
/** Getter for property scaleImage.
* @return Value of property scaleImage.
*
*/
public java.lang.String getScaleImage() {
return scaleImage;
}
/** Setter for property scaleImage.
* @param scaleImage New value of property scaleImage.
*
*/
public void setScaleImage(java.lang.String scaleImage) {
this.scaleImage = scaleImage;
}
/** Getter for property hyperlinkReferenceExpression.
* @return Value of property hyperlinkReferenceExpression.
*
*/
public java.lang.String getHyperlinkReferenceExpression() {
return hyperlinkReferenceExpression;
}
/** Setter for property hyperlinkReferenceExpression.
* @param hyperlinkReferenceExpression New value of property hyperlinkReferenceExpression.
*
*/
public void setHyperlinkReferenceExpression(java.lang.String hyperlinkReferenceExpression) {
this.hyperlinkReferenceExpression = hyperlinkReferenceExpression;
}
/** Getter for property hyperlinkAnchorExpression.
* @return Value of property hyperlinkAnchorExpression.
*
*/
public java.lang.String getHyperlinkAnchorExpression() {
return hyperlinkAnchorExpression;
}
/** Setter for property hyperlinkAnchorExpression.
* @param hyperlinkAnchorExpression New value of property hyperlinkAnchorExpression.
*
*/
public void setHyperlinkAnchorExpression(java.lang.String hyperlinkAnchorExpression) {
this.hyperlinkAnchorExpression = hyperlinkAnchorExpression;
}
/** Getter for property hyperlinkPageExpression.
* @return Value of property hyperlinkPageExpression.
*
*/
public java.lang.String getHyperlinkPageExpression() {
return hyperlinkPageExpression;
}
/** Setter for property hyperlinkPageExpression.
* @param hyperlinkPageExpression New value of property hyperlinkPageExpression.
*
*/
public void setHyperlinkPageExpression(java.lang.String hyperlinkPageExpression) {
this.hyperlinkPageExpression = hyperlinkPageExpression;
}
/** This method is called when information about an image which was
* previously requested using an asynchronous interface becomes
* available. Asynchronous interfaces are method calls such as
* getWidth(ImageObserver) and drawImage(img, x, y, ImageObserver)
* which take an ImageObserver object as an argument. Those methods
* register the caller as interested either in information about
* the overall image itself (in the case of getWidth(ImageObserver))
* or about an output version of an image (in the case of the
* drawImage(img, x, y, [w, h,] ImageObserver) call).
*
* <p>This method
* should return true if further updates are needed or false if the
* required information has been acquired. The image which was being
* tracked is passed in using the img argument. Various constants
* are combined to form the infoflags argument which indicates what
* information about the image is now available. The interpretation
* of the x, y, width, and height arguments depends on the contents
* of the infoflags argument.
* <p>
* The <code>infoflags</code> argument should be the bitwise inclusive
* <b>OR</b> of the following flags: <code>WIDTH</code>,
* <code>HEIGHT</code>, <code>PROPERTIES</code>, <code>SOMEBITS</code>,
* <code>FRAMEBITS</code>, <code>ALLBITS</code>, <code>ERROR</code>,
* <code>ABORT</code>.
*
* @param img the image being observed.
* @param infoflags the bitwise inclusive OR of the following
* flags: <code>WIDTH</code>, <code>HEIGHT</code>,
* <code>PROPERTIES</code>, <code>SOMEBITS</code>,
* <code>FRAMEBITS</code>, <code>ALLBITS</code>,
* <code>ERROR</code>, <code>ABORT</code>.
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
* @param width the width.
* @param height the height.
* @return <code>false</code> if the infoflags indicate that the
* image is completely loaded; <code>true</code> otherwise.
*
* @see #WIDTH
* @see #HEIGHT
* @see #PROPERTIES
* @see #SOMEBITS
* @see #FRAMEBITS
* @see #ALLBITS
* @see #ERROR
* @see #ABORT
* @see Image#getWidth
* @see Image#getHeight
* @see java.awt.Graphics#drawImage
*
*/
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
return true;
}
public static void setImgDef(Image defImg)
{
defimg = defImg;
}
/** Getter for property isUsingCache.
* @return Value of property isUsingCache.
*
*/
public boolean isIsUsingCache() {
return isUsingCache;
}
/** Setter for property isUsingCache.
* @param isUsingCache New value of property isUsingCache.
*
*/
public void setIsUsingCache(boolean isUsingCache) {
this.isUsingCache = isUsingCache;
}
/**
* @return
*/
public File getReportDirectory() {
return reportDirectory;
}
/**
* @param directory
*/
public void setReportDirectory(File directory) {
reportDirectory = directory;
}
protected String hyperlinkTarget = "Self";
/** Getter for property hyperlinkTarget.
* @return Value of property hyperlinkTarget.
*
*/
public java.lang.String getHyperlinkTarget(){ return hyperlinkTarget; }
/** Setter for property hyperlinkTarget.
* @param hyperlinkTarget New value of property hyperlinkTarget.
*
*/
public void setHyperlinkTarget(java.lang.String hyperlinkTarget) { this.hyperlinkTarget = hyperlinkTarget; }
public Box getBox() {
return box;
}
public void setBox(Box box) {
this.box = box;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?