本文整理汇总了Java中net.sf.memoranda.util.Configuration类的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Configuration类属于net.sf.memoranda.util包,在下文中一共展示了Configuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTable
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
public void initTable(CalendarDate d) {
setModel(new EventsTableModel());
int fDow = Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")?Calendar.MONDAY:Calendar.SUNDAY;
Calendar cal = d.getCalendar();
if(cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY && fDow == Calendar.MONDAY) cal.set(Calendar.DAY_OF_YEAR, cal.get(Calendar.DAY_OF_YEAR)-6);
else
cal.set(Calendar.DAY_OF_WEEK, fDow);
Calendar changeCal = (Calendar)cal.clone();
for(int i = 0;i<7;i++){
changeCal.set(Calendar.DAY_OF_YEAR, i+cal.get(Calendar.DAY_OF_YEAR));
events[i] = new Vector(EventsManager.getEventsForDate(new CalendarDate(changeCal)));
days[i] = (Calendar)changeCal.clone();
}
for(int i = 0;i<getColumnModel().getColumnCount();i++){
getColumnModel().getColumn(i).setPreferredWidth(100);
getColumnModel().getColumn(i).setMaxWidth(100);
}
clearSelection();
updateUI();
}
示例2: doExit
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
public void doExit() {
if (Configuration.get("ASK_ON_EXIT").equals("yes")) {
Dimension frmSize = this.getSize();
Point loc = this.getLocation();
ExitConfirmationDialog dlg = new ExitConfirmationDialog(this,Local.getString("Exit"));
dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x, (frmSize.height - dlg.getSize().height) / 2 + loc.y);
dlg.setVisible(true);
if(dlg.CANCELLED) return;
}
Context.put("FRAME_WIDTH", new Integer(this.getWidth()));
Context.put("FRAME_HEIGHT", new Integer(this.getHeight()));
Context.put("FRAME_XPOS", new Integer(this.getLocation().x));
Context.put("FRAME_YPOS", new Integer(this.getLocation().y));
exitNotify();
System.exit(0);
}
示例3: setCalendarParameters
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
void setCalendarParameters() {
int d = 1;
Calendar cal = _date.getCalendar();
if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
cal.setFirstDayOfWeek(Calendar.MONDAY);
d = 2;
} else
cal.setFirstDayOfWeek(Calendar.SUNDAY);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.getTime();
firstDay = cal.get(Calendar.DAY_OF_WEEK) - d;
if (firstDay == -1)
firstDay = 6;
daysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
}
示例4: setCalendarParameters
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
/**
* Builds calendar based on the first and last day of the week.
*/
void setCalendarParameters() {
int d = 1;
Calendar cal = _date.getCalendar();
if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
cal.setFirstDayOfWeek(Calendar.MONDAY);
d = 2;
} else
cal.setFirstDayOfWeek(Calendar.SUNDAY);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.getTime();
firstDay = cal.get(Calendar.DAY_OF_WEEK) - d;
if (firstDay == -1)
firstDay = 6;
daysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
}
示例5: setLOCcountsForProject
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
/**
* Sets line of code count as JSON in format (ProjID, (Path, LOC)), given project ID and path hashmap
* @param projectID
* @param pathWithLOCCount contains the src path as key, project loc count as value
* @param filePath file path
* @param filePathLOCcount file loc count
*
*/
private static synchronized void setLOCcountsForProject(String projectID, ConcurrentHashMap<String, String> pathWithLOCCount, String filePath, String filePathLOCcount){
java.util.Iterator<String> iter = pathWithLOCCount.keySet().iterator();
String jsonObj = "{";
while(iter.hasNext()){//iterate and construct string in JSON from paths, and LOC count
String key = iter.next();
String value = pathWithLOCCount.get(key).toString();
jsonObj = jsonObj+"\""+key+"\""+":"+"\""+value+"\""+",";
}
if(jsonObj.endsWith(",")){
jsonObj = jsonObj.substring(0,jsonObj.length()-1);
jsonObj = jsonObj+"}";
}
Util.debug("Set Path With LOC: "+jsonObj);
Util.debug("Set File path LOC count: "+filePathLOCcount);
Configuration.put(projectID+filePath, filePathLOCcount); //sets file LOC count to match with projectID+filePath
Configuration.put(projectID, jsonObj);
Configuration.saveConfig();
}
示例6: processWindowEvent
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
if (Configuration.get("ON_CLOSE").equals("exit"))
doExit();
else
doMinimize();
}
// Minimize window fix
/*
else if ((e.getID() == WindowEvent.WINDOW_ICONIFIED)) {
super.processWindowEvent(new WindowEvent(this,
WindowEvent.WINDOW_CLOSING));
doMinimize();
}
else
super.processWindowEvent(e);*/
}
示例7: NotesList
import net.sf.memoranda.util.Configuration; //导入依赖的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(d -> updateUI());
CurrentNote.addNoteListener((n, toSaveCurrentNote) -> updateUI());
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange() {
}
public void projectWasChanged() {
update();
}
});
this.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
}
示例8: setCalendarParameters
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
private void setCalendarParameters() {
int d = 1;
Calendar cal = _date.getCalendar();
if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
cal.setFirstDayOfWeek(Calendar.MONDAY);
d = 2;
} else
cal.setFirstDayOfWeek(Calendar.SUNDAY);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.getTime();
firstDay = cal.get(Calendar.DAY_OF_WEEK) - d;
if (firstDay == -1)
firstDay = 6;
daysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
}
示例9: doExit
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
public void doExit() {
if (Configuration.get("ASK_ON_EXIT").equals("yes")) {
Dimension frmSize = this.getSize();
Point loc = this.getLocation();
ExitConfirmationDialog dlg = new ExitConfirmationDialog(this, Local.getString("Exit"));
dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x,
(frmSize.height - dlg.getSize().height) / 2 + loc.y);
dlg.setVisible(true);
// System.out.println("ask");
if (dlg.CANCELLED) {
// System.out.println("dlg.cancle is true");
return;
}
}
// System.out.println("not ask");
Context.put("FRAME_WIDTH", new Integer(this.getWidth()));
Context.put("FRAME_HEIGHT", new Integer(this.getHeight()));
Context.put("FRAME_XPOS", new Integer(this.getLocation().x));
Context.put("FRAME_YPOS", new Integer(this.getLocation().y));
exitNotify();
System.exit(0);
}
示例10: processWindowEvent
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
@Override
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
if (Configuration.get("ON_CLOSE").equals("exit")) {
// System.out.println("1exit");
doExit();
} else {
// System.out.println("2elseExitWindow");
doExit();
}
} else if ((e.getID() == WindowEvent.WINDOW_ICONIFIED)) {
// super.processWindowEvent(new WindowEvent(this,
// WindowEvent.WINDOW_ICONIFIED));
// System.out.println("3elseIfMin"); // minimize goes here
} else {
// System.out.println("4elseOther--usuallyPopUp&PopDown");
super.processWindowEvent(e);
}
}
示例11: setCalendarParameters
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
void setCalendarParameters() {
int d = 1;
Calendar cal = _date.getCalendar();
if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
cal.setFirstDayOfWeek(Calendar.MONDAY);
d = 2;
} else {
cal.setFirstDayOfWeek(Calendar.SUNDAY);
}
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.getTime();
firstDay = cal.get(Calendar.DAY_OF_WEEK) - d;
if (firstDay == -1) {
firstDay = 6;
}
daysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
}
示例12: processWindowEvent
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
if (Configuration.get("ON_CLOSE").equals("exit"))
doExit();
else
doMinimize();
}
else if ((e.getID() == WindowEvent.WINDOW_ICONIFIED)
&& Configuration.get("ON_MINIMIZE").equals("systray")
&& !App.sysTrayDisabled) {
super.processWindowEvent(new WindowEvent(this,
WindowEvent.WINDOW_CLOSING));
doMinimize();
}
else
super.processWindowEvent(e);
}
示例13: processWindowEvent
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
if (Configuration.get("ON_CLOSE").equals("exit"))
doExit();
else
doMinimize();
}
else if ((e.getID() == WindowEvent.WINDOW_ICONIFIED)) {
super.processWindowEvent(new WindowEvent(this,
WindowEvent.WINDOW_CLOSING));
doMinimize();
}
else
super.processWindowEvent(e);
}
示例14: ppInvertSort_actionPerformed
import net.sf.memoranda.util.Configuration; //导入依赖的package包/类
void ppInvertSort_actionPerformed(ActionEvent e) {
Configuration.put(
"NOTES_SORT_ORDER",
new Boolean(ppInvertSort.isSelected()));
Configuration.saveConfig();
notesList.invertSortOrder();
notesList.update();
}
示例15: NotesList
import net.sf.memoranda.util.Configuration; //导入依赖的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);
}