本文整理汇总了Java中net.sf.memoranda.Project.setEndDate方法的典型用法代码示例。如果您正苦于以下问题:Java Project.setEndDate方法的具体用法?Java Project.setEndDate怎么用?Java Project.setEndDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.Project
的用法示例。
在下文中一共展示了Project.setEndDate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ppProperties_actionPerformed
import net.sf.memoranda.Project; //导入方法依赖的package包/类
void ppProperties_actionPerformed(ActionEvent e) {
Project prj = prjTablePanel.getSelectedProject();
ProjectDialog dlg =
new ProjectDialog(null, Local.getString("Project properties"));
Dimension dlgSize = dlg.getSize();
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.prTitleField.setText(prj.getTitle());
dlg.startDate.getModel().setValue(
prj.getStartDate().getCalendar().getTime());
if (prj.getEndDate() != null) {
dlg.edButton.setEnabled(true);
dlg.endDateChB.setForeground(Color.BLACK);
dlg.endDateChB.setSelected(true);
dlg.endDate.setEnabled(true);
dlg.endDate.getModel().setValue(
prj.getEndDate().getCalendar().getTime());
}
/*if (prj.getStatus() == Project.FROZEN)
dlg.freezeChB.setSelected(true);*/
dlg.setVisible(true);
if (dlg.CANCELLED)
return;
prj.setTitle(dlg.prTitleField.getText());
prj.setStartDate(
new CalendarDate((Date) dlg.startDate.getModel().getValue()));
if (dlg.endDateChB.isSelected())
prj.setEndDate(
new CalendarDate((Date) dlg.endDate.getModel().getValue()));
else
prj.setEndDate(null);
prjTablePanel.updateUI();
/*
* if (dlg.freezeChB.isSelected()) prj.freeze(); else
*/
}
示例2: unpack
import net.sf.memoranda.Project; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
Project prj = ProjectManager.createProject(pId, pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();){
ZipEntry ze = (ZipEntry)files.nextElement();
if ( ze.isDirectory() )
{
File theDirectory = new File (JN_DOCPATH + prj.getID()+ "/" + ze.getName() );
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() +"/"+ ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
}
catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from "+zipfile, "Make sure that this file is a Memoranda project archive.");
}
}
示例3: editProject_actionPerformed
import net.sf.memoranda.Project; //导入方法依赖的package包/类
void editProject_actionPerformed(ActionEvent e) {
Project prj = mainPanel.getSelectedProject();
ProjectDialog dlg =
new ProjectDialog(null, Local.getString("Project properties"));
Dimension dlgSize = dlg.getSize();
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.prTitleField.setText(prj.getTitle());
dlg.startDate.getModel().setValue(
prj.getStartDate().getCalendar().getTime());
if (prj.getEndDate() != null) {
dlg.edButton.setEnabled(true);
dlg.endDateChB.setForeground(Color.BLACK);
dlg.endDateChB.setSelected(true);
dlg.endDate.setEnabled(true);
dlg.endDate.getModel().setValue(
prj.getEndDate().getCalendar().getTime());
}
dlg.colorBox.setSelectedItem(prj.getColor());
dlg.setVisible(true);
if (dlg.CANCELLED){
return;
}
prj.setTitle(dlg.prTitleField.getText());
prj.setStartDate(new CalendarDate((Date) dlg.startDate.getModel().getValue()));
prj.setColor((String) dlg.colorBox.getSelectedItem());
if (dlg.endDateChB.isSelected()){
prj.setEndDate(
new CalendarDate((Date) dlg.endDate.getModel().getValue()));
} else{
prj.setEndDate(null);
}
mainPanel.updateUI();
/*
* if (dlg.freezeChB.isSelected()) prj.freeze(); else
*/
}
示例4: unpack
import net.sf.memoranda.Project; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();){
ZipEntry ze = (ZipEntry)files.nextElement();
if ( ze.isDirectory() )
{
File theDirectory = new File(JN_DOCPATH + prj.getID()+ "/" + ze.getName() );
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() +"/"+ ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
}
catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from "+zipfile, "Make sure that this file is a Memoranda project archive.");
}
}
示例5: unpack
import net.sf.memoranda.Project; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();){
ZipEntry ze = (ZipEntry)files.nextElement();
if ( ze.isDirectory() )
{
File theDirectory = new File (JN_DOCPATH + prj.getID()+ "/" + ze.getName() );
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() +"/"+ ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
}
catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from "+zipfile, "Make sure that this file is a Memoranda project archive.");
}
}
示例6: ppProperties_actionPerformed
import net.sf.memoranda.Project; //导入方法依赖的package包/类
void ppProperties_actionPerformed(ActionEvent e) {
Project project = prjTablePanel.getSelectedProject();
ProjectDialog dialog =
new ProjectDialog(null, Local.getString("Project properties"));
Dimension dialogSize = dialog.getSize();
Dimension frameSize = App.getFrame().getSize();
Point loc = App.getFrame().getLocation();
dialog.setLocation(
(frameSize.width - dialogSize.width) / 2 + loc.x,
(frameSize.height - dialogSize.height) / 2 + loc.y);
dialog.projectTypeComboBox.setSelectedItem(dialog.projectTypeComboBoxLookup.get(project.getType()));
dialog.prTitleField.setText(project.getTitle());
dialog.startDate.getModel().setValue(
project.getStartDate().getCalendar().getTime());
if (project.getEndDate() != null) {
dialog.edButton.setEnabled(true);
dialog.endDateChB.setForeground(Color.BLACK);
dialog.endDateChB.setSelected(true);
dialog.endDate.setEnabled(true);
dialog.endDate.getModel().setValue(
project.getEndDate().getCalendar().getTime());
}
/*if (prj.getStatus() == Project.FROZEN)
dlg.freezeChB.setSelected(true);*/
if (project.getType().compareTo(Project.Type.PSP) == 0) {
fillPSPFields(project, dialog);
}
dialog.setVisible(true);
if (dialog.CANCELLED)
return;
project.setTitle(dialog.prTitleField.getText());
project.setStartDate(
new CalendarDate((Date) dialog.startDate.getModel().getValue()));
if (dialog.endDateChB.isSelected())
project.setEndDate(
new CalendarDate((Date) dialog.endDate.getModel().getValue()));
else
project.setEndDate(null);
((PSPProject) project).setPSPAttr("estimatedTime", Integer.parseInt(dialog.estimatedTime.getText()));
((PSPProject) project).setPSPAttr("estimatedSize", Integer.parseInt(dialog.estimatedSize.getText()));
System.out.println("[DEBUG] " + ((PSPProject)project).getPSPAttr("estimatedTime"));
/*
// update current phase
if (prj.getType().compareTo(Project.Type.PSP) == 0) {
System.out.println("[DEBUG] " + dlg.currentPhase.getSelectedItem().toString());
((PSPProject) prj).setPhase(dlg.currentPhase.getSelectedItem().toString());
System.out.println("[DEBUG] " + ((PSPProject) prj).getPSPAttr("currentPhase"));
}
*/
prjTablePanel.updateUI();
/*
* if (dlg.freezeChB.isSelected()) prj.freeze(); else
*/
}
示例7: unpack
import net.sf.memoranda.Project; //导入方法依赖的package包/类
public static void unpack(File zipfile) {
try {
ZipFile zip = new ZipFile(zipfile);
ZipEntry info = zip.getEntry("__PROJECT_INFO__");
BufferedReader in = new BufferedReader(new InputStreamReader(zip.getInputStream(info), "UTF-8"));
String pId = in.readLine();
String pType = in.readLine();
String pTitle = in.readLine();
String pStartD = in.readLine();
String pEndD = in.readLine();
in.close();
if (ProjectManager.getProject(pId) != null) {
int n =
JOptionPane.showConfirmDialog(
App.getFrame(),
Local.getString("This project is already exists and will be replaced.\nContinue?"),
Local.getString("Project is already exists"),
JOptionPane.YES_NO_OPTION);
if (n != JOptionPane.YES_OPTION) {
zip.close();
return;
}
ProjectManager.removeProject(pId);
}
Project prj = ProjectManager.createProject(pId, Project.Type.valueOf(pType), pTitle, new CalendarDate(pStartD), null);
if (pEndD != null)
prj.setEndDate(new CalendarDate(pEndD));
//File prDir = new File(JN_DOCPATH + prj.getID());
Enumeration files;
for (files = zip.entries(); files.hasMoreElements();){
ZipEntry ze = (ZipEntry)files.nextElement();
if ( ze.isDirectory() )
{
File theDirectory = new File (JN_DOCPATH + prj.getID()+ "/" + ze.getName() );
// create this directory (including any necessary parent directories)
theDirectory.mkdirs();
theDirectory = null;
}
if ((!ze.getName().equals("__PROJECT_INFO__")) && (!ze.isDirectory())) {
FileOutputStream out = new FileOutputStream(JN_DOCPATH + prj.getID() +"/"+ ze.getName());
InputStream inp = zip.getInputStream(ze);
byte[] buffer = new byte[1024];
int len;
while((len = inp.read(buffer)) >= 0)
out.write(buffer, 0, len);
inp.close();
out.close();
}
}
zip.close();
CurrentStorage.get().storeProjectManager();
}
catch (Exception ex) {
new ExceptionDialog(ex, "Failed to read from "+zipfile, "Make sure that this file is a Memoranda project archive.");
}
}