geomconst.java
来自「用Java开发的、实现类似Visio功能的应用程序源码」· Java 代码 · 共 61 行
JAVA
61 行
/**
* $Id:GeomConst.java $
*
* Copyright 2004 ~ 2005 JingFei International Cooperation LTD. All rights reserved. *
*/
package com.jfimagine.jfgraph.geom;
/**
* Geom Const class is a const definition list of geometries.
*
* @author CookieMaker
*
* @version $Revision: 1.00 $
*/
public class GeomConst{
/** an original pick offset */
private static int PICK_OFFSET_ORIGINAL =6; //in pixels
/**
* An offset for analog shape/object pick.
* If you want to pick an object, we should give you an offset,
* so you can analogic pick that object.
*/
public static int PICK_OFFSET =PICK_OFFSET_ORIGINAL;
/**
* set zoom for some constant values.
* When zoom in objects, we will 'reduce' the pick_offset,
* for more accurately picking objects.
*/
public static void setZoom(double zoomScale){
if (zoomScale<=1.0){
PICK_OFFSET =PICK_OFFSET_ORIGINAL;
}else{
PICK_OFFSET =(int)(PICK_OFFSET_ORIGINAL/zoomScale);
if (PICK_OFFSET<1)
PICK_OFFSET =1;
}
}
/**
* width/height of a node rectangle, or a port diagonal.
*/
public static final int NODE_SIZE =6; //in pixels
/**
* minimum line length
*/
public static final int MIN_LINELENGTH =4; //in pixels
/**
* A double const represents a very large value.
*/
public static final double LARGE_VALUE =10E10;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?