Here you can find the source of drawScaleTick(Graphics g, int x, int y, boolean yAxisP, int length)
Draws a scale tick of length length from (x, y) to the left if horizontalP is true or down if horizontalP is false using the graphics in the Graphics2D
object g.
Parameter | Description |
---|---|
g | <code>java.awt.Graphics</code> object to the graphics. |
x | int starting x-coordinate of the scale tick. |
y | int starting y-coordinate of the scale tick. |
yAxisP | boolean flag indicating whether the scale tick is for the y-axis. |
length | int length of the scale tick. |
private static void drawScaleTick(Graphics g, int x, int y, boolean yAxisP, int length)
//package com.java2s; /**//from w w w .ja v a 2 s . c o m * PlotUtilities.java * * * Cytobank (TM) is server and client software for web-based management, analysis, * and sharing of flow cytometry data. * * Copyright (C) 2009 Cytobank, Inc. All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Cytobank, Inc. * 659 Oak Grove Avenue #205 * Menlo Park, CA 94025 * * http://www.cytobank.org */ import java.awt.*; public class Main { /** * <p> * Draws a scale tick of length length from (x, y) to the left if * horizontalP is true or down if horizontalP is false using the graphics in * the <code>Graphics2D</code> object g. * </p> * * @param g * <code>java.awt.Graphics</code> object to the graphics. * @param x * int starting x-coordinate of the scale tick. * @param y * int starting y-coordinate of the scale tick. * @param yAxisP * boolean flag indicating whether the scale tick is for the * y-axis. * @param length * int length of the scale tick. */ private static void drawScaleTick(Graphics g, int x, int y, boolean yAxisP, int length) { if (g == null) { // If the graphics is null, then quit. return; } if (yAxisP) { // If the scale tick is for the y-axis, then draw a horizontal scale // tick extending to the left from (x, y). g.drawLine(x, y, x - length, y); } else { // Otherwise, the scale tick is for the x-axis, so draw a vertical // scale tick extending down from (x, y). g.drawLine(x, y, x, y + length); } } }