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

📄 rrdgraphconstants.java

📁 jrobin,使用纯java实现的RRD数据库,使用RRD数据库来统计数据.
💻 JAVA
字号:
/* ============================================================
 * JRobin : Pure java implementation of RRDTool's functionality
 * ============================================================
 *
 * Project Info:  http://www.jrobin.org
 * Project Lead:  Sasa Markovic (saxon@jrobin.org)
 *
 * Developers:    Sasa Markovic (saxon@jrobin.org)
 *
 *
 * (C) Copyright 2003-2005, by Sasa Markovic.
 *
 * This library is free software; you can redistribute it and/or modify it under the terms
 * of the GNU Lesser General Public License as published by the Free Software Foundation;
 * either version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this
 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 */
package org.jrobin.graph;

import java.awt.*;
import java.util.Calendar;
import java.util.Locale;

/**
 * Class to represent various constants used for graphing. No methods are specified.
 */
public interface RrdGraphConstants {
	/**
	 * Default graph starting time
	 */
	String DEFAULT_START = "end-1d";
	/**
	 * Default graph ending time
	 */
	String DEFAULT_END = "now";

	/**
	 * Constant to represent second
	 */
	int SECOND = Calendar.SECOND;
	/**
	 * Constant to represent minute
	 */
	int MINUTE = Calendar.MINUTE;
	/**
	 * Constant to represent hour
	 */
	int HOUR = Calendar.HOUR_OF_DAY;
	/**
	 * Constant to represent day
	 */
	int DAY = Calendar.DAY_OF_MONTH;
	/**
	 * Constant to represent week
	 */
	int WEEK = Calendar.WEEK_OF_YEAR;
	/**
	 * Constant to represent month
	 */
	int MONTH = Calendar.MONTH;
	/**
	 * Constant to represent year
	 */
	int YEAR = Calendar.YEAR;

	/**
	 * Constant to represent Monday
	 */
	int MONDAY = Calendar.MONDAY;
	/**
	 * Constant to represent Tuesday
	 */
	int TUESDAY = Calendar.TUESDAY;
	/**
	 * Constant to represent Wednesday
	 */
	int WEDNESDAY = Calendar.WEDNESDAY;
	/**
	 * Constant to represent Thursday
	 */
	int THURSDAY = Calendar.THURSDAY;
	/**
	 * Constant to represent Friday
	 */
	int FRIDAY = Calendar.FRIDAY;
	/**
	 * Constant to represent Saturday
	 */
	int SATURDAY = Calendar.SATURDAY;
	/**
	 * Constant to represent Sunday
	 */
	int SUNDAY = Calendar.SUNDAY;

	/**
	 * Index of the canvas color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_CANVAS = 0;
	/**
	 * Index of the background color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_BACK = 1;
	/**
	 * Index of the top-left graph shade color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_SHADEA = 2;
	/**
	 * Index of the bottom-right graph shade color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_SHADEB = 3;
	/**
	 * Index of the minor grid color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_GRID = 4;
	/**
	 * Index of the major grid color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_MGRID = 5;
	/**
	 * Index of the font color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_FONT = 6;
	/**
	 * Index of the frame color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_FRAME = 7;
	/**
	 * Index of the arrow color. Used in {@link RrdGraphDef#setColor(int, java.awt.Paint)}
	 */
	int COLOR_ARROW = 8;

	/**
	 * Allowed color names which can be used in {@link RrdGraphDef#setColor(String, java.awt.Paint)} method
	 */
	String[] COLOR_NAMES = {
			"canvas", "back", "shadea", "shadeb", "grid", "mgrid", "font", "frame", "arrow"
	};

	/**
	 * Default first day of the week (obtained from the default locale)
	 */
	int FIRST_DAY_OF_WEEK = Calendar.getInstance(Locale.getDefault()).getFirstDayOfWeek();

	/**
	 * Default graph canvas color
	 */
	Color DEFAULT_CANVAS_COLOR = Color.WHITE;
	/**
	 * Default graph background color
	 */
	Color DEFAULT_BACK_COLOR = new Color(245, 245, 245);
	/**
	 * Default top-left graph shade color
	 */
	Color DEFAULT_SHADEA_COLOR = new Color(200, 200, 200);
	/**
	 * Default bottom-right graph shade color
	 */
	Color DEFAULT_SHADEB_COLOR = new Color(150, 150, 150);
	/**
	 * Default minor grid color
	 */
	Color DEFAULT_GRID_COLOR = new Color(140, 140, 140);
	/**
	 * Default major grid color
	 */
	Color DEFAULT_MGRID_COLOR = new Color(130, 30, 30);
	/**
	 * Default font color
	 */
	Color DEFAULT_FONT_COLOR = Color.BLACK;
	/**
	 * Default frame color
	 */
	Color DEFAULT_FRAME_COLOR = Color.BLACK;
	/**
	 * Default arrow color
	 */
	Color DEFAULT_ARROW_COLOR = Color.RED;

