当前位置: 首页>>代码示例>>Java>>正文


Java Context类代码示例

本文整理汇总了Java中net.sf.memoranda.util.Context的典型用法代码示例。如果您正苦于以下问题:Java Context类的具体用法?Java Context怎么用?Java Context使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Context类属于net.sf.memoranda.util包,在下文中一共展示了Context类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doExit

import net.sf.memoranda.util.Context; //导入依赖的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);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:19,代码来源:AppFrame.java

示例2: stickerColor_actionPerformed

import net.sf.memoranda.util.Context; //导入依赖的package包/类
void stickerColor_actionPerformed(ActionEvent e) {
	int i=stickerColor.getSelectedIndex();
	if (i< colors.length){
		if(i!=textColor.getSelectedIndex()){
			stickerText.setBackground(colors[i]);
			stickerColor.setSelectedIndex(i);
		}
		else{
			stickerColor.setSelectedIndex(i+1);
			stickerText.setBackground(colors[i+1]);
			JOptionPane.showMessageDialog(this, Local.getString("SAME BACKGROUND COLOR"), "Error", 0);
		}
		stickerText.setForeground(colors[textColor.getSelectedIndex()]);
	}
	else {
		Color c =
			JColorChooser.showDialog(
				this,
				Local.getString("Sticker color"),
				stickerText.getBackground());
		if (c != null)
			stickerText.setBackground(c);
	}
	Context.put("STICKER_COLOR", new Integer(stickerText.getBackground().getRGB()));
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:26,代码来源:StickerDialog.java

示例3: textColor_actionPerformed

import net.sf.memoranda.util.Context; //导入依赖的package包/类
void textColor_actionPerformed(ActionEvent e) {
	int i=textColor.getSelectedIndex();
	if (i < colors.length){
		if(i!=stickerColor.getSelectedIndex()){
			stickerText.setForeground(colors[i]);
			textColor.setSelectedIndex(i);
		}
		else{
			textColor.setSelectedIndex(i+1);
			stickerText.setForeground(colors[i+1]);
			JOptionPane.showMessageDialog(this, Local.getString("SAME FOREGROUND COLOR"), "Error", 0);
		}
		stickerText.setForeground(colors[textColor.getSelectedIndex()]);
	}
	else {
		Color c =
			JColorChooser.showDialog(
				this,
				Local.getString("Text color"),
				stickerText.getForeground());
		if (c != null)
			stickerText.setForeground(c);
	}
	Context.put("TEXT_COLOR", new Integer(stickerText.getForeground().getRGB()));		
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:26,代码来源:StickerDialog.java

示例4: set

import net.sf.memoranda.util.Context; //导入依赖的package包/类
public static void set(Project project) {
    if (project.getID().equals(_project.getID())) return;
    TaskList newtasklist = CurrentStorage.get().openTaskList(project);
    //CommitList newcommitlist = CurrentStorage.get().openCommitList(project); Will implement once Jason merges Commit.java and CommitImpl.java
    NoteList newnotelist = CurrentStorage.get().openNoteList(project);
    ResourcesList newresources = CurrentStorage.get().openResourcesList(project);
    TimeLogList newtimeloglist = CurrentStorage.get().openTimeLogList(project);
    notifyListenersBefore(project, newnotelist, newtasklist, newtimeloglist, newresources);
    _project = project;
    //_commitlist = newcommitlist; Will implement once Jason merges Commit.java and CommitImpl.java
    _tasklist = newtasklist;
    _notelist = newnotelist;
    _resources = newresources;
    _timeloglist = newtimeloglist;
    notifyListenersAfter();
    Context.put("LAST_OPENED_PROJECT_ID", project.getID());
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:18,代码来源:CurrentProject.java

示例5: set

import net.sf.memoranda.util.Context; //导入依赖的package包/类
public static void set(Project project) {
	if (project.getID().equals(_project.getID()))
		return;
	TaskList newtasklist = CurrentStorage.get().openTaskList(project);
	NoteList newnotelist = CurrentStorage.get().openNoteList(project);
	ResourcesList newresources = CurrentStorage.get().openResourcesList(project);
	PSP newpsp = CurrentStorage.get().openPSP(project);
	notifyListenersBefore(project, newnotelist, newtasklist, newresources, newpsp);
	_project = project;
	_tasklist = newtasklist;
	_notelist = newnotelist;
	_resources = newresources;
	_psp = newpsp;
	notifyListenersAfter();
	Context.put("LAST_OPENED_PROJECT_ID", project.getID());
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:17,代码来源:CurrentProject.java

示例6: set

import net.sf.memoranda.util.Context; //导入依赖的package包/类
public static void set(Project project) {
    if (project.getID().equals(_project.getID())) return;
    TaskList newtasklist = CurrentStorage.get().openTaskList(project);
    NoteList newnotelist = CurrentStorage.get().openNoteList(project);
    ResourcesList newresources = CurrentStorage.get().openResourcesList(project);
    notifyListenersBefore(project, newnotelist, newtasklist, newresources);
    _project = project;
    _tasklist = newtasklist;
    _notelist = newnotelist;
    _resources = newresources;
    notifyListenersAfter();
    Context.put("LAST_OPENED_PROJECT_ID", project.getID());
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:14,代码来源:CurrentProject.java

示例7: fontSize_actionPerformed

import net.sf.memoranda.util.Context; //导入依赖的package包/类
protected void fontSize_actionPerformed(ActionEvent e) {
int i=fontSize.getSelectedIndex();
if (i < fontLabels.length){
	Font f= stickerText.getFont();
	stickerText.setFont(new Font(f.getFontName(), f.PLAIN, (i*5)+10));
}
fontSize.setSelectedIndex(i);
Context.put("TEXT_SIZE", new Integer(stickerText.getFont().getSize()));		
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:10,代码来源:StickerDialog.java

示例8: set

import net.sf.memoranda.util.Context; //导入依赖的package包/类
public static void set(Project project) {
	Palette.setPalette(project.getColor());
    if (project.getID().equals(_project.getID())) return;
    TaskList newtasklist = CurrentStorage.get().openTaskList(project);
    NoteList newnotelist = CurrentStorage.get().openNoteList(project);
    ResourcesList newresources = CurrentStorage.get().openResourcesList(project);
    notifyListenersBefore(project, newnotelist, newtasklist, newresources);
    _project = project;
    _tasklist = newtasklist;
    _notelist = newnotelist;
    _resources = newresources;
    notifyListenersAfter();
    Context.put("LAST_OPENED_PROJECT_ID", project.getID());
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:15,代码来源:CurrentProject.java

示例9: doExit

import net.sf.memoranda.util.Context; //导入依赖的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));
    
  //JOSH MADE A CHANGE
    /**
	 * 
	 * Tried this to see if commenting 
	 * these lines out. 
	 * It did not work. 
	 * 
	 */
    
    exitNotify();
    System.exit(0);
}
 
开发者ID:ser316asu,项目名称:SER316-Ingolstadt,代码行数:29,代码来源:AppFrame.java

示例10: set

import net.sf.memoranda.util.Context; //导入依赖的package包/类
public static void set(Project project) {
    if (project.getID().equals(_project.getID())) return;
    TaskList newtasklist = CurrentStorage.get().openTaskList(project);
    NoteList newnotelist = CurrentStorage.get().openNoteList(project);
    ResourcesList newresources = CurrentStorage.get().openResourcesList(project);
    notifyListenersBefore(project, newnotelist, newtasklist, newresources);
    _project = project;
    _tasklist = newtasklist;
    _notelist = newnotelist;
    _resources = newresources;
    notifyListenersAfter();
    Context.put("LAST_OPENED_PROJECT_ID", project.getID());
    App.reload(true);
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:15,代码来源:CurrentProject.java

示例11: PspB_actionPerformed

import net.sf.memoranda.util.Context; //导入依赖的package包/类
public void PspB_actionPerformed(ActionEvent e) {
	pspPanel.trackingPanel.loadPSPValues();
	cardLayout1.show(panel, "PSP");
	dailyItemsPanel.selectPanel("PSP");
	setCurrentButton(pspB);
	Context.put("CURRENT_PANEL", "PSP");
	
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:9,代码来源:WorkPanel.java

示例12: ppExport_actionPerformed

import net.sf.memoranda.util.Context; //导入依赖的package包/类
protected void ppExport_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put(
        "FileChooser.lookInLabelText",
        Local.getString("Save in:"));
UIManager.put(
        "FileChooser.upFolderToolTipText",
        Local.getString("Up One Level"));
UIManager.put(
        "FileChooser.newFolderToolTipText",
        Local.getString("Create New Folder"));
UIManager.put(
        "FileChooser.listViewButtonToolTipText",
        Local.getString("List"));
UIManager.put(
        "FileChooser.detailsViewButtonToolTipText",
        Local.getString("Details"));
UIManager.put(
        "FileChooser.fileNameLabelText",
        Local.getString("File Name:"));
UIManager.put(
        "FileChooser.filesOfTypeLabelText",
        Local.getString("Files of Type:"));
UIManager.put("FileChooser.saveButtonText", Local.getString("Save"));
UIManager.put(
        "FileChooser.saveButtonToolTipText",
        Local.getString("Save selected file"));
UIManager.put(
        "FileChooser.cancelButtonText",
        Local.getString("Cancel"));
UIManager.put(
        "FileChooser.cancelButtonToolTipText",
        Local.getString("Cancel"));

JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Export notes"));
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
chooser.addChoosableFileFilter(
        new AllFilesFilter(AllFilesFilter.XHTML));
chooser.addChoosableFileFilter(new AllFilesFilter(AllFilesFilter.HTML));

String lastSel = (String) Context.get("LAST_SELECTED_EXPORT_FILE");
if (lastSel != null)
        chooser.setCurrentDirectory(new File(lastSel));

ProjectExportDialog dlg =
        new ProjectExportDialog(
                App.getFrame(),
                Local.getString("Export notes"),
                chooser);
String enc = (String) Context.get("EXPORT_FILE_ENCODING");
if (enc != null)
        dlg.encCB.setSelectedItem(enc);
Dimension dlgSize = new Dimension(550, 500);
dlg.setSize(dlgSize);
Dimension frmSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dlg.setLocation(
        (frmSize.width - dlgSize.width) / 2 + loc.x,
        (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.setVisible(true);
if (dlg.CANCELLED)
        return;                
        Context.put(
                "LAST_SELECTED_EXPORT_FILE",
                chooser.getSelectedFile().getPath());                
int ei = dlg.encCB.getSelectedIndex();
enc = null;
if (ei == 1)
        enc = "UTF-8";
boolean nument = (ei == 2);
File f = chooser.getSelectedFile();
boolean xhtml =
        chooser.getFileFilter().getDescription().indexOf("XHTML") > -1;
 CurrentProject.save();
 ProjectExporter.export(CurrentProject.get(), chooser.getSelectedFile(), enc, xhtml, 
                 false, true, nument, false, false); 
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:81,代码来源:AppFrame.java

示例13: importB_actionPerformed

import net.sf.memoranda.util.Context; //导入依赖的package包/类
void importB_actionPerformed(ActionEvent e) {
	// Fix until Sun's JVM supports more locales...
	UIManager.put("FileChooser.lookInLabelText", Local
			.getString("Look in:"));
	UIManager.put("FileChooser.upFolderToolTipText", Local
			.getString("Up One Level"));
	UIManager.put("FileChooser.newFolderToolTipText", Local
			.getString("Create New Folder"));
	UIManager.put("FileChooser.listViewButtonToolTipText", Local
			.getString("List"));
	UIManager.put("FileChooser.detailsViewButtonToolTipText", Local
			.getString("Details"));
	UIManager.put("FileChooser.fileNameLabelText", Local
			.getString("File Name:"));
	UIManager.put("FileChooser.filesOfTypeLabelText", Local
			.getString("Files of Type:"));
	UIManager.put("FileChooser.openButtonText", Local.getString("Open"));
	UIManager.put("FileChooser.openButtonToolTipText", Local
			.getString("Open selected file"));
	UIManager
			.put("FileChooser.cancelButtonText", Local.getString("Cancel"));
	UIManager.put("FileChooser.cancelButtonToolTipText", Local
			.getString("Cancel"));

	JFileChooser chooser = new JFileChooser();
	chooser.setFileHidingEnabled(false);
	chooser.setDialogTitle(Local.getString("Insert file"));
	chooser.setAcceptAllFileFilterUsed(false);
	chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
	chooser.addChoosableFileFilter(new AllFilesFilter(AllFilesFilter.HTML));
	chooser.setPreferredSize(new Dimension(550, 375));
	String lastSel = (String) Context.get("LAST_SELECTED_IMPORT_FILE");
	if (lastSel != null)
		chooser.setCurrentDirectory(new java.io.File(lastSel));
	if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
		return;

	Context.put("LAST_SELECTED_IMPORT_FILE", chooser.getSelectedFile()
			.getPath());

	File f = chooser.getSelectedFile();
	new HTMLFileImport(f, editor);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:44,代码来源:EditorPanel.java

示例14: check_activeOnly

import net.sf.memoranda.util.Context; //导入依赖的package包/类
public static boolean check_activeOnly(){
	Object o = Context.get("SHOW_ACTIVE_TASKS_ONLY");
	if(o == null) return false;
	return o.toString().equals("true");
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:6,代码来源:TaskTableModel.java

示例15: ppShowActiveOnlyChB_actionPerformed

import net.sf.memoranda.util.Context; //导入依赖的package包/类
void ppShowActiveOnlyChB_actionPerformed(ActionEvent e) {
	prjTablePanel.setShowActiveOnly(ppShowActiveOnlyChB.isSelected());
	Context.put(
		"SHOW_ACTIVE_PROJECTS_ONLY",
		new Boolean(ppShowActiveOnlyChB.isSelected()));
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:7,代码来源:ProjectsPanel.java


注:本文中的net.sf.memoranda.util.Context类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。