📄 ganttapplet.java
字号:
/** * Copyright 2004 Carlos Silva A. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */package jgantt;import java.applet.Applet;import java.awt.BorderLayout;import java.awt.Container;import java.awt.Label;import java.io.InputStream;import java.io.ObjectInputStream;import java.net.URL;import java.net.URLConnection;import jgantt.model.IOManager;import jgantt.model.Project;import jgantt.view.GanttDisplay;import jgantt.view.adapters.ProjectViewModel;import jgantt.view.dialogs.TaskEditor;public class GanttApplet extends Applet { private static final long serialVersionUID = 3761970449637979449L; Container root; GanttDisplay ganttDisplay; TaskEditor taskEditor; Project project; public Project getProject() throws Exception { if (1 == 1) return IOManager.createEmptyProject(); URL url = new URL("http://localhost:8080/arquitectura/GanttGetter"); URLConnection urlConn = url.openConnection(); urlConn.setDoInput(true); urlConn.setDoOutput(true); urlConn.connect(); // System.out.println(urlConn.getContentType()); InputStream in = urlConn.getInputStream(); ObjectInputStream ois = new ObjectInputStream(in); Project project = (Project) ois.readObject(); ois.close(); in.close(); // project = TestModel.createProject(); return project; } public void start() { root = this; root.setLayout(new BorderLayout()); try { project = getProject(); ProjectViewModel pvm = new ProjectViewModel(project, null); ganttDisplay = new GanttDisplay(pvm); pvm.getMainActionListener().setup(null, ganttDisplay); taskEditor = new TaskEditor(null, ganttDisplay .getProjectViewModel()); root.add(ganttDisplay, BorderLayout.CENTER); root.add(taskEditor, BorderLayout.SOUTH); } catch (Exception e) { root.add(new Label(e.getMessage())); } } public void stop() { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -