|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjas.graph.ArrowComputer
public class ArrowComputer
ArrowComputer computes the vertexes of a triangle, in order to paint the arrow cap of a line.
Title: JAS
Description: Java Agent-based Simulation library
Copyright (C) 2002 Michele Sonnessa
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.
| Field Summary | |
|---|---|
static int |
LEFT
|
static int |
RIGHT
|
static int |
STING
|
| Constructor Summary | |
|---|---|
ArrowComputer()
Set the arrow height to 25 pixels and the arrow width to 6. |
|
ArrowComputer(int arrowHeight,
int arrowWidth)
Set the arrow dimension to the given parameters |
|
| Method Summary | |
|---|---|
void |
calculateBasisVertexes(int x1,
int y1,
int x2,
int y2,
int distance)
This method is used to compute the starting point of a line connecting two points, shifted to the left of the given distance. |
void |
calculateVertexes(int x1,
int y1,
int x2,
int y2)
Calculate vertexes of the triangle representing the arrow cap of an arrow. |
int[] |
getXValues()
Return an array of x coords as results of the computation |
int[] |
getYValues()
Return an array of y coords as results of the computation |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LEFT
public static final int RIGHT
public static final int STING
| Constructor Detail |
|---|
public ArrowComputer()
public ArrowComputer(int arrowHeight,
int arrowWidth)
arrowHeight - The height of the arrow caparrowWidth - The base width of the arrow cap| Method Detail |
|---|
public void calculateBasisVertexes(int x1,
int y1,
int x2,
int y2,
int distance)
x1 - The x coord of the starting pointy1 - The y coord of the starting pointx2 - The x coord of the ending pointy2 - The y coord of the ending pointdistance - The distance of the starting point
public void calculateVertexes(int x1,
int y1,
int x2,
int y2)
x1 - The x coord of the starting pointy1 - The y coord of the starting pointx2 - The x coord of the ending pointy2 - The y coord of the ending pointpublic int[] getXValues()
public int[] getYValues()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||