	/**
	 * Constant to represent left alignment marker
	 */
	String ALIGN_LEFT_MARKER = "\\l";
	/**
	 * Constant to represent centered alignment marker
	 */
	String ALIGN_CENTER_MARKER = "\\c";
	/**
	 * Constant to represent right alignment marker
	 */
	String ALIGN_RIGHT_MARKER = "\\r";
	/**
	 * Constant to represent justified alignment marker
	 */
	String ALIGN_JUSTIFIED_MARKER = "\\j";
	/**
	 * Constant to represent "glue" marker
	 */
	String GLUE_MARKER = "\\g";
	/**
	 * Constant to represent vertical spacing marker
	 */
	String VERTICAL_SPACING_MARKER = "\\s";
	/**
	 * Constant to represent no justification markers
	 */
	String NO_JUSTIFICATION_MARKER = "\\J";
	/**
	 * Used internally
	 */
	String[] MARKERS = {
			ALIGN_LEFT_MARKER, ALIGN_CENTER_MARKER, ALIGN_RIGHT_MARKER,
			ALIGN_JUSTIFIED_MARKER, GLUE_MARKER, VERTICAL_SPACING_MARKER, NO_JUSTIFICATION_MARKER
	};

	/**
	 * Constant to represent in-memory image name
	 */
	String IN_MEMORY_IMAGE = "-";

	/**
	 * Default units length
	 */
	int DEFAULT_UNITS_LENGTH = 9;
	/**
	 * Default graph width
	 */
	int DEFAULT_WIDTH = 400;
	/**
	 * Default graph height
	 */
	int DEFAULT_HEIGHT = 100;
	/**
	 * Default image format
	 */
	String DEFAULT_IMAGE_FORMAT = "gif";
	/**
	 * Default image quality, used only for jpeg graphs
	 */
	float DEFAULT_IMAGE_QUALITY = 0.8F; // only for jpegs, not used for png/gif
	/**
	 * Default value base
	 */
	double DEFAULT_BASE = 1000;

	/**
	 * Default font name, determined based on the current operating system
	 */
	String DEFAULT_FONT_NAME = System.getProperty("os.name").toLowerCase().contains("windows") ?
			"Lucida Sans Typewriter" : "Monospaced";
	/**
	 * Default graph small font
	 */
	Font DEFAULT_SMALL_FONT = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10);
	/**
	 * Default graph large font
	 */
	Font DEFAULT_LARGE_FONT = new Font(DEFAULT_FONT_NAME, Font.BOLD, 12);

	/**
	 * Used internally
	 */
	double LEGEND_LEADING = 1.2; // chars
	/**
	 * Used internally
	 */
	double LEGEND_LEADING_SMALL = 0.7; // chars
	/**
	 * Used internally
	 */
	double LEGEND_BOX_SPACE = 1.2; // chars
	/**
	 * Used internally
	 */
	double LEGEND_BOX = 0.9; // chars
	/**
	 * Used internally
	 */
	int LEGEND_INTERSPACING = 2; // chars
	/**
	 * Used internally
	 */
	int PADDING_LEFT = 10; // pix
	/**
	 * Used internally
	 */
	int PADDING_TOP = 12; // pix
	/**
	 * Used internally
	 */
	int PADDING_TITLE = 6; // pix
	/**
	 * Used internally
	 */
	int PADDING_RIGHT = 16; // pix
	/**
	 * Used internally
	 */
	int PADDING_PLOT = 2; //chars
	/**
	 * Used internally
	 */
	int PADDING_LEGEND = 2; // chars
	/**
	 * Used internally
	 */
	int PADDING_BOTTOM = 6; // pix
	/**
	 * Used internally
	 */
	int PADDING_VLABEL = 7; // pix

	/**
	 * Stroke used to draw grid
	 */
	Stroke GRID_STROKE =
			new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[] {1, 1}, 0);
	/**
	 * Stroke used to draw ticks
	 */
	Stroke TICK_STROKE = new BasicStroke(1);
}

⌨️ 快捷键说明

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