|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| Popup.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* Joey and its relative products are published under the terms
|
|
| 3 |
* of the Apache Software License.
|
|
| 4 |
*/
|
|
| 5 |
/*
|
|
| 6 |
* Created on 2004/01/08
|
|
| 7 |
*/
|
|
| 8 |
package org.asyrinx.brownie.tapestry.components.layer;
|
|
| 9 |
|
|
| 10 |
import java.util.Map;
|
|
| 11 |
|
|
| 12 |
import org.apache.tapestry.IAsset;
|
|
| 13 |
import org.apache.tapestry.IMarkupWriter;
|
|
| 14 |
import org.apache.tapestry.IRequestCycle;
|
|
| 15 |
|
|
| 16 |
/**
|
|
| 17 |
* @author akima
|
|
| 18 |
*/
|
|
| 19 |
public abstract class Popup extends BaseDesktopComponent { |
|
| 20 |
|
|
| 21 |
/**
|
|
| 22 |
* @param scriptName
|
|
| 23 |
*/
|
|
| 24 | 0 |
public Popup() {
|
| 25 | 0 |
super("Popup.script"); |
| 26 | 0 |
this.setWidth("300"); |
| 27 | 0 |
this.setHeight(null); |
| 28 |
} |
|
| 29 |
|
|
| 30 |
/**
|
|
| 31 |
* @see org.apache.tapestry.AbstractComponent#finishLoad()
|
|
| 32 |
*/
|
|
| 33 | 0 |
protected void finishLoad() { |
| 34 | 0 |
this.setPopdownImage(getAsset("img_popdown")); |
| 35 |
} |
|
| 36 |
|
|
| 37 |
/**
|
|
| 38 |
* @see org.asyrinx.brownie.tapestry.script.AbstractScriptComponent#prepareScriptSymbols(java.util.Map,
|
|
| 39 |
* org.apache.tapestry.IRequestCycle)
|
|
| 40 |
*/
|
|
| 41 | 0 |
public void prepareScriptSymbols(Map symbols, IRequestCycle cycle) { |
| 42 | 0 |
super.prepareScriptSymbols(symbols, cycle);
|
| 43 | 0 |
symbols.put("link_id", getLinkId());
|
| 44 | 0 |
symbols.put("frame", new Integer(getFrame())); |
| 45 | 0 |
symbols.put("interval", new Integer(getInterval())); |
| 46 |
} |
|
| 47 |
|
|
| 48 |
/**
|
|
| 49 |
* @see org.asyrinx.brownie.tapestry.script.AbstractScriptComponent#renderComponent(org.apache.tapestry.IMarkupWriter,
|
|
| 50 |
* org.apache.tapestry.IRequestCycle)
|
|
| 51 |
*/
|
|
| 52 | 0 |
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { |
| 53 | 0 |
checkBeforeRender(writer, cycle); |
| 54 | 0 |
this.scriptWriter.execute(cycle);
|
| 55 |
|
|
| 56 | 0 |
writer.begin("div");
|
| 57 | 0 |
writer.attribute("id", getStyleId());
|
| 58 | 0 |
writer.attribute("style", "VISIBILITY:hidden; " + toStyleValue()); |
| 59 | 0 |
renderInformalParameters(writer, cycle); |
| 60 | 0 |
writer.println(); |
| 61 | 0 |
super.renderComponent(writer, cycle);
|
| 62 | 0 |
writer.end(); |
| 63 |
} |
|
| 64 |
|
|
| 65 |
/**
|
|
| 66 |
* 本当は.scriptの方で加工したいんだけど・・・・・ 無理らしいのでしょうがなくこんな感じに。
|
|
| 67 |
*
|
|
| 68 |
* @return
|
|
| 69 |
*/
|
|
| 70 | 0 |
public String getInvokePopdown() {
|
| 71 | 0 |
return "popdown_btn_" + getStyleId() + "_click()"; |
| 72 |
} |
|
| 73 |
|
|
| 74 |
abstract public String getLinkId();
|
|
| 75 |
|
|
| 76 |
abstract public void setLinkId(String string); |
|
| 77 |
|
|
| 78 |
private int frame = 10; // |
|
| 79 |
|
|
| 80 |
private int interval = 20; // mili-second |
|
| 81 |
|
|
| 82 |
private int cellSpacing = 0; |
|
| 83 |
|
|
| 84 |
private int cellPadding = 0; |
|
| 85 |
|
|
| 86 |
private int border = 0; |
|
| 87 |
|
|
| 88 |
private IAsset popdownImage = null; |
|
| 89 |
|
|
| 90 |
/**
|
|
| 91 |
* @return
|
|
| 92 |
*/
|
|
| 93 | 0 |
public int getFrame() { |
| 94 | 0 |
return frame;
|
| 95 |
} |
|
| 96 |
|
|
| 97 |
/**
|
|
| 98 |
* @return
|
|
| 99 |
*/
|
|
| 100 | 0 |
public int getInterval() { |
| 101 | 0 |
return interval;
|
| 102 |
} |
|
| 103 |
|
|
| 104 |
/**
|
|
| 105 |
* @param i
|
|
| 106 |
*/
|
|
| 107 | 0 |
public void setFrame(int i) { |
| 108 | 0 |
frame = i; |
| 109 |
} |
|
| 110 |
|
|
| 111 |
/**
|
|
| 112 |
* @param i
|
|
| 113 |
*/
|
|
| 114 | 0 |
public void setInterval(int i) { |
| 115 | 0 |
interval = i; |
| 116 |
} |
|
| 117 |
|
|
| 118 |
/**
|
|
| 119 |
* @return
|
|
| 120 |
*/
|
|
| 121 | 0 |
public int getBorder() { |
| 122 | 0 |
return border;
|
| 123 |
} |
|
| 124 |
|
|
| 125 |
/**
|
|
| 126 |
* @return
|
|
| 127 |
*/
|
|
| 128 | 0 |
public int getCellPadding() { |
| 129 | 0 |
return cellPadding;
|
| 130 |
} |
|
| 131 |
|
|
| 132 |
/**
|
|
| 133 |
* @return
|
|
| 134 |
*/
|
|
| 135 | 0 |
public int getCellSpacing() { |
| 136 | 0 |
return cellSpacing;
|
| 137 |
} |
|
| 138 |
|
|
| 139 |
/**
|
|
| 140 |
* @return
|
|
| 141 |
*/
|
|
| 142 | 0 |
public IAsset getPopdownImage() {
|
| 143 | 0 |
return popdownImage;
|
| 144 |
} |
|
| 145 |
|
|
| 146 |
/**
|
|
| 147 |
* @param i
|
|
| 148 |
*/
|
|
| 149 | 0 |
public void setBorder(int i) { |
| 150 | 0 |
border = i; |
| 151 |
} |
|
| 152 |
|
|
| 153 |
/**
|
|
| 154 |
* @param i
|
|
| 155 |
*/
|
|
| 156 | 0 |
public void setCellPadding(int i) { |
| 157 | 0 |
cellPadding = i; |
| 158 |
} |
|
| 159 |
|
|
| 160 |
/**
|
|
| 161 |
* @param i
|
|
| 162 |
*/
|
|
| 163 | 0 |
public void setCellSpacing(int i) { |
| 164 | 0 |
cellSpacing = i; |
| 165 |
} |
|
| 166 |
|
|
| 167 |
/**
|
|
| 168 |
* @param asset
|
|
| 169 |
*/
|
|
| 170 | 0 |
public void setPopdownImage(IAsset asset) { |
| 171 | 0 |
popdownImage = asset; |
| 172 |
} |
|
| 173 |
|
|
| 174 |
} |
|
||||||||||