本文整理汇总了Java中net.sf.memoranda.CurrentNote类的典型用法代码示例。如果您正苦于以下问题:Java CurrentNote类的具体用法?Java CurrentNote怎么用?Java CurrentNote使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CurrentNote类属于net.sf.memoranda包,在下文中一共展示了CurrentNote类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: previewB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
void previewB_actionPerformed(ActionEvent e) {
File f;
try {
f = Util.getTempFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), "UTF-8",
false, null, false);
Util.runBrowser("file:" + f.getAbsolutePath());
} catch (IOException ioe) {
new ExceptionDialog(ioe, "Cannot create temporary file", null);
}
}
示例2: currentDateChanged
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
void currentDateChanged(CalendarDate newdate) {
Cursor cur = App.getFrame().getCursor();
App.getFrame().setCursor(waitCursor);
if (!changedByHistory) {
History.add(new HistoryItem(newdate, CurrentProject.get()));
}
if (!dateChangedByCalendar) {
calendarIgnoreChange = true;
calendar.set(newdate);
calendarIgnoreChange = false;
}
/*if ((currentNote != null) && !changedByHistory && !addedToHistory)
History.add(new HistoryItem(currentNote));*/
currentNoteChanged(currentNote,true);
currentNote = CurrentProject.getNoteList().getNoteForDate(newdate);
CurrentNote.set(currentNote,true);
currentDate = CurrentDate.get();
/*addedToHistory = false;
if (!changedByHistory) {
if (currentNote != null) {
History.add(new HistoryItem(currentNote));
addedToHistory = true;
}
}*/
currentDateLabel.setText(newdate.getFullDateString());
if ((currentNote != null) && (currentNote.isMarked())) {
currentDateLabel.setIcon(bookmarkIcon);
currentDateLabel.setHorizontalTextPosition(SwingConstants.LEFT);
}
else {
currentDateLabel.setIcon(null);
}
updateIndicators(newdate, CurrentProject.getTaskList());
App.getFrame().setCursor(cur);
}
示例3: NotesList
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public NotesList(int type) {
super();
if(Configuration.get("NOTES_SORT_ORDER").toString().equalsIgnoreCase("true")) {
sortOrderDesc = true;
}
_type = type;
this.setFont(new java.awt.Font("Dialog", 0, 11));
this.setModel(new NotesListModel());
CurrentDate.addDateListener(new DateListener() {
public void dateChange(CalendarDate d) {
updateUI();
}
});
CurrentNote.addNoteListener(new NoteListener() {
public void noteChange(Note n, boolean toSaveCurrentNote) {
updateUI();
}
});
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, ResourcesList rl) {
}
public void projectWasChanged() {
update();
}
});
this.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
}
示例4: getCellRenderer
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public ListCellRenderer getCellRenderer() {
return new DefaultListCellRenderer() {
public Component getListCellRendererComponent(
JList list,
Object value, // value to display
int index, // cell index
boolean isSelected, // is the cell selected
boolean cellHasFocus) // the list and the cell have the focus
{
JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
String s = value.toString();
label.setText(s);
//Note currentNote = CurrentProject.getNoteList().getActiveNote();
Note currentNote = CurrentNote.get();
if (currentNote != null) {
if (getNote(index).getId().equals(currentNote.getId()))
label.setFont(label.getFont().deriveFont(Font.BOLD));
}
if (getNote(index).isMarked())
label.setIcon(bookmarkIcon);
//setIcon();
/*if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
setEnabled(list.isEnabled());
setFont(list.getFont());
setOpaque(true);*/
label.setToolTipText(s);
return label;
}
};
}
示例5: previewB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
void previewB_actionPerformed(ActionEvent e) {
File f;
try {
f = Util.getTempFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), "UTF-8",
false, null, false);
Util.runBrowser("file:" + f.getAbsolutePath().replace("\\", "/"));
} catch (IOException ioe) {
new ExceptionDialog(ioe, "Cannot create temporary file", null);
}
}
示例6: currentDateChanged
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
/**
* If the date is changed it updates the display.
* @param newdate
*/
void currentDateChanged(CalendarDate newdate) {
Cursor cur = App.getFrame().getCursor();
App.getFrame().setCursor(waitCursor);
if (!changedByHistory) {
History.add(new HistoryItem(newdate, CurrentProject.get()));
}
if (!dateChangedByCalendar) {
calendarIgnoreChange = true;
calendar.set(newdate);
calendarIgnoreChange = false;
}
/*if ((currentNote != null) && !changedByHistory && !addedToHistory)
History.add(new HistoryItem(currentNote));*/
currentNoteChanged(currentNote,true);
currentNote = CurrentProject.getNoteList().getNoteForDate(newdate);
CurrentNote.set(currentNote,true);
currentDate = CurrentDate.get();
/*addedToHistory = false;
if (!changedByHistory) {
if (currentNote != null) {
History.add(new HistoryItem(currentNote));
addedToHistory = true;
}
}*/
currentDateLabel.setText(newdate.getFullDateString());
if ((currentNote != null) && (currentNote.isMarked())) {
currentDateLabel.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.STAR, 8, ColorMap.ICON));
currentDateLabel.setHorizontalTextPosition(SwingConstants.LEFT);
}
else {
currentDateLabel.setIcon(null);
}
updateIndicators(newdate, CurrentProject.getTaskList());
App.getFrame().setCursor(cur);
}
示例7: NotesList
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public NotesList(int type) {
super();
if(Configuration.get("NOTES_SORT_ORDER").toString().equalsIgnoreCase("true")) {
sortOrderDesc = true;
}
_type = type;
this.setFont(new java.awt.Font("Dialog", 0, 11));
this.setModel(new NotesListModel());
CurrentDate.addDateListener(new DateListener() {
public void dateChange(CalendarDate d) {
updateUI();
}
});
CurrentNote.addNoteListener(new NoteListener() {
public void noteChange(Note n, boolean toSaveCurrentNote) {
updateUI();
}
});
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, ResourcesList rl) {
}
public void projectWasChanged() {
update();
}
});
this.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
}
示例8: getCellRenderer
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public ListCellRenderer getCellRenderer() {
return new DefaultListCellRenderer() {
public Component getListCellRendererComponent(
JList list,
Object value, // value to display
int index, // cell index
boolean isSelected, // is the cell selected
boolean cellHasFocus) // the list and the cell have the focus
{
JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
String s = value.toString();
label.setText(s);
//Note currentNote = CurrentProject.getNoteList().getActiveNote();
Note currentNote = CurrentNote.get();
if (currentNote != null) {
if (getNote(index).getId().equals(currentNote.getId()))
label.setFont(label.getFont().deriveFont(Font.BOLD));
}
if (getNote(index).isMarked())
label.setIcon(IconFontSwing.buildIcon(GoogleMaterialDesignIcons.STAR, 8, ColorMap.ICON));
//setIcon();
/*if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
setEnabled(list.isEnabled());
setFont(list.getFont());
setOpaque(true);*/
label.setToolTipText(s);
return label;
}
};
}
示例9: NotesList
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public NotesList(int type) {
super();
if(Configuration.get("NOTES_SORT_ORDER").toString().equalsIgnoreCase("true")) {
sortOrderDesc = true;
}
_type = type;
this.setFont(new java.awt.Font("Dialog", 0, 11));
this.setModel(new NotesListModel());
CurrentDate.addDateListener(new DateListener() {
public void dateChange(CalendarDate d) {
updateUI();
}
});
CurrentNote.addNoteListener(new NoteListener() {
public void noteChange(Note n, boolean toSaveCurrentNote) {
updateUI();
}
});
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, TimeLogList tll, ResourcesList rl) {
}
public void projectWasChanged() {
update();
}
});
this.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
}
示例10: currentDateChanged
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
void currentDateChanged(CalendarDate newdate) {
Cursor cur = App.getFrame().getCursor();
App.getFrame().setCursor(waitCursor);
if (!changedByHistory) {
History.add(new HistoryItem(newdate, CurrentProject.get()));
}
if (!dateChangedByCalendar) {
calendarIgnoreChange = true;
calendar.set(newdate);
calendarIgnoreChange = false;
}
/*if ((currentNote != null) && !changedByHistory && !addedToHistory)
History.add(new HistoryItem(currentNote));*/
currentNoteChanged(currentNote,true);
currentNote = CurrentProject.getNoteList().getNoteForDate(newdate);
CurrentNote.set(currentNote,true);
currentDate = CurrentDate.get();
/*addedToHistory = false;
if (!changedByHistory) {
if (currentNote != null) {
History.add(new HistoryItem(currentNote));
addedToHistory = true;
}
}*/
currentDateLabel.setText(newdate.getFullDateString());
updateFullDateFormat();//Test
if ((currentNote != null) && (currentNote.isMarked())) {
currentDateLabel.setIcon(bookmarkIcon);
currentDateLabel.setHorizontalTextPosition(SwingConstants.LEFT);
}
else {
currentDateLabel.setIcon(null);
}
updateIndicators(newdate, CurrentProject.getTaskList());
App.getFrame().setCursor(cur);
}
示例11: newNoteCap
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public void newNoteCap(){
CurrentNote.set(null, true);
setDocument(null);
this.titleField.requestFocus();
this.tagsField.requestFocus();
}
示例12: ppClearNote_actionPerformed
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
void ppClearNote_actionPerformed(ActionEvent e) {
String msg;
if (notesList.getSelectedIndices().length > 1)
msg = Local.getString(Local.getString("Clear")) + " " + notesList.getSelectedIndices().length + " "
+ Local.getString("notes") + "\n" + Local.getString("Are you sure?");
else
msg = Local.getString("Clear note") + "\n'"
+ ((Note) notesList.getNote(notesList.getSelectedIndex())).getDate().getFullDateString() + "'\n"
+ Local.getString("Are you sure?");
int n = JOptionPane.showConfirmDialog(App.getFrame(), msg, Local.getString("Clear note"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION)
return;
for (int i = 0; i < notesList.getSelectedIndices().length; i++) {
Note note = (Note) notesList.getNote(notesList.getSelectedIndices()[i]);
if (CurrentProject.getNoteList().getActiveNote() != null
&& note.getDate().equals(CurrentProject.getNoteList().getActiveNote().getDate())) {
/* Debug */ System.out.println("[DEBUG] Current note removed");
CurrentNote.set(null, true);
}
CurrentProject.getNoteList().removeNote(note.getDate(), note.getId());
CurrentStorage.get().removeNote(note);
}
bookmarksListPanel.notesList.update();
searchPanel.notesList.update();
notesListPanel.notesList.update();
notesList.updateUI();
notesList.clearSelection();
// notesList.requestFocus();*/
// ((AppFrame)App.getFrame()).workPanel.dailyItemsPanel.editorPanel.editor.requestFocus();
}
示例13: NotesList
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public NotesList(int type) {
super();
if(Configuration.get("NOTES_SORT_ORDER").toString().equalsIgnoreCase("true")) {
sortOrderDesc = true;
}
_type = type;
this.setFont(new java.awt.Font("Dialog", 0, 11));
this.setModel(new NotesListModel());
CurrentDate.addDateListener(new DateListener() {
public void dateChange(CalendarDate d) {
updateUI();
}
});
CurrentNote.addNoteListener(new NoteListener() {
public void noteChange(Note n, boolean toSaveCurrentNote) {
updateUI();
}
});
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, ResourcesList rl, PSP psp) {
}
public void projectWasChanged() {
update();
}
});
this.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
}
示例14: previewB_actionPerformed
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
private void previewB_actionPerformed() {
File f;
try {
f = Util.getTempFile();
new HTMLFileExport(f, editor.document, CurrentNote.get(), "UTF-8",
false, null, false);
Util.runBrowser("file:" + f.getAbsolutePath());
} catch (IOException ioe) {
new ExceptionDialog(ioe, "Cannot create temporary file", null);
}
}
示例15: NotesList
import net.sf.memoranda.CurrentNote; //导入依赖的package包/类
public NotesList(int type) {
super();
if(Configuration.get("NOTES_SORT_ORDER").toString().equalsIgnoreCase("true")) {
sortOrderDesc = true;
}
_type = type;
this.setFont(new java.awt.Font("Dialog", 0, 11));
this.setModel(new NotesListModel());
CurrentDate.addDateListener(new DateListener() {
public void dateChange(CalendarDate d) {
updateUI();
}
});
CurrentNote.addNoteListener(new NoteListener() {
public void noteChange(Note n, boolean toSaveCurrentNote) {
updateUI();
}
});
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl, DefectList dl, ResourcesList rl) {
}
public void projectWasChanged() {
update();
}
});
this.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
}