本文整理汇总了Java中net.sf.memoranda.EventsManager.getStickers方法的典型用法代码示例。如果您正苦于以下问题:Java EventsManager.getStickers方法的具体用法?Java EventsManager.getStickers怎么用?Java EventsManager.getStickers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.EventsManager
的用法示例。
在下文中一共展示了EventsManager.getStickers方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sortStickers
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
private static PriorityQueue sortStickers(){
Map stickers = EventsManager.getStickers();
PriorityQueue pQ = new PriorityQueue(stickers.size());
for (Iterator i = stickers.keySet().iterator(); i.hasNext();) {
String id = (String)i.next();
Element el = (Element)stickers.get(id);
int j=2;
j=Integer.parseInt(el.getAttributeValue("priority"));
pQ.insertar(new Pair(el,j));
}
return pQ;
}
示例2: getSticker
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
public String getSticker(){
Map stickers = EventsManager.getStickers();
String result = "";
String nl = System.getProperty("line.separator");
for (Iterator i = stickers.keySet().iterator(); i.hasNext();) {
String id = (String)i.next();
result += (String)(((Element)stickers.get(id)).getValue())+nl;
}
return result;
}
示例3: sortStickers
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
private static PriorityQueue sortStickers() {
Map stickers = EventsManager.getStickers();
PriorityQueue pQ = new PriorityQueue(stickers.size());
for (Iterator i = stickers.keySet().iterator(); i.hasNext();) {
String id = (String) i.next();
Element el = (Element) stickers.get(id);
int j = 2;
j = Integer.parseInt(el.getAttributeValue("priority"));
pQ.insertar(new Pair(el, j));
}
return pQ;
}
示例4: testStickerExpiration
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
//This will require
public void testStickerExpiration() {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date expirationDate = new Date();
//The 12 is for font size.
String orig = "This sticker should not exist; it is a monument to man's arrogance.";
int sP = 0;
String txt = ("<div style=\"background-color:"+
"0"+";font-size:"+
"12"+";color:"+
"FFFFFF"+"; \">" + orig+
"</div>");
EventsManager.createSticker(txt, sP, expirationDate);
//FileStorage.JN_DOCPATH = FileStorage.JN_DOCPATH + "/ExpirationStickerTest";
CurrentStorage.get().storeEventsManager();
Map stickers = EventsManager.getStickers();
String raw_sticker;
String stickerText;
int first;
int last;
Iterator i = stickers.entrySet().iterator();
while (i.hasNext()){
Entry stickerEntry = (Entry) i.next();
raw_sticker = (String) ((Element)stickerEntry.getValue()).getValue();
stickerText = getOriginalStickerText(raw_sticker);
System.out.println(stickerText);
//Should never load a sticker with the same text as the original
assertFalse(stickerText.compareTo(orig) == 0);
}
}
示例5: testStickerPermanance
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
public void testStickerPermanance() {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
//Date expirationDate = new Date();
//The 12 is for font size.
String orig = "This sticker will live forever.";
int sP = 0;
String txt = ("<div style=\"background-color:"+
"0"+";font-size:"+
"12"+";color:"+
"FFFFFF"+"; \">" + orig+
"</div>");
EventsManager.createSticker(txt, sP, null);
//FileStorage.JN_DOCPATH = FileStorage.JN_DOCPATH + "/ExpirationStickerTest";
CurrentStorage.get().storeEventsManager();
Map stickers = EventsManager.getStickers();
String raw_sticker;
String stickerText;
int first;
int last;
Iterator i = stickers.entrySet().iterator();
boolean success = false;
while (i.hasNext()){
Entry stickerEntry = (Entry) i.next();
raw_sticker = (String)((Element)stickerEntry.getValue()).getValue();
stickerText = getOriginalStickerText(raw_sticker);
System.out.println(stickerText);
//Should never load a sticker with the same text as the original
if (stickerText.compareTo(orig) == 0) {
success = true;
break;
}
}
assertTrue(success);
}
示例6: testStickerNotDeadYet
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
public void testStickerNotDeadYet() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date expirationDate = sdf.parse("31/03/2018");
//The 12 is for font size.
String orig = "Memento Mori";
int sP = 0;
String txt = ("<div style=\"background-color:"+
"0"+";font-size:"+
"12"+";color:"+
"FFFFFF"+"; \">" + orig+
"</div>");
EventsManager.createSticker(txt, sP, expirationDate);
//FileStorage.JN_DOCPATH = FileStorage.JN_DOCPATH + "/ExpirationStickerTest";
CurrentStorage.get().storeEventsManager();
Map stickers = EventsManager.getStickers();
String raw_sticker;
String stickerText;
int first;
int last;
Iterator i = stickers.entrySet().iterator();
boolean success = false;
while (i.hasNext()){
Entry stickerEntry = (Entry) i.next();
raw_sticker = (String) ((Element)stickerEntry.getValue()).getValue();
stickerText = getOriginalStickerText(raw_sticker);
System.out.println(stickerText);
//Should never load a sticker with the same text as the original
if (stickerText.compareTo(orig) == 0) {
success = true;
break;
}
}
assertTrue(success);
}
示例7: getSticker
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
public String getSticker(){
Map stickers = EventsManager.getStickers();
String result = "";
StringBuffer buf = new StringBuffer();
String nl = System.getProperty("line.separator");
for (Iterator i = stickers.keySet().iterator(); i.hasNext();) {
String id = (String)i.next();
//FIND BUGS FIX
//result += (String)(((Element)stickers.get(id)).getValue())+nl;
buf.append((String)(((Element)stickers.get(id)).getValue())+nl);
}
return result = buf.toString();
}
示例8: getSticker
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
private String getSticker() {
Map stickers = EventsManager.getStickers();
StringBuilder result = new StringBuilder();
String nl = System.getProperty("line.separator");
for (Object o : stickers.keySet()) {
String id = (String) o;
result.append(((Element) stickers.get(id)).getValue());
result.append(nl);
}
return result.toString();
}