⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 column.java

📁 Owing to the applet Gantt chart source yard, already Chinese melt, Gantt chart can demonstrate a Chi
💻 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.view.tree;import java.lang.reflect.Method;import java.util.Date;import jgantt.model.GanttException;import jgantt.model.Task;public class Column {	String name, property;	int x;	int length;	int baseLength;	boolean readOnly;	public static final int LEFT = -1;	public static final int RIGHT = 1;	public static final int CENTER = 0;	int align = LEFT; // left	TaskTree taskTree = null;	public Column(		TaskTree tt,		String name,		int length,		String property,		boolean readOnly,		int al) {		this.taskTree = tt;		this.name = name;		this.length = length;		this.property = property;		this.readOnly = readOnly;		this.baseLength = length;		this.align = al;	}	public void setX(int x) {		this.x = x;	}	public int getX() {		return x;	}	public void setLength(int l) {		if (l < baseLength)			l = baseLength;		length = l;	}	public String getName() {		return name;	}	public String getProperty() {		return property;	}	public int getLength() {		return length;	}	public boolean isReadOnly() {		return readOnly;	}	public String getValue(Task t) {		String methodName =			"get"				+ property.substring(0, 1).toUpperCase()				+ property.substring(1);		try {			Method method = Task.class.getDeclaredMethod(methodName, null);			Object o = method.invoke(t, null);			if (o == null)				return null;			if (o instanceof Date)				return taskTree.sdf.format(o);			return o.toString();		} catch (Exception e) {			e.printStackTrace(System.err);			return null;		}	}	public void setValue(Task t, String v) throws GanttException {		if (property.equals("name"))			t.setName(v);		else if (property.equals("length"))			t.setLength(Integer.parseInt(v));		else if (property.equals("completed"))			t.setCompleted(Integer.parseInt(v));		else if (property.equals("comments"))			t.setComments(v);		else if (property.equals("priority"))			t.setPriority(Integer.parseInt(v));		else			throw new RuntimeException(				"Columna sin setter para la propiedad:" + property);	}	public int getAlign() {		return align;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -