本文整理汇总了Java中net.sf.memoranda.Project类的典型用法代码示例。如果您正苦于以下问题:Java Project类的具体用法?Java Project怎么用?Java Project使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Project类属于net.sf.memoranda包,在下文中一共展示了Project类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTreeCellRendererComponent
import net.sf.memoranda.Project; //导入依赖的package包/类
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
boolean expanded, boolean leaf, int row, boolean hasFocus) {
// if root then just return some component
// it is not shown anyway
super.getTreeCellRendererComponent(
tree, value, selected,
expanded, leaf, row,
hasFocus);
if (value instanceof Project)
return empty_panel;
if (!(value instanceof Task))
return empty_panel;
Task t = (Task) value;
setText(t.getText());
setToolTipText(t.getDescription());
setIcon(getStatusIcon(t));
applyFont(t, this);
//return getTaskTreeCellRenderer(t, selected, hasFocus);
return this;
}
示例2: ResourcesTable
import net.sf.memoranda.Project; //导入依赖的package包/类
public ResourcesTable() {
super();
initTable();
sorter = new TableSorter(new ResourcesTableModel());
sorter.addMouseListenerToHeaderInTable(this);
setModel(sorter);
this.setShowGrid(false);
this.setFont(new Font("Dialog",0,11));
initColumsWidth();
//this.setModel(new ResourcesTableModel());
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, ResourcesList rl) {
}
public void projectWasChanged() {
tableChanged();
}
});
}
示例3: openNoteList
import net.sf.memoranda.Project; //导入依赖的package包/类
/**
* @see net.sf.memoranda.util.Storage#openNoteList(net.sf.memoranda.Project)
*/
public NoteList openNoteList(Project prj) {
String fn = JN_DOCPATH + prj.getID() + File.separator + ".notes";
if (documentExists(fn)) {
/*DEBUG*/
System.out.println(
"[DEBUG] Open note list: "
+ JN_DOCPATH
+ prj.getID()
+ File.separator
+ ".notes");
return new NoteListImpl(openDocument(fn), prj);
}
else {
/*DEBUG*/
System.out.println("[DEBUG] New note list created");
return new NoteListImpl(prj);
}
}
示例4: generateAllProjectsInfo
import net.sf.memoranda.Project; //导入依赖的package包/类
static String generateAllProjectsInfo(CalendarDate date, Collection expandedTasks) {
String s =
"<td width=\"66%\" valign=\"top\">"
+ "<h1>"
+ Local.getString("Projects and tasks")
+ "</h1>\n";
s += generateProjectInfo(CurrentProject.get(), date, expandedTasks);
for (Iterator i = ProjectManager.getActiveProjects().iterator();
i.hasNext();
) {
Project p = (Project) i.next();
if (!p.getID().equals(CurrentProject.get().getID()))
s += generateProjectInfo(p, date, expandedTasks);
}
return s + "</td>";
}
示例5: currentProjectChanged
import net.sf.memoranda.Project; //导入依赖的package包/类
void currentProjectChanged(Project newprj, NoteList nl, TaskList tl, ResourcesList rl) {
// Util.debug("currentProjectChanged");
Cursor cur = App.getFrame().getCursor();
App.getFrame().setCursor(waitCursor);
if (!changedByHistory)
History.add(new HistoryItem(CurrentDate.get(), newprj));
if (editorPanel.isDocumentChanged())
saveNote();
/*if ((currentNote != null) && !changedByHistory && !addedToHistory)
History.add(new HistoryItem(currentNote));*/
notesControlPane.refresh();
eventsControlPane.refresh();
CurrentProject.save();
/*addedToHistory = false;
if (!changedByHistory) {
if (currentNote != null) {
History.add(new HistoryItem(currentNote));
addedToHistory = true;
}
}*/
updateIndicators(CurrentDate.get(), tl);
App.getFrame().setCursor(cur);
}
示例6: ResourcesTable
import net.sf.memoranda.Project; //导入依赖的package包/类
/**
* Initialize resources table.
*/
public ResourcesTable() {
super();
initTable();
sorter = new TableSorter(new ResourcesTableModel());
sorter.addMouseListenerToHeaderInTable(this);
setModel(sorter);
this.setShowGrid(false);
this.setFont(new Font("Dialog",0,11));
initColumsWidth();
//this.setModel(new ResourcesTableModel());
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, ResourcesList rl) {
}
public void projectWasChanged() {
tableChanged();
}
});
}
示例7: getStatusString
import net.sf.memoranda.Project; //导入依赖的package包/类
String getStatusString(int status) {
switch (status) {
case Project.ACTIVE :
return Local.getString("Active");
case Project.COMPLETED :
return Local.getString("Completed");
case Project.FAILED :
return Local.getString("Failed");
case Project.FROZEN :
return Local.getString("Frozen");
case Project.SCHEDULED :
return Local.getString("Scheduled");
default:
return "";
}
}
示例8: openNoteList
import net.sf.memoranda.Project; //导入依赖的package包/类
/**
* @see net.sf.memoranda.util.Storage#openNoteList(net.sf.memoranda.Project)
*/
public NoteList openNoteList(Project prj) {
String fn = JN_DOCPATH + prj.getID() + File.separator + ".notes";
if (documentExists(fn)) {
Util.debug(
"Open note list: "
+ JN_DOCPATH
+ prj.getID()
+ File.separator
+ ".notes");
return new NoteListImpl(openDocument(fn), prj);
}
else {
Util.debug("New note list created");
return new NoteListImpl(prj);
}
}
示例9: noteToDocument
import net.sf.memoranda.Project; //导入依赖的package包/类
private Document noteToDocument(Note note, String noteHtmlContents) {
Document d = new Document ();
String id = note.getId ();
Project project = note.getProject();
String projectId = project.getID();
String projectName = project.getTitle();
String title = note.getTitle ();
String date = note.getDate() != null ? new SimpleDateFormat ("yyyy-MM-dd").format(note.getDate().getDate()) : null;
d.add (new StringField ("id", id, Field.Store.YES));
d.add (new StringField ("project_id", projectId, Field.Store.YES));
d.add (new StoredField ("project_name", projectName));
d.add (new TextField ("title", title, Field.Store.YES));
d.add (new TextField ("title_cs", title, Field.Store.YES));
d.add (new TextField ("date", date != null ? date : "", Field.Store.YES));
d.add (new TextField ("body", noteHtmlContents, Field.Store.YES));
return d;
}
示例10: fillPSPFields
import net.sf.memoranda.Project; //导入依赖的package包/类
private void fillPSPFields(Project prj, ProjectDialog dlg) {
String getPrjLOCcount = "";
ProjectLOCHandler projectLOCHandler = new ProjectLOCHandler(prj.getID());
dlg.showPSPAttrs();
getPrjLOCcount = new ProjectLOCHandler(prj.getID()).getProjectLOC();
dlg.estimatedTime.setText(((PSPProject)prj).getPSPAttr("estimatedTime"));
dlg.estimatedSize.setText(Local.getString(((PSPProject)prj).getPSPAttr("estimatedSize")));
dlg.totalTime.setText(Local.getString(((PSPProject) prj).getPSPAttr("totalTime")));
dlg.totalDefectsInjected.setText(Integer.toString(CurrentProject.getTaskList().calculateTotalInjectedDefects()));
dlg.totalDefectsRemoved.setText(Local.getString(((PSPProject) prj).getPSPAttr("totalDefectsRemoved")));
dlg.totalLocCountField.setText(projectLOCHandler.getProjectLOC());
dlg.defectLocRatioField.setText(Double.toString(CurrentProject.getTaskList().calculateInjecteDefectsToLocRatio()));
// dlg.programSize.setText(Local.getString(((PSPProject) prj).getPSPAttr("programSize")));
Util.debug("LOC set up to UI : "+ getPrjLOCcount);
}
示例11: getTreeCellRendererComponent
import net.sf.memoranda.Project; //导入依赖的package包/类
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
boolean expanded, boolean leaf, int row, boolean hasFocus) {
// if root then just return some component
// it is not shown anyway
super.getTreeCellRendererComponent(
tree, value, selected,
expanded, leaf, row,
hasFocus);
if (value instanceof Project)
return empty_panel;
if (!(value instanceof TimeLog))
return empty_panel;
TimeLog tl = (TimeLog) value;
setText(tl.getTimeLogTask());
setToolTipText(tl.getDescription());
return this;
}
示例12: expandRecursively
import net.sf.memoranda.Project; //导入依赖的package包/类
/**
* @param t
* @param expandedTasks
*/
private static String expandRecursively(Project p,CalendarDate date, TaskList tl,Task t, Collection expandedTasks, int level) {
Util.debug("Expanding task " + t.getText() + " level " + level);
Collection st = tl.getActiveSubTasks(t.getID(),date);
Util.debug("number of subtasks " + st.size());
String s = "\n<ul>\n";
for (Iterator iter = st.iterator(); iter.hasNext();) {
Task subTask = (Task) iter.next();
// if(Context.get("SHOW_ACTIVE_TASKS_ONLY").equals(new Boolean(true))) {
// if (!((subTask.getStatus() == Task.ACTIVE) || (subTask.getStatus() == Task.DEADLINE) || (subTask.getStatus() == Task.FAILED))) {
// continue;
// }
// }
s = s + renderTask(p,date,tl,subTask,level,expandedTasks);
if (expandedTasks.contains(subTask.getID())) {
s = s + expandRecursively(p,date,tl,subTask,expandedTasks,level + 1);
}
}
s += "\n</ul>\n";
return s;
}
示例13: addTagToProject
import net.sf.memoranda.Project; //导入依赖的package包/类
public static boolean addTagToProject(String tag, Project prj) {
if (tag==null || prj == null) return false;
tag = tag.toLowerCase();
try{
if (!tags.contains(tag)) {
tags.add(tag);
}
return prj.addTag(tag);
}
catch(Exception e){
Util.error(e);
return false;
}
}
示例14: removeTagFromProject
import net.sf.memoranda.Project; //导入依赖的package包/类
public static boolean removeTagFromProject(String tag, Project prj) {
if (tag==null || prj==null) return false;
tag = tag.toLowerCase();
try {
if (!tags.contains(tag)) {
return false;
}
return prj.removeTag(tag);
} catch (Exception e) {
Util.error(e);
return false;
}
}
示例15: createProjectStorage
import net.sf.memoranda.Project; //导入依赖的package包/类
/**
* @see net.sf.memoranda.util.Storage#createProjectStorage(net.sf.memoranda.Project)
*/
public void createProjectStorage(Project prj) {
/*DEBUG*/
System.out.println(
"[DEBUG] Create project dir: " + JN_DOCPATH + prj.getID());
File dir = new File(JN_DOCPATH + prj.getID());
dir.mkdirs();
}