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

📄 mxconstants.java

📁 经典的java图像处理程序源码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/** * $Id: mxConstants.java,v 1.21 2009/03/28 14:27:35 gaudenz Exp $ * Copyright (c) 2007, Gaudenz Alder */package com.mxgraph.util;import java.awt.BasicStroke;import java.awt.Color;import java.awt.Component;import java.awt.Graphics;import java.awt.Graphics2D;import java.awt.Image;import java.awt.Stroke;import java.awt.image.BufferedImage;import javax.swing.border.Border;import javax.swing.border.LineBorder;/** * Contains all global constants. */public class mxConstants{	/**	 * Defines the portion of the cell which is to be used as a connectable	 * region. Default is 0.3.	 */	public static double DEFAULT_HOTSPOT = 0.3;	/**	 * Defines the minimum size in pixels of the portion of the cell which is	 * to be used as a connectable region. Default is 8.	 */	public static int MIN_HOTSPOT_SIZE = 8;	/**	 * Defines the maximum size in pixels of the portion of the cell which is	 * to be used as a connectable region. Use 0 for no maximum. Default is 0.	 */	public static int MAX_HOTSPOT_SIZE = 0;	/**	 * Defines the SVG namespace.	 */	public static String NS_SVG = "http =//www.w3.org/2000/svg";	/**	 * Defines the XHTML namespace.	 */	public static String NS_XHTML = "http://www.w3.org/1999/xhtml";	/**	 * Defines the XLink namespace.	 */	public static String NS_XLINK = "http =//www.w3.org/1999/xlink";	/**	 * Contains an empty image of size 1, 1.	 */	public static Image EMPTY_IMAGE = new BufferedImage(1, 1,			BufferedImage.TYPE_INT_RGB);	/**	 * Comma separated list of default fonts for CSS properties.	 * Default is Arial, Helvetica.	 */	public static String DEFAULT_FONTFAMILIES = "Arial,Helvetica";	/**	 * Defines the default font family. Default is Arial.	 */	public static String DEFAULT_FONTFAMILY = "Arial";	/**	 * Defines the default font size. Default is 11.	 */	public static int DEFAULT_FONTSIZE = 11;	/**	 * Specifies the line spacing. Default is 0.	 */	public static int LINESPACING = 0;	/**	 * Defines the inset in absolute pixels between the label bounding box and	 * the label text. Default is 3.	 */	public static int LABEL_INSET = 3;	/**	 * Defines the default marker size. Default is 6.	 */	public static int DEFAULT_MARKERSIZE = 6;	/**	 * Defines the default image size. Default is 24.	 */	public static int DEFAULT_IMAGESIZE = 24;	/**	 * Defines the color to be used for shadows. Default is gray.	 */	public static Color SHADOW_COLOR = Color.gray;	/**	 * Defines the x-offset to be used for shadows. Default is 2.	 */	public static int SHADOW_OFFSETX = 2;	/**	 * Defines the y-offset to be used for shadows. Default is 3.	 */	public static int SHADOW_OFFSETY = 3;	/**	 * Defines the color to be used to draw shadows in W3C standards. Default	 * is gray.	 */	public static String W3C_SHADOWCOLOR = "gray";	/**	 * Defines the transformation used to draw shadows in SVG.	 */	public static String SVG_SHADOWTRANSFORM = "translate(2 3)";	/**	 * Specifies the default valid color. Default is green.	 */	public static Color DEFAULT_VALID_COLOR = Color.GREEN;	/**	 * Specifies the default invalid color. Default is red.	 */	public static Color DEFAULT_INVALID_COLOR = Color.RED;	/**	 * Defines the rubberband border color. 	 */	public static Color RUBBERBAND_BORDERCOLOR = new Color(51, 153, 255);	/**	 * Defines the rubberband fill color with an alpha of 80.	 */	public static Color RUBBERBAND_FILLCOLOR = new Color(51, 153, 255, 80);	/**	 * Defines the handle size. Default is 8.	 */	public static int HANDLE_SIZE = 7;	/**	 * Defines the handle border color. Default is black.	 */	public static Color HANDLE_BORDERCOLOR = Color.black;	/**	 * Defines the handle fill color. Default is green.	 */	public static Color HANDLE_FILLCOLOR = Color.green;	/**	 * Defines the label handle fill color. Default is yellow.	 */	public static Color LABEL_HANDLE_FILLCOLOR = Color.yellow;	/**	 * Defines the connect handle fill color. Default is blue.	 */	public static Color CONNECT_HANDLE_FILLCOLOR = Color.blue;	/**	 * Defines the handle fill color for locked handles. Default is red.	 */	public static Color LOCKED_HANDLE_FILLCOLOR = Color.red;	/**	 * Defines the default value for the connect handle. Default is false.	 */	public static boolean CONNECT_HANDLE_ENABLED = false;	/**	 * Defines the connect handle size. Default is 8.	 */	public static int CONNECT_HANDLE_SIZE = 8;	/**	 * Defines the selection color. Default is green.	 */	public static Color SELECTION_COLOR = Color.green;	/**	 * Defines the stroke used for painting selected edges and the border	 * of selected vertices. Default is a dashed line.	 */	public static Stroke SELECTION_STROKE = new BasicStroke(1,			BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, new float[] {					3, 3 }, 0.0f);	/**	 * Defines the stroke used for painting the preview for new and existing edges	 * that are being changed. Default is a dashed line.	 */	public static Stroke PREVIEW_STROKE = new BasicStroke(1,			BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, new float[] {					3, 3 }, 0.0f);	/**	 * Defines the border used for painting the preview when vertices are being	 * resized, or cells and labels are being moved.	 */	public static Border PREVIEW_BORDER = new LineBorder(			mxConstants.HANDLE_BORDERCOLOR)	{		public void paintBorder(Component c, Graphics g, int x, int y,				int width, int height)		{			((Graphics2D) g).setStroke(SELECTION_STROKE);			super.paintBorder(c, g, x, y, width, height);		}	};	/**	 * Defines the length of the horizontal segment of an Entity Relation.	 * This can be overridden using mxConstants.STYLE_STARTSIZE style.	 * Default is 30.	 */	public static int ENTITY_SEGMENT = 30;	/**	 * Defines the spacing between the arrow shape and its terminals. Default	 * is 10.	 */	public static int ARROW_SPACING = 10;	/**	 * Defines the width of the arrow shape. Default is 30.	 */	public static int ARROW_WIDTH = 30;	/**	 * Defines the size of the arrowhead in the arrow shape. Default is 30.	 */	public static int ARROW_SIZE = 30;	/**	 * Defines the value for none. Default is "none".	 */	public static String NONE = "none";	/**	 * Defines the key for the perimeter style.	 * Possible values are the functions defined	 * in mxPerimeter.	 */	public static String STYLE_PERIMETER = "perimeter";	/**	 * Defines the key for the opacity style (0-100).	 */	public static String STYLE_OPACITY = "opacity";	/**	 * Defines the key for the text opacity style (0-100).	 */	public static String STYLE_TEXT_OPACITY = "textOpacity";	/**	 * Defines the key for the rotation style (0-360).	 */	public static String STYLE_ROTATION = "rotation";	/**	 * Defines the key for the fillColor style.	 * Possible values are all color codes.	 */	public static String STYLE_FILLCOLOR = "fillColor";	/**	 * Defines the key for the gradientColor style.	 * Possible values are all color codes.	 */	public static String STYLE_GRADIENTCOLOR = "gradientColor";	/**	 * Defines the key for the gradient direction. Possible values	 * Possible values are DIRECTION_EAST (default), DIRECTION_WEST,	 * DIRECTION_NORTH and DIRECTION_SOUTH. Default is DIRECTION_SOUTH.	 */	public static String STYLE_GRADIENT_DIRECTION = "gradientDirection";	/**	 * Defines the key for the strokeColor style.	 * Possible values are all color codes.	 */	public static String STYLE_STROKECOLOR = "strokeColor";	/**	 * Defines the key for the separatorColor style.	 * Possible values are all color codes.	 */	public static String STYLE_SEPARATORCOLOR = "separatorColor";	/**	 * Defines the key for the strokeWidth style (in px).	 */	public static String STYLE_STROKEWIDTH = "strokeWidth";	/**	 * Defines the key for the align style.	 * Possible values are ALIGN_LEFT,	 * ALIGN_CENTER and ALIGN_RIGHT.	 */	public static String STYLE_ALIGN = "align";	/**	 * Defines the key for the verticalAlign style.	 * Possible values are ALIGN_TOP,	 * ALIGN_MIDDLE and ALIGN_BOTTOM.	 */	public static String STYLE_VERTICAL_ALIGN = "verticalAlign";	/**	 * Defines the key for the horizontal label position of vertices.	 * Possible values are ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT.	 * Default is ALIGN_CENTER. If left or right are used, then the	 * text alignment should be the opposite value of this.	 */	public static String STYLE_LABEL_POSITION = "labelPosition";	/**	 * Defines the key for the vertical label position of vertices.	 * Possible values are ALIGN_TOP, ALIGN_MIDDLE and ALIGN_BOTTOM.	 * Default is ALIGN_MIDDLE. If top or bottom are used, then the	 * vertical text alignment should be the opposite value of this.	 */	public static String STYLE_VERTICAL_LABEL_POSITION = "verticalLabelPosition";	/**	 * Defines the key for the align style.	 * Possible values are ALIGN_LEFT,	 * ALIGN_CENTER and ALIGN_RIGHT.	 */	public static String STYLE_IMAGE_ALIGN = "imageAlign";	/**	 * Defines the key for the verticalAlign style.	 * Possible values are ALIGN_TOP,	 * ALIGN_MIDDLE and ALIGN_BOTTOM.	 */	public static String STYLE_IMAGE_VERTICAL_ALIGN = "imageVerticalAlign";	/**	 * Defines the key for the image style.	 * Possible values are any image URL.	 */	public static String STYLE_IMAGE = "image";	/**	 * Defines the key for the imageWidth style (in px).	 */	public static String STYLE_IMAGE_WIDTH = "imageWidth";	/**	 * Defines the key for the imageHeight style (in px).	 */	public static String STYLE_IMAGE_HEIGHT = "imageHeight";	/**	 * Defines the key for the noLabel style. If this is	 * true then no label is visible for a given cell.	 * Possible values are true or false (1 or 0).	 * Default is false.	 */	public static String STYLE_NOLABEL = "noLabel";	/**	 * Defines the key for the noEdgeStyle style. If this is	 * true then no edge style is applied for a given edge.	 * Possible values are true or false (1 or 0).	 * Default is false.	 */	public static String STYLE_NOEDGESTYLE = "noEdgeStyle";	/**	 * Defines the key for the label background color.	 * Possible values are all color codes.	 */	public static String STYLE_LABEL_BACKGROUNDCOLOR = "labelBackgroundColor";	/**	 * Defines the key for the label border color.	 * Possible values are all color codes.	 */	public static String STYLE_LABEL_BORDERCOLOR = "labelBorderColor";	/**	 * Defines the key for the indicatorShape style.	 * Possible values are any of the SHAPE_*	 * constants.	 */	public static String STYLE_INDICATOR_SHAPE = "indicatorShape";	/**	 * Defines the key for the indicatorImage style.	 * Possible values are any image URL.	 */	public static String STYLE_INDICATOR_IMAGE = "indicatorImage";	/**	 * Defines the key for the indicatorColor style.	 * Possible values are all color codes.	 */	public static String STYLE_INDICATOR_COLOR = "indicatorColor";	/**	 * Defines the key for the indicatorGradientColor style.	 * Possible values are all color codes.	 */	public static String STYLE_INDICATOR_GRADIENTCOLOR = "indicatorGradientColor";	/**	 * Defines the key for the indicatorSpacing style (in px).

⌨️ 快捷键说明

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